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 4c5ccd1a3e..fe00bfc6bc 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; @@ -336,6 +337,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, @@ -1152,6 +1154,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); @@ -1180,6 +1183,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); @@ -1302,6 +1306,7 @@ typedef struct { SArray* pRetensions; int8_t schemaless; int16_t sstTrigger; + int8_t withArbitrator; } SDbCfgRsp; typedef SDbCfgRsp SDbCfgInfo; @@ -2145,6 +2150,98 @@ 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; +} 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 45e79ddcf6..768a43ca3f 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -168,208 +168,208 @@ #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_SELECT 274 -#define TK_NK_HINT 275 -#define TK_DISTINCT 276 -#define TK_WHERE 277 -#define TK_PARTITION 278 -#define TK_BY 279 -#define TK_SESSION 280 -#define TK_STATE_WINDOW 281 -#define TK_EVENT_WINDOW 282 -#define TK_COUNT_WINDOW 283 -#define TK_SLIDING 284 -#define TK_FILL 285 -#define TK_VALUE 286 -#define TK_VALUE_F 287 -#define TK_NONE 288 -#define TK_PREV 289 -#define TK_NULL_F 290 -#define TK_LINEAR 291 -#define TK_NEXT 292 -#define TK_HAVING 293 -#define TK_RANGE 294 -#define TK_EVERY 295 -#define TK_ORDER 296 -#define TK_SLIMIT 297 -#define TK_SOFFSET 298 -#define TK_LIMIT 299 -#define TK_OFFSET 300 -#define TK_ASC 301 -#define TK_NULLS 302 -#define TK_ABORT 303 -#define TK_AFTER 304 -#define TK_ATTACH 305 -#define TK_BEFORE 306 -#define TK_BEGIN 307 -#define TK_BITAND 308 -#define TK_BITNOT 309 -#define TK_BITOR 310 -#define TK_BLOCKS 311 -#define TK_CHANGE 312 -#define TK_COMMA 313 -#define TK_CONCAT 314 -#define TK_CONFLICT 315 -#define TK_COPY 316 -#define TK_DEFERRED 317 -#define TK_DELIMITERS 318 -#define TK_DETACH 319 -#define TK_DIVIDE 320 -#define TK_DOT 321 -#define TK_EACH 322 -#define TK_FAIL 323 -#define TK_FILE 324 -#define TK_FOR 325 -#define TK_GLOB 326 -#define TK_ID 327 -#define TK_IMMEDIATE 328 -#define TK_IMPORT 329 -#define TK_INITIALLY 330 -#define TK_INSTEAD 331 -#define TK_ISNULL 332 -#define TK_KEY 333 -#define TK_MODULES 334 -#define TK_NK_BITNOT 335 -#define TK_NK_SEMI 336 -#define TK_NOTNULL 337 -#define TK_OF 338 -#define TK_PLUS 339 -#define TK_PRIVILEGE 340 -#define TK_RAISE 341 -#define TK_RESTRICT 342 -#define TK_ROW 343 -#define TK_SEMI 344 -#define TK_STAR 345 -#define TK_STATEMENT 346 -#define TK_STRICT 347 -#define TK_STRING 348 -#define TK_TIMES 349 -#define TK_VALUES 350 -#define TK_VARIABLE 351 -#define TK_WAL 352 - +#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_SELECT 275 +#define TK_NK_HINT 276 +#define TK_DISTINCT 277 +#define TK_WHERE 278 +#define TK_PARTITION 279 +#define TK_BY 280 +#define TK_SESSION 281 +#define TK_STATE_WINDOW 282 +#define TK_EVENT_WINDOW 283 +#define TK_COUNT_WINDOW 284 +#define TK_SLIDING 285 +#define TK_FILL 286 +#define TK_VALUE 287 +#define TK_VALUE_F 288 +#define TK_NONE 289 +#define TK_PREV 290 +#define TK_NULL_F 291 +#define TK_LINEAR 292 +#define TK_NEXT 293 +#define TK_HAVING 294 +#define TK_RANGE 295 +#define TK_EVERY 296 +#define TK_ORDER 297 +#define TK_SLIMIT 298 +#define TK_SOFFSET 299 +#define TK_LIMIT 300 +#define TK_OFFSET 301 +#define TK_ASC 302 +#define TK_NULLS 303 +#define TK_ABORT 304 +#define TK_AFTER 305 +#define TK_ATTACH 306 +#define TK_BEFORE 307 +#define TK_BEGIN 308 +#define TK_BITAND 309 +#define TK_BITNOT 310 +#define TK_BITOR 311 +#define TK_BLOCKS 312 +#define TK_CHANGE 313 +#define TK_COMMA 314 +#define TK_CONCAT 315 +#define TK_CONFLICT 316 +#define TK_COPY 317 +#define TK_DEFERRED 318 +#define TK_DELIMITERS 319 +#define TK_DETACH 320 +#define TK_DIVIDE 321 +#define TK_DOT 322 +#define TK_EACH 323 +#define TK_FAIL 324 +#define TK_FILE 325 +#define TK_FOR 326 +#define TK_GLOB 327 +#define TK_ID 328 +#define TK_IMMEDIATE 329 +#define TK_IMPORT 330 +#define TK_INITIALLY 331 +#define TK_INSTEAD 332 +#define TK_ISNULL 333 +#define TK_KEY 334 +#define TK_MODULES 335 +#define TK_NK_BITNOT 336 +#define TK_NK_SEMI 337 +#define TK_NOTNULL 338 +#define TK_OF 339 +#define TK_PLUS 340 +#define TK_PRIVILEGE 341 +#define TK_RAISE 342 +#define TK_RESTRICT 343 +#define TK_ROW 344 +#define TK_SEMI 345 +#define TK_STAR 346 +#define TK_STATEMENT 347 +#define TK_STRICT 348 +#define TK_STRING 349 +#define TK_TIMES 350 +#define TK_VALUES 351 +#define TK_VARIABLE 352 +#define TK_WAL 353 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 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 3a689fc63d..4c3990306a 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 e2d1beb5a5..96d974e4e0 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -279,6 +279,8 @@ typedef enum ELogicConditionType { #define TSDB_SHOW_SUBQUERY_LEN 1000 #define TSDB_LOG_VAR_LEN 32 +#define TSDB_ARB_TOKEN_SIZE 32 + #define TSDB_TRANS_STAGE_LEN 12 #define TSDB_TRANS_TYPE_LEN 16 #define TSDB_TRANS_ERROR_LEN 512 @@ -425,6 +427,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 @@ -523,12 +529,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 @@ -548,8 +554,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..80184dbd05 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 = 50; + // 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 9138d7c983..6311e9bf12 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,343 @@ 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 < 2; 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; + + 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 < 2; 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; + + 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 4a092057ce..a9bda1ce5c 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 { @@ -176,6 +177,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; @@ -247,6 +249,39 @@ 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[2]; + int8_t isSync; + SArbAssignedLeader assignedLeader; + + // following fields will not be duplicated + bool mutexInited; + TdThreadMutex mutex; +} SArbGroup; + typedef struct { int32_t maxUsers; int32_t maxDbs; @@ -343,6 +378,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..0678ee2c98 --- /dev/null +++ b/source/dnode/mnode/impl/src/mndArbGroup.c @@ -0,0 +1,1059 @@ +/* + * 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 < 2; 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 < 2; 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_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 < 2; 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) + + 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); + for (int i = 0; i < 2; 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); + 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 < 2; 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"); + 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); + + 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) { + if (term < 0) { + mError("vgId:%d, arb failed to get term since %s", vgId, terrstr()); + sdbRelease(pSdb, pArbGroup); + return -1; + } + (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 < 2; 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; + + 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 < 2; 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); + + 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 < 2; 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) { + 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); + terrno = TSDB_CODE_SUCCESS; + +_OVER: + tFreeSVArbHeartBeatRsp(&arbHbRsp); + return terrno == TSDB_CODE_SUCCESS ? 0 : -1; +} + +static int32_t mndProcessArbCheckSyncRsp(SRpcMsg *pRsp) { + 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()); + } + +_OVER: + tFreeSVArbCheckSyncRsp(&syncRsp); + return terrno == TSDB_CODE_SUCCESS ? 0 : -1; +} + +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) { + mndArbGroupDupObj(pGroup, pNewGroup); + mndArbGroupResetAssignedLeader(pNewGroup); + + mInfo("vgId:%d, arb resetting assigned leader", vgId); + updateAssigned = true; + 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) { + 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()); + } + } + +_OVER: + tFreeSVArbSetAssignedLeaderRsp(&setAssignedRsp); + return terrno == TSDB_CODE_SUCCESS ? 0 : -1; +} + +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 < 2; 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..d94e651114 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -311,6 +311,18 @@ 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; + + addEpIntoEpSet(&epSet, pDnode->fqdn, pDnode->port); + + mndReleaseDnode(pMnode, pDnode); + return epSet; +} + static SDnodeObj *mndAcquireDnodeByEp(SMnode *pMnode, char *pEpStr) { SSdb *pSdb = pMnode->pSdb; @@ -776,7 +788,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..73c71c0431 --- /dev/null +++ b/source/dnode/mnode/impl/test/arbgroup/arbgroup.cpp @@ -0,0 +1,274 @@ +/* + * 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(); + sprintf(buf, "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); + + // -------------------------------------------------------------------------------- + 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)); + + 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); + + // -------------------------------------------------------------------------------- + { // 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); + } +} + +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; + + // -------------------------------------------------------------------------------- + { // 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); + } +} + +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); + + // -------------------------------------------------------------------------------- + { // 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_TRUE(updateAssigned); + EXPECT_EQ(newGroup.assignedLeader.dnodeId, 0); + EXPECT_EQ(std::string(newGroup.assignedLeader.token).size(), 0); + } + + { // 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); + } +} + +#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/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 019ef6f18b..12e3112420 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -209,6 +209,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: @@ -266,7 +268,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: @@ -3178,16 +3180,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); } @@ -6654,6 +6656,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); } @@ -7179,6 +7185,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: @@ -7516,6 +7524,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: @@ -7580,7 +7590,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 1bdcda3ddf..7251db21b6 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -419,6 +419,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: @@ -1072,6 +1073,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: @@ -1363,7 +1365,7 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyList(pPhyNode->pOnRight); nodesDestroyNode(pPhyNode->pFilterConditions); nodesDestroyList(pPhyNode->pTargets); - + nodesDestroyNode(pPhyNode->pPrimKeyCond); nodesDestroyNode(pPhyNode->pColEqCond); nodesDestroyNode(pPhyNode->pTagEqCond); @@ -1703,9 +1705,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 dcd102b92d..1953911dda 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -196,7 +196,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 0e738679ce..b96a02e136 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 8613fd3e7a..4ef14ad93d 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); @@ -1189,11 +1189,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; } } @@ -1263,6 +1263,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; } @@ -1298,6 +1299,7 @@ SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt) { pOptions->sstTrigger = -1; pOptions->tablePrefix = -1; pOptions->tableSuffix = -1; + pOptions->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; return (SNode*)pOptions; } @@ -1353,6 +1355,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); } @@ -1782,7 +1785,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 514ad930c3..a192087f4b 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -304,6 +304,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 3bfa2122f6..2110013310 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -100,6 +100,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, @@ -263,7 +270,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, @@ -380,7 +387,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 { @@ -390,7 +397,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); @@ -401,7 +408,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 @@ -420,7 +427,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); @@ -950,7 +957,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->colId = isPrimaryKey(pTable, (SNode*)pExpr) ? PRIMARYKEY_TIMESTAMP_COL_ID : 0; strcpy(pCol->colName, pExpr->aliasName); @@ -1167,8 +1174,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); @@ -1180,13 +1187,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); } @@ -1199,7 +1206,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; @@ -1249,8 +1256,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); @@ -1263,9 +1270,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); @@ -1957,7 +1964,7 @@ static int32_t translateInterpPseudoColumnFunc(STranslateContext* pCxt, SNode** return code; } translateColumn(pCxt, (SColumnNode**)ppNode); - return pCxt->errCode; + return pCxt->errCode; } return TSDB_CODE_SUCCESS; } @@ -2262,7 +2269,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; @@ -2286,14 +2293,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); } @@ -2327,7 +2334,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); @@ -2822,7 +2829,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); } @@ -4367,7 +4374,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; @@ -4403,7 +4410,7 @@ static void findEqualCondTbnameInLogicCondAnd(STranslateContext* pCxt, SNode* pW } } } - //TODO: logic cond + //TODO: logic cond } } @@ -4523,7 +4530,7 @@ static int32_t setEqualTbnameTableVgroups(STranslateContext* pCxt, SSelectStmt* pInfo->pRealTable->pVgroupList = vgsInfo; } else { taosMemoryFree(vgsInfo); - } + } } return TSDB_CODE_SUCCESS; } @@ -5041,7 +5048,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; } @@ -5138,6 +5145,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); } @@ -5375,7 +5383,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, @@ -5439,6 +5447,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; } @@ -5491,7 +5505,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); @@ -5530,6 +5544,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); } @@ -5742,6 +5760,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; } @@ -7476,7 +7495,7 @@ static int32_t translateDescribe(STranslateContext* pCxt, SDescribeStmt* pStmt) taosMemoryFree(res.schemaRes.pSchema); } } -#endif +#endif return code; } @@ -7577,8 +7596,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; } @@ -8581,7 +8600,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) { @@ -8604,7 +8623,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; } @@ -8632,7 +8651,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); } @@ -8825,7 +8844,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); @@ -8934,7 +8953,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); @@ -9349,7 +9368,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; } @@ -10836,7 +10855,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) { @@ -10870,6 +10889,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 d9ede90113..a0b47af082 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -1,3 +1,5 @@ +/* This file is automatically generated by Lemon from input grammar +** source file "sql.y". */ /* ** 2000-05-29 ** @@ -22,9 +24,8 @@ ** The following is the concatenation of all %include directives from the ** input grammar file: */ -#include -#include /************ Begin %include sections from the grammar ************************/ +#line 11 "sql.y" #include #include @@ -41,12 +42,366 @@ #include "parAst.h" #define YYSTACKDEPTH 0 +#line 46 "sql.c" /**************** End of %include directives **********************************/ -/* These constants specify the various numeric values for terminal symbols -** in a format understandable to "makeheaders". This section is blank unless -** "lemon" is run with the "-m" command-line option. -***************** Begin makeheaders token definitions *************************/ -/**************** End makeheaders token definitions ***************************/ +/* These constants specify the various numeric values for terminal symbols. +***************** Begin token definitions *************************************/ +#ifndef TK_OR +#define TK_OR 1 +#define TK_AND 2 +#define TK_UNION 3 +#define TK_ALL 4 +#define TK_MINUS 5 +#define TK_EXCEPT 6 +#define TK_INTERSECT 7 +#define TK_NK_BITAND 8 +#define TK_NK_BITOR 9 +#define TK_NK_LSHIFT 10 +#define TK_NK_RSHIFT 11 +#define TK_NK_PLUS 12 +#define TK_NK_MINUS 13 +#define TK_NK_STAR 14 +#define TK_NK_SLASH 15 +#define TK_NK_REM 16 +#define TK_NK_CONCAT 17 +#define TK_CREATE 18 +#define TK_ACCOUNT 19 +#define TK_NK_ID 20 +#define TK_PASS 21 +#define TK_NK_STRING 22 +#define TK_ALTER 23 +#define TK_PPS 24 +#define TK_TSERIES 25 +#define TK_STORAGE 26 +#define TK_STREAMS 27 +#define TK_QTIME 28 +#define TK_DBS 29 +#define TK_USERS 30 +#define TK_CONNS 31 +#define TK_STATE 32 +#define TK_NK_COMMA 33 +#define TK_HOST 34 +#define TK_USER 35 +#define TK_ENABLE 36 +#define TK_NK_INTEGER 37 +#define TK_SYSINFO 38 +#define TK_ADD 39 +#define TK_DROP 40 +#define TK_GRANT 41 +#define TK_ON 42 +#define TK_TO 43 +#define TK_REVOKE 44 +#define TK_FROM 45 +#define TK_SUBSCRIBE 46 +#define TK_READ 47 +#define TK_WRITE 48 +#define TK_NK_DOT 49 +#define TK_WITH 50 +#define TK_DNODE 51 +#define TK_PORT 52 +#define TK_DNODES 53 +#define TK_RESTORE 54 +#define TK_NK_IPTOKEN 55 +#define TK_FORCE 56 +#define TK_UNSAFE 57 +#define TK_CLUSTER 58 +#define TK_LOCAL 59 +#define TK_QNODE 60 +#define TK_BNODE 61 +#define TK_SNODE 62 +#define TK_MNODE 63 +#define TK_VNODE 64 +#define TK_DATABASE 65 +#define TK_USE 66 +#define TK_FLUSH 67 +#define TK_TRIM 68 +#define TK_COMPACT 69 +#define TK_IF 70 +#define TK_NOT 71 +#define TK_EXISTS 72 +#define TK_BUFFER 73 +#define TK_CACHEMODEL 74 +#define TK_CACHESIZE 75 +#define TK_COMP 76 +#define TK_DURATION 77 +#define TK_NK_VARIABLE 78 +#define TK_MAXROWS 79 +#define TK_MINROWS 80 +#define TK_KEEP 81 +#define TK_PAGES 82 +#define TK_PAGESIZE 83 +#define TK_TSDB_PAGESIZE 84 +#define TK_PRECISION 85 +#define TK_REPLICA 86 +#define TK_VGROUPS 87 +#define TK_SINGLE_STABLE 88 +#define TK_RETENTIONS 89 +#define TK_SCHEMALESS 90 +#define TK_WAL_LEVEL 91 +#define TK_WAL_FSYNC_PERIOD 92 +#define TK_WAL_RETENTION_PERIOD 93 +#define TK_WAL_RETENTION_SIZE 94 +#define TK_WAL_ROLL_PERIOD 95 +#define TK_WAL_SEGMENT_SIZE 96 +#define TK_STT_TRIGGER 97 +#define TK_TABLE_PREFIX 98 +#define TK_TABLE_SUFFIX 99 +#define TK_KEEP_TIME_OFFSET 100 +#define TK_NK_COLON 101 +#define TK_BWLIMIT 102 +#define TK_START 103 +#define TK_TIMESTAMP 104 +#define TK_END 105 +#define TK_TABLE 106 +#define TK_NK_LP 107 +#define TK_NK_RP 108 +#define TK_STABLE 109 +#define TK_COLUMN 110 +#define TK_MODIFY 111 +#define TK_RENAME 112 +#define TK_TAG 113 +#define TK_SET 114 +#define TK_NK_EQ 115 +#define TK_USING 116 +#define TK_TAGS 117 +#define TK_BOOL 118 +#define TK_TINYINT 119 +#define TK_SMALLINT 120 +#define TK_INT 121 +#define TK_INTEGER 122 +#define TK_BIGINT 123 +#define TK_FLOAT 124 +#define TK_DOUBLE 125 +#define TK_BINARY 126 +#define TK_NCHAR 127 +#define TK_UNSIGNED 128 +#define TK_JSON 129 +#define TK_VARCHAR 130 +#define TK_MEDIUMBLOB 131 +#define TK_BLOB 132 +#define TK_VARBINARY 133 +#define TK_GEOMETRY 134 +#define TK_DECIMAL 135 +#define TK_COMMENT 136 +#define TK_MAX_DELAY 137 +#define TK_WATERMARK 138 +#define TK_ROLLUP 139 +#define TK_TTL 140 +#define TK_SMA 141 +#define TK_DELETE_MARK 142 +#define TK_FIRST 143 +#define TK_LAST 144 +#define TK_SHOW 145 +#define TK_PRIVILEGES 146 +#define TK_DATABASES 147 +#define TK_TABLES 148 +#define TK_STABLES 149 +#define TK_MNODES 150 +#define TK_QNODES 151 +#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_SELECT 275 +#define TK_NK_HINT 276 +#define TK_DISTINCT 277 +#define TK_WHERE 278 +#define TK_PARTITION 279 +#define TK_BY 280 +#define TK_SESSION 281 +#define TK_STATE_WINDOW 282 +#define TK_EVENT_WINDOW 283 +#define TK_COUNT_WINDOW 284 +#define TK_SLIDING 285 +#define TK_FILL 286 +#define TK_VALUE 287 +#define TK_VALUE_F 288 +#define TK_NONE 289 +#define TK_PREV 290 +#define TK_NULL_F 291 +#define TK_LINEAR 292 +#define TK_NEXT 293 +#define TK_HAVING 294 +#define TK_RANGE 295 +#define TK_EVERY 296 +#define TK_ORDER 297 +#define TK_SLIMIT 298 +#define TK_SOFFSET 299 +#define TK_LIMIT 300 +#define TK_OFFSET 301 +#define TK_ASC 302 +#define TK_NULLS 303 +#define TK_ABORT 304 +#define TK_AFTER 305 +#define TK_ATTACH 306 +#define TK_BEFORE 307 +#define TK_BEGIN 308 +#define TK_BITAND 309 +#define TK_BITNOT 310 +#define TK_BITOR 311 +#define TK_BLOCKS 312 +#define TK_CHANGE 313 +#define TK_COMMA 314 +#define TK_CONCAT 315 +#define TK_CONFLICT 316 +#define TK_COPY 317 +#define TK_DEFERRED 318 +#define TK_DELIMITERS 319 +#define TK_DETACH 320 +#define TK_DIVIDE 321 +#define TK_DOT 322 +#define TK_EACH 323 +#define TK_FAIL 324 +#define TK_FILE 325 +#define TK_FOR 326 +#define TK_GLOB 327 +#define TK_ID 328 +#define TK_IMMEDIATE 329 +#define TK_IMPORT 330 +#define TK_INITIALLY 331 +#define TK_INSTEAD 332 +#define TK_ISNULL 333 +#define TK_KEY 334 +#define TK_MODULES 335 +#define TK_NK_BITNOT 336 +#define TK_NK_SEMI 337 +#define TK_NOTNULL 338 +#define TK_OF 339 +#define TK_PLUS 340 +#define TK_PRIVILEGE 341 +#define TK_RAISE 342 +#define TK_RESTRICT 343 +#define TK_ROW 344 +#define TK_SEMI 345 +#define TK_STAR 346 +#define TK_STATEMENT 347 +#define TK_STRICT 348 +#define TK_STRING 349 +#define TK_TIMES 350 +#define TK_VALUES 351 +#define TK_VARIABLE 352 +#define TK_WAL 353 +#endif +/**************** End token definitions ***************************************/ /* The next sections is a series of control #defines. ** various aspects of the generated parser. @@ -104,29 +459,29 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 516 +#define YYNOCODE 517 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - ENullOrder yy73; - SNodeList* yy136; - int8_t yy191; - SDataType yy256; - SShowTablesOption yy493; - bool yy497; - EShowKind yy633; - SNode* yy656; - EJoinType yy660; - SToken yy665; - EOrder yy674; - int32_t yy676; - SAlterOption yy749; - STokenPair yy753; - EFillMode yy822; - EOperatorType yy836; - int64_t yy909; + SShowTablesOption yy91; + EShowKind yy101; + int32_t yy134; + EFillMode yy206; + SDataType yy224; + ENullOrder yy345; + int64_t yy525; + SNodeList* yy552; + bool yy559; + EOrder yy576; + STokenPair yy665; + SNode* yy718; + EOperatorType yy810; + int8_t yy883; + SAlterOption yy959; + SToken yy965; + EJoinType yy992; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -142,18 +497,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 859 -#define YYNRULE 670 -#define YYNRULE_WITH_ACTION 670 -#define YYNTOKEN 353 -#define YY_MAX_SHIFT 858 -#define YY_MIN_SHIFTREDUCE 1281 -#define YY_MAX_SHIFTREDUCE 1950 -#define YY_ERROR_ACTION 1951 -#define YY_ACCEPT_ACTION 1952 -#define YY_NO_ACTION 1953 -#define YY_MIN_REDUCE 1954 -#define YY_MAX_REDUCE 2623 +#define YYNSTATE 860 +#define YYNRULE 671 +#define YYNRULE_WITH_ACTION 671 +#define YYNTOKEN 354 +#define YY_MAX_SHIFT 859 +#define YY_MIN_SHIFTREDUCE 1282 +#define YY_MAX_SHIFTREDUCE 1952 +#define YY_ERROR_ACTION 1953 +#define YY_ACCEPT_ACTION 1954 +#define YY_NO_ACTION 1955 +#define YY_MIN_REDUCE 1956 +#define YY_MAX_REDUCE 2626 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -220,864 +575,875 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2992) +#define YY_ACTTAB_COUNT (3048) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 2197, 2197, 573, 428, 474, 574, 1997, 404, 414, 473, - /* 10 */ 2197, 169, 47, 45, 1872, 2195, 2195, 33, 405, 2146, - /* 20 */ 419, 1737, 1712, 40, 39, 729, 2195, 46, 44, 43, - /* 30 */ 42, 41, 1738, 2282, 35, 1798, 2040, 1710, 2215, 759, - /* 40 */ 40, 39, 653, 2422, 46, 44, 43, 42, 41, 481, - /* 50 */ 1328, 2280, 747, 722, 147, 681, 725, 651, 2594, 649, - /* 60 */ 271, 270, 40, 39, 759, 1793, 46, 44, 43, 42, - /* 70 */ 41, 19, 1692, 1737, 1326, 1327, 2600, 204, 1718, 760, - /* 80 */ 2144, 2595, 711, 664, 2440, 40, 39, 29, 2528, 46, - /* 90 */ 44, 43, 42, 41, 540, 538, 2388, 370, 742, 138, - /* 100 */ 1977, 218, 37, 310, 855, 2381, 616, 15, 426, 830, - /* 110 */ 829, 828, 827, 437, 2525, 826, 825, 152, 820, 819, - /* 120 */ 818, 817, 816, 815, 814, 151, 808, 807, 806, 436, - /* 130 */ 435, 803, 802, 801, 184, 183, 800, 593, 2421, 2135, - /* 140 */ 175, 2459, 1966, 1800, 1801, 115, 2423, 746, 2425, 2426, - /* 150 */ 741, 50, 764, 2388, 1740, 1611, 1612, 187, 2282, 2513, - /* 160 */ 425, 66, 1917, 415, 2509, 302, 2521, 721, 2197, 139, - /* 170 */ 720, 764, 2594, 422, 2352, 424, 2279, 747, 206, 62, - /* 180 */ 1772, 1782, 1955, 2195, 759, 1916, 2543, 1799, 1802, 581, - /* 190 */ 709, 204, 574, 1997, 425, 2595, 711, 519, 518, 1610, - /* 200 */ 1613, 1485, 1713, 128, 1711, 764, 127, 126, 125, 124, - /* 210 */ 123, 122, 121, 120, 119, 1476, 789, 788, 787, 1480, - /* 220 */ 786, 1482, 1483, 785, 782, 447, 1491, 779, 1493, 1494, - /* 230 */ 776, 773, 770, 1591, 1592, 2349, 1716, 1717, 1769, 1695, - /* 240 */ 1771, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 738, - /* 250 */ 762, 761, 1792, 1794, 1795, 1796, 1797, 2, 47, 45, - /* 260 */ 96, 578, 589, 368, 62, 1735, 419, 575, 1712, 1698, - /* 270 */ 1701, 50, 524, 710, 2422, 543, 2594, 392, 1321, 2122, - /* 280 */ 542, 1798, 1976, 1710, 40, 39, 2139, 740, 46, 44, - /* 290 */ 43, 42, 41, 2528, 709, 204, 504, 1328, 544, 2595, - /* 300 */ 711, 40, 39, 369, 506, 46, 44, 43, 42, 41, - /* 310 */ 62, 1793, 153, 1741, 484, 2440, 304, 19, 306, 2524, - /* 320 */ 1323, 1326, 1327, 107, 1718, 760, 2144, 2388, 430, 742, - /* 330 */ 799, 2190, 2192, 128, 1738, 2388, 127, 126, 125, 124, - /* 340 */ 123, 122, 121, 120, 119, 138, 306, 380, 2137, 2398, - /* 350 */ 855, 391, 621, 15, 46, 44, 43, 42, 41, 40, - /* 360 */ 39, 2528, 492, 46, 44, 43, 42, 41, 1876, 2421, - /* 370 */ 185, 2599, 2459, 2402, 1737, 534, 360, 2423, 746, 2425, - /* 380 */ 2426, 741, 739, 764, 730, 2478, 1737, 2523, 1740, 1800, - /* 390 */ 1801, 1827, 2269, 2248, 2263, 531, 530, 529, 528, 523, - /* 400 */ 522, 521, 520, 374, 472, 51, 471, 510, 509, 508, - /* 410 */ 507, 501, 500, 499, 1954, 494, 493, 389, 2404, 2406, - /* 420 */ 416, 485, 1579, 1580, 12, 185, 1772, 1782, 1598, 764, - /* 430 */ 173, 306, 1952, 1799, 1802, 344, 470, 229, 137, 136, - /* 440 */ 135, 134, 133, 132, 131, 130, 129, 390, 1713, 2262, - /* 450 */ 1711, 705, 342, 75, 1808, 1828, 74, 1520, 1521, 1888, - /* 460 */ 1737, 533, 228, 211, 40, 39, 371, 810, 46, 44, - /* 470 */ 43, 42, 41, 62, 662, 200, 1940, 306, 237, 555, - /* 480 */ 553, 550, 1716, 1717, 1769, 329, 1771, 1774, 1775, 1776, - /* 490 */ 1777, 1778, 1779, 1780, 1781, 738, 762, 761, 1792, 1794, - /* 500 */ 1795, 1796, 1797, 2, 12, 47, 45, 2382, 43, 42, - /* 510 */ 41, 2398, 440, 419, 2197, 1712, 1347, 439, 1346, 62, - /* 520 */ 239, 388, 314, 315, 576, 1718, 2005, 313, 1798, 2195, - /* 530 */ 1710, 1742, 812, 143, 1773, 2402, 700, 36, 417, 1822, - /* 540 */ 1823, 1824, 1825, 1826, 1830, 1831, 1832, 1833, 40, 39, - /* 550 */ 304, 1348, 46, 44, 43, 42, 41, 63, 1793, 760, - /* 560 */ 2144, 2422, 425, 681, 19, 12, 2594, 10, 434, 433, - /* 570 */ 174, 1718, 306, 764, 743, 2361, 722, 147, 2083, 209, - /* 580 */ 2404, 2407, 396, 395, 2600, 204, 570, 9, 1691, 2595, - /* 590 */ 711, 764, 1770, 1719, 731, 568, 2485, 855, 564, 560, - /* 600 */ 15, 710, 2440, 2598, 2594, 2422, 85, 84, 477, 1975, - /* 610 */ 2133, 217, 490, 2258, 2388, 241, 742, 2027, 743, 576, - /* 620 */ 1773, 2005, 709, 204, 469, 467, 681, 2595, 711, 2594, - /* 630 */ 706, 701, 694, 690, 1440, 367, 1800, 1801, 456, 636, - /* 640 */ 306, 453, 449, 445, 442, 470, 2440, 2600, 204, 1439, - /* 650 */ 1947, 1741, 2595, 711, 394, 393, 2421, 618, 2388, 2459, - /* 660 */ 742, 220, 2388, 176, 2423, 746, 2425, 2426, 741, 1769, - /* 670 */ 764, 790, 2599, 1772, 1782, 2594, 760, 2144, 1770, 620, - /* 680 */ 1799, 1802, 714, 619, 760, 2144, 306, 724, 202, 2521, - /* 690 */ 2522, 1428, 145, 2526, 2598, 1713, 55, 1711, 2595, 2597, - /* 700 */ 2421, 14, 13, 2459, 478, 682, 2554, 115, 2423, 746, - /* 710 */ 2425, 2426, 741, 1741, 764, 2362, 545, 149, 286, 156, - /* 720 */ 2484, 2513, 171, 496, 2258, 415, 2509, 1905, 704, 1716, - /* 730 */ 1717, 1769, 1430, 1771, 1774, 1775, 1776, 1777, 1778, 1779, - /* 740 */ 1780, 1781, 738, 762, 761, 1792, 1794, 1795, 1796, 1797, - /* 750 */ 2, 47, 45, 1803, 2422, 1694, 2440, 1946, 96, 419, - /* 760 */ 1722, 1712, 101, 197, 722, 147, 681, 725, 680, 2594, - /* 770 */ 760, 2144, 222, 257, 1798, 2184, 1710, 697, 696, 1903, - /* 780 */ 1904, 1906, 1907, 1908, 2140, 1697, 1700, 2600, 204, 180, - /* 790 */ 479, 813, 2595, 711, 2105, 2440, 2121, 1444, 610, 606, - /* 800 */ 602, 598, 2599, 256, 1793, 2594, 2129, 2388, 1841, 742, - /* 810 */ 760, 2144, 1443, 195, 635, 634, 633, 1718, 1861, 703, - /* 820 */ 1829, 625, 144, 629, 2598, 760, 2144, 628, 2595, 2596, - /* 830 */ 498, 2131, 627, 632, 398, 397, 1974, 1347, 626, 1346, - /* 840 */ 642, 622, 1741, 855, 97, 511, 48, 254, 2231, 2421, - /* 850 */ 2127, 2422, 2459, 760, 2144, 654, 115, 2423, 746, 2425, - /* 860 */ 2426, 741, 148, 764, 743, 2484, 2007, 1869, 187, 1742, - /* 870 */ 2513, 272, 1348, 512, 415, 2509, 203, 2521, 2522, 547, - /* 880 */ 145, 2526, 1800, 1801, 1712, 760, 2144, 645, 2119, 2388, - /* 890 */ 526, 2258, 2440, 665, 639, 637, 713, 2544, 665, 1710, - /* 900 */ 60, 269, 34, 620, 2388, 513, 742, 619, 678, 1973, - /* 910 */ 40, 39, 1834, 244, 46, 44, 43, 42, 41, 1772, - /* 920 */ 1782, 100, 253, 246, 275, 791, 1799, 1802, 2188, 251, - /* 930 */ 587, 1742, 797, 162, 161, 794, 793, 792, 159, 227, - /* 940 */ 1718, 1713, 71, 1711, 590, 70, 2421, 715, 243, 2459, - /* 950 */ 760, 2144, 1639, 115, 2423, 746, 2425, 2426, 741, 733, - /* 960 */ 764, 2485, 2388, 1897, 660, 2614, 855, 2513, 583, 2321, - /* 970 */ 592, 415, 2509, 667, 2321, 1716, 1717, 1769, 1898, 1771, - /* 980 */ 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 738, 762, - /* 990 */ 761, 1792, 1794, 1795, 1796, 1797, 2, 47, 45, 2422, - /* 1000 */ 591, 2275, 1660, 1661, 199, 419, 2148, 1712, 666, 517, - /* 1010 */ 722, 147, 743, 516, 2551, 681, 1972, 1971, 2594, 1896, - /* 1020 */ 1798, 515, 1710, 423, 797, 162, 161, 794, 793, 792, - /* 1030 */ 159, 172, 1737, 2191, 2192, 1970, 2600, 204, 2422, 2146, - /* 1040 */ 2440, 2595, 711, 797, 162, 161, 794, 793, 792, 159, - /* 1050 */ 1793, 743, 2388, 2564, 742, 760, 2144, 428, 458, 681, - /* 1060 */ 1742, 1969, 2594, 1718, 1713, 172, 1711, 760, 2144, 2388, - /* 1070 */ 2388, 1350, 1351, 2146, 431, 2141, 612, 611, 2120, 2440, - /* 1080 */ 2600, 204, 172, 1737, 726, 2595, 711, 277, 2388, 855, - /* 1090 */ 2146, 2388, 48, 742, 2421, 282, 2422, 2459, 1716, 1717, - /* 1100 */ 1968, 115, 2423, 746, 2425, 2426, 741, 1965, 764, 743, - /* 1110 */ 2197, 692, 77, 2614, 2388, 2513, 717, 429, 737, 415, - /* 1120 */ 2509, 1964, 205, 2521, 2522, 2195, 145, 2526, 1800, 1801, - /* 1130 */ 760, 2144, 2557, 2421, 3, 681, 2459, 2440, 2594, 1868, - /* 1140 */ 115, 2423, 746, 2425, 2426, 741, 53, 764, 799, 2388, - /* 1150 */ 285, 742, 2614, 2388, 2513, 1963, 2600, 204, 415, 2509, - /* 1160 */ 2388, 2595, 711, 224, 88, 1772, 1782, 1962, 760, 2144, - /* 1170 */ 760, 2144, 1799, 1802, 2388, 198, 760, 2144, 2197, 274, - /* 1180 */ 631, 630, 2197, 273, 1982, 850, 462, 1713, 728, 1711, - /* 1190 */ 318, 2421, 1773, 755, 2459, 736, 757, 2196, 115, 2423, - /* 1200 */ 746, 2425, 2426, 741, 91, 764, 1961, 90, 2388, 1330, - /* 1210 */ 2614, 1967, 2513, 464, 460, 1736, 415, 2509, 614, 613, - /* 1220 */ 2388, 1716, 1717, 1769, 2330, 1771, 1774, 1775, 1776, 1777, - /* 1230 */ 1778, 1779, 1780, 1781, 738, 762, 761, 1792, 1794, 1795, - /* 1240 */ 1796, 1797, 2, 47, 45, 760, 2144, 760, 2144, 2422, - /* 1250 */ 1770, 419, 99, 1712, 1960, 377, 160, 1959, 403, 2388, - /* 1260 */ 655, 113, 743, 2241, 2587, 758, 1798, 325, 1710, 1958, - /* 1270 */ 1957, 824, 822, 89, 760, 2144, 1721, 172, 150, 276, - /* 1280 */ 795, 2533, 1861, 2188, 2422, 2147, 2136, 160, 796, 338, - /* 1290 */ 2440, 2188, 2174, 160, 432, 262, 1793, 743, 260, 2532, - /* 1300 */ 623, 1770, 2388, 140, 742, 488, 624, 2388, 264, 1718, - /* 1310 */ 2388, 263, 2025, 266, 268, 87, 265, 267, 2016, 2014, - /* 1320 */ 1949, 1950, 2388, 2388, 1425, 2440, 657, 688, 656, 1720, - /* 1330 */ 1423, 54, 49, 2084, 638, 855, 698, 2388, 15, 742, - /* 1340 */ 640, 643, 49, 804, 2421, 2409, 188, 2459, 160, 14, - /* 1350 */ 13, 115, 2423, 746, 2425, 2426, 741, 64, 764, 49, - /* 1360 */ 1819, 2008, 1655, 2614, 49, 2513, 312, 1402, 1658, 415, - /* 1370 */ 2509, 434, 433, 805, 1800, 1801, 76, 324, 323, 2421, - /* 1380 */ 158, 1726, 2459, 718, 160, 73, 115, 2423, 746, 2425, - /* 1390 */ 2426, 741, 112, 764, 1798, 2422, 1719, 1400, 2614, 299, - /* 1400 */ 2513, 109, 1892, 2411, 415, 2509, 1383, 1902, 743, 142, - /* 1410 */ 2441, 1772, 1782, 848, 768, 293, 158, 1901, 1799, 1802, - /* 1420 */ 160, 291, 2267, 727, 1793, 2081, 1998, 2080, 141, 2547, - /* 1430 */ 158, 695, 1835, 1713, 1783, 1711, 2440, 1718, 410, 1608, - /* 1440 */ 702, 316, 406, 1724, 749, 438, 2268, 1384, 2388, 2004, - /* 1450 */ 742, 752, 2185, 2422, 674, 320, 2548, 2558, 723, 1470, - /* 1460 */ 337, 301, 298, 735, 305, 5, 743, 1716, 1717, 1769, - /* 1470 */ 441, 1771, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, - /* 1480 */ 738, 762, 761, 1792, 1794, 1795, 1796, 1797, 2, 1498, - /* 1490 */ 2421, 1502, 2106, 2459, 2440, 1509, 1723, 115, 2423, 746, - /* 1500 */ 2425, 2426, 741, 1507, 764, 163, 2388, 2043, 742, 2488, - /* 1510 */ 446, 2513, 373, 372, 386, 415, 2509, 454, 455, 1745, - /* 1520 */ 466, 465, 1702, 2422, 212, 213, 468, 215, 1632, 332, - /* 1530 */ 1735, 482, 1736, 489, 226, 1798, 743, 1690, 491, 495, - /* 1540 */ 497, 536, 502, 514, 527, 525, 2260, 532, 2421, 535, - /* 1550 */ 537, 2459, 548, 549, 546, 115, 2423, 746, 2425, 2426, - /* 1560 */ 741, 1727, 764, 1722, 2440, 1793, 231, 2486, 232, 2513, - /* 1570 */ 551, 552, 1743, 415, 2509, 234, 2388, 554, 742, 556, - /* 1580 */ 635, 634, 633, 571, 4, 572, 579, 625, 144, 629, - /* 1590 */ 582, 580, 2422, 628, 242, 1730, 1732, 1738, 627, 632, - /* 1600 */ 398, 397, 584, 1744, 626, 743, 93, 622, 585, 762, - /* 1610 */ 761, 1792, 1794, 1795, 1796, 1797, 586, 245, 2421, 1746, - /* 1620 */ 248, 2459, 588, 2422, 250, 115, 2423, 746, 2425, 2426, - /* 1630 */ 741, 1747, 764, 2440, 94, 2276, 743, 732, 95, 2513, - /* 1640 */ 594, 255, 615, 415, 2509, 2388, 617, 742, 2134, 646, - /* 1650 */ 259, 117, 2130, 261, 647, 165, 166, 2339, 364, 2132, - /* 1660 */ 659, 661, 2128, 167, 2440, 168, 98, 1739, 154, 333, - /* 1670 */ 669, 2322, 670, 278, 668, 281, 2388, 283, 742, 675, - /* 1680 */ 2336, 699, 2335, 750, 676, 673, 685, 2421, 2563, 2562, - /* 1690 */ 2459, 8, 2422, 292, 116, 2423, 746, 2425, 2426, 741, - /* 1700 */ 2535, 764, 1703, 288, 1693, 743, 290, 708, 2513, 179, - /* 1710 */ 686, 684, 2512, 2509, 683, 411, 297, 719, 2421, 716, - /* 1720 */ 2617, 2459, 294, 300, 296, 116, 2423, 746, 2425, 2426, - /* 1730 */ 741, 1861, 764, 2440, 1696, 1699, 1704, 295, 1740, 2513, - /* 1740 */ 146, 2529, 2593, 734, 2509, 2388, 1866, 742, 1864, 191, - /* 1750 */ 762, 761, 1792, 1794, 1795, 1796, 1797, 307, 61, 1, - /* 1760 */ 155, 2422, 334, 207, 2494, 748, 2290, 2289, 335, 753, - /* 1770 */ 336, 2145, 2288, 421, 743, 157, 2422, 754, 106, 2380, - /* 1780 */ 108, 2379, 2189, 327, 339, 766, 1305, 744, 852, 743, - /* 1790 */ 2459, 849, 52, 164, 116, 2423, 746, 2425, 2426, 741, - /* 1800 */ 351, 764, 2440, 854, 384, 2422, 385, 343, 2513, 341, - /* 1810 */ 362, 2360, 379, 2509, 2388, 352, 742, 2440, 743, 2359, - /* 1820 */ 363, 2358, 82, 2353, 443, 444, 1683, 1684, 210, 2388, - /* 1830 */ 448, 742, 2351, 450, 451, 2422, 452, 1682, 2350, 387, - /* 1840 */ 2348, 457, 2347, 2346, 459, 2345, 2440, 461, 743, 463, - /* 1850 */ 1671, 2326, 214, 2325, 216, 1634, 2421, 83, 2388, 2459, - /* 1860 */ 742, 1635, 2303, 177, 2423, 746, 2425, 2426, 741, 2302, - /* 1870 */ 764, 2421, 2301, 475, 2459, 476, 2440, 2300, 116, 2423, - /* 1880 */ 746, 2425, 2426, 741, 2299, 764, 2250, 2247, 2388, 483, - /* 1890 */ 742, 2246, 2513, 2422, 2240, 480, 1578, 2510, 486, 487, - /* 1900 */ 2421, 2237, 2236, 2459, 219, 86, 743, 176, 2423, 746, - /* 1910 */ 2425, 2426, 741, 2235, 764, 2234, 2239, 712, 2615, 2422, - /* 1920 */ 221, 2238, 2233, 2232, 2230, 2229, 2228, 223, 2227, 503, - /* 1930 */ 2421, 505, 743, 2459, 2440, 2225, 2224, 354, 2423, 746, - /* 1940 */ 2425, 2426, 741, 2223, 764, 2222, 2388, 2245, 742, 2221, - /* 1950 */ 2555, 2220, 2422, 225, 2208, 92, 2207, 2206, 2205, 2244, - /* 1960 */ 2440, 2219, 2243, 2226, 2218, 743, 2217, 2216, 408, 2214, - /* 1970 */ 2213, 2212, 2388, 2211, 742, 230, 2201, 1584, 2202, 2200, - /* 1980 */ 539, 541, 2199, 707, 2210, 2209, 2242, 2204, 2421, 2203, - /* 1990 */ 2422, 2459, 2198, 2440, 409, 361, 2423, 746, 2425, 2426, - /* 2000 */ 741, 2046, 764, 740, 233, 2388, 2045, 742, 2044, 1437, - /* 2010 */ 1441, 235, 1445, 236, 2421, 375, 2042, 2459, 376, 2039, - /* 2020 */ 557, 361, 2423, 746, 2425, 2426, 741, 2038, 764, 2031, - /* 2030 */ 561, 2440, 558, 559, 2018, 565, 563, 1993, 567, 569, - /* 2040 */ 186, 1992, 1329, 2388, 238, 742, 562, 2421, 240, 2422, - /* 2050 */ 2459, 566, 79, 2408, 177, 2423, 746, 2425, 2426, 741, - /* 2060 */ 196, 764, 743, 577, 80, 2422, 2324, 2320, 2310, 2298, - /* 2070 */ 2297, 249, 247, 252, 2274, 2123, 2041, 2037, 743, 595, - /* 2080 */ 597, 1376, 596, 2035, 599, 2421, 600, 601, 2459, 2033, - /* 2090 */ 2440, 603, 360, 2423, 746, 2425, 2426, 741, 605, 764, - /* 2100 */ 604, 2479, 2388, 2030, 742, 609, 2440, 2013, 607, 2616, - /* 2110 */ 608, 2011, 2012, 2010, 1989, 2125, 258, 1514, 2388, 1513, - /* 2120 */ 742, 2124, 1427, 1426, 418, 1424, 1413, 72, 1422, 1421, - /* 2130 */ 1420, 821, 1419, 1418, 823, 2028, 1415, 1414, 399, 1412, - /* 2140 */ 420, 2026, 400, 2017, 2421, 401, 663, 2459, 2015, 402, - /* 2150 */ 1988, 361, 2423, 746, 2425, 2426, 741, 1987, 764, 641, - /* 2160 */ 2421, 644, 2422, 2459, 858, 1986, 648, 361, 2423, 746, - /* 2170 */ 2425, 2426, 741, 1985, 764, 743, 650, 1984, 652, 118, - /* 2180 */ 331, 1665, 2323, 1667, 1664, 28, 2422, 1669, 67, 1645, - /* 2190 */ 2319, 280, 1641, 1643, 2309, 56, 194, 57, 671, 743, - /* 2200 */ 672, 2296, 2295, 2440, 687, 846, 842, 838, 834, 677, - /* 2210 */ 328, 284, 679, 2599, 1620, 2388, 20, 742, 1619, 17, - /* 2220 */ 6, 2422, 170, 407, 30, 7, 1919, 2440, 21, 287, - /* 2230 */ 22, 190, 65, 689, 743, 691, 1893, 693, 178, 2388, - /* 2240 */ 289, 742, 201, 1934, 1900, 189, 32, 31, 2409, 24, - /* 2250 */ 59, 114, 1933, 23, 321, 412, 81, 658, 1938, 1887, - /* 2260 */ 2459, 1939, 2440, 1937, 356, 2423, 746, 2425, 2426, 741, - /* 2270 */ 1940, 764, 413, 303, 2388, 2294, 742, 181, 2273, 103, - /* 2280 */ 1858, 2421, 1857, 25, 2459, 102, 756, 13, 346, 2423, - /* 2290 */ 746, 2425, 2426, 741, 2422, 764, 1810, 58, 11, 1728, - /* 2300 */ 18, 1809, 182, 192, 1762, 751, 2272, 743, 1820, 2422, - /* 2310 */ 104, 1785, 38, 322, 326, 1784, 2421, 1754, 16, 2459, - /* 2320 */ 311, 26, 743, 345, 2423, 746, 2425, 2426, 741, 309, - /* 2330 */ 764, 2422, 27, 767, 193, 2440, 308, 765, 1895, 317, - /* 2340 */ 69, 105, 319, 809, 743, 2464, 2463, 2388, 745, 742, - /* 2350 */ 2440, 1787, 109, 2422, 763, 279, 68, 427, 771, 1499, - /* 2360 */ 1496, 774, 2388, 769, 742, 772, 743, 1495, 775, 777, - /* 2370 */ 1492, 1486, 2440, 778, 780, 1484, 781, 783, 784, 110, - /* 2380 */ 111, 1504, 1508, 78, 2388, 1490, 742, 1374, 1489, 2421, - /* 2390 */ 798, 1435, 2459, 1488, 2440, 1409, 347, 2423, 746, 2425, - /* 2400 */ 2426, 741, 1487, 764, 2421, 1406, 2388, 2459, 742, 1405, - /* 2410 */ 1404, 353, 2423, 746, 2425, 2426, 741, 1403, 764, 1401, - /* 2420 */ 1399, 1398, 1397, 811, 1434, 208, 2421, 1395, 1394, 2459, - /* 2430 */ 1393, 1392, 1391, 357, 2423, 746, 2425, 2426, 741, 1390, - /* 2440 */ 764, 1389, 1431, 1429, 1386, 1385, 1380, 1382, 2421, 2036, - /* 2450 */ 2422, 2459, 1381, 1379, 831, 348, 2423, 746, 2425, 2426, - /* 2460 */ 741, 833, 764, 743, 832, 2034, 2422, 835, 837, 836, - /* 2470 */ 2032, 839, 840, 841, 2029, 843, 844, 845, 2009, 743, - /* 2480 */ 847, 2422, 1318, 1983, 1306, 851, 330, 853, 1953, 1714, - /* 2490 */ 340, 2440, 856, 857, 743, 1953, 1953, 1953, 1953, 1953, - /* 2500 */ 1953, 1953, 1953, 2388, 1953, 742, 1953, 2440, 1953, 1953, - /* 2510 */ 2422, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2388, - /* 2520 */ 1953, 742, 2440, 743, 1953, 2422, 1953, 1953, 1953, 1953, - /* 2530 */ 1953, 1953, 1953, 1953, 2388, 1953, 742, 1953, 743, 1953, - /* 2540 */ 1953, 1953, 1953, 1953, 1953, 2421, 1953, 1953, 2459, 1953, - /* 2550 */ 1953, 2440, 358, 2423, 746, 2425, 2426, 741, 1953, 764, - /* 2560 */ 1953, 2421, 1953, 2388, 2459, 742, 2440, 1953, 349, 2423, - /* 2570 */ 746, 2425, 2426, 741, 1953, 764, 2421, 1953, 2388, 2459, - /* 2580 */ 742, 1953, 1953, 359, 2423, 746, 2425, 2426, 741, 1953, - /* 2590 */ 764, 1953, 1953, 1953, 1953, 1953, 2422, 1953, 1953, 1953, - /* 2600 */ 1953, 1953, 1953, 1953, 1953, 2421, 1953, 1953, 2459, 743, - /* 2610 */ 1953, 2422, 350, 2423, 746, 2425, 2426, 741, 1953, 764, - /* 2620 */ 2421, 1953, 1953, 2459, 743, 1953, 2422, 365, 2423, 746, - /* 2630 */ 2425, 2426, 741, 1953, 764, 1953, 1953, 2440, 1953, 743, - /* 2640 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2388, - /* 2650 */ 1953, 742, 2440, 1953, 1953, 1953, 1953, 1953, 1953, 1953, - /* 2660 */ 1953, 1953, 1953, 1953, 2388, 1953, 742, 2440, 1953, 1953, - /* 2670 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2388, - /* 2680 */ 1953, 742, 1953, 1953, 2422, 1953, 1953, 1953, 1953, 1953, - /* 2690 */ 1953, 2421, 1953, 1953, 2459, 1953, 1953, 743, 366, 2423, - /* 2700 */ 746, 2425, 2426, 741, 1953, 764, 2421, 1953, 1953, 2459, - /* 2710 */ 2422, 1953, 1953, 2434, 2423, 746, 2425, 2426, 741, 1953, - /* 2720 */ 764, 2421, 1953, 743, 2459, 2440, 1953, 1953, 2433, 2423, - /* 2730 */ 746, 2425, 2426, 741, 1953, 764, 1953, 2388, 1953, 742, - /* 2740 */ 1953, 1953, 1953, 2422, 1953, 1953, 1953, 1953, 1953, 1953, - /* 2750 */ 1953, 2440, 1953, 1953, 1953, 1953, 743, 1953, 1953, 1953, - /* 2760 */ 1953, 1953, 1953, 2388, 1953, 742, 1953, 1953, 2422, 1953, - /* 2770 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2421, - /* 2780 */ 1953, 743, 2459, 1953, 2440, 1953, 2432, 2423, 746, 2425, - /* 2790 */ 2426, 741, 1953, 764, 1953, 1953, 2388, 1953, 742, 1953, - /* 2800 */ 1953, 1953, 1953, 1953, 1953, 2421, 1953, 1953, 2459, 2440, - /* 2810 */ 1953, 1953, 381, 2423, 746, 2425, 2426, 741, 1953, 764, - /* 2820 */ 1953, 2388, 1953, 742, 1953, 1953, 1953, 1953, 1953, 1953, - /* 2830 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2421, 1953, - /* 2840 */ 1953, 2459, 1953, 1953, 1953, 382, 2423, 746, 2425, 2426, - /* 2850 */ 741, 2422, 764, 1953, 1953, 1953, 1953, 1953, 1953, 1953, - /* 2860 */ 1953, 1953, 1953, 2421, 743, 1953, 2459, 2422, 1953, 1953, - /* 2870 */ 378, 2423, 746, 2425, 2426, 741, 1953, 764, 1953, 1953, - /* 2880 */ 743, 1953, 2422, 1953, 1953, 1953, 1953, 1953, 1953, 1953, - /* 2890 */ 1953, 1953, 2440, 1953, 1953, 743, 1953, 1953, 1953, 1953, - /* 2900 */ 1953, 1953, 1953, 1953, 2388, 1953, 742, 1953, 2440, 1953, - /* 2910 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, - /* 2920 */ 2388, 1953, 742, 2440, 1953, 1953, 1953, 1953, 1953, 1953, - /* 2930 */ 1953, 1953, 1953, 1953, 1953, 2388, 1953, 742, 1953, 1953, - /* 2940 */ 1953, 1953, 1953, 1953, 1953, 1953, 2421, 1953, 1953, 2459, - /* 2950 */ 1953, 1953, 1953, 383, 2423, 746, 2425, 2426, 741, 1953, - /* 2960 */ 764, 1953, 744, 1953, 1953, 2459, 1953, 1953, 1953, 356, - /* 2970 */ 2423, 746, 2425, 2426, 741, 1953, 764, 2421, 1953, 1953, - /* 2980 */ 2459, 1953, 1953, 1953, 355, 2423, 746, 2425, 2426, 741, - /* 2990 */ 1953, 764, + /* 0 */ 481, 428, 2122, 2384, 711, 2401, 426, 2597, 2531, 169, + /* 10 */ 37, 310, 47, 45, 1874, 574, 405, 2148, 575, 1999, + /* 20 */ 419, 2285, 1714, 2531, 2197, 710, 204, 760, 474, 2405, + /* 30 */ 2598, 712, 2285, 473, 2528, 1800, 2042, 1712, 1740, 2283, + /* 40 */ 748, 2602, 654, 2425, 2597, 541, 539, 422, 370, 2527, + /* 50 */ 2282, 748, 218, 723, 147, 2199, 726, 652, 425, 650, + /* 60 */ 271, 270, 404, 2601, 666, 1795, 2199, 2598, 2600, 765, + /* 70 */ 2197, 19, 800, 388, 2407, 2409, 416, 571, 1720, 682, + /* 80 */ 705, 2197, 2597, 1739, 2443, 765, 569, 40, 39, 565, + /* 90 */ 561, 46, 44, 43, 42, 41, 2391, 66, 743, 582, + /* 100 */ 2603, 204, 575, 1999, 856, 2598, 712, 15, 2443, 831, + /* 110 */ 830, 829, 828, 437, 50, 827, 826, 152, 821, 820, + /* 120 */ 819, 818, 817, 816, 815, 151, 809, 808, 807, 436, + /* 130 */ 435, 804, 803, 802, 184, 183, 801, 760, 2424, 584, + /* 140 */ 2324, 2462, 1429, 1802, 1803, 115, 2426, 747, 2428, 2429, + /* 150 */ 742, 706, 765, 711, 1740, 1979, 2597, 187, 591, 2516, + /* 160 */ 9, 1613, 1614, 415, 2512, 302, 2524, 722, 1329, 139, + /* 170 */ 721, 704, 2597, 62, 710, 204, 723, 147, 206, 2598, + /* 180 */ 712, 1774, 1784, 1431, 761, 2146, 2546, 1978, 1801, 1804, + /* 190 */ 710, 204, 1327, 1328, 1739, 2598, 712, 1956, 430, 665, + /* 200 */ 62, 2192, 2194, 1715, 209, 1713, 1612, 1615, 2391, 1977, + /* 210 */ 723, 147, 40, 39, 592, 2278, 46, 44, 43, 42, + /* 220 */ 41, 137, 136, 135, 134, 133, 132, 131, 130, 129, + /* 230 */ 798, 162, 161, 795, 794, 793, 159, 1718, 1719, 1771, + /* 240 */ 2391, 1773, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, + /* 250 */ 739, 763, 762, 1794, 1796, 1797, 1798, 1799, 2, 47, + /* 260 */ 45, 107, 2391, 760, 368, 2333, 1737, 419, 472, 1714, + /* 270 */ 471, 761, 2146, 524, 1949, 380, 544, 1521, 1522, 621, + /* 280 */ 1831, 543, 1800, 620, 1712, 2045, 2139, 725, 202, 2524, + /* 290 */ 2525, 138, 145, 2529, 761, 2146, 33, 504, 617, 545, + /* 300 */ 470, 1899, 40, 39, 369, 506, 46, 44, 43, 42, + /* 310 */ 41, 175, 1795, 1968, 138, 484, 1900, 1486, 19, 1829, + /* 320 */ 276, 622, 203, 2524, 2525, 1720, 145, 2529, 434, 433, + /* 330 */ 811, 1477, 790, 789, 788, 1481, 787, 1483, 1484, 786, + /* 340 */ 783, 306, 1492, 780, 1494, 1495, 777, 774, 771, 1742, + /* 350 */ 50, 856, 391, 1721, 15, 1593, 1594, 1898, 636, 635, + /* 360 */ 634, 2602, 34, 492, 2597, 626, 144, 630, 306, 239, + /* 370 */ 1771, 629, 1836, 577, 579, 2007, 628, 633, 398, 397, + /* 380 */ 576, 1948, 627, 2601, 1830, 623, 2123, 2598, 2599, 1322, + /* 390 */ 1802, 1803, 1863, 2272, 2251, 813, 532, 531, 530, 529, + /* 400 */ 528, 523, 522, 521, 520, 374, 761, 2146, 1329, 510, + /* 410 */ 509, 508, 507, 501, 500, 499, 1957, 494, 493, 389, + /* 420 */ 2193, 2194, 458, 485, 1581, 1582, 55, 1976, 1774, 1784, + /* 430 */ 1600, 1324, 1327, 1328, 160, 1801, 1804, 128, 396, 395, + /* 440 */ 127, 126, 125, 124, 123, 122, 121, 120, 119, 2124, + /* 450 */ 1715, 128, 1713, 197, 127, 126, 125, 124, 123, 122, + /* 460 */ 121, 120, 119, 1739, 1714, 2186, 36, 417, 1824, 1825, + /* 470 */ 1826, 1827, 1828, 1832, 1833, 1834, 1835, 241, 1975, 1712, + /* 480 */ 2391, 577, 153, 2007, 1718, 1719, 1771, 701, 1773, 1776, + /* 490 */ 1777, 1778, 1779, 1780, 1781, 1782, 1783, 739, 763, 762, + /* 500 */ 1794, 1796, 1797, 1798, 1799, 2, 12, 47, 45, 54, + /* 510 */ 394, 393, 304, 619, 173, 419, 12, 1714, 306, 344, + /* 520 */ 1720, 1724, 798, 162, 161, 795, 794, 793, 159, 2121, + /* 530 */ 1800, 2391, 1712, 535, 590, 621, 342, 75, 160, 620, + /* 540 */ 74, 2602, 314, 315, 490, 2261, 856, 313, 40, 39, + /* 550 */ 371, 462, 46, 44, 43, 42, 41, 12, 1742, 10, + /* 560 */ 1795, 1743, 237, 556, 554, 551, 19, 636, 635, 634, + /* 570 */ 658, 2137, 657, 1720, 626, 144, 630, 1907, 464, 460, + /* 580 */ 629, 707, 702, 695, 691, 628, 633, 398, 397, 723, + /* 590 */ 147, 627, 1878, 220, 623, 229, 613, 612, 1739, 856, + /* 600 */ 40, 39, 15, 62, 46, 44, 43, 42, 41, 2425, + /* 610 */ 40, 39, 1743, 1657, 46, 44, 43, 42, 41, 2401, + /* 620 */ 534, 228, 744, 1348, 1775, 1347, 425, 698, 697, 1905, + /* 630 */ 1906, 1908, 1909, 1910, 2234, 663, 1694, 765, 1802, 1803, + /* 640 */ 143, 63, 35, 2405, 1739, 1715, 1942, 1713, 40, 39, + /* 650 */ 2443, 185, 46, 44, 43, 42, 41, 1810, 1349, 1348, + /* 660 */ 160, 1347, 2391, 1739, 743, 798, 162, 161, 795, 794, + /* 670 */ 793, 159, 62, 390, 594, 2265, 1774, 1784, 224, 1718, + /* 680 */ 1719, 800, 1772, 1801, 1804, 43, 42, 41, 2407, 2410, + /* 690 */ 51, 85, 84, 477, 1349, 732, 217, 2488, 1715, 765, + /* 700 */ 1713, 205, 2524, 2525, 2424, 145, 2529, 2462, 2385, 469, + /* 710 */ 467, 177, 2426, 747, 2428, 2429, 742, 2352, 765, 91, + /* 720 */ 367, 304, 90, 456, 496, 2261, 453, 449, 445, 442, + /* 730 */ 470, 62, 1718, 1719, 1771, 1660, 1773, 1776, 1777, 1778, + /* 740 */ 1779, 1780, 1781, 1782, 1783, 739, 763, 762, 1794, 1796, + /* 750 */ 1797, 1798, 1799, 2, 47, 45, 1805, 2425, 2412, 1775, + /* 760 */ 2364, 174, 419, 425, 1714, 713, 2618, 791, 274, 2085, + /* 770 */ 744, 306, 273, 222, 765, 200, 1693, 1800, 1720, 1712, + /* 780 */ 1744, 761, 2146, 761, 2146, 171, 2425, 526, 2261, 89, + /* 790 */ 46, 44, 43, 42, 41, 734, 517, 2488, 2443, 726, + /* 800 */ 516, 478, 2365, 479, 1697, 761, 2146, 1795, 515, 1871, + /* 810 */ 2391, 682, 743, 423, 2597, 2199, 2414, 1772, 172, 1743, + /* 820 */ 1720, 172, 414, 185, 1775, 498, 2149, 2443, 666, 2148, + /* 830 */ 2197, 1744, 2603, 204, 1700, 1703, 227, 2598, 712, 2391, + /* 840 */ 306, 743, 99, 1743, 2218, 377, 856, 2266, 403, 48, + /* 850 */ 656, 814, 2424, 682, 2107, 2462, 2597, 2425, 306, 115, + /* 860 */ 2426, 747, 2428, 2429, 742, 1974, 765, 761, 2146, 149, + /* 870 */ 744, 156, 2487, 2516, 2603, 204, 2135, 415, 2512, 2598, + /* 880 */ 712, 2424, 1772, 2029, 2462, 1802, 1803, 511, 115, 2426, + /* 890 */ 747, 2428, 2429, 742, 96, 765, 761, 2146, 2443, 306, + /* 900 */ 187, 428, 2516, 668, 2324, 637, 415, 2512, 664, 172, + /* 910 */ 2391, 392, 743, 2010, 761, 2146, 512, 2148, 2391, 681, + /* 920 */ 2141, 761, 2146, 1774, 1784, 100, 859, 2531, 2199, 2547, + /* 930 */ 1801, 1804, 40, 39, 513, 424, 46, 44, 43, 42, + /* 940 */ 41, 593, 331, 2197, 1696, 1715, 211, 1713, 329, 14, + /* 950 */ 13, 275, 2424, 2526, 1954, 2462, 1641, 29, 194, 115, + /* 960 */ 2426, 747, 2428, 2429, 742, 849, 765, 847, 843, 839, + /* 970 */ 835, 2491, 328, 2516, 1699, 1702, 2131, 415, 2512, 1718, + /* 980 */ 1719, 1771, 195, 1773, 1776, 1777, 1778, 1779, 1780, 1781, + /* 990 */ 1782, 1783, 739, 763, 762, 1794, 1796, 1797, 1798, 1799, + /* 1000 */ 2, 47, 45, 2601, 519, 518, 199, 761, 2146, 419, + /* 1010 */ 112, 1714, 689, 114, 1351, 1352, 321, 761, 2146, 109, + /* 1020 */ 761, 2146, 2425, 1973, 1800, 431, 1712, 2143, 113, 2199, + /* 1030 */ 1662, 1663, 1919, 172, 440, 744, 429, 277, 1744, 439, + /* 1040 */ 285, 2148, 2425, 1331, 2197, 150, 761, 2146, 757, 1738, + /* 1050 */ 615, 614, 60, 2138, 1795, 744, 1843, 2009, 761, 2146, + /* 1060 */ 679, 1972, 1744, 2443, 40, 39, 729, 1720, 46, 44, + /* 1070 */ 43, 42, 41, 632, 631, 2391, 2391, 743, 318, 825, + /* 1080 */ 823, 2425, 1870, 2443, 96, 682, 1971, 1894, 2597, 761, + /* 1090 */ 2146, 1739, 309, 856, 744, 2391, 48, 743, 2133, 308, + /* 1100 */ 2425, 761, 2146, 761, 2146, 792, 2603, 204, 2190, 758, + /* 1110 */ 2142, 2598, 712, 744, 2391, 2554, 49, 2424, 279, 1970, + /* 1120 */ 2462, 759, 2443, 325, 116, 2426, 747, 2428, 2429, 742, + /* 1130 */ 2129, 765, 1802, 1803, 2391, 1441, 743, 2424, 2516, 2391, + /* 1140 */ 2462, 2443, 2199, 2513, 115, 2426, 747, 2428, 2429, 742, + /* 1150 */ 1440, 765, 2199, 2391, 715, 743, 2617, 730, 2516, 1967, + /* 1160 */ 761, 2146, 415, 2512, 1918, 1966, 1965, 756, 718, 1964, + /* 1170 */ 1774, 1784, 2391, 1984, 851, 2027, 2424, 1801, 1804, 2462, + /* 1180 */ 432, 2199, 1723, 354, 2426, 747, 2428, 2429, 742, 3, + /* 1190 */ 765, 1904, 1715, 1445, 1713, 2424, 2198, 639, 2462, 1963, + /* 1200 */ 1962, 53, 115, 2426, 747, 2428, 2429, 742, 1444, 765, + /* 1210 */ 661, 737, 2391, 1961, 2617, 1960, 2516, 546, 2391, 2391, + /* 1220 */ 415, 2512, 2391, 1959, 2536, 1863, 1718, 1719, 1771, 708, + /* 1230 */ 1773, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 739, + /* 1240 */ 763, 762, 1794, 1796, 1797, 1798, 1799, 2, 47, 45, + /* 1250 */ 2425, 148, 2391, 2391, 2487, 667, 419, 796, 1714, 797, + /* 1260 */ 2190, 682, 2190, 744, 2597, 2567, 2391, 338, 2391, 2355, + /* 1270 */ 2176, 1800, 140, 1712, 624, 548, 2391, 2244, 77, 286, + /* 1280 */ 1951, 1952, 2603, 204, 87, 2018, 2016, 2598, 712, 2425, + /* 1290 */ 262, 2443, 2086, 260, 2150, 727, 264, 714, 1426, 263, + /* 1300 */ 49, 1795, 744, 2391, 693, 743, 682, 641, 644, 2597, + /* 1310 */ 1772, 625, 266, 198, 1720, 265, 434, 433, 268, 488, + /* 1320 */ 447, 267, 188, 101, 160, 282, 1728, 2603, 204, 64, + /* 1330 */ 2443, 88, 2598, 712, 1722, 1424, 49, 14, 13, 1800, + /* 1340 */ 856, 1721, 2391, 15, 743, 2424, 682, 2425, 2462, 2597, + /* 1350 */ 1726, 49, 115, 2426, 747, 2428, 2429, 742, 738, 765, + /* 1360 */ 744, 1969, 2590, 312, 2617, 76, 2516, 2603, 204, 1795, + /* 1370 */ 415, 2512, 2598, 712, 299, 1903, 2560, 1821, 699, 1802, + /* 1380 */ 1803, 293, 1720, 158, 2424, 160, 142, 2462, 2443, 73, + /* 1390 */ 769, 115, 2426, 747, 2428, 2429, 742, 291, 765, 728, + /* 1400 */ 2391, 2083, 743, 2617, 1837, 2516, 324, 323, 736, 415, + /* 1410 */ 2512, 1785, 2444, 805, 2082, 643, 2270, 1774, 1784, 806, + /* 1420 */ 716, 158, 160, 141, 1801, 1804, 1610, 40, 39, 158, + /* 1430 */ 655, 46, 44, 43, 42, 41, 719, 1403, 316, 1715, + /* 1440 */ 753, 1713, 2424, 1401, 2000, 2462, 272, 2550, 696, 115, + /* 1450 */ 2426, 747, 2428, 2429, 742, 410, 765, 703, 320, 1384, + /* 1460 */ 1471, 2617, 646, 2516, 337, 1499, 406, 415, 2512, 640, + /* 1470 */ 638, 750, 438, 1718, 1719, 1771, 269, 1773, 1776, 1777, + /* 1480 */ 1778, 1779, 1780, 1781, 1782, 1783, 739, 763, 762, 1794, + /* 1490 */ 1796, 1797, 1798, 1799, 2, 2425, 1503, 1510, 1508, 2006, + /* 1500 */ 1385, 2271, 1725, 2187, 163, 675, 724, 1729, 744, 1724, + /* 1510 */ 2535, 2551, 2561, 301, 298, 305, 2108, 71, 5, 441, + /* 1520 */ 70, 446, 386, 454, 1747, 455, 466, 1890, 465, 213, + /* 1530 */ 212, 468, 215, 332, 1634, 1737, 2443, 482, 1738, 489, + /* 1540 */ 226, 1732, 1734, 491, 495, 497, 537, 502, 2391, 525, + /* 1550 */ 743, 514, 2263, 2425, 549, 763, 762, 1794, 1796, 1797, + /* 1560 */ 1798, 1799, 527, 533, 536, 538, 744, 550, 547, 231, + /* 1570 */ 232, 552, 553, 234, 555, 557, 1745, 572, 4, 573, + /* 1580 */ 580, 242, 581, 1740, 585, 583, 1746, 93, 245, 1748, + /* 1590 */ 2424, 586, 2425, 2462, 2443, 587, 1749, 115, 2426, 747, + /* 1600 */ 2428, 2429, 742, 248, 765, 744, 2391, 250, 743, 2617, + /* 1610 */ 2279, 2516, 373, 372, 589, 415, 2512, 595, 616, 94, + /* 1620 */ 95, 618, 1704, 2425, 255, 2136, 259, 117, 2132, 261, + /* 1630 */ 165, 166, 2134, 2443, 647, 1800, 744, 1692, 648, 660, + /* 1640 */ 662, 364, 2130, 167, 98, 2391, 154, 743, 2424, 168, + /* 1650 */ 1741, 2462, 278, 333, 670, 115, 2426, 747, 2428, 2429, + /* 1660 */ 742, 669, 765, 2342, 2443, 1795, 2325, 2489, 281, 2516, + /* 1670 */ 2339, 674, 2338, 415, 2512, 283, 2391, 677, 743, 700, + /* 1680 */ 671, 686, 676, 2566, 751, 288, 8, 2424, 2538, 2565, + /* 1690 */ 2462, 290, 709, 292, 115, 2426, 747, 2428, 2429, 742, + /* 1700 */ 687, 765, 685, 684, 411, 296, 733, 179, 2516, 720, + /* 1710 */ 297, 2425, 415, 2512, 294, 2620, 295, 1863, 2424, 717, + /* 1720 */ 1742, 2462, 2532, 146, 744, 116, 2426, 747, 2428, 2429, + /* 1730 */ 742, 1868, 765, 257, 2596, 1866, 191, 307, 155, 2516, + /* 1740 */ 1, 207, 61, 2515, 2512, 334, 2497, 300, 749, 180, + /* 1750 */ 2293, 2292, 2443, 2291, 335, 421, 754, 157, 611, 607, + /* 1760 */ 603, 599, 336, 256, 2391, 2147, 743, 106, 755, 2383, + /* 1770 */ 2382, 108, 767, 2191, 339, 1306, 850, 853, 327, 164, + /* 1780 */ 52, 363, 855, 343, 384, 341, 2363, 385, 2362, 351, + /* 1790 */ 362, 2361, 82, 2356, 443, 352, 444, 1685, 1686, 210, + /* 1800 */ 448, 2354, 450, 1705, 97, 1695, 2424, 254, 2425, 2462, + /* 1810 */ 451, 452, 1684, 116, 2426, 747, 2428, 2429, 742, 2353, + /* 1820 */ 765, 744, 387, 2351, 457, 2350, 459, 2516, 2349, 461, + /* 1830 */ 2348, 735, 2512, 463, 1673, 1698, 1701, 1706, 2329, 214, + /* 1840 */ 2328, 83, 216, 1636, 1637, 2425, 2306, 2305, 2304, 2443, + /* 1850 */ 475, 763, 762, 1794, 1796, 1797, 1798, 1799, 741, 476, + /* 1860 */ 2303, 2391, 2302, 743, 2253, 480, 2425, 1580, 2250, 483, + /* 1870 */ 2249, 2243, 486, 487, 244, 2240, 219, 2239, 86, 744, + /* 1880 */ 2238, 2237, 2242, 253, 246, 2241, 2443, 2236, 221, 2235, + /* 1890 */ 251, 588, 2233, 2232, 2231, 223, 503, 2230, 2391, 505, + /* 1900 */ 743, 2228, 2227, 745, 2226, 2225, 2462, 2443, 2248, 243, + /* 1910 */ 116, 2426, 747, 2428, 2429, 742, 2224, 765, 2223, 2391, + /* 1920 */ 2222, 743, 225, 2211, 2516, 2246, 2229, 2221, 379, 2512, + /* 1930 */ 2220, 2219, 2217, 2216, 2215, 2214, 2213, 2212, 2210, 2209, + /* 1940 */ 2424, 92, 2208, 2462, 2207, 2247, 2245, 360, 2426, 747, + /* 1950 */ 2428, 2429, 742, 740, 765, 731, 2481, 2206, 2205, 2204, + /* 1960 */ 230, 2424, 1586, 2425, 2462, 2203, 2202, 540, 176, 2426, + /* 1970 */ 747, 2428, 2429, 742, 2201, 765, 744, 542, 2200, 375, + /* 1980 */ 2425, 1330, 1442, 1446, 2048, 1438, 233, 2047, 2046, 235, + /* 1990 */ 2044, 376, 2041, 744, 559, 2425, 560, 2040, 564, 558, + /* 2000 */ 562, 563, 2033, 567, 2443, 566, 568, 2020, 744, 570, + /* 2010 */ 683, 2557, 236, 1995, 238, 79, 2391, 1994, 743, 186, + /* 2020 */ 2411, 2443, 240, 2327, 196, 578, 2323, 80, 2313, 2301, + /* 2030 */ 2300, 247, 252, 2391, 2277, 743, 2443, 249, 2125, 2043, + /* 2040 */ 2039, 596, 1377, 598, 597, 2037, 600, 601, 2391, 2035, + /* 2050 */ 743, 604, 602, 606, 605, 408, 2032, 608, 2424, 609, + /* 2060 */ 610, 2462, 2015, 2013, 2425, 176, 2426, 747, 2428, 2429, + /* 2070 */ 742, 2014, 765, 2012, 1991, 2424, 2127, 744, 2462, 2425, + /* 2080 */ 1515, 1514, 361, 2426, 747, 2428, 2429, 742, 2126, 765, + /* 2090 */ 2424, 1428, 741, 2462, 1427, 72, 2030, 177, 2426, 747, + /* 2100 */ 2428, 2429, 742, 1425, 765, 2443, 1423, 258, 2558, 1422, + /* 2110 */ 2028, 1414, 1421, 822, 1420, 1419, 824, 2391, 1416, 743, + /* 2120 */ 2443, 1415, 1413, 399, 400, 2019, 401, 2017, 402, 645, + /* 2130 */ 1990, 1989, 2391, 1988, 743, 642, 649, 1987, 1986, 409, + /* 2140 */ 651, 653, 118, 1671, 1667, 1669, 1666, 2326, 28, 67, + /* 2150 */ 2322, 1643, 2619, 2312, 280, 2299, 1645, 2298, 672, 2424, + /* 2160 */ 56, 1647, 2462, 2425, 2602, 57, 361, 2426, 747, 2428, + /* 2170 */ 2429, 742, 20, 765, 2424, 17, 744, 2462, 2425, 688, + /* 2180 */ 407, 360, 2426, 747, 2428, 2429, 742, 1921, 765, 673, + /* 2190 */ 2482, 744, 21, 2425, 30, 678, 6, 170, 284, 1622, + /* 2200 */ 287, 7, 1895, 692, 2443, 1621, 744, 690, 22, 2425, + /* 2210 */ 190, 680, 201, 32, 694, 2412, 2391, 65, 743, 2443, + /* 2220 */ 289, 1902, 744, 178, 189, 31, 24, 1936, 1889, 1941, + /* 2230 */ 81, 2391, 1942, 743, 2443, 23, 1935, 412, 418, 1940, + /* 2240 */ 1939, 413, 59, 303, 181, 2297, 2391, 2276, 743, 1860, + /* 2250 */ 2443, 25, 1859, 420, 103, 102, 13, 1812, 2424, 11, + /* 2260 */ 1730, 2462, 2391, 1811, 743, 361, 2426, 747, 2428, 2429, + /* 2270 */ 742, 58, 765, 2424, 1822, 18, 2462, 1787, 38, 2425, + /* 2280 */ 361, 2426, 747, 2428, 2429, 742, 1786, 765, 659, 182, + /* 2290 */ 16, 2462, 744, 26, 1764, 356, 2426, 747, 2428, 2429, + /* 2300 */ 742, 192, 765, 27, 2424, 1756, 2425, 2462, 746, 311, + /* 2310 */ 2275, 346, 2426, 747, 2428, 2429, 742, 104, 765, 744, + /* 2320 */ 2443, 1897, 193, 317, 69, 322, 105, 752, 2467, 2466, + /* 2330 */ 319, 1789, 2391, 764, 743, 68, 109, 1500, 2425, 768, + /* 2340 */ 427, 766, 770, 772, 1497, 1496, 773, 2443, 775, 776, + /* 2350 */ 778, 744, 1493, 779, 781, 784, 1487, 782, 785, 2391, + /* 2360 */ 1491, 743, 1490, 1485, 110, 326, 111, 1509, 78, 1489, + /* 2370 */ 1505, 1488, 1375, 1410, 2424, 799, 2425, 2462, 1407, 2443, + /* 2380 */ 1406, 345, 2426, 747, 2428, 2429, 742, 1405, 765, 744, + /* 2390 */ 1404, 2391, 1402, 743, 1400, 1399, 1398, 1436, 810, 1435, + /* 2400 */ 812, 2424, 208, 1396, 2462, 1395, 1393, 1394, 347, 2426, + /* 2410 */ 747, 2428, 2429, 742, 1381, 765, 1392, 2443, 1391, 1390, + /* 2420 */ 1432, 2038, 2425, 1430, 1387, 1386, 1383, 1382, 1380, 2391, + /* 2430 */ 832, 743, 2036, 2424, 833, 744, 2462, 834, 836, 838, + /* 2440 */ 353, 2426, 747, 2428, 2429, 742, 2034, 765, 2425, 837, + /* 2450 */ 840, 841, 842, 2031, 844, 845, 846, 2011, 1985, 848, + /* 2460 */ 1319, 744, 1307, 2443, 852, 330, 854, 1955, 1955, 1716, + /* 2470 */ 340, 2424, 857, 1955, 2462, 2391, 858, 743, 357, 2426, + /* 2480 */ 747, 2428, 2429, 742, 1955, 765, 1955, 1955, 1955, 2443, + /* 2490 */ 1955, 1955, 2425, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + /* 2500 */ 1955, 2391, 1955, 743, 1955, 744, 1955, 1955, 1955, 1955, + /* 2510 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 2424, 1955, 1955, + /* 2520 */ 2462, 2425, 1955, 1955, 348, 2426, 747, 2428, 2429, 742, + /* 2530 */ 1955, 765, 1955, 2443, 744, 1955, 2425, 1955, 1955, 1955, + /* 2540 */ 1955, 1955, 1955, 2424, 1955, 2391, 2462, 743, 1955, 744, + /* 2550 */ 358, 2426, 747, 2428, 2429, 742, 1955, 765, 1955, 1955, + /* 2560 */ 1955, 1955, 2443, 1955, 1955, 1955, 1955, 2425, 1955, 1955, + /* 2570 */ 1955, 1955, 1955, 1955, 2391, 1955, 743, 2443, 1955, 1955, + /* 2580 */ 744, 1955, 1955, 1955, 1955, 1955, 1955, 2424, 1955, 2391, + /* 2590 */ 2462, 743, 1955, 1955, 349, 2426, 747, 2428, 2429, 742, + /* 2600 */ 1955, 765, 1955, 1955, 1955, 1955, 1955, 1955, 2443, 1955, + /* 2610 */ 1955, 1955, 1955, 1955, 1955, 1955, 2424, 1955, 1955, 2462, + /* 2620 */ 2391, 1955, 743, 359, 2426, 747, 2428, 2429, 742, 1955, + /* 2630 */ 765, 2424, 1955, 1955, 2462, 1955, 1955, 2425, 350, 2426, + /* 2640 */ 747, 2428, 2429, 742, 1955, 765, 1955, 1955, 1955, 1955, + /* 2650 */ 744, 1955, 1955, 2425, 1955, 1955, 1955, 1955, 1955, 1955, + /* 2660 */ 1955, 1955, 2424, 1955, 1955, 2462, 744, 1955, 1955, 365, + /* 2670 */ 2426, 747, 2428, 2429, 742, 1955, 765, 1955, 2443, 1955, + /* 2680 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + /* 2690 */ 2391, 1955, 743, 1955, 2443, 1955, 1955, 1955, 1955, 1955, + /* 2700 */ 1955, 1955, 1955, 1955, 1955, 1955, 2391, 1955, 743, 1955, + /* 2710 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + /* 2720 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + /* 2730 */ 1955, 1955, 2424, 1955, 2425, 2462, 1955, 1955, 1955, 366, + /* 2740 */ 2426, 747, 2428, 2429, 742, 1955, 765, 744, 2424, 1955, + /* 2750 */ 1955, 2462, 1955, 1955, 1955, 2437, 2426, 747, 2428, 2429, + /* 2760 */ 742, 1955, 765, 1955, 1955, 1955, 2425, 1955, 1955, 1955, + /* 2770 */ 1955, 1955, 1955, 1955, 1955, 2443, 1955, 1955, 1955, 744, + /* 2780 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 2391, 1955, 743, + /* 2790 */ 1955, 1955, 1955, 2425, 1955, 1955, 1955, 1955, 1955, 1955, + /* 2800 */ 1955, 1955, 1955, 1955, 1955, 1955, 744, 2443, 1955, 1955, + /* 2810 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 2391, + /* 2820 */ 1955, 743, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 2424, + /* 2830 */ 1955, 1955, 2462, 1955, 2443, 1955, 2436, 2426, 747, 2428, + /* 2840 */ 2429, 742, 1955, 765, 1955, 1955, 2391, 1955, 743, 1955, + /* 2850 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + /* 2860 */ 1955, 2424, 1955, 2425, 2462, 1955, 1955, 1955, 2435, 2426, + /* 2870 */ 747, 2428, 2429, 742, 1955, 765, 744, 1955, 1955, 2425, + /* 2880 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 2424, 1955, + /* 2890 */ 1955, 2462, 744, 1955, 2425, 381, 2426, 747, 2428, 2429, + /* 2900 */ 742, 1955, 765, 1955, 2443, 1955, 1955, 744, 1955, 2425, + /* 2910 */ 1955, 1955, 1955, 1955, 1955, 1955, 2391, 1955, 743, 1955, + /* 2920 */ 2443, 1955, 744, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + /* 2930 */ 1955, 1955, 2391, 1955, 743, 2443, 1955, 1955, 2425, 1955, + /* 2940 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 2391, 1955, 743, + /* 2950 */ 2443, 744, 1955, 1955, 1955, 1955, 1955, 1955, 2424, 1955, + /* 2960 */ 1955, 2462, 2391, 1955, 743, 382, 2426, 747, 2428, 2429, + /* 2970 */ 742, 1955, 765, 1955, 2424, 1955, 1955, 2462, 1955, 2443, + /* 2980 */ 1955, 378, 2426, 747, 2428, 2429, 742, 1955, 765, 2424, + /* 2990 */ 1955, 2391, 2462, 743, 1955, 1955, 383, 2426, 747, 2428, + /* 3000 */ 2429, 742, 1955, 765, 745, 1955, 1955, 2462, 1955, 1955, + /* 3010 */ 1955, 356, 2426, 747, 2428, 2429, 742, 1955, 765, 1955, + /* 3020 */ 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + /* 3030 */ 1955, 1955, 1955, 2424, 1955, 1955, 2462, 1955, 1955, 1955, + /* 3040 */ 355, 2426, 747, 2428, 2429, 742, 1955, 765, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 397, 397, 363, 389, 433, 366, 367, 404, 404, 438, - /* 10 */ 397, 397, 12, 13, 14, 412, 412, 2, 404, 405, - /* 20 */ 20, 20, 22, 8, 9, 412, 412, 12, 13, 14, - /* 30 */ 15, 16, 20, 411, 2, 35, 0, 37, 0, 20, - /* 40 */ 8, 9, 21, 356, 12, 13, 14, 15, 16, 368, - /* 50 */ 23, 429, 430, 368, 369, 484, 369, 36, 487, 38, - /* 60 */ 39, 40, 8, 9, 20, 65, 12, 13, 14, 15, - /* 70 */ 16, 71, 37, 20, 47, 48, 505, 506, 78, 368, - /* 80 */ 369, 510, 511, 20, 397, 8, 9, 33, 457, 12, - /* 90 */ 13, 14, 15, 16, 413, 414, 409, 416, 411, 388, - /* 100 */ 356, 420, 473, 474, 104, 399, 395, 107, 402, 73, - /* 110 */ 74, 75, 76, 77, 483, 79, 80, 81, 82, 83, + /* 0 */ 369, 390, 0, 400, 485, 386, 403, 488, 458, 398, + /* 10 */ 474, 475, 12, 13, 14, 364, 405, 406, 367, 368, + /* 20 */ 20, 412, 22, 458, 413, 506, 507, 20, 434, 410, + /* 30 */ 511, 512, 412, 439, 484, 35, 0, 37, 20, 430, + /* 40 */ 431, 485, 21, 357, 488, 414, 415, 427, 417, 484, + /* 50 */ 430, 431, 421, 369, 370, 398, 370, 36, 455, 38, + /* 60 */ 39, 40, 405, 507, 369, 65, 398, 511, 512, 466, + /* 70 */ 413, 71, 70, 405, 455, 456, 457, 51, 78, 485, + /* 80 */ 370, 413, 488, 20, 398, 466, 60, 8, 9, 63, + /* 90 */ 64, 12, 13, 14, 15, 16, 410, 4, 412, 364, + /* 100 */ 506, 507, 367, 368, 104, 511, 512, 107, 398, 73, + /* 110 */ 74, 75, 76, 77, 107, 79, 80, 81, 82, 83, /* 120 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - /* 130 */ 94, 95, 96, 97, 98, 99, 100, 70, 451, 399, - /* 140 */ 355, 454, 357, 143, 144, 458, 459, 460, 461, 462, - /* 150 */ 463, 107, 465, 409, 20, 143, 144, 470, 411, 472, - /* 160 */ 454, 4, 108, 476, 477, 480, 481, 482, 397, 484, - /* 170 */ 485, 465, 487, 426, 0, 404, 429, 430, 491, 107, - /* 180 */ 180, 181, 0, 412, 20, 108, 499, 187, 188, 363, - /* 190 */ 505, 506, 366, 367, 454, 510, 511, 159, 160, 187, - /* 200 */ 188, 104, 202, 21, 204, 465, 24, 25, 26, 27, - /* 210 */ 28, 29, 30, 31, 32, 118, 119, 120, 121, 122, - /* 220 */ 123, 124, 125, 126, 127, 51, 129, 130, 131, 132, - /* 230 */ 133, 134, 135, 180, 181, 0, 236, 237, 238, 204, - /* 240 */ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - /* 250 */ 250, 251, 252, 253, 254, 255, 256, 257, 12, 13, - /* 260 */ 377, 14, 20, 18, 107, 20, 20, 20, 22, 234, - /* 270 */ 235, 107, 27, 484, 356, 30, 487, 394, 4, 0, - /* 280 */ 35, 35, 356, 37, 8, 9, 403, 369, 12, 13, - /* 290 */ 14, 15, 16, 457, 505, 506, 51, 23, 53, 510, - /* 300 */ 511, 8, 9, 58, 59, 12, 13, 14, 15, 16, - /* 310 */ 107, 65, 33, 20, 69, 397, 182, 71, 274, 483, - /* 320 */ 46, 47, 48, 375, 78, 368, 369, 409, 407, 411, - /* 330 */ 70, 410, 411, 21, 20, 409, 24, 25, 26, 27, - /* 340 */ 28, 29, 30, 31, 32, 388, 274, 71, 400, 385, - /* 350 */ 104, 106, 395, 107, 12, 13, 14, 15, 16, 8, - /* 360 */ 9, 457, 117, 12, 13, 14, 15, 16, 14, 451, - /* 370 */ 397, 3, 454, 409, 20, 87, 458, 459, 460, 461, - /* 380 */ 462, 463, 464, 465, 466, 467, 20, 483, 20, 143, - /* 390 */ 144, 115, 147, 148, 421, 150, 151, 152, 153, 154, - /* 400 */ 155, 156, 157, 158, 201, 107, 203, 162, 163, 164, - /* 410 */ 165, 166, 167, 168, 0, 170, 171, 172, 454, 455, - /* 420 */ 456, 176, 177, 178, 258, 397, 180, 181, 183, 465, - /* 430 */ 18, 274, 353, 187, 188, 23, 233, 149, 24, 25, - /* 440 */ 26, 27, 28, 29, 30, 31, 32, 419, 202, 421, - /* 450 */ 204, 20, 40, 41, 14, 179, 44, 143, 144, 108, - /* 460 */ 20, 173, 174, 228, 8, 9, 54, 13, 12, 13, - /* 470 */ 14, 15, 16, 107, 117, 182, 108, 274, 66, 67, - /* 480 */ 68, 69, 236, 237, 238, 34, 240, 241, 242, 243, - /* 490 */ 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - /* 500 */ 254, 255, 256, 257, 258, 12, 13, 399, 14, 15, - /* 510 */ 16, 385, 433, 20, 397, 22, 20, 438, 22, 107, - /* 520 */ 364, 404, 137, 138, 368, 78, 370, 142, 35, 412, - /* 530 */ 37, 238, 78, 37, 180, 409, 186, 261, 262, 263, - /* 540 */ 264, 265, 266, 267, 268, 269, 270, 271, 8, 9, - /* 550 */ 182, 55, 12, 13, 14, 15, 16, 145, 65, 368, - /* 560 */ 369, 356, 454, 484, 71, 258, 487, 260, 12, 13, - /* 570 */ 378, 78, 274, 465, 369, 433, 368, 369, 386, 388, - /* 580 */ 454, 455, 39, 40, 505, 506, 51, 42, 37, 510, - /* 590 */ 511, 465, 238, 37, 469, 60, 471, 104, 63, 64, - /* 600 */ 107, 484, 397, 3, 487, 356, 194, 195, 196, 356, - /* 610 */ 398, 199, 368, 369, 409, 364, 411, 0, 369, 368, - /* 620 */ 180, 370, 505, 506, 212, 213, 484, 510, 511, 487, - /* 630 */ 280, 281, 282, 283, 22, 223, 143, 144, 226, 22, - /* 640 */ 274, 229, 230, 231, 232, 233, 397, 505, 506, 37, - /* 650 */ 194, 20, 510, 511, 111, 112, 451, 114, 409, 454, - /* 660 */ 411, 417, 409, 458, 459, 460, 461, 462, 463, 238, - /* 670 */ 465, 117, 484, 180, 181, 487, 368, 369, 238, 136, - /* 680 */ 187, 188, 33, 140, 368, 369, 274, 479, 480, 481, - /* 690 */ 482, 37, 484, 485, 506, 202, 388, 204, 510, 511, - /* 700 */ 451, 1, 2, 454, 388, 500, 501, 458, 459, 460, - /* 710 */ 461, 462, 463, 20, 465, 433, 104, 468, 65, 470, - /* 720 */ 471, 472, 182, 368, 369, 476, 477, 236, 369, 236, - /* 730 */ 237, 238, 78, 240, 241, 242, 243, 244, 245, 246, - /* 740 */ 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - /* 750 */ 257, 12, 13, 14, 356, 204, 397, 301, 377, 20, - /* 760 */ 204, 22, 109, 396, 368, 369, 484, 369, 50, 487, - /* 770 */ 368, 369, 417, 35, 35, 408, 37, 286, 287, 288, - /* 780 */ 289, 290, 291, 292, 403, 234, 235, 505, 506, 51, - /* 790 */ 388, 384, 510, 511, 387, 397, 0, 22, 60, 61, - /* 800 */ 62, 63, 484, 65, 65, 487, 398, 409, 108, 411, - /* 810 */ 368, 369, 37, 182, 73, 74, 75, 78, 273, 460, - /* 820 */ 179, 80, 81, 82, 506, 368, 369, 86, 510, 511, - /* 830 */ 388, 398, 91, 92, 93, 94, 356, 20, 97, 22, - /* 840 */ 4, 100, 20, 104, 106, 388, 107, 109, 0, 451, - /* 850 */ 398, 356, 454, 368, 369, 19, 458, 459, 460, 461, - /* 860 */ 462, 463, 468, 465, 369, 471, 371, 4, 470, 238, - /* 870 */ 472, 35, 55, 388, 476, 477, 480, 481, 482, 104, - /* 880 */ 484, 485, 143, 144, 22, 368, 369, 51, 0, 409, - /* 890 */ 368, 369, 397, 368, 58, 59, 296, 499, 368, 37, - /* 900 */ 182, 65, 261, 136, 409, 388, 411, 140, 190, 356, - /* 910 */ 8, 9, 271, 175, 12, 13, 14, 15, 16, 180, - /* 920 */ 181, 175, 184, 185, 137, 406, 187, 188, 409, 191, - /* 930 */ 192, 238, 136, 137, 138, 139, 140, 141, 142, 417, - /* 940 */ 78, 202, 106, 204, 368, 109, 451, 298, 210, 454, - /* 950 */ 368, 369, 206, 458, 459, 460, 461, 462, 463, 469, - /* 960 */ 465, 471, 409, 22, 433, 470, 104, 472, 443, 444, - /* 970 */ 388, 476, 477, 443, 444, 236, 237, 238, 37, 240, - /* 980 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - /* 990 */ 251, 252, 253, 254, 255, 256, 257, 12, 13, 356, - /* 1000 */ 424, 425, 215, 216, 182, 20, 398, 22, 433, 161, - /* 1010 */ 368, 369, 369, 165, 371, 484, 356, 356, 487, 78, - /* 1020 */ 35, 173, 37, 389, 136, 137, 138, 139, 140, 141, - /* 1030 */ 142, 397, 20, 410, 411, 356, 505, 506, 356, 405, - /* 1040 */ 397, 510, 511, 136, 137, 138, 139, 140, 141, 142, - /* 1050 */ 65, 369, 409, 371, 411, 368, 369, 389, 69, 484, - /* 1060 */ 238, 356, 487, 78, 202, 397, 204, 368, 369, 409, - /* 1070 */ 409, 56, 57, 405, 389, 388, 373, 374, 0, 397, - /* 1080 */ 505, 506, 397, 20, 433, 510, 511, 388, 409, 104, - /* 1090 */ 405, 409, 107, 411, 451, 398, 356, 454, 236, 237, - /* 1100 */ 356, 458, 459, 460, 461, 462, 463, 356, 465, 369, - /* 1110 */ 397, 371, 117, 470, 409, 472, 33, 404, 398, 476, - /* 1120 */ 477, 356, 480, 481, 482, 412, 484, 485, 143, 144, - /* 1130 */ 368, 369, 422, 451, 33, 484, 454, 397, 487, 276, - /* 1140 */ 458, 459, 460, 461, 462, 463, 45, 465, 70, 409, - /* 1150 */ 388, 411, 470, 409, 472, 356, 505, 506, 476, 477, - /* 1160 */ 409, 510, 511, 65, 169, 180, 181, 356, 368, 369, - /* 1170 */ 368, 369, 187, 188, 409, 439, 368, 369, 397, 138, - /* 1180 */ 382, 383, 397, 142, 359, 360, 197, 202, 388, 204, - /* 1190 */ 388, 451, 180, 412, 454, 71, 388, 412, 458, 459, - /* 1200 */ 460, 461, 462, 463, 106, 465, 356, 109, 409, 14, - /* 1210 */ 470, 357, 472, 224, 225, 20, 476, 477, 373, 374, - /* 1220 */ 409, 236, 237, 238, 393, 240, 241, 242, 243, 244, - /* 1230 */ 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - /* 1240 */ 255, 256, 257, 12, 13, 368, 369, 368, 369, 356, - /* 1250 */ 238, 20, 211, 22, 356, 214, 33, 356, 217, 409, - /* 1260 */ 219, 375, 369, 0, 371, 388, 35, 388, 37, 356, - /* 1270 */ 356, 382, 383, 175, 368, 369, 37, 397, 392, 448, - /* 1280 */ 406, 272, 273, 409, 356, 405, 400, 33, 406, 390, - /* 1290 */ 397, 409, 393, 33, 388, 110, 65, 369, 113, 371, - /* 1300 */ 13, 238, 409, 33, 411, 42, 13, 409, 110, 78, - /* 1310 */ 409, 113, 0, 110, 110, 45, 113, 113, 0, 0, - /* 1320 */ 143, 144, 409, 409, 37, 397, 218, 33, 220, 37, - /* 1330 */ 37, 108, 33, 386, 22, 104, 503, 409, 107, 411, - /* 1340 */ 22, 22, 33, 13, 451, 49, 33, 454, 33, 1, - /* 1350 */ 2, 458, 459, 460, 461, 462, 463, 33, 465, 33, - /* 1360 */ 236, 0, 108, 470, 33, 472, 33, 37, 108, 476, - /* 1370 */ 477, 12, 13, 13, 143, 144, 33, 12, 13, 451, - /* 1380 */ 33, 22, 454, 300, 33, 33, 458, 459, 460, 461, - /* 1390 */ 462, 463, 107, 465, 35, 356, 37, 37, 470, 514, - /* 1400 */ 472, 116, 108, 107, 476, 477, 37, 108, 369, 372, - /* 1410 */ 397, 180, 181, 52, 33, 496, 33, 108, 187, 188, - /* 1420 */ 33, 108, 422, 108, 65, 385, 367, 385, 33, 422, - /* 1430 */ 33, 502, 108, 202, 108, 204, 397, 78, 502, 108, - /* 1440 */ 502, 108, 432, 204, 502, 372, 422, 78, 409, 369, - /* 1450 */ 411, 108, 408, 356, 440, 108, 422, 422, 486, 108, - /* 1460 */ 108, 507, 478, 104, 489, 277, 369, 236, 237, 238, - /* 1470 */ 434, 240, 241, 242, 243, 244, 245, 246, 247, 248, - /* 1480 */ 249, 250, 251, 252, 253, 254, 255, 256, 257, 108, - /* 1490 */ 451, 108, 387, 454, 397, 108, 204, 458, 459, 460, - /* 1500 */ 461, 462, 463, 108, 465, 108, 409, 0, 411, 470, - /* 1510 */ 51, 472, 12, 13, 453, 476, 477, 42, 452, 20, - /* 1520 */ 445, 217, 22, 356, 450, 377, 445, 377, 200, 436, - /* 1530 */ 20, 368, 20, 369, 45, 35, 369, 37, 418, 369, - /* 1540 */ 418, 179, 415, 368, 418, 369, 368, 415, 451, 415, - /* 1550 */ 415, 454, 105, 381, 103, 458, 459, 460, 461, 462, - /* 1560 */ 463, 202, 465, 204, 397, 65, 380, 470, 368, 472, - /* 1570 */ 102, 379, 20, 476, 477, 368, 409, 368, 411, 368, - /* 1580 */ 73, 74, 75, 361, 50, 365, 361, 80, 81, 82, - /* 1590 */ 445, 365, 356, 86, 377, 236, 237, 20, 91, 92, - /* 1600 */ 93, 94, 411, 20, 97, 369, 377, 100, 370, 250, - /* 1610 */ 251, 252, 253, 254, 255, 256, 435, 377, 451, 20, - /* 1620 */ 377, 454, 370, 356, 377, 458, 459, 460, 461, 462, - /* 1630 */ 463, 20, 465, 397, 377, 425, 369, 470, 377, 472, - /* 1640 */ 368, 377, 361, 476, 477, 409, 397, 411, 397, 359, - /* 1650 */ 397, 368, 397, 397, 359, 397, 397, 409, 361, 397, - /* 1660 */ 221, 449, 397, 397, 397, 397, 107, 20, 447, 445, - /* 1670 */ 208, 444, 442, 375, 207, 441, 409, 375, 411, 434, - /* 1680 */ 409, 285, 409, 284, 368, 411, 409, 451, 495, 495, - /* 1690 */ 454, 293, 356, 497, 458, 459, 460, 461, 462, 463, - /* 1700 */ 498, 465, 202, 427, 204, 369, 427, 193, 472, 495, - /* 1710 */ 295, 294, 476, 477, 278, 302, 434, 299, 451, 297, - /* 1720 */ 515, 454, 494, 508, 492, 458, 459, 460, 461, 462, - /* 1730 */ 463, 273, 465, 397, 234, 235, 236, 493, 20, 472, - /* 1740 */ 369, 457, 509, 476, 477, 409, 117, 411, 275, 370, - /* 1750 */ 250, 251, 252, 253, 254, 255, 256, 375, 107, 490, - /* 1760 */ 375, 356, 427, 488, 475, 409, 409, 409, 427, 185, - /* 1770 */ 393, 369, 409, 409, 369, 375, 356, 423, 375, 409, - /* 1780 */ 107, 409, 409, 375, 368, 401, 22, 451, 358, 369, - /* 1790 */ 454, 38, 437, 362, 458, 459, 460, 461, 462, 463, - /* 1800 */ 391, 465, 397, 361, 428, 356, 428, 354, 472, 376, - /* 1810 */ 391, 0, 476, 477, 409, 391, 411, 397, 369, 0, - /* 1820 */ 446, 0, 45, 0, 37, 227, 37, 37, 37, 409, - /* 1830 */ 227, 411, 0, 37, 37, 356, 227, 37, 0, 227, - /* 1840 */ 0, 37, 0, 0, 37, 0, 397, 22, 369, 37, - /* 1850 */ 222, 0, 210, 0, 210, 202, 451, 211, 409, 454, - /* 1860 */ 411, 204, 0, 458, 459, 460, 461, 462, 463, 0, - /* 1870 */ 465, 451, 0, 198, 454, 197, 397, 0, 458, 459, - /* 1880 */ 460, 461, 462, 463, 0, 465, 148, 0, 409, 37, - /* 1890 */ 411, 0, 472, 356, 0, 49, 49, 477, 37, 51, - /* 1900 */ 451, 0, 0, 454, 49, 45, 369, 458, 459, 460, - /* 1910 */ 461, 462, 463, 0, 465, 0, 0, 512, 513, 356, - /* 1920 */ 49, 0, 0, 0, 0, 0, 0, 165, 0, 37, - /* 1930 */ 451, 165, 369, 454, 397, 0, 0, 458, 459, 460, - /* 1940 */ 461, 462, 463, 0, 465, 0, 409, 0, 411, 0, - /* 1950 */ 501, 0, 356, 49, 0, 45, 0, 0, 0, 0, - /* 1960 */ 397, 0, 0, 0, 0, 369, 0, 0, 431, 0, - /* 1970 */ 0, 0, 409, 0, 411, 148, 0, 22, 0, 0, - /* 1980 */ 147, 146, 0, 504, 0, 0, 0, 0, 451, 0, - /* 1990 */ 356, 454, 0, 397, 431, 458, 459, 460, 461, 462, - /* 2000 */ 463, 0, 465, 369, 65, 409, 0, 411, 0, 37, - /* 2010 */ 22, 65, 22, 65, 451, 50, 0, 454, 50, 0, - /* 2020 */ 37, 458, 459, 460, 461, 462, 463, 0, 465, 0, - /* 2030 */ 37, 397, 51, 42, 0, 37, 42, 0, 42, 37, - /* 2040 */ 33, 0, 14, 409, 45, 411, 51, 451, 43, 356, - /* 2050 */ 454, 51, 42, 49, 458, 459, 460, 461, 462, 463, - /* 2060 */ 49, 465, 369, 49, 42, 356, 0, 0, 0, 0, - /* 2070 */ 0, 193, 42, 49, 0, 0, 0, 0, 369, 37, - /* 2080 */ 42, 72, 51, 0, 37, 451, 51, 42, 454, 0, - /* 2090 */ 397, 37, 458, 459, 460, 461, 462, 463, 42, 465, - /* 2100 */ 51, 467, 409, 0, 411, 42, 397, 0, 37, 513, - /* 2110 */ 51, 0, 0, 0, 0, 0, 113, 37, 409, 22, - /* 2120 */ 411, 0, 37, 37, 431, 37, 22, 115, 37, 37, - /* 2130 */ 37, 33, 37, 37, 33, 0, 37, 37, 22, 37, - /* 2140 */ 431, 0, 22, 0, 451, 22, 1, 454, 0, 22, - /* 2150 */ 0, 458, 459, 460, 461, 462, 463, 0, 465, 53, - /* 2160 */ 451, 37, 356, 454, 19, 0, 37, 458, 459, 460, - /* 2170 */ 461, 462, 463, 0, 465, 369, 37, 0, 22, 20, - /* 2180 */ 35, 37, 0, 37, 37, 107, 356, 108, 107, 209, - /* 2190 */ 0, 49, 37, 22, 0, 182, 51, 182, 22, 369, - /* 2200 */ 182, 0, 0, 397, 37, 60, 61, 62, 63, 189, - /* 2210 */ 65, 185, 189, 3, 182, 409, 33, 411, 182, 279, - /* 2220 */ 50, 356, 205, 37, 107, 50, 108, 397, 33, 107, - /* 2230 */ 33, 33, 3, 107, 369, 105, 108, 103, 107, 409, - /* 2240 */ 108, 411, 49, 37, 108, 107, 33, 107, 49, 33, - /* 2250 */ 33, 106, 37, 279, 109, 37, 107, 451, 37, 108, - /* 2260 */ 454, 108, 397, 37, 458, 459, 460, 461, 462, 463, - /* 2270 */ 108, 465, 37, 49, 409, 0, 411, 49, 0, 42, - /* 2280 */ 108, 451, 108, 33, 454, 107, 141, 2, 458, 459, - /* 2290 */ 460, 461, 462, 463, 356, 465, 105, 272, 259, 22, - /* 2300 */ 279, 105, 49, 49, 22, 186, 0, 369, 236, 356, - /* 2310 */ 42, 108, 107, 49, 33, 108, 451, 108, 107, 454, - /* 2320 */ 108, 107, 369, 458, 459, 460, 461, 462, 463, 184, - /* 2330 */ 465, 356, 107, 37, 107, 397, 191, 117, 108, 107, - /* 2340 */ 107, 107, 184, 101, 369, 107, 107, 409, 239, 411, - /* 2350 */ 397, 108, 116, 356, 107, 210, 107, 37, 37, 108, - /* 2360 */ 108, 37, 409, 107, 411, 107, 369, 108, 107, 37, - /* 2370 */ 108, 108, 397, 107, 37, 108, 107, 37, 107, 107, - /* 2380 */ 107, 22, 37, 107, 409, 128, 411, 72, 128, 451, - /* 2390 */ 71, 78, 454, 128, 397, 37, 458, 459, 460, 461, - /* 2400 */ 462, 463, 128, 465, 451, 37, 409, 454, 411, 37, - /* 2410 */ 37, 458, 459, 460, 461, 462, 463, 37, 465, 37, - /* 2420 */ 37, 37, 37, 101, 78, 33, 451, 37, 37, 454, - /* 2430 */ 37, 22, 37, 458, 459, 460, 461, 462, 463, 37, - /* 2440 */ 465, 37, 78, 37, 37, 37, 22, 37, 451, 0, - /* 2450 */ 356, 454, 37, 37, 37, 458, 459, 460, 461, 462, - /* 2460 */ 463, 42, 465, 369, 51, 0, 356, 37, 42, 51, - /* 2470 */ 0, 37, 51, 42, 0, 37, 51, 42, 0, 369, - /* 2480 */ 37, 356, 37, 0, 22, 33, 22, 21, 516, 22, - /* 2490 */ 22, 397, 21, 20, 369, 516, 516, 516, 516, 516, - /* 2500 */ 516, 516, 516, 409, 516, 411, 516, 397, 516, 516, - /* 2510 */ 356, 516, 516, 516, 516, 516, 516, 516, 516, 409, - /* 2520 */ 516, 411, 397, 369, 516, 356, 516, 516, 516, 516, - /* 2530 */ 516, 516, 516, 516, 409, 516, 411, 516, 369, 516, - /* 2540 */ 516, 516, 516, 516, 516, 451, 516, 516, 454, 516, - /* 2550 */ 516, 397, 458, 459, 460, 461, 462, 463, 516, 465, - /* 2560 */ 516, 451, 516, 409, 454, 411, 397, 516, 458, 459, - /* 2570 */ 460, 461, 462, 463, 516, 465, 451, 516, 409, 454, - /* 2580 */ 411, 516, 516, 458, 459, 460, 461, 462, 463, 516, - /* 2590 */ 465, 516, 516, 516, 516, 516, 356, 516, 516, 516, - /* 2600 */ 516, 516, 516, 516, 516, 451, 516, 516, 454, 369, - /* 2610 */ 516, 356, 458, 459, 460, 461, 462, 463, 516, 465, - /* 2620 */ 451, 516, 516, 454, 369, 516, 356, 458, 459, 460, - /* 2630 */ 461, 462, 463, 516, 465, 516, 516, 397, 516, 369, - /* 2640 */ 516, 516, 516, 516, 516, 516, 516, 516, 516, 409, - /* 2650 */ 516, 411, 397, 516, 516, 516, 516, 516, 516, 516, - /* 2660 */ 516, 516, 516, 516, 409, 516, 411, 397, 516, 516, - /* 2670 */ 516, 516, 516, 516, 516, 516, 516, 516, 516, 409, - /* 2680 */ 516, 411, 516, 516, 356, 516, 516, 516, 516, 516, - /* 2690 */ 516, 451, 516, 516, 454, 516, 516, 369, 458, 459, - /* 2700 */ 460, 461, 462, 463, 516, 465, 451, 516, 516, 454, - /* 2710 */ 356, 516, 516, 458, 459, 460, 461, 462, 463, 516, - /* 2720 */ 465, 451, 516, 369, 454, 397, 516, 516, 458, 459, - /* 2730 */ 460, 461, 462, 463, 516, 465, 516, 409, 516, 411, - /* 2740 */ 516, 516, 516, 356, 516, 516, 516, 516, 516, 516, - /* 2750 */ 516, 397, 516, 516, 516, 516, 369, 516, 516, 516, - /* 2760 */ 516, 516, 516, 409, 516, 411, 516, 516, 356, 516, - /* 2770 */ 516, 516, 516, 516, 516, 516, 516, 516, 516, 451, - /* 2780 */ 516, 369, 454, 516, 397, 516, 458, 459, 460, 461, - /* 2790 */ 462, 463, 516, 465, 516, 516, 409, 516, 411, 516, - /* 2800 */ 516, 516, 516, 516, 516, 451, 516, 516, 454, 397, - /* 2810 */ 516, 516, 458, 459, 460, 461, 462, 463, 516, 465, - /* 2820 */ 516, 409, 516, 411, 516, 516, 516, 516, 516, 516, - /* 2830 */ 516, 516, 516, 516, 516, 516, 516, 516, 451, 516, - /* 2840 */ 516, 454, 516, 516, 516, 458, 459, 460, 461, 462, - /* 2850 */ 463, 356, 465, 516, 516, 516, 516, 516, 516, 516, - /* 2860 */ 516, 516, 516, 451, 369, 516, 454, 356, 516, 516, - /* 2870 */ 458, 459, 460, 461, 462, 463, 516, 465, 516, 516, - /* 2880 */ 369, 516, 356, 516, 516, 516, 516, 516, 516, 516, - /* 2890 */ 516, 516, 397, 516, 516, 369, 516, 516, 516, 516, - /* 2900 */ 516, 516, 516, 516, 409, 516, 411, 516, 397, 516, - /* 2910 */ 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, - /* 2920 */ 409, 516, 411, 397, 516, 516, 516, 516, 516, 516, - /* 2930 */ 516, 516, 516, 516, 516, 409, 516, 411, 516, 516, - /* 2940 */ 516, 516, 516, 516, 516, 516, 451, 516, 516, 454, - /* 2950 */ 516, 516, 516, 458, 459, 460, 461, 462, 463, 516, - /* 2960 */ 465, 516, 451, 516, 516, 454, 516, 516, 516, 458, - /* 2970 */ 459, 460, 461, 462, 463, 516, 465, 451, 516, 516, - /* 2980 */ 454, 516, 516, 516, 458, 459, 460, 461, 462, 463, - /* 2990 */ 516, 465, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3000 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3010 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3020 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3030 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3040 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3050 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3060 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3070 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3080 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3090 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3100 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3110 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3120 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3130 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3140 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3150 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3160 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3170 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3180 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3190 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3200 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3210 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3220 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3230 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3240 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3250 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3260 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3270 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3280 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3290 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3300 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3310 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3320 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3330 */ 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, - /* 3340 */ 353, 353, 353, 353, 353, + /* 130 */ 94, 95, 96, 97, 98, 99, 100, 20, 452, 444, + /* 140 */ 445, 455, 37, 143, 144, 459, 460, 461, 462, 463, + /* 150 */ 464, 20, 466, 485, 20, 357, 488, 471, 369, 473, + /* 160 */ 42, 143, 144, 477, 478, 481, 482, 483, 23, 485, + /* 170 */ 486, 461, 488, 107, 506, 507, 369, 370, 492, 511, + /* 180 */ 512, 181, 182, 78, 369, 370, 500, 357, 188, 189, + /* 190 */ 506, 507, 47, 48, 20, 511, 512, 0, 408, 20, + /* 200 */ 107, 411, 412, 203, 389, 205, 188, 189, 410, 357, + /* 210 */ 369, 370, 8, 9, 425, 426, 12, 13, 14, 15, + /* 220 */ 16, 24, 25, 26, 27, 28, 29, 30, 31, 32, + /* 230 */ 136, 137, 138, 139, 140, 141, 142, 237, 238, 239, + /* 240 */ 410, 241, 242, 243, 244, 245, 246, 247, 248, 249, + /* 250 */ 250, 251, 252, 253, 254, 255, 256, 257, 258, 12, + /* 260 */ 13, 376, 410, 20, 18, 394, 20, 20, 202, 22, + /* 270 */ 204, 369, 370, 27, 195, 71, 30, 143, 144, 136, + /* 280 */ 180, 35, 35, 140, 37, 0, 401, 480, 481, 482, + /* 290 */ 483, 389, 485, 486, 369, 370, 2, 51, 396, 53, + /* 300 */ 234, 22, 8, 9, 58, 59, 12, 13, 14, 15, + /* 310 */ 16, 356, 65, 358, 389, 69, 37, 104, 71, 115, + /* 320 */ 449, 396, 481, 482, 483, 78, 485, 486, 12, 13, + /* 330 */ 13, 118, 119, 120, 121, 122, 123, 124, 125, 126, + /* 340 */ 127, 275, 129, 130, 131, 132, 133, 134, 135, 20, + /* 350 */ 107, 104, 106, 37, 107, 181, 182, 78, 73, 74, + /* 360 */ 75, 485, 262, 117, 488, 80, 81, 82, 275, 365, + /* 370 */ 239, 86, 272, 369, 14, 371, 91, 92, 93, 94, + /* 380 */ 20, 302, 97, 507, 180, 100, 0, 511, 512, 4, + /* 390 */ 143, 144, 274, 147, 148, 78, 150, 151, 152, 153, + /* 400 */ 154, 155, 156, 157, 158, 159, 369, 370, 23, 163, + /* 410 */ 164, 165, 166, 167, 168, 169, 0, 171, 172, 173, + /* 420 */ 411, 412, 69, 177, 178, 179, 389, 357, 181, 182, + /* 430 */ 184, 46, 47, 48, 33, 188, 189, 21, 39, 40, + /* 440 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 0, + /* 450 */ 203, 21, 205, 397, 24, 25, 26, 27, 28, 29, + /* 460 */ 30, 31, 32, 20, 22, 409, 262, 263, 264, 265, + /* 470 */ 266, 267, 268, 269, 270, 271, 272, 365, 357, 37, + /* 480 */ 410, 369, 33, 371, 237, 238, 239, 187, 241, 242, + /* 490 */ 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + /* 500 */ 253, 254, 255, 256, 257, 258, 259, 12, 13, 108, + /* 510 */ 111, 112, 183, 114, 18, 20, 259, 22, 275, 23, + /* 520 */ 78, 205, 136, 137, 138, 139, 140, 141, 142, 0, + /* 530 */ 35, 410, 37, 87, 20, 136, 40, 41, 33, 140, + /* 540 */ 44, 3, 137, 138, 369, 370, 104, 142, 8, 9, + /* 550 */ 54, 198, 12, 13, 14, 15, 16, 259, 20, 261, + /* 560 */ 65, 20, 66, 67, 68, 69, 71, 73, 74, 75, + /* 570 */ 219, 400, 221, 78, 80, 81, 82, 237, 225, 226, + /* 580 */ 86, 281, 282, 283, 284, 91, 92, 93, 94, 369, + /* 590 */ 370, 97, 14, 418, 100, 149, 374, 375, 20, 104, + /* 600 */ 8, 9, 107, 107, 12, 13, 14, 15, 16, 357, + /* 610 */ 8, 9, 20, 108, 12, 13, 14, 15, 16, 386, + /* 620 */ 174, 175, 370, 20, 181, 22, 455, 287, 288, 289, + /* 630 */ 290, 291, 292, 293, 0, 117, 37, 466, 143, 144, + /* 640 */ 37, 145, 2, 410, 20, 203, 108, 205, 8, 9, + /* 650 */ 398, 398, 12, 13, 14, 15, 16, 14, 55, 20, + /* 660 */ 33, 22, 410, 20, 412, 136, 137, 138, 139, 140, + /* 670 */ 141, 142, 107, 420, 70, 422, 181, 182, 65, 237, + /* 680 */ 238, 70, 239, 188, 189, 14, 15, 16, 455, 456, + /* 690 */ 107, 195, 196, 197, 55, 470, 200, 472, 203, 466, + /* 700 */ 205, 481, 482, 483, 452, 485, 486, 455, 400, 213, + /* 710 */ 214, 459, 460, 461, 462, 463, 464, 0, 466, 106, + /* 720 */ 224, 183, 109, 227, 369, 370, 230, 231, 232, 233, + /* 730 */ 234, 107, 237, 238, 239, 108, 241, 242, 243, 244, + /* 740 */ 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + /* 750 */ 255, 256, 257, 258, 12, 13, 14, 357, 49, 181, + /* 760 */ 434, 379, 20, 455, 22, 513, 514, 117, 138, 387, + /* 770 */ 370, 275, 142, 418, 466, 183, 37, 35, 78, 37, + /* 780 */ 239, 369, 370, 369, 370, 183, 357, 369, 370, 176, + /* 790 */ 12, 13, 14, 15, 16, 470, 162, 472, 398, 370, + /* 800 */ 166, 389, 434, 389, 205, 369, 370, 65, 174, 4, + /* 810 */ 410, 485, 412, 390, 488, 398, 107, 239, 398, 20, + /* 820 */ 78, 398, 405, 398, 181, 389, 406, 398, 369, 406, + /* 830 */ 413, 239, 506, 507, 235, 236, 418, 511, 512, 410, + /* 840 */ 275, 412, 212, 20, 0, 215, 104, 422, 218, 107, + /* 850 */ 220, 385, 452, 485, 388, 455, 488, 357, 275, 459, + /* 860 */ 460, 461, 462, 463, 464, 357, 466, 369, 370, 469, + /* 870 */ 370, 471, 472, 473, 506, 507, 399, 477, 478, 511, + /* 880 */ 512, 452, 239, 0, 455, 143, 144, 389, 459, 460, + /* 890 */ 461, 462, 463, 464, 378, 466, 369, 370, 398, 275, + /* 900 */ 471, 390, 473, 444, 445, 22, 477, 478, 1, 398, + /* 910 */ 410, 395, 412, 0, 369, 370, 389, 406, 410, 50, + /* 920 */ 404, 369, 370, 181, 182, 176, 19, 458, 398, 500, + /* 930 */ 188, 189, 8, 9, 389, 405, 12, 13, 14, 15, + /* 940 */ 16, 389, 35, 413, 205, 203, 229, 205, 34, 1, + /* 950 */ 2, 137, 452, 484, 354, 455, 207, 33, 51, 459, + /* 960 */ 460, 461, 462, 463, 464, 52, 466, 60, 61, 62, + /* 970 */ 63, 471, 65, 473, 235, 236, 399, 477, 478, 237, + /* 980 */ 238, 239, 183, 241, 242, 243, 244, 245, 246, 247, + /* 990 */ 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + /* 1000 */ 258, 12, 13, 3, 160, 161, 183, 369, 370, 20, + /* 1010 */ 107, 22, 33, 106, 56, 57, 109, 369, 370, 116, + /* 1020 */ 369, 370, 357, 357, 35, 390, 37, 389, 376, 398, + /* 1030 */ 216, 217, 108, 398, 434, 370, 405, 389, 239, 439, + /* 1040 */ 389, 406, 357, 14, 413, 393, 369, 370, 141, 20, + /* 1050 */ 374, 375, 183, 401, 65, 370, 108, 372, 369, 370, + /* 1060 */ 191, 357, 239, 398, 8, 9, 389, 78, 12, 13, + /* 1070 */ 14, 15, 16, 383, 384, 410, 410, 412, 389, 383, + /* 1080 */ 384, 357, 277, 398, 378, 485, 357, 108, 488, 369, + /* 1090 */ 370, 20, 185, 104, 370, 410, 107, 412, 399, 192, + /* 1100 */ 357, 369, 370, 369, 370, 407, 506, 507, 410, 389, + /* 1110 */ 404, 511, 512, 370, 410, 372, 33, 452, 211, 357, + /* 1120 */ 455, 389, 398, 389, 459, 460, 461, 462, 463, 464, + /* 1130 */ 399, 466, 143, 144, 410, 22, 412, 452, 473, 410, + /* 1140 */ 455, 398, 398, 478, 459, 460, 461, 462, 463, 464, + /* 1150 */ 37, 466, 398, 410, 33, 412, 471, 413, 473, 357, + /* 1160 */ 369, 370, 477, 478, 108, 357, 357, 413, 33, 357, + /* 1170 */ 181, 182, 410, 360, 361, 0, 452, 188, 189, 455, + /* 1180 */ 389, 398, 37, 459, 460, 461, 462, 463, 464, 33, + /* 1190 */ 466, 108, 203, 22, 205, 452, 413, 22, 455, 357, + /* 1200 */ 357, 45, 459, 460, 461, 462, 463, 464, 37, 466, + /* 1210 */ 434, 71, 410, 357, 471, 357, 473, 104, 410, 410, + /* 1220 */ 477, 478, 410, 357, 273, 274, 237, 238, 239, 505, + /* 1230 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + /* 1240 */ 251, 252, 253, 254, 255, 256, 257, 258, 12, 13, + /* 1250 */ 357, 469, 410, 410, 472, 434, 20, 407, 22, 407, + /* 1260 */ 410, 485, 410, 370, 488, 372, 410, 391, 410, 0, + /* 1270 */ 394, 35, 33, 37, 13, 104, 410, 0, 117, 65, + /* 1280 */ 143, 144, 506, 507, 45, 0, 0, 511, 512, 357, + /* 1290 */ 110, 398, 387, 113, 399, 434, 110, 297, 37, 113, + /* 1300 */ 33, 65, 370, 410, 372, 412, 485, 22, 22, 488, + /* 1310 */ 239, 13, 110, 440, 78, 113, 12, 13, 110, 42, + /* 1320 */ 51, 113, 33, 109, 33, 399, 22, 506, 507, 33, + /* 1330 */ 398, 170, 511, 512, 37, 37, 33, 1, 2, 35, + /* 1340 */ 104, 37, 410, 107, 412, 452, 485, 357, 455, 488, + /* 1350 */ 205, 33, 459, 460, 461, 462, 463, 464, 399, 466, + /* 1360 */ 370, 358, 372, 33, 471, 33, 473, 506, 507, 65, + /* 1370 */ 477, 478, 511, 512, 515, 108, 423, 237, 504, 143, + /* 1380 */ 144, 497, 78, 33, 452, 33, 373, 455, 398, 33, + /* 1390 */ 33, 459, 460, 461, 462, 463, 464, 108, 466, 108, + /* 1400 */ 410, 386, 412, 471, 108, 473, 12, 13, 104, 477, + /* 1410 */ 478, 108, 398, 13, 386, 4, 423, 181, 182, 13, + /* 1420 */ 299, 33, 33, 33, 188, 189, 108, 8, 9, 33, + /* 1430 */ 19, 12, 13, 14, 15, 16, 301, 37, 108, 203, + /* 1440 */ 108, 205, 452, 37, 368, 455, 35, 423, 503, 459, + /* 1450 */ 460, 461, 462, 463, 464, 503, 466, 503, 108, 37, + /* 1460 */ 108, 471, 51, 473, 108, 108, 433, 477, 478, 58, + /* 1470 */ 59, 503, 373, 237, 238, 239, 65, 241, 242, 243, + /* 1480 */ 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + /* 1490 */ 254, 255, 256, 257, 258, 357, 108, 108, 108, 370, + /* 1500 */ 78, 423, 205, 409, 108, 441, 487, 203, 370, 205, + /* 1510 */ 372, 423, 423, 508, 479, 490, 388, 106, 278, 435, + /* 1520 */ 109, 51, 454, 42, 20, 453, 446, 108, 218, 378, + /* 1530 */ 451, 446, 378, 437, 201, 20, 398, 369, 20, 370, + /* 1540 */ 45, 237, 238, 419, 370, 419, 180, 416, 410, 370, + /* 1550 */ 412, 369, 369, 357, 105, 251, 252, 253, 254, 255, + /* 1560 */ 256, 257, 419, 416, 416, 416, 370, 382, 103, 381, + /* 1570 */ 369, 102, 380, 369, 369, 369, 20, 362, 50, 366, + /* 1580 */ 362, 378, 366, 20, 412, 446, 20, 378, 378, 20, + /* 1590 */ 452, 371, 357, 455, 398, 436, 20, 459, 460, 461, + /* 1600 */ 462, 463, 464, 378, 466, 370, 410, 378, 412, 471, + /* 1610 */ 426, 473, 12, 13, 371, 477, 478, 369, 362, 378, + /* 1620 */ 378, 398, 22, 357, 378, 398, 398, 369, 398, 398, + /* 1630 */ 398, 398, 398, 398, 360, 35, 370, 37, 360, 222, + /* 1640 */ 450, 362, 398, 398, 107, 410, 448, 412, 452, 398, + /* 1650 */ 20, 455, 376, 446, 209, 459, 460, 461, 462, 463, + /* 1660 */ 464, 208, 466, 410, 398, 65, 445, 471, 442, 473, + /* 1670 */ 410, 412, 410, 477, 478, 376, 410, 369, 412, 286, + /* 1680 */ 443, 410, 435, 496, 285, 428, 294, 452, 499, 496, + /* 1690 */ 455, 428, 194, 498, 459, 460, 461, 462, 463, 464, + /* 1700 */ 296, 466, 295, 279, 303, 493, 471, 496, 473, 300, + /* 1710 */ 435, 357, 477, 478, 495, 516, 494, 274, 452, 298, + /* 1720 */ 20, 455, 458, 370, 370, 459, 460, 461, 462, 463, + /* 1730 */ 464, 117, 466, 35, 510, 276, 371, 376, 376, 473, + /* 1740 */ 491, 489, 107, 477, 478, 428, 476, 509, 410, 51, + /* 1750 */ 410, 410, 398, 410, 428, 410, 186, 376, 60, 61, + /* 1760 */ 62, 63, 394, 65, 410, 370, 412, 376, 424, 410, + /* 1770 */ 410, 107, 402, 410, 369, 22, 38, 359, 376, 363, + /* 1780 */ 438, 447, 362, 355, 429, 377, 0, 429, 0, 392, + /* 1790 */ 392, 0, 45, 0, 37, 392, 228, 37, 37, 37, + /* 1800 */ 228, 0, 37, 203, 106, 205, 452, 109, 357, 455, + /* 1810 */ 37, 228, 37, 459, 460, 461, 462, 463, 464, 0, + /* 1820 */ 466, 370, 228, 0, 37, 0, 37, 473, 0, 22, + /* 1830 */ 0, 477, 478, 37, 223, 235, 236, 237, 0, 211, + /* 1840 */ 0, 212, 211, 203, 205, 357, 0, 0, 0, 398, + /* 1850 */ 199, 251, 252, 253, 254, 255, 256, 257, 370, 198, + /* 1860 */ 0, 410, 0, 412, 148, 49, 357, 49, 0, 37, + /* 1870 */ 0, 0, 37, 51, 176, 0, 49, 0, 45, 370, + /* 1880 */ 0, 0, 0, 185, 186, 0, 398, 0, 49, 0, + /* 1890 */ 192, 193, 0, 0, 0, 166, 37, 0, 410, 166, + /* 1900 */ 412, 0, 0, 452, 0, 0, 455, 398, 0, 211, + /* 1910 */ 459, 460, 461, 462, 463, 464, 0, 466, 0, 410, + /* 1920 */ 0, 412, 49, 0, 473, 0, 0, 0, 477, 478, + /* 1930 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /* 1940 */ 452, 45, 0, 455, 0, 0, 0, 459, 460, 461, + /* 1950 */ 462, 463, 464, 465, 466, 467, 468, 0, 0, 0, + /* 1960 */ 148, 452, 22, 357, 455, 0, 0, 147, 459, 460, + /* 1970 */ 461, 462, 463, 464, 0, 466, 370, 146, 0, 50, + /* 1980 */ 357, 14, 22, 22, 0, 37, 65, 0, 0, 65, + /* 1990 */ 0, 50, 0, 370, 51, 357, 42, 0, 42, 37, + /* 2000 */ 37, 51, 0, 51, 398, 37, 42, 0, 370, 37, + /* 2010 */ 501, 502, 65, 0, 45, 42, 410, 0, 412, 33, + /* 2020 */ 49, 398, 43, 0, 49, 49, 0, 42, 0, 0, + /* 2030 */ 0, 42, 49, 410, 0, 412, 398, 194, 0, 0, + /* 2040 */ 0, 37, 72, 42, 51, 0, 37, 51, 410, 0, + /* 2050 */ 412, 37, 42, 42, 51, 432, 0, 37, 452, 51, + /* 2060 */ 42, 455, 0, 0, 357, 459, 460, 461, 462, 463, + /* 2070 */ 464, 0, 466, 0, 0, 452, 0, 370, 455, 357, + /* 2080 */ 37, 22, 459, 460, 461, 462, 463, 464, 0, 466, + /* 2090 */ 452, 37, 370, 455, 37, 115, 0, 459, 460, 461, + /* 2100 */ 462, 463, 464, 37, 466, 398, 37, 113, 502, 37, + /* 2110 */ 0, 22, 37, 33, 37, 37, 33, 410, 37, 412, + /* 2120 */ 398, 37, 37, 22, 22, 0, 22, 0, 22, 37, + /* 2130 */ 0, 0, 410, 0, 412, 53, 37, 0, 0, 432, + /* 2140 */ 37, 22, 20, 108, 37, 37, 37, 0, 107, 107, + /* 2150 */ 0, 37, 514, 0, 49, 0, 22, 0, 22, 452, + /* 2160 */ 183, 210, 455, 357, 3, 183, 459, 460, 461, 462, + /* 2170 */ 463, 464, 33, 466, 452, 280, 370, 455, 357, 37, + /* 2180 */ 37, 459, 460, 461, 462, 463, 464, 108, 466, 183, + /* 2190 */ 468, 370, 33, 357, 107, 190, 50, 206, 186, 183, + /* 2200 */ 107, 50, 108, 105, 398, 183, 370, 107, 33, 357, + /* 2210 */ 33, 190, 49, 33, 103, 49, 410, 3, 412, 398, + /* 2220 */ 108, 108, 370, 107, 107, 107, 33, 37, 108, 108, + /* 2230 */ 107, 410, 108, 412, 398, 280, 37, 37, 432, 37, + /* 2240 */ 37, 37, 33, 49, 49, 0, 410, 0, 412, 108, + /* 2250 */ 398, 33, 108, 432, 42, 107, 2, 105, 452, 260, + /* 2260 */ 22, 455, 410, 105, 412, 459, 460, 461, 462, 463, + /* 2270 */ 464, 273, 466, 452, 237, 280, 455, 108, 107, 357, + /* 2280 */ 459, 460, 461, 462, 463, 464, 108, 466, 452, 49, + /* 2290 */ 107, 455, 370, 107, 22, 459, 460, 461, 462, 463, + /* 2300 */ 464, 49, 466, 107, 452, 108, 357, 455, 240, 108, + /* 2310 */ 0, 459, 460, 461, 462, 463, 464, 42, 466, 370, + /* 2320 */ 398, 108, 107, 107, 107, 49, 107, 187, 107, 107, + /* 2330 */ 185, 108, 410, 107, 412, 107, 116, 108, 357, 37, + /* 2340 */ 37, 117, 107, 37, 108, 108, 107, 398, 37, 107, + /* 2350 */ 37, 370, 108, 107, 37, 37, 108, 107, 107, 410, + /* 2360 */ 128, 412, 128, 108, 107, 33, 107, 37, 107, 128, + /* 2370 */ 22, 128, 72, 37, 452, 71, 357, 455, 37, 398, + /* 2380 */ 37, 459, 460, 461, 462, 463, 464, 37, 466, 370, + /* 2390 */ 37, 410, 37, 412, 37, 37, 37, 78, 101, 78, + /* 2400 */ 101, 452, 33, 37, 455, 37, 22, 37, 459, 460, + /* 2410 */ 461, 462, 463, 464, 22, 466, 37, 398, 37, 37, + /* 2420 */ 78, 0, 357, 37, 37, 37, 37, 37, 37, 410, + /* 2430 */ 37, 412, 0, 452, 51, 370, 455, 42, 37, 42, + /* 2440 */ 459, 460, 461, 462, 463, 464, 0, 466, 357, 51, + /* 2450 */ 37, 51, 42, 0, 37, 51, 42, 0, 0, 37, + /* 2460 */ 37, 370, 22, 398, 33, 22, 21, 517, 517, 22, + /* 2470 */ 22, 452, 21, 517, 455, 410, 20, 412, 459, 460, + /* 2480 */ 461, 462, 463, 464, 517, 466, 517, 517, 517, 398, + /* 2490 */ 517, 517, 357, 517, 517, 517, 517, 517, 517, 517, + /* 2500 */ 517, 410, 517, 412, 517, 370, 517, 517, 517, 517, + /* 2510 */ 517, 517, 517, 517, 517, 517, 517, 452, 517, 517, + /* 2520 */ 455, 357, 517, 517, 459, 460, 461, 462, 463, 464, + /* 2530 */ 517, 466, 517, 398, 370, 517, 357, 517, 517, 517, + /* 2540 */ 517, 517, 517, 452, 517, 410, 455, 412, 517, 370, + /* 2550 */ 459, 460, 461, 462, 463, 464, 517, 466, 517, 517, + /* 2560 */ 517, 517, 398, 517, 517, 517, 517, 357, 517, 517, + /* 2570 */ 517, 517, 517, 517, 410, 517, 412, 398, 517, 517, + /* 2580 */ 370, 517, 517, 517, 517, 517, 517, 452, 517, 410, + /* 2590 */ 455, 412, 517, 517, 459, 460, 461, 462, 463, 464, + /* 2600 */ 517, 466, 517, 517, 517, 517, 517, 517, 398, 517, + /* 2610 */ 517, 517, 517, 517, 517, 517, 452, 517, 517, 455, + /* 2620 */ 410, 517, 412, 459, 460, 461, 462, 463, 464, 517, + /* 2630 */ 466, 452, 517, 517, 455, 517, 517, 357, 459, 460, + /* 2640 */ 461, 462, 463, 464, 517, 466, 517, 517, 517, 517, + /* 2650 */ 370, 517, 517, 357, 517, 517, 517, 517, 517, 517, + /* 2660 */ 517, 517, 452, 517, 517, 455, 370, 517, 517, 459, + /* 2670 */ 460, 461, 462, 463, 464, 517, 466, 517, 398, 517, + /* 2680 */ 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, + /* 2690 */ 410, 517, 412, 517, 398, 517, 517, 517, 517, 517, + /* 2700 */ 517, 517, 517, 517, 517, 517, 410, 517, 412, 517, + /* 2710 */ 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, + /* 2720 */ 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, + /* 2730 */ 517, 517, 452, 517, 357, 455, 517, 517, 517, 459, + /* 2740 */ 460, 461, 462, 463, 464, 517, 466, 370, 452, 517, + /* 2750 */ 517, 455, 517, 517, 517, 459, 460, 461, 462, 463, + /* 2760 */ 464, 517, 466, 517, 517, 517, 357, 517, 517, 517, + /* 2770 */ 517, 517, 517, 517, 517, 398, 517, 517, 517, 370, + /* 2780 */ 517, 517, 517, 517, 517, 517, 517, 410, 517, 412, + /* 2790 */ 517, 517, 517, 357, 517, 517, 517, 517, 517, 517, + /* 2800 */ 517, 517, 517, 517, 517, 517, 370, 398, 517, 517, + /* 2810 */ 517, 517, 517, 517, 517, 517, 517, 517, 517, 410, + /* 2820 */ 517, 412, 517, 517, 517, 517, 517, 517, 517, 452, + /* 2830 */ 517, 517, 455, 517, 398, 517, 459, 460, 461, 462, + /* 2840 */ 463, 464, 517, 466, 517, 517, 410, 517, 412, 517, + /* 2850 */ 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, + /* 2860 */ 517, 452, 517, 357, 455, 517, 517, 517, 459, 460, + /* 2870 */ 461, 462, 463, 464, 517, 466, 370, 517, 517, 357, + /* 2880 */ 517, 517, 517, 517, 517, 517, 517, 517, 452, 517, + /* 2890 */ 517, 455, 370, 517, 357, 459, 460, 461, 462, 463, + /* 2900 */ 464, 517, 466, 517, 398, 517, 517, 370, 517, 357, + /* 2910 */ 517, 517, 517, 517, 517, 517, 410, 517, 412, 517, + /* 2920 */ 398, 517, 370, 517, 517, 517, 517, 517, 517, 517, + /* 2930 */ 517, 517, 410, 517, 412, 398, 517, 517, 357, 517, + /* 2940 */ 517, 517, 517, 517, 517, 517, 517, 410, 517, 412, + /* 2950 */ 398, 370, 517, 517, 517, 517, 517, 517, 452, 517, + /* 2960 */ 517, 455, 410, 517, 412, 459, 460, 461, 462, 463, + /* 2970 */ 464, 517, 466, 517, 452, 517, 517, 455, 517, 398, + /* 2980 */ 517, 459, 460, 461, 462, 463, 464, 517, 466, 452, + /* 2990 */ 517, 410, 455, 412, 517, 517, 459, 460, 461, 462, + /* 3000 */ 463, 464, 517, 466, 452, 517, 517, 455, 517, 517, + /* 3010 */ 517, 459, 460, 461, 462, 463, 464, 517, 466, 517, + /* 3020 */ 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, + /* 3030 */ 517, 517, 517, 452, 517, 517, 455, 517, 517, 517, + /* 3040 */ 459, 460, 461, 462, 463, 464, 517, 466, 354, 354, + /* 3050 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3060 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3070 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3080 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3090 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3100 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3110 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3120 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3130 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3140 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3150 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3160 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3170 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3180 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3190 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3200 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3210 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3220 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3230 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3240 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3250 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3260 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3270 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3280 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3290 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3300 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3310 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3320 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3330 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3340 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3350 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3360 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3370 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3380 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3390 */ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + /* 3400 */ 354, 354, }; -#define YY_SHIFT_COUNT (858) +#define YY_SHIFT_COUNT (859) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2483) +#define YY_SHIFT_MAX (2458) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 412, 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, 366, 203, 164, 72, 298, 72, 72, 164, 164, - /* 60 */ 72, 1359, 72, 245, 1359, 157, 72, 1, 1500, 12, - /* 70 */ 19, 19, 1500, 1500, 274, 274, 12, 53, 314, 247, - /* 80 */ 247, 431, 19, 19, 19, 19, 19, 19, 19, 19, - /* 90 */ 19, 19, 19, 63, 242, 19, 19, 67, 1, 19, - /* 100 */ 63, 19, 1, 19, 19, 1, 19, 19, 1, 19, - /* 110 */ 1, 1, 1, 19, 260, 276, 276, 741, 312, 862, - /* 120 */ 862, 862, 862, 862, 862, 862, 862, 862, 862, 862, - /* 130 */ 862, 862, 862, 862, 862, 862, 862, 862, 543, 368, - /* 140 */ 53, 314, 1015, 1015, 654, 134, 134, 134, 307, 307, - /* 150 */ 1078, 454, 654, 67, 357, 1, 166, 1, 1, 447, - /* 160 */ 1, 447, 447, 554, 451, 97, 97, 97, 97, 97, - /* 170 */ 97, 97, 97, 2145, 1507, 182, 293, 456, 491, 350, - /* 180 */ 496, 354, 440, 556, 556, 631, 27, 822, 941, 941, - /* 190 */ 941, 718, 1012, 941, 817, 693, 1195, 767, 746, 693, - /* 200 */ 693, 1063, 1009, 545, 600, 1009, 1101, 863, 454, 1188, - /* 210 */ 1459, 1475, 1499, 1304, 67, 1499, 67, 1328, 1510, 1512, - /* 220 */ 1489, 1512, 1489, 1362, 1510, 1512, 1510, 1489, 1362, 1362, - /* 230 */ 1362, 1447, 1451, 1510, 1468, 1510, 1510, 1510, 1552, 1534, - /* 240 */ 1552, 1534, 1499, 67, 67, 1577, 67, 1583, 1599, 67, - /* 250 */ 1583, 67, 1611, 67, 67, 1510, 67, 1552, 1, 1, - /* 260 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1510, - /* 270 */ 451, 451, 1552, 447, 447, 447, 1439, 1559, 1499, 260, - /* 280 */ 1647, 1462, 1467, 1577, 260, 1188, 1510, 447, 1396, 1399, - /* 290 */ 1396, 1399, 1398, 1514, 1396, 1415, 1417, 1436, 1188, 1413, - /* 300 */ 1418, 1422, 1458, 1512, 1718, 1629, 1473, 1583, 260, 260, - /* 310 */ 1651, 1399, 447, 447, 447, 447, 1399, 447, 1584, 260, - /* 320 */ 554, 260, 1512, 447, 447, 1673, 447, 1510, 260, 1764, - /* 330 */ 1753, 1552, 2992, 2992, 2992, 2992, 2992, 2992, 2992, 2992, - /* 340 */ 2992, 36, 738, 414, 836, 54, 77, 351, 15, 32, - /* 350 */ 540, 796, 888, 902, 902, 902, 902, 902, 902, 902, - /* 360 */ 902, 902, 907, 1041, 21, 342, 342, 989, 1098, 848, - /* 370 */ 288, 535, 35, 551, 38, 612, 775, 787, 494, 700, - /* 380 */ 641, 494, 494, 494, 385, 385, 174, 235, 1223, 1263, - /* 390 */ 1270, 995, 279, 1185, 1198, 1203, 1204, 1287, 1293, 617, - /* 400 */ 1312, 1318, 1319, 1108, 1254, 1260, 653, 1294, 1299, 1309, - /* 410 */ 1313, 1177, 649, 1083, 1315, 1348, 1324, 1124, 1326, 1296, - /* 420 */ 1331, 1333, 1343, 1347, 1351, 1365, 1352, 1381, 1383, 1387, - /* 430 */ 1395, 1397, 1285, 1239, 1292, 1330, 1360, 1369, 1361, 1811, - /* 440 */ 1819, 1821, 1777, 1823, 1787, 1598, 1789, 1790, 1791, 1603, - /* 450 */ 1832, 1796, 1797, 1609, 1800, 1838, 1612, 1840, 1804, 1842, - /* 460 */ 1807, 1843, 1825, 1845, 1812, 1628, 1851, 1642, 1853, 1644, - /* 470 */ 1646, 1657, 1653, 1862, 1869, 1872, 1675, 1678, 1877, 1884, - /* 480 */ 1738, 1846, 1847, 1887, 1852, 1891, 1894, 1861, 1848, 1901, - /* 490 */ 1855, 1902, 1860, 1913, 1915, 1916, 1871, 1921, 1922, 1923, - /* 500 */ 1924, 1925, 1926, 1762, 1892, 1928, 1766, 1935, 1936, 1943, - /* 510 */ 1945, 1947, 1949, 1951, 1961, 1962, 1963, 1964, 1966, 1967, - /* 520 */ 1969, 1970, 1971, 1973, 1984, 1985, 1904, 1954, 1910, 1956, - /* 530 */ 1957, 1958, 1959, 1986, 1987, 1989, 1955, 1978, 1827, 1976, - /* 540 */ 1833, 1979, 1835, 1982, 1992, 1988, 1965, 1990, 1968, 2001, - /* 550 */ 1939, 1972, 2006, 1946, 2008, 1948, 2016, 2019, 1983, 1981, - /* 560 */ 1991, 2027, 1993, 1995, 1994, 2029, 1998, 2000, 1996, 2034, - /* 570 */ 2002, 2037, 1999, 2010, 2007, 2004, 2011, 2028, 2014, 2041, - /* 580 */ 2005, 2022, 2066, 2067, 2068, 2069, 2030, 1878, 2070, 2004, - /* 590 */ 2024, 2074, 2075, 2009, 2076, 2077, 2042, 2031, 2038, 2083, - /* 600 */ 2047, 2035, 2045, 2089, 2054, 2049, 2056, 2103, 2071, 2059, - /* 610 */ 2063, 2107, 2111, 2112, 2113, 2114, 2115, 2012, 2003, 2080, - /* 620 */ 2097, 2121, 2085, 2086, 2088, 2091, 2092, 2093, 2095, 2096, - /* 630 */ 2098, 2101, 2099, 2100, 2104, 2102, 2135, 2116, 2141, 2120, - /* 640 */ 2143, 2123, 2106, 2148, 2127, 2124, 2150, 2157, 2165, 2129, - /* 650 */ 2173, 2139, 2177, 2156, 2159, 2144, 2146, 2147, 2079, 2078, - /* 660 */ 2182, 2013, 2081, 1980, 2004, 2142, 2190, 2015, 2155, 2171, - /* 670 */ 2194, 2017, 2176, 2018, 2026, 2201, 2202, 2032, 2020, 2036, - /* 680 */ 2023, 2210, 2183, 1940, 2117, 2118, 2122, 2128, 2167, 2186, - /* 690 */ 2126, 2170, 2130, 2175, 2134, 2132, 2195, 2197, 2136, 2131, - /* 700 */ 2138, 2140, 2151, 2198, 2193, 2199, 2149, 2213, 1974, 2153, - /* 710 */ 2162, 2229, 2216, 2021, 2206, 2215, 2218, 2221, 2226, 2235, - /* 720 */ 2172, 2174, 2224, 2025, 2217, 2228, 2275, 2278, 2178, 2237, - /* 730 */ 2250, 2191, 2039, 2196, 2285, 2277, 2072, 2203, 2205, 2207, - /* 740 */ 2253, 2211, 2214, 2254, 2209, 2282, 2109, 2225, 2212, 2230, - /* 750 */ 2227, 2232, 2119, 2233, 2306, 2268, 2158, 2234, 2236, 2004, - /* 760 */ 2264, 2238, 2239, 2243, 2247, 2249, 2220, 2251, 2296, 2320, - /* 770 */ 2256, 2252, 2321, 2258, 2259, 2324, 2261, 2262, 2332, 2266, - /* 780 */ 2263, 2337, 2269, 2267, 2340, 2271, 2257, 2260, 2265, 2274, - /* 790 */ 2272, 2281, 2273, 2345, 2276, 2281, 2281, 2359, 2315, 2319, - /* 800 */ 2358, 2368, 2372, 2373, 2380, 2382, 2383, 2384, 2385, 2313, - /* 810 */ 2242, 2346, 2322, 2392, 2390, 2391, 2393, 2409, 2395, 2402, - /* 820 */ 2404, 2364, 2098, 2406, 2101, 2407, 2408, 2410, 2415, 2424, - /* 830 */ 2416, 2449, 2417, 2413, 2419, 2465, 2430, 2418, 2426, 2470, - /* 840 */ 2434, 2421, 2431, 2474, 2438, 2425, 2435, 2478, 2443, 2445, - /* 850 */ 2483, 2462, 2452, 2464, 2466, 2467, 2468, 2471, 2473, + /* 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 */ 243, 624, 66, 7, 565, 583, 565, 565, 7, 7, + /* 60 */ 565, 1304, 565, 246, 1304, 93, 565, 63, 1600, 18, + /* 70 */ 117, 117, 1600, 1600, 385, 385, 18, 174, 134, 360, + /* 80 */ 360, 131, 117, 117, 117, 117, 117, 117, 117, 117, + /* 90 */ 117, 117, 117, 179, 514, 117, 117, 604, 63, 117, + /* 100 */ 179, 117, 63, 117, 117, 63, 117, 117, 63, 117, + /* 110 */ 63, 63, 63, 117, 611, 204, 204, 494, 430, 442, + /* 120 */ 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, + /* 130 */ 442, 442, 442, 442, 442, 442, 442, 442, 399, 538, + /* 140 */ 174, 134, 958, 958, 105, 329, 329, 329, 298, 298, + /* 150 */ 2, 317, 105, 604, 518, 63, 257, 63, 63, 700, + /* 160 */ 63, 700, 700, 650, 914, 213, 213, 213, 213, 213, + /* 170 */ 213, 213, 213, 907, 285, 416, 592, 79, 340, 300, + /* 180 */ 603, 578, 643, 316, 316, 799, 145, 823, 279, 279, + /* 190 */ 279, 869, 443, 279, 639, 541, 1029, 143, 749, 541, + /* 200 */ 541, 1071, 951, 118, 1000, 951, 1156, 805, 317, 1240, + /* 210 */ 1470, 1481, 1504, 1310, 604, 1504, 604, 1333, 1515, 1518, + /* 220 */ 1495, 1518, 1495, 1366, 1515, 1518, 1515, 1495, 1366, 1366, + /* 230 */ 1366, 1449, 1465, 1515, 1469, 1515, 1515, 1515, 1556, 1528, + /* 240 */ 1556, 1528, 1504, 604, 604, 1563, 604, 1566, 1569, 604, + /* 250 */ 1566, 604, 1576, 604, 604, 1515, 604, 1556, 63, 63, + /* 260 */ 63, 63, 63, 63, 63, 63, 63, 63, 63, 1515, + /* 270 */ 914, 914, 1556, 700, 700, 700, 1417, 1537, 1504, 611, + /* 280 */ 1630, 1445, 1453, 1563, 611, 1240, 1515, 700, 1393, 1399, + /* 290 */ 1393, 1399, 1392, 1498, 1393, 1404, 1407, 1424, 1240, 1401, + /* 300 */ 1409, 1421, 1443, 1518, 1700, 1614, 1459, 1566, 611, 611, + /* 310 */ 1635, 1399, 700, 700, 700, 700, 1399, 700, 1570, 611, + /* 320 */ 650, 611, 1518, 700, 700, 1664, 700, 1515, 611, 1753, + /* 330 */ 1738, 1556, 3048, 3048, 3048, 3048, 3048, 3048, 3048, 3048, + /* 340 */ 3048, 36, 1698, 197, 1411, 924, 1056, 1419, 294, 640, + /* 350 */ 602, 386, 529, 540, 540, 540, 540, 540, 540, 540, + /* 360 */ 540, 540, 94, 630, 21, 778, 778, 353, 613, 634, + /* 370 */ 446, 26, 599, 739, 844, 1113, 1171, 814, 671, 948, + /* 380 */ 100, 671, 671, 671, 405, 405, 1269, 717, 401, 1277, + /* 390 */ 1239, 1161, 449, 1180, 1186, 1202, 1208, 1261, 1298, 883, + /* 400 */ 1175, 1285, 1286, 351, 505, 627, 1214, 979, 1083, 1267, + /* 410 */ 1289, 1137, 1121, 1135, 1291, 1336, 1296, 1140, 1303, 709, + /* 420 */ 1318, 1330, 1332, 1350, 1352, 1394, 1356, 1357, 1388, 1389, + /* 430 */ 1390, 1396, 903, 1145, 1297, 1400, 1406, 1422, 913, 1786, + /* 440 */ 1788, 1791, 1747, 1793, 1757, 1568, 1760, 1761, 1762, 1572, + /* 450 */ 1801, 1765, 1773, 1583, 1775, 1819, 1594, 1823, 1787, 1825, + /* 460 */ 1789, 1828, 1807, 1830, 1796, 1611, 1838, 1628, 1840, 1631, + /* 470 */ 1629, 1639, 1640, 1846, 1847, 1848, 1651, 1661, 1860, 1862, + /* 480 */ 1716, 1816, 1818, 1868, 1832, 1870, 1871, 1835, 1822, 1875, + /* 490 */ 1827, 1877, 1833, 1880, 1881, 1882, 1839, 1885, 1887, 1889, + /* 500 */ 1892, 1893, 1894, 1729, 1859, 1897, 1733, 1901, 1902, 1904, + /* 510 */ 1905, 1908, 1916, 1918, 1920, 1925, 1926, 1927, 1930, 1931, + /* 520 */ 1932, 1933, 1934, 1935, 1936, 1937, 1873, 1923, 1896, 1938, + /* 530 */ 1939, 1942, 1944, 1945, 1946, 1957, 1958, 1940, 1959, 1812, + /* 540 */ 1965, 1820, 1966, 1831, 1974, 1978, 1960, 1929, 1961, 1941, + /* 550 */ 1984, 1921, 1948, 1987, 1924, 1988, 1947, 1990, 1992, 1962, + /* 560 */ 1943, 1954, 1997, 1963, 1950, 1956, 2002, 1968, 1952, 1964, + /* 570 */ 2007, 1972, 2013, 1969, 1973, 1986, 1971, 1975, 1967, 1976, + /* 580 */ 2017, 1979, 1985, 2023, 2026, 2028, 2029, 1989, 1843, 2030, + /* 590 */ 1971, 1983, 2034, 2038, 1970, 2039, 2040, 2004, 1993, 2001, + /* 600 */ 2045, 2009, 1996, 2010, 2049, 2014, 2003, 2011, 2056, 2020, + /* 610 */ 2008, 2018, 2062, 2063, 2071, 2073, 2074, 2076, 1980, 1994, + /* 620 */ 2043, 2059, 2088, 2054, 2057, 2066, 2069, 2072, 2075, 2077, + /* 630 */ 2078, 2080, 2083, 2081, 2084, 2089, 2085, 2096, 2101, 2110, + /* 640 */ 2102, 2125, 2104, 2082, 2127, 2106, 2092, 2130, 2131, 2133, + /* 650 */ 2099, 2137, 2103, 2138, 2119, 2122, 2107, 2108, 2109, 2035, + /* 660 */ 2041, 2147, 1977, 2042, 1951, 1971, 2105, 2150, 1982, 2114, + /* 670 */ 2134, 2153, 1991, 2136, 2006, 2012, 2155, 2157, 2016, 2005, + /* 680 */ 2022, 2021, 2161, 2139, 1895, 2087, 2079, 2093, 2094, 2142, + /* 690 */ 2143, 2100, 2146, 2098, 2151, 2111, 2112, 2159, 2175, 2113, + /* 700 */ 2116, 2117, 2118, 2120, 2177, 2163, 2166, 2123, 2180, 1955, + /* 710 */ 2121, 2124, 2214, 2193, 1995, 2190, 2199, 2200, 2202, 2203, + /* 720 */ 2204, 2141, 2144, 2194, 1998, 2209, 2195, 2245, 2247, 2148, + /* 730 */ 2212, 2218, 2152, 1999, 2158, 2254, 2238, 2037, 2169, 2171, + /* 740 */ 2178, 2240, 2183, 2186, 2252, 2197, 2272, 2068, 2196, 2201, + /* 750 */ 2213, 2215, 2216, 2140, 2217, 2310, 2275, 2145, 2219, 2220, + /* 760 */ 1971, 2276, 2221, 2222, 2223, 2226, 2228, 2224, 2229, 2302, + /* 770 */ 2303, 2235, 2236, 2306, 2239, 2237, 2311, 2242, 2244, 2313, + /* 780 */ 2246, 2248, 2317, 2250, 2255, 2318, 2251, 2232, 2234, 2241, + /* 790 */ 2243, 2257, 2332, 2259, 2330, 2261, 2332, 2332, 2348, 2300, + /* 800 */ 2304, 2336, 2341, 2343, 2350, 2353, 2355, 2357, 2358, 2359, + /* 810 */ 2319, 2297, 2321, 2299, 2369, 2366, 2368, 2370, 2384, 2379, + /* 820 */ 2381, 2382, 2342, 2080, 2386, 2083, 2387, 2388, 2389, 2390, + /* 830 */ 2392, 2391, 2421, 2393, 2383, 2395, 2432, 2401, 2398, 2397, + /* 840 */ 2446, 2413, 2400, 2410, 2453, 2417, 2404, 2414, 2457, 2422, + /* 850 */ 2423, 2458, 2440, 2431, 2443, 2445, 2447, 2448, 2451, 2456, }; #define YY_REDUCE_COUNT (340) -#define YY_REDUCE_MIN (-429) -#define YY_REDUCE_MAX (2526) +#define YY_REDUCE_MIN (-481) +#define YY_REDUCE_MAX (2581) static const short yy_reduce_ofst[] = { - /* 0 */ 79, -313, 249, 398, 495, 643, 682, 740, 893, 928, - /* 10 */ 1039, 1097, 1167, 1236, 1267, 1336, -82, 205, 1405, 1420, - /* 20 */ 1449, 1537, 1563, 1479, 1596, 1634, 1693, 1709, 1806, 1830, - /* 30 */ 1865, 1938, 1953, 1975, 1997, 2094, 2110, 2125, 2154, 2169, - /* 40 */ 2240, 2255, 2270, 2328, 2354, 2387, 2412, 2495, 2511, 2526, - /* 50 */ -315, 117, -429, 208, 142, 282, 531, 575, 396, 642, - /* 60 */ 651, -36, -211, -319, 126, 188, 318, -386, -294, -253, - /* 70 */ -289, -43, -260, 108, -361, -174, -378, 28, -79, 156, - /* 80 */ 251, 359, 191, 308, 316, 402, 244, 355, 442, 457, - /* 90 */ 485, 517, 522, 525, 576, 582, 687, -117, -397, 699, - /* 100 */ 530, 762, -396, 800, 802, 634, 808, 877, -229, 879, - /* 110 */ 668, 713, 685, 906, 886, -371, -371, 192, -215, -256, - /* 120 */ -74, 253, 480, 553, 660, 661, 679, 705, 744, 751, - /* 130 */ 765, 799, 811, 850, 898, 901, 913, 914, 367, -369, - /* 140 */ -27, 623, 703, 845, 798, -369, -164, -96, 125, 490, - /* 150 */ -52, 407, 889, 381, 831, -387, 394, 781, 880, 519, - /* 160 */ 785, 874, 882, 899, 825, 212, 408, 433, 452, 608, - /* 170 */ 697, 720, 608, 736, 947, 854, 710, 885, 833, 919, - /* 180 */ 1037, 1013, 1013, 1040, 1042, 1000, 1059, 1007, 929, 936, - /* 190 */ 938, 1010, 1013, 942, 1073, 1024, 1080, 1044, 1014, 1034, - /* 200 */ 1035, 1013, 972, 972, 954, 972, 984, 975, 1105, 1036, - /* 210 */ 1061, 1066, 1075, 1074, 1148, 1081, 1150, 1093, 1163, 1164, - /* 220 */ 1120, 1170, 1122, 1127, 1175, 1176, 1178, 1126, 1132, 1134, - /* 230 */ 1135, 1172, 1186, 1200, 1192, 1207, 1209, 1211, 1222, 1220, - /* 240 */ 1225, 1226, 1145, 1217, 1229, 1191, 1240, 1238, 1181, 1243, - /* 250 */ 1252, 1247, 1210, 1257, 1261, 1272, 1264, 1281, 1249, 1251, - /* 260 */ 1253, 1255, 1256, 1258, 1259, 1262, 1265, 1266, 1268, 1283, - /* 270 */ 1290, 1295, 1297, 1248, 1271, 1273, 1212, 1221, 1224, 1298, - /* 280 */ 1227, 1230, 1234, 1274, 1302, 1245, 1316, 1277, 1193, 1276, - /* 290 */ 1194, 1279, 1202, 1196, 1214, 1228, 1244, 1232, 1282, 1205, - /* 300 */ 1233, 1215, 972, 1371, 1284, 1269, 1275, 1379, 1382, 1385, - /* 310 */ 1289, 1335, 1356, 1357, 1358, 1363, 1341, 1364, 1354, 1400, - /* 320 */ 1377, 1403, 1402, 1370, 1372, 1384, 1373, 1416, 1408, 1430, - /* 330 */ 1431, 1442, 1355, 1374, 1376, 1378, 1409, 1419, 1424, 1433, - /* 340 */ 1453, + /* 0 */ 600, -314, 400, 429, 685, 743, 893, 932, 990, 1138, + /* 10 */ 500, 1196, 1235, 1266, 1354, 1451, 1488, 1509, 252, 665, + /* 20 */ 1606, 1623, 1707, 724, 1638, 1722, 1806, 1821, 1836, 1852, + /* 30 */ 1922, 1949, 1981, 2019, 2065, 2091, 2135, 2164, 2179, 2210, + /* 40 */ 2280, 2296, 2377, 2409, 2436, 2506, 2522, 2537, 2552, 2581, + /* 50 */ -316, -332, -406, -193, 326, 368, 776, 821, -159, 220, + /* 60 */ 861, -381, -481, -369, 233, -444, -124, -389, -397, -380, + /* 70 */ -98, -75, 171, 308, -349, -265, -391, 253, -210, 4, + /* 80 */ 112, -290, -185, 37, 412, 414, 175, 355, 436, 498, + /* 90 */ 527, 545, 418, -305, -211, 552, 638, 516, -343, 648, + /* 100 */ 459, 651, 417, 677, 689, 423, 720, 732, 530, 734, + /* 110 */ 511, 631, 635, 791, 652, -464, -464, 382, -45, -202, + /* 120 */ -170, -148, 70, 121, 508, 666, 704, 729, 762, 802, + /* 130 */ 808, 809, 812, 842, 843, 856, 858, 866, 56, -450, + /* 140 */ 425, 9, 222, 676, 690, -450, -435, 469, 225, 325, + /* 150 */ -115, 466, 696, 706, -129, 744, 782, 754, 420, 698, + /* 160 */ 783, 850, 852, 876, 813, 477, 577, 699, 731, 895, + /* 170 */ 926, 959, 895, 873, 905, 1003, 953, 859, 874, 884, + /* 180 */ 1013, 1014, 1014, 1015, 1028, 993, 1076, 1024, 945, 952, + /* 190 */ 954, 1033, 1014, 968, 1099, 1078, 1129, 1094, 1064, 1088, + /* 200 */ 1089, 1014, 1019, 1019, 1005, 1019, 1035, 1025, 1128, 1084, + /* 210 */ 1068, 1072, 1080, 1079, 1151, 1085, 1154, 1096, 1168, 1169, + /* 220 */ 1124, 1174, 1126, 1131, 1182, 1179, 1183, 1143, 1147, 1148, + /* 230 */ 1149, 1185, 1188, 1201, 1192, 1204, 1205, 1206, 1215, 1213, + /* 240 */ 1218, 1216, 1139, 1203, 1209, 1172, 1210, 1220, 1159, 1225, + /* 250 */ 1243, 1229, 1184, 1241, 1242, 1248, 1246, 1256, 1223, 1227, + /* 260 */ 1228, 1230, 1231, 1232, 1233, 1234, 1244, 1245, 1251, 1258, + /* 270 */ 1274, 1278, 1279, 1253, 1260, 1262, 1190, 1198, 1207, 1276, + /* 280 */ 1221, 1237, 1226, 1259, 1299, 1247, 1308, 1271, 1187, 1257, + /* 290 */ 1193, 1263, 1189, 1195, 1211, 1219, 1222, 1212, 1275, 1199, + /* 300 */ 1224, 1238, 1019, 1353, 1264, 1249, 1252, 1365, 1361, 1362, + /* 310 */ 1270, 1317, 1338, 1340, 1341, 1343, 1326, 1345, 1344, 1381, + /* 320 */ 1368, 1391, 1395, 1359, 1360, 1370, 1363, 1405, 1402, 1418, + /* 330 */ 1416, 1420, 1342, 1334, 1355, 1358, 1397, 1398, 1403, 1408, + /* 340 */ 1428, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 10 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 20 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 30 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 40 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 50 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 60 */ 2291, 1951, 1951, 2254, 1951, 1951, 1951, 1951, 1951, 1951, - /* 70 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 2261, 1951, 1951, - /* 80 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 90 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 2050, 1951, 1951, - /* 100 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 110 */ 1951, 1951, 1951, 1951, 2048, 2515, 1951, 1951, 1951, 1951, - /* 120 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 130 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 2527, - /* 140 */ 1951, 1951, 2022, 2022, 1951, 2527, 2527, 2527, 2487, 2487, - /* 150 */ 2048, 1951, 1951, 2050, 2329, 1951, 1951, 1951, 1951, 1951, - /* 160 */ 1951, 1951, 1951, 2173, 1981, 1951, 1951, 1951, 1951, 2197, - /* 170 */ 1951, 1951, 1951, 2317, 1951, 1951, 2556, 2618, 1951, 2559, - /* 180 */ 1951, 1951, 1951, 1951, 1951, 2266, 1951, 2546, 1951, 1951, - /* 190 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 2126, 2311, 1951, - /* 200 */ 1951, 1951, 2519, 2533, 2602, 2520, 2517, 2540, 1951, 2550, - /* 210 */ 1951, 2354, 1951, 2343, 2050, 1951, 2050, 2304, 2249, 1951, - /* 220 */ 2259, 1951, 2259, 2256, 1951, 1951, 1951, 2259, 2256, 2256, - /* 230 */ 2256, 2115, 2111, 1951, 2109, 1951, 1951, 1951, 1951, 2006, - /* 240 */ 1951, 2006, 1951, 2050, 2050, 1951, 2050, 1951, 1951, 2050, - /* 250 */ 1951, 2050, 1951, 2050, 2050, 1951, 2050, 1951, 1951, 1951, - /* 260 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 270 */ 1951, 1951, 1951, 1951, 1951, 1951, 2341, 2327, 1951, 2048, - /* 280 */ 1951, 2315, 2313, 1951, 2048, 2550, 1951, 1951, 2572, 2567, - /* 290 */ 2572, 2567, 2586, 2582, 2572, 2591, 2588, 2552, 2550, 2621, - /* 300 */ 2608, 2604, 2533, 1951, 1951, 2538, 2536, 1951, 2048, 2048, - /* 310 */ 1951, 2567, 1951, 1951, 1951, 1951, 2567, 1951, 1951, 2048, - /* 320 */ 1951, 2048, 1951, 1951, 1951, 2142, 1951, 1951, 2048, 1951, - /* 330 */ 1990, 1951, 2306, 2332, 2287, 2287, 2176, 2176, 2176, 2051, - /* 340 */ 1956, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 350 */ 1951, 1951, 1951, 2585, 2584, 2439, 1951, 2491, 2490, 2489, - /* 360 */ 2480, 2438, 2138, 1951, 1951, 2437, 2436, 1951, 1951, 1951, - /* 370 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 2430, 1951, - /* 380 */ 1951, 2431, 2429, 2428, 2278, 2277, 1951, 1951, 1951, 1951, - /* 390 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 400 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 410 */ 1951, 1951, 2605, 2609, 1951, 2516, 1951, 1951, 1951, 2410, - /* 420 */ 1951, 1951, 1951, 1951, 1951, 2378, 1951, 1951, 1951, 1951, - /* 430 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 440 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 450 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 460 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 470 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 480 */ 2255, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 490 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 500 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 510 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 520 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 530 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 540 */ 1951, 1951, 2270, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 550 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 560 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 570 */ 1951, 1951, 1951, 1951, 1995, 2417, 1951, 1951, 1951, 1951, - /* 580 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 2420, - /* 590 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 600 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 610 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 620 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 630 */ 2090, 2089, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 640 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 650 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 2421, 1951, - /* 660 */ 1951, 1951, 1951, 1951, 2412, 1951, 1951, 1951, 1951, 1951, - /* 670 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 680 */ 1951, 2601, 2553, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 690 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 700 */ 1951, 1951, 1951, 1951, 1951, 2410, 1951, 2583, 1951, 1951, - /* 710 */ 2599, 1951, 2603, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 720 */ 2526, 2522, 1951, 1951, 2518, 1951, 1951, 1951, 1951, 1951, - /* 730 */ 2477, 1951, 1951, 1951, 2511, 1951, 1951, 1951, 1951, 1951, - /* 740 */ 1951, 1951, 1951, 1951, 2421, 1951, 2424, 1951, 1951, 1951, - /* 750 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 2409, - /* 760 */ 1951, 2462, 2461, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 770 */ 2170, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 780 */ 1951, 1951, 1951, 1951, 1951, 1951, 2154, 2152, 2151, 2150, - /* 790 */ 1951, 2183, 1951, 1951, 1951, 2179, 2178, 1951, 1951, 1951, - /* 800 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 810 */ 1951, 1951, 1951, 2069, 1951, 1951, 1951, 1951, 1951, 1951, - /* 820 */ 1951, 1951, 2061, 1951, 2060, 1951, 1951, 1951, 1951, 1951, - /* 830 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 840 */ 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1951, - /* 850 */ 1951, 1951, 1980, 1951, 1951, 1951, 1951, 1951, 1951, + /* 0 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 10 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 20 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 30 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 40 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 50 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 60 */ 2294, 1953, 1953, 2257, 1953, 1953, 1953, 1953, 1953, 1953, + /* 70 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2264, 1953, 1953, + /* 80 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 90 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2052, 1953, 1953, + /* 100 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 110 */ 1953, 1953, 1953, 1953, 2050, 2518, 1953, 1953, 1953, 1953, + /* 120 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 130 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2530, + /* 140 */ 1953, 1953, 2024, 2024, 1953, 2530, 2530, 2530, 2490, 2490, + /* 150 */ 2050, 1953, 1953, 2052, 2332, 1953, 1953, 1953, 1953, 1953, + /* 160 */ 1953, 1953, 1953, 2175, 1983, 1953, 1953, 1953, 1953, 2199, + /* 170 */ 1953, 1953, 1953, 2320, 1953, 1953, 2559, 2621, 1953, 2562, + /* 180 */ 1953, 1953, 1953, 1953, 1953, 2269, 1953, 2549, 1953, 1953, + /* 190 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2128, 2314, 1953, + /* 200 */ 1953, 1953, 2522, 2536, 2605, 2523, 2520, 2543, 1953, 2553, + /* 210 */ 1953, 2357, 1953, 2346, 2052, 1953, 2052, 2307, 2252, 1953, + /* 220 */ 2262, 1953, 2262, 2259, 1953, 1953, 1953, 2262, 2259, 2259, + /* 230 */ 2259, 2117, 2113, 1953, 2111, 1953, 1953, 1953, 1953, 2008, + /* 240 */ 1953, 2008, 1953, 2052, 2052, 1953, 2052, 1953, 1953, 2052, + /* 250 */ 1953, 2052, 1953, 2052, 2052, 1953, 2052, 1953, 1953, 1953, + /* 260 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 270 */ 1953, 1953, 1953, 1953, 1953, 1953, 2344, 2330, 1953, 2050, + /* 280 */ 1953, 2318, 2316, 1953, 2050, 2553, 1953, 1953, 2575, 2570, + /* 290 */ 2575, 2570, 2589, 2585, 2575, 2594, 2591, 2555, 2553, 2624, + /* 300 */ 2611, 2607, 2536, 1953, 1953, 2541, 2539, 1953, 2050, 2050, + /* 310 */ 1953, 2570, 1953, 1953, 1953, 1953, 2570, 1953, 1953, 2050, + /* 320 */ 1953, 2050, 1953, 1953, 1953, 2144, 1953, 1953, 2050, 1953, + /* 330 */ 1992, 1953, 2309, 2335, 2290, 2290, 2178, 2178, 2178, 2053, + /* 340 */ 1958, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 350 */ 1953, 1953, 1953, 2588, 2587, 2442, 1953, 2494, 2493, 2492, + /* 360 */ 2483, 2441, 2140, 1953, 1953, 2440, 2439, 1953, 1953, 1953, + /* 370 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2433, 1953, + /* 380 */ 1953, 2434, 2432, 2431, 2281, 2280, 1953, 1953, 1953, 1953, + /* 390 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 400 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 410 */ 1953, 1953, 2608, 2612, 1953, 2519, 1953, 1953, 1953, 2413, + /* 420 */ 1953, 1953, 1953, 1953, 1953, 2381, 1953, 1953, 1953, 1953, + /* 430 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 440 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 450 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 460 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 470 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 480 */ 2258, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 490 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 500 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 510 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 520 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 530 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 540 */ 1953, 1953, 1953, 2273, 1953, 1953, 1953, 1953, 1953, 1953, + /* 550 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 560 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 570 */ 1953, 1953, 1953, 1953, 1953, 1997, 2420, 1953, 1953, 1953, + /* 580 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 590 */ 2423, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 600 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 610 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 620 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 630 */ 1953, 2092, 2091, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 640 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 650 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2424, + /* 660 */ 1953, 1953, 1953, 1953, 1953, 2415, 1953, 1953, 1953, 1953, + /* 670 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 680 */ 1953, 1953, 2604, 2556, 1953, 1953, 1953, 1953, 1953, 1953, + /* 690 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 700 */ 1953, 1953, 1953, 1953, 1953, 1953, 2413, 1953, 2586, 1953, + /* 710 */ 1953, 2602, 1953, 2606, 1953, 1953, 1953, 1953, 1953, 1953, + /* 720 */ 1953, 2529, 2525, 1953, 1953, 2521, 1953, 1953, 1953, 1953, + /* 730 */ 1953, 2480, 1953, 1953, 1953, 2514, 1953, 1953, 1953, 1953, + /* 740 */ 1953, 1953, 1953, 1953, 1953, 2424, 1953, 2427, 1953, 1953, + /* 750 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 760 */ 2412, 1953, 2465, 2464, 1953, 1953, 1953, 1953, 1953, 1953, + /* 770 */ 1953, 2172, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 780 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 2156, 2154, 2153, + /* 790 */ 2152, 1953, 2185, 1953, 1953, 1953, 2181, 2180, 1953, 1953, + /* 800 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 810 */ 1953, 1953, 1953, 1953, 2071, 1953, 1953, 1953, 1953, 1953, + /* 820 */ 1953, 1953, 1953, 2063, 1953, 2062, 1953, 1953, 1953, 1953, + /* 830 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 840 */ 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, 1953, + /* 850 */ 1953, 1953, 1953, 1982, 1953, 1953, 1953, 1953, 1953, 1953, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1202,7 +1568,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* BWLIMIT => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 303, /* END => ABORT */ + 304, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ @@ -1249,6 +1615,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 */ @@ -1272,7 +1639,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* VNODES => nothing */ 0, /* ALIVE => nothing */ 0, /* VIEWS => nothing */ - 303, /* VIEW => ABORT */ + 304, /* VIEW => ABORT */ 0, /* COMPACTS => nothing */ 0, /* NORMAL => nothing */ 0, /* CHILD => nothing */ @@ -1401,55 +1768,55 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 303, /* AFTER => ABORT */ - 303, /* ATTACH => ABORT */ - 303, /* BEFORE => ABORT */ - 303, /* BEGIN => ABORT */ - 303, /* BITAND => ABORT */ - 303, /* BITNOT => ABORT */ - 303, /* BITOR => ABORT */ - 303, /* BLOCKS => ABORT */ - 303, /* CHANGE => ABORT */ - 303, /* COMMA => ABORT */ - 303, /* CONCAT => ABORT */ - 303, /* CONFLICT => ABORT */ - 303, /* COPY => ABORT */ - 303, /* DEFERRED => ABORT */ - 303, /* DELIMITERS => ABORT */ - 303, /* DETACH => ABORT */ - 303, /* DIVIDE => ABORT */ - 303, /* DOT => ABORT */ - 303, /* EACH => ABORT */ - 303, /* FAIL => ABORT */ - 303, /* FILE => ABORT */ - 303, /* FOR => ABORT */ - 303, /* GLOB => ABORT */ - 303, /* ID => ABORT */ - 303, /* IMMEDIATE => ABORT */ - 303, /* IMPORT => ABORT */ - 303, /* INITIALLY => ABORT */ - 303, /* INSTEAD => ABORT */ - 303, /* ISNULL => ABORT */ - 303, /* KEY => ABORT */ - 303, /* MODULES => ABORT */ - 303, /* NK_BITNOT => ABORT */ - 303, /* NK_SEMI => ABORT */ - 303, /* NOTNULL => ABORT */ - 303, /* OF => ABORT */ - 303, /* PLUS => ABORT */ - 303, /* PRIVILEGE => ABORT */ - 303, /* RAISE => ABORT */ - 303, /* RESTRICT => ABORT */ - 303, /* ROW => ABORT */ - 303, /* SEMI => ABORT */ - 303, /* STAR => ABORT */ - 303, /* STATEMENT => ABORT */ - 303, /* STRICT => ABORT */ - 303, /* STRING => ABORT */ - 303, /* TIMES => ABORT */ - 303, /* VALUES => ABORT */ - 303, /* VARIABLE => ABORT */ - 303, /* WAL => ABORT */ + 304, /* AFTER => ABORT */ + 304, /* ATTACH => ABORT */ + 304, /* BEFORE => ABORT */ + 304, /* BEGIN => ABORT */ + 304, /* BITAND => ABORT */ + 304, /* BITNOT => ABORT */ + 304, /* BITOR => ABORT */ + 304, /* BLOCKS => ABORT */ + 304, /* CHANGE => ABORT */ + 304, /* COMMA => ABORT */ + 304, /* CONCAT => ABORT */ + 304, /* CONFLICT => ABORT */ + 304, /* COPY => ABORT */ + 304, /* DEFERRED => ABORT */ + 304, /* DELIMITERS => ABORT */ + 304, /* DETACH => ABORT */ + 304, /* DIVIDE => ABORT */ + 304, /* DOT => ABORT */ + 304, /* EACH => ABORT */ + 304, /* FAIL => ABORT */ + 304, /* FILE => ABORT */ + 304, /* FOR => ABORT */ + 304, /* GLOB => ABORT */ + 304, /* ID => ABORT */ + 304, /* IMMEDIATE => ABORT */ + 304, /* IMPORT => ABORT */ + 304, /* INITIALLY => ABORT */ + 304, /* INSTEAD => ABORT */ + 304, /* ISNULL => ABORT */ + 304, /* KEY => ABORT */ + 304, /* MODULES => ABORT */ + 304, /* NK_BITNOT => ABORT */ + 304, /* NK_SEMI => ABORT */ + 304, /* NOTNULL => ABORT */ + 304, /* OF => ABORT */ + 304, /* PLUS => ABORT */ + 304, /* PRIVILEGE => ABORT */ + 304, /* RAISE => ABORT */ + 304, /* RESTRICT => ABORT */ + 304, /* ROW => ABORT */ + 304, /* SEMI => ABORT */ + 304, /* STAR => ABORT */ + 304, /* STATEMENT => ABORT */ + 304, /* STRICT => ABORT */ + 304, /* STRING => ABORT */ + 304, /* TIMES => ABORT */ + 304, /* VALUES => ABORT */ + 304, /* VARIABLE => ABORT */ + 304, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1501,6 +1868,7 @@ struct yyParser { }; typedef struct yyParser yyParser; +#include #ifndef NDEBUG #include static FILE *yyTraceFILE = 0; @@ -1689,370 +2057,371 @@ 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 */ "SELECT", - /* 275 */ "NK_HINT", - /* 276 */ "DISTINCT", - /* 277 */ "WHERE", - /* 278 */ "PARTITION", - /* 279 */ "BY", - /* 280 */ "SESSION", - /* 281 */ "STATE_WINDOW", - /* 282 */ "EVENT_WINDOW", - /* 283 */ "COUNT_WINDOW", - /* 284 */ "SLIDING", - /* 285 */ "FILL", - /* 286 */ "VALUE", - /* 287 */ "VALUE_F", - /* 288 */ "NONE", - /* 289 */ "PREV", - /* 290 */ "NULL_F", - /* 291 */ "LINEAR", - /* 292 */ "NEXT", - /* 293 */ "HAVING", - /* 294 */ "RANGE", - /* 295 */ "EVERY", - /* 296 */ "ORDER", - /* 297 */ "SLIMIT", - /* 298 */ "SOFFSET", - /* 299 */ "LIMIT", - /* 300 */ "OFFSET", - /* 301 */ "ASC", - /* 302 */ "NULLS", - /* 303 */ "ABORT", - /* 304 */ "AFTER", - /* 305 */ "ATTACH", - /* 306 */ "BEFORE", - /* 307 */ "BEGIN", - /* 308 */ "BITAND", - /* 309 */ "BITNOT", - /* 310 */ "BITOR", - /* 311 */ "BLOCKS", - /* 312 */ "CHANGE", - /* 313 */ "COMMA", - /* 314 */ "CONCAT", - /* 315 */ "CONFLICT", - /* 316 */ "COPY", - /* 317 */ "DEFERRED", - /* 318 */ "DELIMITERS", - /* 319 */ "DETACH", - /* 320 */ "DIVIDE", - /* 321 */ "DOT", - /* 322 */ "EACH", - /* 323 */ "FAIL", - /* 324 */ "FILE", - /* 325 */ "FOR", - /* 326 */ "GLOB", - /* 327 */ "ID", - /* 328 */ "IMMEDIATE", - /* 329 */ "IMPORT", - /* 330 */ "INITIALLY", - /* 331 */ "INSTEAD", - /* 332 */ "ISNULL", - /* 333 */ "KEY", - /* 334 */ "MODULES", - /* 335 */ "NK_BITNOT", - /* 336 */ "NK_SEMI", - /* 337 */ "NOTNULL", - /* 338 */ "OF", - /* 339 */ "PLUS", - /* 340 */ "PRIVILEGE", - /* 341 */ "RAISE", - /* 342 */ "RESTRICT", - /* 343 */ "ROW", - /* 344 */ "SEMI", - /* 345 */ "STAR", - /* 346 */ "STATEMENT", - /* 347 */ "STRICT", - /* 348 */ "STRING", - /* 349 */ "TIMES", - /* 350 */ "VALUES", - /* 351 */ "VARIABLE", - /* 352 */ "WAL", - /* 353 */ "cmd", - /* 354 */ "account_options", - /* 355 */ "alter_account_options", - /* 356 */ "literal", - /* 357 */ "alter_account_option", - /* 358 */ "ip_range_list", - /* 359 */ "white_list", - /* 360 */ "white_list_opt", - /* 361 */ "user_name", - /* 362 */ "sysinfo_opt", - /* 363 */ "privileges", - /* 364 */ "priv_level", - /* 365 */ "with_opt", - /* 366 */ "priv_type_list", - /* 367 */ "priv_type", - /* 368 */ "db_name", - /* 369 */ "table_name", - /* 370 */ "topic_name", - /* 371 */ "search_condition", - /* 372 */ "dnode_endpoint", - /* 373 */ "force_opt", - /* 374 */ "unsafe_opt", - /* 375 */ "not_exists_opt", - /* 376 */ "db_options", - /* 377 */ "exists_opt", - /* 378 */ "alter_db_options", - /* 379 */ "speed_opt", - /* 380 */ "start_opt", - /* 381 */ "end_opt", - /* 382 */ "integer_list", - /* 383 */ "variable_list", - /* 384 */ "retention_list", - /* 385 */ "signed", - /* 386 */ "alter_db_option", - /* 387 */ "retention", - /* 388 */ "full_table_name", - /* 389 */ "column_def_list", - /* 390 */ "tags_def_opt", - /* 391 */ "table_options", - /* 392 */ "multi_create_clause", - /* 393 */ "tags_def", - /* 394 */ "multi_drop_clause", - /* 395 */ "alter_table_clause", - /* 396 */ "alter_table_options", - /* 397 */ "column_name", - /* 398 */ "type_name", - /* 399 */ "tags_literal", - /* 400 */ "create_subtable_clause", - /* 401 */ "specific_cols_opt", - /* 402 */ "tags_literal_list", - /* 403 */ "drop_table_clause", - /* 404 */ "col_name_list", - /* 405 */ "column_def", - /* 406 */ "duration_list", - /* 407 */ "rollup_func_list", - /* 408 */ "alter_table_option", - /* 409 */ "duration_literal", - /* 410 */ "rollup_func_name", - /* 411 */ "function_name", - /* 412 */ "col_name", - /* 413 */ "db_kind_opt", - /* 414 */ "table_kind_db_name_cond_opt", - /* 415 */ "like_pattern_opt", - /* 416 */ "db_name_cond_opt", - /* 417 */ "table_name_cond", - /* 418 */ "from_db_opt", - /* 419 */ "tag_list_opt", - /* 420 */ "table_kind", - /* 421 */ "tag_item", - /* 422 */ "column_alias", - /* 423 */ "index_options", - /* 424 */ "full_index_name", - /* 425 */ "index_name", - /* 426 */ "func_list", - /* 427 */ "sliding_opt", - /* 428 */ "sma_stream_opt", - /* 429 */ "func", - /* 430 */ "sma_func_name", - /* 431 */ "expression_list", - /* 432 */ "with_meta", - /* 433 */ "query_or_subquery", - /* 434 */ "where_clause_opt", - /* 435 */ "cgroup_name", - /* 436 */ "analyze_opt", - /* 437 */ "explain_options", - /* 438 */ "insert_query", - /* 439 */ "or_replace_opt", - /* 440 */ "agg_func_opt", - /* 441 */ "bufsize_opt", - /* 442 */ "language_opt", - /* 443 */ "full_view_name", - /* 444 */ "view_name", - /* 445 */ "stream_name", - /* 446 */ "stream_options", - /* 447 */ "col_list_opt", - /* 448 */ "tag_def_or_ref_opt", - /* 449 */ "subtable_opt", - /* 450 */ "ignore_opt", - /* 451 */ "expression", - /* 452 */ "on_vgroup_id", - /* 453 */ "dnode_list", - /* 454 */ "literal_func", - /* 455 */ "signed_literal", - /* 456 */ "literal_list", - /* 457 */ "table_alias", - /* 458 */ "expr_or_subquery", - /* 459 */ "pseudo_column", - /* 460 */ "column_reference", - /* 461 */ "function_expression", - /* 462 */ "case_when_expression", - /* 463 */ "star_func", - /* 464 */ "star_func_para_list", - /* 465 */ "noarg_func", - /* 466 */ "other_para_list", - /* 467 */ "star_func_para", - /* 468 */ "when_then_list", - /* 469 */ "case_when_else_opt", - /* 470 */ "common_expression", - /* 471 */ "when_then_expr", - /* 472 */ "predicate", - /* 473 */ "compare_op", - /* 474 */ "in_op", - /* 475 */ "in_predicate_value", - /* 476 */ "boolean_value_expression", - /* 477 */ "boolean_primary", - /* 478 */ "from_clause_opt", - /* 479 */ "table_reference_list", - /* 480 */ "table_reference", - /* 481 */ "table_primary", - /* 482 */ "joined_table", - /* 483 */ "alias_opt", - /* 484 */ "subquery", - /* 485 */ "parenthesized_joined_table", - /* 486 */ "join_type", - /* 487 */ "query_specification", - /* 488 */ "hint_list", - /* 489 */ "set_quantifier_opt", - /* 490 */ "tag_mode_opt", - /* 491 */ "select_list", - /* 492 */ "partition_by_clause_opt", - /* 493 */ "range_opt", - /* 494 */ "every_opt", - /* 495 */ "fill_opt", - /* 496 */ "twindow_clause_opt", - /* 497 */ "group_by_clause_opt", - /* 498 */ "having_clause_opt", - /* 499 */ "select_item", - /* 500 */ "partition_list", - /* 501 */ "partition_item", - /* 502 */ "interval_sliding_duration_literal", - /* 503 */ "fill_mode", - /* 504 */ "group_by_list", - /* 505 */ "query_expression", - /* 506 */ "query_simple", - /* 507 */ "order_by_clause_opt", - /* 508 */ "slimit_clause_opt", - /* 509 */ "limit_clause_opt", - /* 510 */ "union_query_expression", - /* 511 */ "query_simple_or_subquery", - /* 512 */ "sort_specification_list", - /* 513 */ "sort_specification", - /* 514 */ "ordering_specification_opt", - /* 515 */ "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 */ "SELECT", + /* 276 */ "NK_HINT", + /* 277 */ "DISTINCT", + /* 278 */ "WHERE", + /* 279 */ "PARTITION", + /* 280 */ "BY", + /* 281 */ "SESSION", + /* 282 */ "STATE_WINDOW", + /* 283 */ "EVENT_WINDOW", + /* 284 */ "COUNT_WINDOW", + /* 285 */ "SLIDING", + /* 286 */ "FILL", + /* 287 */ "VALUE", + /* 288 */ "VALUE_F", + /* 289 */ "NONE", + /* 290 */ "PREV", + /* 291 */ "NULL_F", + /* 292 */ "LINEAR", + /* 293 */ "NEXT", + /* 294 */ "HAVING", + /* 295 */ "RANGE", + /* 296 */ "EVERY", + /* 297 */ "ORDER", + /* 298 */ "SLIMIT", + /* 299 */ "SOFFSET", + /* 300 */ "LIMIT", + /* 301 */ "OFFSET", + /* 302 */ "ASC", + /* 303 */ "NULLS", + /* 304 */ "ABORT", + /* 305 */ "AFTER", + /* 306 */ "ATTACH", + /* 307 */ "BEFORE", + /* 308 */ "BEGIN", + /* 309 */ "BITAND", + /* 310 */ "BITNOT", + /* 311 */ "BITOR", + /* 312 */ "BLOCKS", + /* 313 */ "CHANGE", + /* 314 */ "COMMA", + /* 315 */ "CONCAT", + /* 316 */ "CONFLICT", + /* 317 */ "COPY", + /* 318 */ "DEFERRED", + /* 319 */ "DELIMITERS", + /* 320 */ "DETACH", + /* 321 */ "DIVIDE", + /* 322 */ "DOT", + /* 323 */ "EACH", + /* 324 */ "FAIL", + /* 325 */ "FILE", + /* 326 */ "FOR", + /* 327 */ "GLOB", + /* 328 */ "ID", + /* 329 */ "IMMEDIATE", + /* 330 */ "IMPORT", + /* 331 */ "INITIALLY", + /* 332 */ "INSTEAD", + /* 333 */ "ISNULL", + /* 334 */ "KEY", + /* 335 */ "MODULES", + /* 336 */ "NK_BITNOT", + /* 337 */ "NK_SEMI", + /* 338 */ "NOTNULL", + /* 339 */ "OF", + /* 340 */ "PLUS", + /* 341 */ "PRIVILEGE", + /* 342 */ "RAISE", + /* 343 */ "RESTRICT", + /* 344 */ "ROW", + /* 345 */ "SEMI", + /* 346 */ "STAR", + /* 347 */ "STATEMENT", + /* 348 */ "STRICT", + /* 349 */ "STRING", + /* 350 */ "TIMES", + /* 351 */ "VALUES", + /* 352 */ "VARIABLE", + /* 353 */ "WAL", + /* 354 */ "cmd", + /* 355 */ "account_options", + /* 356 */ "alter_account_options", + /* 357 */ "literal", + /* 358 */ "alter_account_option", + /* 359 */ "ip_range_list", + /* 360 */ "white_list", + /* 361 */ "white_list_opt", + /* 362 */ "user_name", + /* 363 */ "sysinfo_opt", + /* 364 */ "privileges", + /* 365 */ "priv_level", + /* 366 */ "with_opt", + /* 367 */ "priv_type_list", + /* 368 */ "priv_type", + /* 369 */ "db_name", + /* 370 */ "table_name", + /* 371 */ "topic_name", + /* 372 */ "search_condition", + /* 373 */ "dnode_endpoint", + /* 374 */ "force_opt", + /* 375 */ "unsafe_opt", + /* 376 */ "not_exists_opt", + /* 377 */ "db_options", + /* 378 */ "exists_opt", + /* 379 */ "alter_db_options", + /* 380 */ "speed_opt", + /* 381 */ "start_opt", + /* 382 */ "end_opt", + /* 383 */ "integer_list", + /* 384 */ "variable_list", + /* 385 */ "retention_list", + /* 386 */ "signed", + /* 387 */ "alter_db_option", + /* 388 */ "retention", + /* 389 */ "full_table_name", + /* 390 */ "column_def_list", + /* 391 */ "tags_def_opt", + /* 392 */ "table_options", + /* 393 */ "multi_create_clause", + /* 394 */ "tags_def", + /* 395 */ "multi_drop_clause", + /* 396 */ "alter_table_clause", + /* 397 */ "alter_table_options", + /* 398 */ "column_name", + /* 399 */ "type_name", + /* 400 */ "tags_literal", + /* 401 */ "create_subtable_clause", + /* 402 */ "specific_cols_opt", + /* 403 */ "tags_literal_list", + /* 404 */ "drop_table_clause", + /* 405 */ "col_name_list", + /* 406 */ "column_def", + /* 407 */ "duration_list", + /* 408 */ "rollup_func_list", + /* 409 */ "alter_table_option", + /* 410 */ "duration_literal", + /* 411 */ "rollup_func_name", + /* 412 */ "function_name", + /* 413 */ "col_name", + /* 414 */ "db_kind_opt", + /* 415 */ "table_kind_db_name_cond_opt", + /* 416 */ "like_pattern_opt", + /* 417 */ "db_name_cond_opt", + /* 418 */ "table_name_cond", + /* 419 */ "from_db_opt", + /* 420 */ "tag_list_opt", + /* 421 */ "table_kind", + /* 422 */ "tag_item", + /* 423 */ "column_alias", + /* 424 */ "index_options", + /* 425 */ "full_index_name", + /* 426 */ "index_name", + /* 427 */ "func_list", + /* 428 */ "sliding_opt", + /* 429 */ "sma_stream_opt", + /* 430 */ "func", + /* 431 */ "sma_func_name", + /* 432 */ "expression_list", + /* 433 */ "with_meta", + /* 434 */ "query_or_subquery", + /* 435 */ "where_clause_opt", + /* 436 */ "cgroup_name", + /* 437 */ "analyze_opt", + /* 438 */ "explain_options", + /* 439 */ "insert_query", + /* 440 */ "or_replace_opt", + /* 441 */ "agg_func_opt", + /* 442 */ "bufsize_opt", + /* 443 */ "language_opt", + /* 444 */ "full_view_name", + /* 445 */ "view_name", + /* 446 */ "stream_name", + /* 447 */ "stream_options", + /* 448 */ "col_list_opt", + /* 449 */ "tag_def_or_ref_opt", + /* 450 */ "subtable_opt", + /* 451 */ "ignore_opt", + /* 452 */ "expression", + /* 453 */ "on_vgroup_id", + /* 454 */ "dnode_list", + /* 455 */ "literal_func", + /* 456 */ "signed_literal", + /* 457 */ "literal_list", + /* 458 */ "table_alias", + /* 459 */ "expr_or_subquery", + /* 460 */ "pseudo_column", + /* 461 */ "column_reference", + /* 462 */ "function_expression", + /* 463 */ "case_when_expression", + /* 464 */ "star_func", + /* 465 */ "star_func_para_list", + /* 466 */ "noarg_func", + /* 467 */ "other_para_list", + /* 468 */ "star_func_para", + /* 469 */ "when_then_list", + /* 470 */ "case_when_else_opt", + /* 471 */ "common_expression", + /* 472 */ "when_then_expr", + /* 473 */ "predicate", + /* 474 */ "compare_op", + /* 475 */ "in_op", + /* 476 */ "in_predicate_value", + /* 477 */ "boolean_value_expression", + /* 478 */ "boolean_primary", + /* 479 */ "from_clause_opt", + /* 480 */ "table_reference_list", + /* 481 */ "table_reference", + /* 482 */ "table_primary", + /* 483 */ "joined_table", + /* 484 */ "alias_opt", + /* 485 */ "subquery", + /* 486 */ "parenthesized_joined_table", + /* 487 */ "join_type", + /* 488 */ "query_specification", + /* 489 */ "hint_list", + /* 490 */ "set_quantifier_opt", + /* 491 */ "tag_mode_opt", + /* 492 */ "select_list", + /* 493 */ "partition_by_clause_opt", + /* 494 */ "range_opt", + /* 495 */ "every_opt", + /* 496 */ "fill_opt", + /* 497 */ "twindow_clause_opt", + /* 498 */ "group_by_clause_opt", + /* 499 */ "having_clause_opt", + /* 500 */ "select_item", + /* 501 */ "partition_list", + /* 502 */ "partition_item", + /* 503 */ "interval_sliding_duration_literal", + /* 504 */ "fill_mode", + /* 505 */ "group_by_list", + /* 506 */ "query_expression", + /* 507 */ "query_simple", + /* 508 */ "order_by_clause_opt", + /* 509 */ "slimit_clause_opt", + /* 510 */ "limit_clause_opt", + /* 511 */ "union_query_expression", + /* 512 */ "query_simple_or_subquery", + /* 513 */ "sort_specification_list", + /* 514 */ "sort_specification", + /* 515 */ "ordering_specification_opt", + /* 516 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2313,423 +2682,424 @@ 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 table_reference ON search_condition", - /* 579 */ "join_type ::=", - /* 580 */ "join_type ::= INNER", - /* 581 */ "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", - /* 582 */ "hint_list ::=", - /* 583 */ "hint_list ::= NK_HINT", - /* 584 */ "tag_mode_opt ::=", - /* 585 */ "tag_mode_opt ::= TAGS", - /* 586 */ "set_quantifier_opt ::=", - /* 587 */ "set_quantifier_opt ::= DISTINCT", - /* 588 */ "set_quantifier_opt ::= ALL", - /* 589 */ "select_list ::= select_item", - /* 590 */ "select_list ::= select_list NK_COMMA select_item", - /* 591 */ "select_item ::= NK_STAR", - /* 592 */ "select_item ::= common_expression", - /* 593 */ "select_item ::= common_expression column_alias", - /* 594 */ "select_item ::= common_expression AS column_alias", - /* 595 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 596 */ "where_clause_opt ::=", - /* 597 */ "where_clause_opt ::= WHERE search_condition", - /* 598 */ "partition_by_clause_opt ::=", - /* 599 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 600 */ "partition_list ::= partition_item", - /* 601 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 602 */ "partition_item ::= expr_or_subquery", - /* 603 */ "partition_item ::= expr_or_subquery column_alias", - /* 604 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 605 */ "twindow_clause_opt ::=", - /* 606 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 607 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 608 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 609 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 610 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 611 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", - /* 612 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 613 */ "sliding_opt ::=", - /* 614 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 615 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 616 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 617 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 618 */ "fill_opt ::=", - /* 619 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 620 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 621 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 622 */ "fill_mode ::= NONE", - /* 623 */ "fill_mode ::= PREV", - /* 624 */ "fill_mode ::= NULL", - /* 625 */ "fill_mode ::= NULL_F", - /* 626 */ "fill_mode ::= LINEAR", - /* 627 */ "fill_mode ::= NEXT", - /* 628 */ "group_by_clause_opt ::=", - /* 629 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 630 */ "group_by_list ::= expr_or_subquery", - /* 631 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 632 */ "having_clause_opt ::=", - /* 633 */ "having_clause_opt ::= HAVING search_condition", - /* 634 */ "range_opt ::=", - /* 635 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 636 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 637 */ "every_opt ::=", - /* 638 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 639 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 640 */ "query_simple ::= query_specification", - /* 641 */ "query_simple ::= union_query_expression", - /* 642 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 643 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 644 */ "query_simple_or_subquery ::= query_simple", - /* 645 */ "query_simple_or_subquery ::= subquery", - /* 646 */ "query_or_subquery ::= query_expression", - /* 647 */ "query_or_subquery ::= subquery", - /* 648 */ "order_by_clause_opt ::=", - /* 649 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 650 */ "slimit_clause_opt ::=", - /* 651 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 652 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 653 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 654 */ "limit_clause_opt ::=", - /* 655 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 656 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 657 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 658 */ "subquery ::= NK_LP query_expression NK_RP", - /* 659 */ "subquery ::= NK_LP subquery NK_RP", - /* 660 */ "search_condition ::= common_expression", - /* 661 */ "sort_specification_list ::= sort_specification", - /* 662 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 663 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 664 */ "ordering_specification_opt ::=", - /* 665 */ "ordering_specification_opt ::= ASC", - /* 666 */ "ordering_specification_opt ::= DESC", - /* 667 */ "null_ordering_opt ::=", - /* 668 */ "null_ordering_opt ::= NULLS FIRST", - /* 669 */ "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 table_reference ON search_condition", + /* 580 */ "join_type ::=", + /* 581 */ "join_type ::= INNER", + /* 582 */ "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", + /* 583 */ "hint_list ::=", + /* 584 */ "hint_list ::= NK_HINT", + /* 585 */ "tag_mode_opt ::=", + /* 586 */ "tag_mode_opt ::= TAGS", + /* 587 */ "set_quantifier_opt ::=", + /* 588 */ "set_quantifier_opt ::= DISTINCT", + /* 589 */ "set_quantifier_opt ::= ALL", + /* 590 */ "select_list ::= select_item", + /* 591 */ "select_list ::= select_list NK_COMMA select_item", + /* 592 */ "select_item ::= NK_STAR", + /* 593 */ "select_item ::= common_expression", + /* 594 */ "select_item ::= common_expression column_alias", + /* 595 */ "select_item ::= common_expression AS column_alias", + /* 596 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 597 */ "where_clause_opt ::=", + /* 598 */ "where_clause_opt ::= WHERE search_condition", + /* 599 */ "partition_by_clause_opt ::=", + /* 600 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 601 */ "partition_list ::= partition_item", + /* 602 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 603 */ "partition_item ::= expr_or_subquery", + /* 604 */ "partition_item ::= expr_or_subquery column_alias", + /* 605 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 606 */ "twindow_clause_opt ::=", + /* 607 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", + /* 608 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 609 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 610 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 611 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 612 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", + /* 613 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 614 */ "sliding_opt ::=", + /* 615 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 616 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 617 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 618 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 619 */ "fill_opt ::=", + /* 620 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 621 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 622 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 623 */ "fill_mode ::= NONE", + /* 624 */ "fill_mode ::= PREV", + /* 625 */ "fill_mode ::= NULL", + /* 626 */ "fill_mode ::= NULL_F", + /* 627 */ "fill_mode ::= LINEAR", + /* 628 */ "fill_mode ::= NEXT", + /* 629 */ "group_by_clause_opt ::=", + /* 630 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 631 */ "group_by_list ::= expr_or_subquery", + /* 632 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 633 */ "having_clause_opt ::=", + /* 634 */ "having_clause_opt ::= HAVING search_condition", + /* 635 */ "range_opt ::=", + /* 636 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 637 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 638 */ "every_opt ::=", + /* 639 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 640 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 641 */ "query_simple ::= query_specification", + /* 642 */ "query_simple ::= union_query_expression", + /* 643 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 644 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 645 */ "query_simple_or_subquery ::= query_simple", + /* 646 */ "query_simple_or_subquery ::= subquery", + /* 647 */ "query_or_subquery ::= query_expression", + /* 648 */ "query_or_subquery ::= subquery", + /* 649 */ "order_by_clause_opt ::=", + /* 650 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 651 */ "slimit_clause_opt ::=", + /* 652 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 653 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 654 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 655 */ "limit_clause_opt ::=", + /* 656 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 657 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 658 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 659 */ "subquery ::= NK_LP query_expression NK_RP", + /* 660 */ "subquery ::= NK_LP subquery NK_RP", + /* 661 */ "search_condition ::= common_expression", + /* 662 */ "sort_specification_list ::= sort_specification", + /* 663 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 664 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 665 */ "ordering_specification_opt ::=", + /* 666 */ "ordering_specification_opt ::= ASC", + /* 667 */ "ordering_specification_opt ::= DESC", + /* 668 */ "null_ordering_opt ::=", + /* 669 */ "null_ordering_opt ::= NULLS FIRST", + /* 670 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2856,235 +3226,269 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 353: /* cmd */ - case 356: /* literal */ - case 365: /* with_opt */ - case 371: /* search_condition */ - case 376: /* db_options */ - case 378: /* alter_db_options */ - case 380: /* start_opt */ - case 381: /* end_opt */ - case 385: /* signed */ - case 387: /* retention */ - case 388: /* full_table_name */ - case 391: /* table_options */ - case 395: /* alter_table_clause */ - case 396: /* alter_table_options */ - case 399: /* tags_literal */ - case 400: /* create_subtable_clause */ - case 403: /* drop_table_clause */ - case 405: /* column_def */ - case 409: /* duration_literal */ - case 410: /* rollup_func_name */ - case 412: /* col_name */ - case 415: /* like_pattern_opt */ - case 416: /* db_name_cond_opt */ - case 417: /* table_name_cond */ - case 418: /* from_db_opt */ - case 421: /* tag_item */ - case 423: /* index_options */ - case 424: /* full_index_name */ - case 427: /* sliding_opt */ - case 428: /* sma_stream_opt */ - case 429: /* func */ - case 433: /* query_or_subquery */ - case 434: /* where_clause_opt */ - case 437: /* explain_options */ - case 438: /* insert_query */ - case 443: /* full_view_name */ - case 446: /* stream_options */ - case 449: /* subtable_opt */ - case 451: /* expression */ - case 454: /* literal_func */ - case 455: /* signed_literal */ - case 458: /* expr_or_subquery */ - case 459: /* pseudo_column */ - case 460: /* column_reference */ - case 461: /* function_expression */ - case 462: /* case_when_expression */ - case 467: /* star_func_para */ - case 469: /* case_when_else_opt */ - case 470: /* common_expression */ - case 471: /* when_then_expr */ - case 472: /* predicate */ - case 475: /* in_predicate_value */ - case 476: /* boolean_value_expression */ - case 477: /* boolean_primary */ - case 478: /* from_clause_opt */ - case 479: /* table_reference_list */ - case 480: /* table_reference */ - case 481: /* table_primary */ - case 482: /* joined_table */ - case 484: /* subquery */ - case 485: /* parenthesized_joined_table */ - case 487: /* query_specification */ - case 493: /* range_opt */ - case 494: /* every_opt */ - case 495: /* fill_opt */ - case 496: /* twindow_clause_opt */ - case 498: /* having_clause_opt */ - case 499: /* select_item */ - case 501: /* partition_item */ - case 502: /* interval_sliding_duration_literal */ - case 505: /* query_expression */ - case 506: /* query_simple */ - case 508: /* slimit_clause_opt */ - case 509: /* limit_clause_opt */ - case 510: /* union_query_expression */ - case 511: /* query_simple_or_subquery */ - case 513: /* sort_specification */ + case 354: /* cmd */ + case 357: /* literal */ + case 366: /* with_opt */ + case 372: /* search_condition */ + case 377: /* db_options */ + case 379: /* alter_db_options */ + case 381: /* start_opt */ + case 382: /* end_opt */ + case 386: /* signed */ + case 388: /* retention */ + case 389: /* full_table_name */ + case 392: /* table_options */ + case 396: /* alter_table_clause */ + case 397: /* alter_table_options */ + case 400: /* tags_literal */ + case 401: /* create_subtable_clause */ + case 404: /* drop_table_clause */ + case 406: /* column_def */ + case 410: /* duration_literal */ + case 411: /* rollup_func_name */ + case 413: /* col_name */ + case 416: /* like_pattern_opt */ + case 417: /* db_name_cond_opt */ + case 418: /* table_name_cond */ + case 419: /* from_db_opt */ + case 422: /* tag_item */ + case 424: /* index_options */ + case 425: /* full_index_name */ + case 428: /* sliding_opt */ + case 429: /* sma_stream_opt */ + case 430: /* func */ + case 434: /* query_or_subquery */ + case 435: /* where_clause_opt */ + case 438: /* explain_options */ + case 439: /* insert_query */ + case 444: /* full_view_name */ + case 447: /* stream_options */ + case 450: /* subtable_opt */ + case 452: /* expression */ + case 455: /* literal_func */ + case 456: /* signed_literal */ + case 459: /* expr_or_subquery */ + case 460: /* pseudo_column */ + case 461: /* column_reference */ + case 462: /* function_expression */ + case 463: /* case_when_expression */ + case 468: /* star_func_para */ + case 470: /* case_when_else_opt */ + case 471: /* common_expression */ + case 472: /* when_then_expr */ + case 473: /* predicate */ + case 476: /* in_predicate_value */ + case 477: /* boolean_value_expression */ + case 478: /* boolean_primary */ + case 479: /* from_clause_opt */ + case 480: /* table_reference_list */ + case 481: /* table_reference */ + case 482: /* table_primary */ + case 483: /* joined_table */ + case 485: /* subquery */ + case 486: /* parenthesized_joined_table */ + case 488: /* query_specification */ + case 494: /* range_opt */ + case 495: /* every_opt */ + case 496: /* fill_opt */ + case 497: /* twindow_clause_opt */ + case 499: /* having_clause_opt */ + case 500: /* select_item */ + case 502: /* partition_item */ + case 503: /* interval_sliding_duration_literal */ + case 506: /* query_expression */ + case 507: /* query_simple */ + case 509: /* slimit_clause_opt */ + case 510: /* limit_clause_opt */ + case 511: /* union_query_expression */ + case 512: /* query_simple_or_subquery */ + case 514: /* sort_specification */ { - nodesDestroyNode((yypminor->yy656)); +#line 7 "sql.y" + nodesDestroyNode((yypminor->yy718)); +#line 3309 "sql.c" } break; - case 354: /* account_options */ - case 355: /* alter_account_options */ - case 357: /* alter_account_option */ - case 379: /* speed_opt */ - case 432: /* with_meta */ - case 441: /* bufsize_opt */ + case 355: /* account_options */ + case 356: /* alter_account_options */ + case 358: /* alter_account_option */ + case 380: /* speed_opt */ + case 433: /* with_meta */ + case 442: /* bufsize_opt */ { +#line 54 "sql.y" +#line 3321 "sql.c" } break; - case 358: /* ip_range_list */ - case 359: /* white_list */ - case 360: /* white_list_opt */ - case 382: /* integer_list */ - case 383: /* variable_list */ - case 384: /* retention_list */ - case 389: /* column_def_list */ - case 390: /* tags_def_opt */ - case 392: /* multi_create_clause */ - case 393: /* tags_def */ - case 394: /* multi_drop_clause */ - case 401: /* specific_cols_opt */ - case 402: /* tags_literal_list */ - case 404: /* col_name_list */ - case 406: /* duration_list */ - case 407: /* rollup_func_list */ - case 419: /* tag_list_opt */ - case 426: /* func_list */ - case 431: /* expression_list */ - case 447: /* col_list_opt */ - case 448: /* tag_def_or_ref_opt */ - case 453: /* dnode_list */ - case 456: /* literal_list */ - case 464: /* star_func_para_list */ - case 466: /* other_para_list */ - case 468: /* when_then_list */ - case 488: /* hint_list */ - case 491: /* select_list */ - case 492: /* partition_by_clause_opt */ - case 497: /* group_by_clause_opt */ - case 500: /* partition_list */ - case 504: /* group_by_list */ - case 507: /* order_by_clause_opt */ - case 512: /* sort_specification_list */ + case 359: /* ip_range_list */ + case 360: /* white_list */ + case 361: /* white_list_opt */ + case 383: /* integer_list */ + case 384: /* variable_list */ + case 385: /* retention_list */ + case 390: /* column_def_list */ + case 391: /* tags_def_opt */ + case 393: /* multi_create_clause */ + case 394: /* tags_def */ + case 395: /* multi_drop_clause */ + case 402: /* specific_cols_opt */ + case 403: /* tags_literal_list */ + case 405: /* col_name_list */ + case 407: /* duration_list */ + case 408: /* rollup_func_list */ + case 420: /* tag_list_opt */ + case 427: /* func_list */ + case 432: /* expression_list */ + case 448: /* col_list_opt */ + case 449: /* tag_def_or_ref_opt */ + case 454: /* dnode_list */ + case 457: /* literal_list */ + case 465: /* star_func_para_list */ + case 467: /* other_para_list */ + case 469: /* when_then_list */ + case 489: /* hint_list */ + case 492: /* select_list */ + case 493: /* partition_by_clause_opt */ + case 498: /* group_by_clause_opt */ + case 501: /* partition_list */ + case 505: /* group_by_list */ + case 508: /* order_by_clause_opt */ + case 513: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy136)); +#line 85 "sql.y" + nodesDestroyList((yypminor->yy552)); +#line 3361 "sql.c" } break; - case 361: /* user_name */ - case 368: /* db_name */ - case 369: /* table_name */ - case 370: /* topic_name */ - case 372: /* dnode_endpoint */ - case 397: /* column_name */ - case 411: /* function_name */ - case 422: /* column_alias */ - case 425: /* index_name */ - case 430: /* sma_func_name */ - case 435: /* cgroup_name */ - case 442: /* language_opt */ - case 444: /* view_name */ - case 445: /* stream_name */ - case 452: /* on_vgroup_id */ - case 457: /* table_alias */ - case 463: /* star_func */ - case 465: /* noarg_func */ - case 483: /* alias_opt */ + case 362: /* user_name */ + case 369: /* db_name */ + case 370: /* table_name */ + case 371: /* topic_name */ + case 373: /* dnode_endpoint */ + case 398: /* column_name */ + case 412: /* function_name */ + case 423: /* column_alias */ + case 426: /* index_name */ + case 431: /* sma_func_name */ + case 436: /* cgroup_name */ + case 443: /* language_opt */ + case 445: /* view_name */ + case 446: /* stream_name */ + case 453: /* on_vgroup_id */ + case 458: /* table_alias */ + case 464: /* star_func */ + case 466: /* noarg_func */ + case 484: /* alias_opt */ { +#line 890 "sql.y" +#line 3386 "sql.c" } break; - case 362: /* sysinfo_opt */ + case 363: /* sysinfo_opt */ { +#line 112 "sql.y" +#line 3393 "sql.c" } break; - case 363: /* privileges */ - case 366: /* priv_type_list */ - case 367: /* priv_type */ + case 364: /* privileges */ + case 367: /* priv_type_list */ + case 368: /* priv_type */ { +#line 121 "sql.y" +#line 3402 "sql.c" } break; - case 364: /* priv_level */ + case 365: /* priv_level */ { +#line 138 "sql.y" +#line 3409 "sql.c" } break; - case 373: /* force_opt */ - case 374: /* unsafe_opt */ - case 375: /* not_exists_opt */ - case 377: /* exists_opt */ - case 436: /* analyze_opt */ - case 439: /* or_replace_opt */ - case 440: /* agg_func_opt */ - case 450: /* ignore_opt */ - case 489: /* set_quantifier_opt */ - case 490: /* tag_mode_opt */ + case 374: /* force_opt */ + case 375: /* unsafe_opt */ + case 376: /* not_exists_opt */ + case 378: /* exists_opt */ + case 437: /* analyze_opt */ + case 440: /* or_replace_opt */ + case 441: /* agg_func_opt */ + case 451: /* ignore_opt */ + case 490: /* set_quantifier_opt */ + case 491: /* tag_mode_opt */ { +#line 167 "sql.y" +#line 3425 "sql.c" } break; - case 386: /* alter_db_option */ - case 408: /* alter_table_option */ + case 387: /* alter_db_option */ + case 409: /* alter_table_option */ { +#line 269 "sql.y" +#line 3433 "sql.c" } break; - case 398: /* type_name */ + case 399: /* type_name */ { +#line 392 "sql.y" +#line 3440 "sql.c" } break; - case 413: /* db_kind_opt */ - case 420: /* table_kind */ + case 414: /* db_kind_opt */ + case 421: /* table_kind */ { +#line 561 "sql.y" +#line 3448 "sql.c" } break; - case 414: /* table_kind_db_name_cond_opt */ + case 415: /* table_kind_db_name_cond_opt */ { +#line 526 "sql.y" +#line 3455 "sql.c" } break; - case 473: /* compare_op */ - case 474: /* in_op */ + case 474: /* compare_op */ + case 475: /* in_op */ { +#line 1081 "sql.y" +#line 3463 "sql.c" } break; - case 486: /* join_type */ + case 487: /* join_type */ { +#line 1157 "sql.y" +#line 3470 "sql.c" } break; - case 503: /* fill_mode */ + case 504: /* fill_mode */ { +#line 1252 "sql.y" +#line 3477 "sql.c" } break; - case 514: /* ordering_specification_opt */ + case 515: /* ordering_specification_opt */ { +#line 1337 "sql.y" +#line 3484 "sql.c" } break; - case 515: /* null_ordering_opt */ + case 516: /* null_ordering_opt */ { +#line 1343 "sql.y" +#line 3491 "sql.c" } break; /********* End destructor definitions *****************************************/ @@ -3251,7 +3655,7 @@ static YYACTIONTYPE yy_find_shift_action( #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ - assert( i>=0 && i=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) ); return yy_action[i]; } }while(1); @@ -3373,676 +3777,677 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 353, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 353, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 354, /* (2) account_options ::= */ - 354, /* (3) account_options ::= account_options PPS literal */ - 354, /* (4) account_options ::= account_options TSERIES literal */ - 354, /* (5) account_options ::= account_options STORAGE literal */ - 354, /* (6) account_options ::= account_options STREAMS literal */ - 354, /* (7) account_options ::= account_options QTIME literal */ - 354, /* (8) account_options ::= account_options DBS literal */ - 354, /* (9) account_options ::= account_options USERS literal */ - 354, /* (10) account_options ::= account_options CONNS literal */ - 354, /* (11) account_options ::= account_options STATE literal */ - 355, /* (12) alter_account_options ::= alter_account_option */ - 355, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 357, /* (14) alter_account_option ::= PASS literal */ - 357, /* (15) alter_account_option ::= PPS literal */ - 357, /* (16) alter_account_option ::= TSERIES literal */ - 357, /* (17) alter_account_option ::= STORAGE literal */ - 357, /* (18) alter_account_option ::= STREAMS literal */ - 357, /* (19) alter_account_option ::= QTIME literal */ - 357, /* (20) alter_account_option ::= DBS literal */ - 357, /* (21) alter_account_option ::= USERS literal */ - 357, /* (22) alter_account_option ::= CONNS literal */ - 357, /* (23) alter_account_option ::= STATE literal */ - 358, /* (24) ip_range_list ::= NK_STRING */ - 358, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 359, /* (26) white_list ::= HOST ip_range_list */ - 360, /* (27) white_list_opt ::= */ - 360, /* (28) white_list_opt ::= white_list */ - 353, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ - 353, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ - 353, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 353, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 353, /* (33) cmd ::= ALTER USER user_name ADD white_list */ - 353, /* (34) cmd ::= ALTER USER user_name DROP white_list */ - 353, /* (35) cmd ::= DROP USER user_name */ - 362, /* (36) sysinfo_opt ::= */ - 362, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 353, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - 353, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - 363, /* (40) privileges ::= ALL */ - 363, /* (41) privileges ::= priv_type_list */ - 363, /* (42) privileges ::= SUBSCRIBE */ - 366, /* (43) priv_type_list ::= priv_type */ - 366, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 367, /* (45) priv_type ::= READ */ - 367, /* (46) priv_type ::= WRITE */ - 367, /* (47) priv_type ::= ALTER */ - 364, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 364, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ - 364, /* (50) priv_level ::= db_name NK_DOT table_name */ - 364, /* (51) priv_level ::= topic_name */ - 365, /* (52) with_opt ::= */ - 365, /* (53) with_opt ::= WITH search_condition */ - 353, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ - 353, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 353, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 353, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 353, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 353, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 353, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 353, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 353, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ - 353, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 353, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ - 372, /* (65) dnode_endpoint ::= NK_STRING */ - 372, /* (66) dnode_endpoint ::= NK_ID */ - 372, /* (67) dnode_endpoint ::= NK_IPTOKEN */ - 373, /* (68) force_opt ::= */ - 373, /* (69) force_opt ::= FORCE */ - 374, /* (70) unsafe_opt ::= UNSAFE */ - 353, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ - 353, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - 353, /* (73) cmd ::= ALTER LOCAL NK_STRING */ - 353, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 353, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 353, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 353, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 353, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 353, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 353, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 353, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 353, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 353, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 353, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 353, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 353, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 353, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ - 353, /* (88) cmd ::= USE db_name */ - 353, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ - 353, /* (90) cmd ::= FLUSH DATABASE db_name */ - 353, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ - 353, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 375, /* (93) not_exists_opt ::= IF NOT EXISTS */ - 375, /* (94) not_exists_opt ::= */ - 377, /* (95) exists_opt ::= IF EXISTS */ - 377, /* (96) exists_opt ::= */ - 376, /* (97) db_options ::= */ - 376, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ - 376, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ - 376, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ - 376, /* (101) db_options ::= db_options COMP NK_INTEGER */ - 376, /* (102) db_options ::= db_options DURATION NK_INTEGER */ - 376, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ - 376, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ - 376, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ - 376, /* (106) db_options ::= db_options KEEP integer_list */ - 376, /* (107) db_options ::= db_options KEEP variable_list */ - 376, /* (108) db_options ::= db_options PAGES NK_INTEGER */ - 376, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ - 376, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 376, /* (111) db_options ::= db_options PRECISION NK_STRING */ - 376, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ - 376, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ - 376, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 376, /* (115) db_options ::= db_options RETENTIONS retention_list */ - 376, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 376, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 376, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 376, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 376, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 376, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 376, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 376, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 376, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 376, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 376, /* (126) db_options ::= db_options TABLE_PREFIX signed */ - 376, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ - 376, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 378, /* (129) alter_db_options ::= alter_db_option */ - 378, /* (130) alter_db_options ::= alter_db_options alter_db_option */ - 386, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ - 386, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ - 386, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ - 386, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 386, /* (135) alter_db_option ::= KEEP integer_list */ - 386, /* (136) alter_db_option ::= KEEP variable_list */ - 386, /* (137) alter_db_option ::= PAGES NK_INTEGER */ - 386, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ - 386, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 386, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 386, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ - 386, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 386, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 386, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 386, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 386, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 382, /* (147) integer_list ::= NK_INTEGER */ - 382, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 383, /* (149) variable_list ::= NK_VARIABLE */ - 383, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 384, /* (151) retention_list ::= retention */ - 384, /* (152) retention_list ::= retention_list NK_COMMA retention */ - 387, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 387, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 379, /* (155) speed_opt ::= */ - 379, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ - 380, /* (157) start_opt ::= */ - 380, /* (158) start_opt ::= START WITH NK_INTEGER */ - 380, /* (159) start_opt ::= START WITH NK_STRING */ - 380, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 381, /* (161) end_opt ::= */ - 381, /* (162) end_opt ::= END WITH NK_INTEGER */ - 381, /* (163) end_opt ::= END WITH NK_STRING */ - 381, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 353, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 353, /* (166) cmd ::= CREATE TABLE multi_create_clause */ - 353, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 353, /* (168) cmd ::= DROP TABLE multi_drop_clause */ - 353, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ - 353, /* (170) cmd ::= ALTER TABLE alter_table_clause */ - 353, /* (171) cmd ::= ALTER STABLE alter_table_clause */ - 395, /* (172) alter_table_clause ::= full_table_name alter_table_options */ - 395, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - 395, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 395, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 395, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 395, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 395, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ - 395, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 395, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 395, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - 392, /* (182) multi_create_clause ::= create_subtable_clause */ - 392, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 400, /* (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 */ - 394, /* (185) multi_drop_clause ::= drop_table_clause */ - 394, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 403, /* (187) drop_table_clause ::= exists_opt full_table_name */ - 401, /* (188) specific_cols_opt ::= */ - 401, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 388, /* (190) full_table_name ::= table_name */ - 388, /* (191) full_table_name ::= db_name NK_DOT table_name */ - 389, /* (192) column_def_list ::= column_def */ - 389, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ - 405, /* (194) column_def ::= column_name type_name */ - 398, /* (195) type_name ::= BOOL */ - 398, /* (196) type_name ::= TINYINT */ - 398, /* (197) type_name ::= SMALLINT */ - 398, /* (198) type_name ::= INT */ - 398, /* (199) type_name ::= INTEGER */ - 398, /* (200) type_name ::= BIGINT */ - 398, /* (201) type_name ::= FLOAT */ - 398, /* (202) type_name ::= DOUBLE */ - 398, /* (203) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 398, /* (204) type_name ::= TIMESTAMP */ - 398, /* (205) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 398, /* (206) type_name ::= TINYINT UNSIGNED */ - 398, /* (207) type_name ::= SMALLINT UNSIGNED */ - 398, /* (208) type_name ::= INT UNSIGNED */ - 398, /* (209) type_name ::= BIGINT UNSIGNED */ - 398, /* (210) type_name ::= JSON */ - 398, /* (211) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 398, /* (212) type_name ::= MEDIUMBLOB */ - 398, /* (213) type_name ::= BLOB */ - 398, /* (214) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 398, /* (215) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 398, /* (216) type_name ::= DECIMAL */ - 398, /* (217) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 398, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 390, /* (219) tags_def_opt ::= */ - 390, /* (220) tags_def_opt ::= tags_def */ - 393, /* (221) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 391, /* (222) table_options ::= */ - 391, /* (223) table_options ::= table_options COMMENT NK_STRING */ - 391, /* (224) table_options ::= table_options MAX_DELAY duration_list */ - 391, /* (225) table_options ::= table_options WATERMARK duration_list */ - 391, /* (226) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 391, /* (227) table_options ::= table_options TTL NK_INTEGER */ - 391, /* (228) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 391, /* (229) table_options ::= table_options DELETE_MARK duration_list */ - 396, /* (230) alter_table_options ::= alter_table_option */ - 396, /* (231) alter_table_options ::= alter_table_options alter_table_option */ - 408, /* (232) alter_table_option ::= COMMENT NK_STRING */ - 408, /* (233) alter_table_option ::= TTL NK_INTEGER */ - 406, /* (234) duration_list ::= duration_literal */ - 406, /* (235) duration_list ::= duration_list NK_COMMA duration_literal */ - 407, /* (236) rollup_func_list ::= rollup_func_name */ - 407, /* (237) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 410, /* (238) rollup_func_name ::= function_name */ - 410, /* (239) rollup_func_name ::= FIRST */ - 410, /* (240) rollup_func_name ::= LAST */ - 404, /* (241) col_name_list ::= col_name */ - 404, /* (242) col_name_list ::= col_name_list NK_COMMA col_name */ - 412, /* (243) col_name ::= column_name */ - 353, /* (244) cmd ::= SHOW DNODES */ - 353, /* (245) cmd ::= SHOW USERS */ - 353, /* (246) cmd ::= SHOW USER PRIVILEGES */ - 353, /* (247) cmd ::= SHOW db_kind_opt DATABASES */ - 353, /* (248) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 353, /* (249) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 353, /* (250) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 353, /* (251) cmd ::= SHOW MNODES */ - 353, /* (252) cmd ::= SHOW QNODES */ - 353, /* (253) cmd ::= SHOW FUNCTIONS */ - 353, /* (254) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 353, /* (255) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 353, /* (256) cmd ::= SHOW STREAMS */ - 353, /* (257) cmd ::= SHOW ACCOUNTS */ - 353, /* (258) cmd ::= SHOW APPS */ - 353, /* (259) cmd ::= SHOW CONNECTIONS */ - 353, /* (260) cmd ::= SHOW LICENCES */ - 353, /* (261) cmd ::= SHOW GRANTS */ - 353, /* (262) cmd ::= SHOW GRANTS FULL */ - 353, /* (263) cmd ::= SHOW GRANTS LOGS */ - 353, /* (264) cmd ::= SHOW CLUSTER MACHINES */ - 353, /* (265) cmd ::= SHOW CREATE DATABASE db_name */ - 353, /* (266) cmd ::= SHOW CREATE TABLE full_table_name */ - 353, /* (267) cmd ::= SHOW CREATE STABLE full_table_name */ - 353, /* (268) cmd ::= SHOW QUERIES */ - 353, /* (269) cmd ::= SHOW SCORES */ - 353, /* (270) cmd ::= SHOW TOPICS */ - 353, /* (271) cmd ::= SHOW VARIABLES */ - 353, /* (272) cmd ::= SHOW CLUSTER VARIABLES */ - 353, /* (273) cmd ::= SHOW LOCAL VARIABLES */ - 353, /* (274) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 353, /* (275) cmd ::= SHOW BNODES */ - 353, /* (276) cmd ::= SHOW SNODES */ - 353, /* (277) cmd ::= SHOW CLUSTER */ - 353, /* (278) cmd ::= SHOW TRANSACTIONS */ - 353, /* (279) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 353, /* (280) cmd ::= SHOW CONSUMERS */ - 353, /* (281) cmd ::= SHOW SUBSCRIPTIONS */ - 353, /* (282) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 353, /* (283) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 353, /* (284) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 353, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 353, /* (286) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 353, /* (287) cmd ::= SHOW VNODES */ - 353, /* (288) cmd ::= SHOW db_name_cond_opt ALIVE */ - 353, /* (289) cmd ::= SHOW CLUSTER ALIVE */ - 353, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 353, /* (291) cmd ::= SHOW CREATE VIEW full_table_name */ - 353, /* (292) cmd ::= SHOW COMPACTS */ - 353, /* (293) cmd ::= SHOW COMPACT NK_INTEGER */ - 414, /* (294) table_kind_db_name_cond_opt ::= */ - 414, /* (295) table_kind_db_name_cond_opt ::= table_kind */ - 414, /* (296) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 414, /* (297) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 420, /* (298) table_kind ::= NORMAL */ - 420, /* (299) table_kind ::= CHILD */ - 416, /* (300) db_name_cond_opt ::= */ - 416, /* (301) db_name_cond_opt ::= db_name NK_DOT */ - 415, /* (302) like_pattern_opt ::= */ - 415, /* (303) like_pattern_opt ::= LIKE NK_STRING */ - 417, /* (304) table_name_cond ::= table_name */ - 418, /* (305) from_db_opt ::= */ - 418, /* (306) from_db_opt ::= FROM db_name */ - 419, /* (307) tag_list_opt ::= */ - 419, /* (308) tag_list_opt ::= tag_item */ - 419, /* (309) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 421, /* (310) tag_item ::= TBNAME */ - 421, /* (311) tag_item ::= QTAGS */ - 421, /* (312) tag_item ::= column_name */ - 421, /* (313) tag_item ::= column_name column_alias */ - 421, /* (314) tag_item ::= column_name AS column_alias */ - 413, /* (315) db_kind_opt ::= */ - 413, /* (316) db_kind_opt ::= USER */ - 413, /* (317) db_kind_opt ::= SYSTEM */ - 353, /* (318) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 353, /* (319) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 353, /* (320) cmd ::= DROP INDEX exists_opt full_index_name */ - 424, /* (321) full_index_name ::= index_name */ - 424, /* (322) full_index_name ::= db_name NK_DOT index_name */ - 423, /* (323) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 423, /* (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 */ - 426, /* (325) func_list ::= func */ - 426, /* (326) func_list ::= func_list NK_COMMA func */ - 429, /* (327) func ::= sma_func_name NK_LP expression_list NK_RP */ - 430, /* (328) sma_func_name ::= function_name */ - 430, /* (329) sma_func_name ::= COUNT */ - 430, /* (330) sma_func_name ::= FIRST */ - 430, /* (331) sma_func_name ::= LAST */ - 430, /* (332) sma_func_name ::= LAST_ROW */ - 428, /* (333) sma_stream_opt ::= */ - 428, /* (334) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 428, /* (335) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 428, /* (336) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 432, /* (337) with_meta ::= AS */ - 432, /* (338) with_meta ::= WITH META AS */ - 432, /* (339) with_meta ::= ONLY META AS */ - 353, /* (340) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 353, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 353, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 353, /* (343) cmd ::= DROP TOPIC exists_opt topic_name */ - 353, /* (344) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 353, /* (345) cmd ::= DESC full_table_name */ - 353, /* (346) cmd ::= DESCRIBE full_table_name */ - 353, /* (347) cmd ::= RESET QUERY CACHE */ - 353, /* (348) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 353, /* (349) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 436, /* (350) analyze_opt ::= */ - 436, /* (351) analyze_opt ::= ANALYZE */ - 437, /* (352) explain_options ::= */ - 437, /* (353) explain_options ::= explain_options VERBOSE NK_BOOL */ - 437, /* (354) explain_options ::= explain_options RATIO NK_FLOAT */ - 353, /* (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 */ - 353, /* (356) cmd ::= DROP FUNCTION exists_opt function_name */ - 440, /* (357) agg_func_opt ::= */ - 440, /* (358) agg_func_opt ::= AGGREGATE */ - 441, /* (359) bufsize_opt ::= */ - 441, /* (360) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 442, /* (361) language_opt ::= */ - 442, /* (362) language_opt ::= LANGUAGE NK_STRING */ - 439, /* (363) or_replace_opt ::= */ - 439, /* (364) or_replace_opt ::= OR REPLACE */ - 353, /* (365) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 353, /* (366) cmd ::= DROP VIEW exists_opt full_view_name */ - 443, /* (367) full_view_name ::= view_name */ - 443, /* (368) full_view_name ::= db_name NK_DOT view_name */ - 353, /* (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 */ - 353, /* (370) cmd ::= DROP STREAM exists_opt stream_name */ - 353, /* (371) cmd ::= PAUSE STREAM exists_opt stream_name */ - 353, /* (372) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 447, /* (373) col_list_opt ::= */ - 447, /* (374) col_list_opt ::= NK_LP col_name_list NK_RP */ - 448, /* (375) tag_def_or_ref_opt ::= */ - 448, /* (376) tag_def_or_ref_opt ::= tags_def */ - 448, /* (377) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 446, /* (378) stream_options ::= */ - 446, /* (379) stream_options ::= stream_options TRIGGER AT_ONCE */ - 446, /* (380) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 446, /* (381) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 446, /* (382) stream_options ::= stream_options WATERMARK duration_literal */ - 446, /* (383) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 446, /* (384) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 446, /* (385) stream_options ::= stream_options DELETE_MARK duration_literal */ - 446, /* (386) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 449, /* (387) subtable_opt ::= */ - 449, /* (388) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 450, /* (389) ignore_opt ::= */ - 450, /* (390) ignore_opt ::= IGNORE UNTREATED */ - 353, /* (391) cmd ::= KILL CONNECTION NK_INTEGER */ - 353, /* (392) cmd ::= KILL QUERY NK_STRING */ - 353, /* (393) cmd ::= KILL TRANSACTION NK_INTEGER */ - 353, /* (394) cmd ::= KILL COMPACT NK_INTEGER */ - 353, /* (395) cmd ::= BALANCE VGROUP */ - 353, /* (396) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 353, /* (397) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 353, /* (398) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 353, /* (399) cmd ::= SPLIT VGROUP NK_INTEGER */ - 452, /* (400) on_vgroup_id ::= */ - 452, /* (401) on_vgroup_id ::= ON NK_INTEGER */ - 453, /* (402) dnode_list ::= DNODE NK_INTEGER */ - 453, /* (403) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 353, /* (404) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 353, /* (405) cmd ::= query_or_subquery */ - 353, /* (406) cmd ::= insert_query */ - 438, /* (407) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 438, /* (408) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 399, /* (409) tags_literal ::= NK_INTEGER */ - 399, /* (410) tags_literal ::= NK_PLUS NK_INTEGER */ - 399, /* (411) tags_literal ::= NK_MINUS NK_INTEGER */ - 399, /* (412) tags_literal ::= NK_FLOAT */ - 399, /* (413) tags_literal ::= NK_PLUS NK_FLOAT */ - 399, /* (414) tags_literal ::= NK_MINUS NK_FLOAT */ - 399, /* (415) tags_literal ::= NK_BIN */ - 399, /* (416) tags_literal ::= NK_PLUS NK_BIN */ - 399, /* (417) tags_literal ::= NK_MINUS NK_BIN */ - 399, /* (418) tags_literal ::= NK_HEX */ - 399, /* (419) tags_literal ::= NK_PLUS NK_HEX */ - 399, /* (420) tags_literal ::= NK_MINUS NK_HEX */ - 399, /* (421) tags_literal ::= NK_STRING */ - 399, /* (422) tags_literal ::= NK_BOOL */ - 399, /* (423) tags_literal ::= NULL */ - 399, /* (424) tags_literal ::= literal_func */ - 399, /* (425) tags_literal ::= literal_func NK_PLUS duration_literal */ - 399, /* (426) tags_literal ::= literal_func NK_MINUS duration_literal */ - 402, /* (427) tags_literal_list ::= tags_literal */ - 402, /* (428) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - 356, /* (429) literal ::= NK_INTEGER */ - 356, /* (430) literal ::= NK_FLOAT */ - 356, /* (431) literal ::= NK_STRING */ - 356, /* (432) literal ::= NK_BOOL */ - 356, /* (433) literal ::= TIMESTAMP NK_STRING */ - 356, /* (434) literal ::= duration_literal */ - 356, /* (435) literal ::= NULL */ - 356, /* (436) literal ::= NK_QUESTION */ - 409, /* (437) duration_literal ::= NK_VARIABLE */ - 385, /* (438) signed ::= NK_INTEGER */ - 385, /* (439) signed ::= NK_PLUS NK_INTEGER */ - 385, /* (440) signed ::= NK_MINUS NK_INTEGER */ - 385, /* (441) signed ::= NK_FLOAT */ - 385, /* (442) signed ::= NK_PLUS NK_FLOAT */ - 385, /* (443) signed ::= NK_MINUS NK_FLOAT */ - 455, /* (444) signed_literal ::= signed */ - 455, /* (445) signed_literal ::= NK_STRING */ - 455, /* (446) signed_literal ::= NK_BOOL */ - 455, /* (447) signed_literal ::= TIMESTAMP NK_STRING */ - 455, /* (448) signed_literal ::= duration_literal */ - 455, /* (449) signed_literal ::= NULL */ - 455, /* (450) signed_literal ::= literal_func */ - 455, /* (451) signed_literal ::= NK_QUESTION */ - 456, /* (452) literal_list ::= signed_literal */ - 456, /* (453) literal_list ::= literal_list NK_COMMA signed_literal */ - 368, /* (454) db_name ::= NK_ID */ - 369, /* (455) table_name ::= NK_ID */ - 397, /* (456) column_name ::= NK_ID */ - 411, /* (457) function_name ::= NK_ID */ - 444, /* (458) view_name ::= NK_ID */ - 457, /* (459) table_alias ::= NK_ID */ - 422, /* (460) column_alias ::= NK_ID */ - 422, /* (461) column_alias ::= NK_ALIAS */ - 361, /* (462) user_name ::= NK_ID */ - 370, /* (463) topic_name ::= NK_ID */ - 445, /* (464) stream_name ::= NK_ID */ - 435, /* (465) cgroup_name ::= NK_ID */ - 425, /* (466) index_name ::= NK_ID */ - 458, /* (467) expr_or_subquery ::= expression */ - 451, /* (468) expression ::= literal */ - 451, /* (469) expression ::= pseudo_column */ - 451, /* (470) expression ::= column_reference */ - 451, /* (471) expression ::= function_expression */ - 451, /* (472) expression ::= case_when_expression */ - 451, /* (473) expression ::= NK_LP expression NK_RP */ - 451, /* (474) expression ::= NK_PLUS expr_or_subquery */ - 451, /* (475) expression ::= NK_MINUS expr_or_subquery */ - 451, /* (476) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 451, /* (477) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 451, /* (478) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 451, /* (479) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 451, /* (480) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 451, /* (481) expression ::= column_reference NK_ARROW NK_STRING */ - 451, /* (482) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 451, /* (483) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 431, /* (484) expression_list ::= expr_or_subquery */ - 431, /* (485) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 460, /* (486) column_reference ::= column_name */ - 460, /* (487) column_reference ::= table_name NK_DOT column_name */ - 460, /* (488) column_reference ::= NK_ALIAS */ - 460, /* (489) column_reference ::= table_name NK_DOT NK_ALIAS */ - 459, /* (490) pseudo_column ::= ROWTS */ - 459, /* (491) pseudo_column ::= TBNAME */ - 459, /* (492) pseudo_column ::= table_name NK_DOT TBNAME */ - 459, /* (493) pseudo_column ::= QSTART */ - 459, /* (494) pseudo_column ::= QEND */ - 459, /* (495) pseudo_column ::= QDURATION */ - 459, /* (496) pseudo_column ::= WSTART */ - 459, /* (497) pseudo_column ::= WEND */ - 459, /* (498) pseudo_column ::= WDURATION */ - 459, /* (499) pseudo_column ::= IROWTS */ - 459, /* (500) pseudo_column ::= ISFILLED */ - 459, /* (501) pseudo_column ::= QTAGS */ - 461, /* (502) function_expression ::= function_name NK_LP expression_list NK_RP */ - 461, /* (503) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 461, /* (504) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 461, /* (505) function_expression ::= literal_func */ - 454, /* (506) literal_func ::= noarg_func NK_LP NK_RP */ - 454, /* (507) literal_func ::= NOW */ - 454, /* (508) literal_func ::= TODAY */ - 465, /* (509) noarg_func ::= NOW */ - 465, /* (510) noarg_func ::= TODAY */ - 465, /* (511) noarg_func ::= TIMEZONE */ - 465, /* (512) noarg_func ::= DATABASE */ - 465, /* (513) noarg_func ::= CLIENT_VERSION */ - 465, /* (514) noarg_func ::= SERVER_VERSION */ - 465, /* (515) noarg_func ::= SERVER_STATUS */ - 465, /* (516) noarg_func ::= CURRENT_USER */ - 465, /* (517) noarg_func ::= USER */ - 463, /* (518) star_func ::= COUNT */ - 463, /* (519) star_func ::= FIRST */ - 463, /* (520) star_func ::= LAST */ - 463, /* (521) star_func ::= LAST_ROW */ - 464, /* (522) star_func_para_list ::= NK_STAR */ - 464, /* (523) star_func_para_list ::= other_para_list */ - 466, /* (524) other_para_list ::= star_func_para */ - 466, /* (525) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 467, /* (526) star_func_para ::= expr_or_subquery */ - 467, /* (527) star_func_para ::= table_name NK_DOT NK_STAR */ - 462, /* (528) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 462, /* (529) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 468, /* (530) when_then_list ::= when_then_expr */ - 468, /* (531) when_then_list ::= when_then_list when_then_expr */ - 471, /* (532) when_then_expr ::= WHEN common_expression THEN common_expression */ - 469, /* (533) case_when_else_opt ::= */ - 469, /* (534) case_when_else_opt ::= ELSE common_expression */ - 472, /* (535) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 472, /* (536) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 472, /* (537) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 472, /* (538) predicate ::= expr_or_subquery IS NULL */ - 472, /* (539) predicate ::= expr_or_subquery IS NOT NULL */ - 472, /* (540) predicate ::= expr_or_subquery in_op in_predicate_value */ - 473, /* (541) compare_op ::= NK_LT */ - 473, /* (542) compare_op ::= NK_GT */ - 473, /* (543) compare_op ::= NK_LE */ - 473, /* (544) compare_op ::= NK_GE */ - 473, /* (545) compare_op ::= NK_NE */ - 473, /* (546) compare_op ::= NK_EQ */ - 473, /* (547) compare_op ::= LIKE */ - 473, /* (548) compare_op ::= NOT LIKE */ - 473, /* (549) compare_op ::= MATCH */ - 473, /* (550) compare_op ::= NMATCH */ - 473, /* (551) compare_op ::= CONTAINS */ - 474, /* (552) in_op ::= IN */ - 474, /* (553) in_op ::= NOT IN */ - 475, /* (554) in_predicate_value ::= NK_LP literal_list NK_RP */ - 476, /* (555) boolean_value_expression ::= boolean_primary */ - 476, /* (556) boolean_value_expression ::= NOT boolean_primary */ - 476, /* (557) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 476, /* (558) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 477, /* (559) boolean_primary ::= predicate */ - 477, /* (560) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 470, /* (561) common_expression ::= expr_or_subquery */ - 470, /* (562) common_expression ::= boolean_value_expression */ - 478, /* (563) from_clause_opt ::= */ - 478, /* (564) from_clause_opt ::= FROM table_reference_list */ - 479, /* (565) table_reference_list ::= table_reference */ - 479, /* (566) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 480, /* (567) table_reference ::= table_primary */ - 480, /* (568) table_reference ::= joined_table */ - 481, /* (569) table_primary ::= table_name alias_opt */ - 481, /* (570) table_primary ::= db_name NK_DOT table_name alias_opt */ - 481, /* (571) table_primary ::= subquery alias_opt */ - 481, /* (572) table_primary ::= parenthesized_joined_table */ - 483, /* (573) alias_opt ::= */ - 483, /* (574) alias_opt ::= table_alias */ - 483, /* (575) alias_opt ::= AS table_alias */ - 485, /* (576) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 485, /* (577) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 482, /* (578) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 486, /* (579) join_type ::= */ - 486, /* (580) join_type ::= INNER */ - 487, /* (581) 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 */ - 488, /* (582) hint_list ::= */ - 488, /* (583) hint_list ::= NK_HINT */ - 490, /* (584) tag_mode_opt ::= */ - 490, /* (585) tag_mode_opt ::= TAGS */ - 489, /* (586) set_quantifier_opt ::= */ - 489, /* (587) set_quantifier_opt ::= DISTINCT */ - 489, /* (588) set_quantifier_opt ::= ALL */ - 491, /* (589) select_list ::= select_item */ - 491, /* (590) select_list ::= select_list NK_COMMA select_item */ - 499, /* (591) select_item ::= NK_STAR */ - 499, /* (592) select_item ::= common_expression */ - 499, /* (593) select_item ::= common_expression column_alias */ - 499, /* (594) select_item ::= common_expression AS column_alias */ - 499, /* (595) select_item ::= table_name NK_DOT NK_STAR */ - 434, /* (596) where_clause_opt ::= */ - 434, /* (597) where_clause_opt ::= WHERE search_condition */ - 492, /* (598) partition_by_clause_opt ::= */ - 492, /* (599) partition_by_clause_opt ::= PARTITION BY partition_list */ - 500, /* (600) partition_list ::= partition_item */ - 500, /* (601) partition_list ::= partition_list NK_COMMA partition_item */ - 501, /* (602) partition_item ::= expr_or_subquery */ - 501, /* (603) partition_item ::= expr_or_subquery column_alias */ - 501, /* (604) partition_item ::= expr_or_subquery AS column_alias */ - 496, /* (605) twindow_clause_opt ::= */ - 496, /* (606) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 496, /* (607) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 496, /* (608) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 496, /* (609) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 496, /* (610) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 496, /* (611) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - 496, /* (612) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 427, /* (613) sliding_opt ::= */ - 427, /* (614) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 502, /* (615) interval_sliding_duration_literal ::= NK_VARIABLE */ - 502, /* (616) interval_sliding_duration_literal ::= NK_STRING */ - 502, /* (617) interval_sliding_duration_literal ::= NK_INTEGER */ - 495, /* (618) fill_opt ::= */ - 495, /* (619) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 495, /* (620) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 495, /* (621) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 503, /* (622) fill_mode ::= NONE */ - 503, /* (623) fill_mode ::= PREV */ - 503, /* (624) fill_mode ::= NULL */ - 503, /* (625) fill_mode ::= NULL_F */ - 503, /* (626) fill_mode ::= LINEAR */ - 503, /* (627) fill_mode ::= NEXT */ - 497, /* (628) group_by_clause_opt ::= */ - 497, /* (629) group_by_clause_opt ::= GROUP BY group_by_list */ - 504, /* (630) group_by_list ::= expr_or_subquery */ - 504, /* (631) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 498, /* (632) having_clause_opt ::= */ - 498, /* (633) having_clause_opt ::= HAVING search_condition */ - 493, /* (634) range_opt ::= */ - 493, /* (635) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 493, /* (636) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 494, /* (637) every_opt ::= */ - 494, /* (638) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 505, /* (639) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 506, /* (640) query_simple ::= query_specification */ - 506, /* (641) query_simple ::= union_query_expression */ - 510, /* (642) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 510, /* (643) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 511, /* (644) query_simple_or_subquery ::= query_simple */ - 511, /* (645) query_simple_or_subquery ::= subquery */ - 433, /* (646) query_or_subquery ::= query_expression */ - 433, /* (647) query_or_subquery ::= subquery */ - 507, /* (648) order_by_clause_opt ::= */ - 507, /* (649) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 508, /* (650) slimit_clause_opt ::= */ - 508, /* (651) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 508, /* (652) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 508, /* (653) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 509, /* (654) limit_clause_opt ::= */ - 509, /* (655) limit_clause_opt ::= LIMIT NK_INTEGER */ - 509, /* (656) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 509, /* (657) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 484, /* (658) subquery ::= NK_LP query_expression NK_RP */ - 484, /* (659) subquery ::= NK_LP subquery NK_RP */ - 371, /* (660) search_condition ::= common_expression */ - 512, /* (661) sort_specification_list ::= sort_specification */ - 512, /* (662) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 513, /* (663) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 514, /* (664) ordering_specification_opt ::= */ - 514, /* (665) ordering_specification_opt ::= ASC */ - 514, /* (666) ordering_specification_opt ::= DESC */ - 515, /* (667) null_ordering_opt ::= */ - 515, /* (668) null_ordering_opt ::= NULLS FIRST */ - 515, /* (669) null_ordering_opt ::= NULLS LAST */ + 354, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 354, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 355, /* (2) account_options ::= */ + 355, /* (3) account_options ::= account_options PPS literal */ + 355, /* (4) account_options ::= account_options TSERIES literal */ + 355, /* (5) account_options ::= account_options STORAGE literal */ + 355, /* (6) account_options ::= account_options STREAMS literal */ + 355, /* (7) account_options ::= account_options QTIME literal */ + 355, /* (8) account_options ::= account_options DBS literal */ + 355, /* (9) account_options ::= account_options USERS literal */ + 355, /* (10) account_options ::= account_options CONNS literal */ + 355, /* (11) account_options ::= account_options STATE literal */ + 356, /* (12) alter_account_options ::= alter_account_option */ + 356, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 358, /* (14) alter_account_option ::= PASS literal */ + 358, /* (15) alter_account_option ::= PPS literal */ + 358, /* (16) alter_account_option ::= TSERIES literal */ + 358, /* (17) alter_account_option ::= STORAGE literal */ + 358, /* (18) alter_account_option ::= STREAMS literal */ + 358, /* (19) alter_account_option ::= QTIME literal */ + 358, /* (20) alter_account_option ::= DBS literal */ + 358, /* (21) alter_account_option ::= USERS literal */ + 358, /* (22) alter_account_option ::= CONNS literal */ + 358, /* (23) alter_account_option ::= STATE literal */ + 359, /* (24) ip_range_list ::= NK_STRING */ + 359, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + 360, /* (26) white_list ::= HOST ip_range_list */ + 361, /* (27) white_list_opt ::= */ + 361, /* (28) white_list_opt ::= white_list */ + 354, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ + 354, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ + 354, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 354, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 354, /* (33) cmd ::= ALTER USER user_name ADD white_list */ + 354, /* (34) cmd ::= ALTER USER user_name DROP white_list */ + 354, /* (35) cmd ::= DROP USER user_name */ + 363, /* (36) sysinfo_opt ::= */ + 363, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 354, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + 354, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + 364, /* (40) privileges ::= ALL */ + 364, /* (41) privileges ::= priv_type_list */ + 364, /* (42) privileges ::= SUBSCRIBE */ + 367, /* (43) priv_type_list ::= priv_type */ + 367, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 368, /* (45) priv_type ::= READ */ + 368, /* (46) priv_type ::= WRITE */ + 368, /* (47) priv_type ::= ALTER */ + 365, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 365, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ + 365, /* (50) priv_level ::= db_name NK_DOT table_name */ + 365, /* (51) priv_level ::= topic_name */ + 366, /* (52) with_opt ::= */ + 366, /* (53) with_opt ::= WITH search_condition */ + 354, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ + 354, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 354, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 354, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 354, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 354, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 354, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 354, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 354, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ + 354, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 354, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ + 373, /* (65) dnode_endpoint ::= NK_STRING */ + 373, /* (66) dnode_endpoint ::= NK_ID */ + 373, /* (67) dnode_endpoint ::= NK_IPTOKEN */ + 374, /* (68) force_opt ::= */ + 374, /* (69) force_opt ::= FORCE */ + 375, /* (70) unsafe_opt ::= UNSAFE */ + 354, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ + 354, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + 354, /* (73) cmd ::= ALTER LOCAL NK_STRING */ + 354, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 354, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 354, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 354, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 354, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 354, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 354, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 354, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 354, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 354, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 354, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 354, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 354, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 354, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ + 354, /* (88) cmd ::= USE db_name */ + 354, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ + 354, /* (90) cmd ::= FLUSH DATABASE db_name */ + 354, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ + 354, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 376, /* (93) not_exists_opt ::= IF NOT EXISTS */ + 376, /* (94) not_exists_opt ::= */ + 378, /* (95) exists_opt ::= IF EXISTS */ + 378, /* (96) exists_opt ::= */ + 377, /* (97) db_options ::= */ + 377, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ + 377, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ + 377, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ + 377, /* (101) db_options ::= db_options COMP NK_INTEGER */ + 377, /* (102) db_options ::= db_options DURATION NK_INTEGER */ + 377, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ + 377, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ + 377, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ + 377, /* (106) db_options ::= db_options KEEP integer_list */ + 377, /* (107) db_options ::= db_options KEEP variable_list */ + 377, /* (108) db_options ::= db_options PAGES NK_INTEGER */ + 377, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ + 377, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 377, /* (111) db_options ::= db_options PRECISION NK_STRING */ + 377, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ + 377, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ + 377, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 377, /* (115) db_options ::= db_options RETENTIONS retention_list */ + 377, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 377, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 377, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 377, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 377, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 377, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 377, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 377, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 377, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 377, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 377, /* (126) db_options ::= db_options TABLE_PREFIX signed */ + 377, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ + 377, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + 379, /* (129) alter_db_options ::= alter_db_option */ + 379, /* (130) alter_db_options ::= alter_db_options alter_db_option */ + 387, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ + 387, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ + 387, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ + 387, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 387, /* (135) alter_db_option ::= KEEP integer_list */ + 387, /* (136) alter_db_option ::= KEEP variable_list */ + 387, /* (137) alter_db_option ::= PAGES NK_INTEGER */ + 387, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ + 387, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 387, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 387, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ + 387, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 387, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 387, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 387, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 387, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + 383, /* (147) integer_list ::= NK_INTEGER */ + 383, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 384, /* (149) variable_list ::= NK_VARIABLE */ + 384, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 385, /* (151) retention_list ::= retention */ + 385, /* (152) retention_list ::= retention_list NK_COMMA retention */ + 388, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 388, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 380, /* (155) speed_opt ::= */ + 380, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ + 381, /* (157) start_opt ::= */ + 381, /* (158) start_opt ::= START WITH NK_INTEGER */ + 381, /* (159) start_opt ::= START WITH NK_STRING */ + 381, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 382, /* (161) end_opt ::= */ + 382, /* (162) end_opt ::= END WITH NK_INTEGER */ + 382, /* (163) end_opt ::= END WITH NK_STRING */ + 382, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 354, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 354, /* (166) cmd ::= CREATE TABLE multi_create_clause */ + 354, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 354, /* (168) cmd ::= DROP TABLE multi_drop_clause */ + 354, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ + 354, /* (170) cmd ::= ALTER TABLE alter_table_clause */ + 354, /* (171) cmd ::= ALTER STABLE alter_table_clause */ + 396, /* (172) alter_table_clause ::= full_table_name alter_table_options */ + 396, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + 396, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 396, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 396, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 396, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 396, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ + 396, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 396, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 396, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + 393, /* (182) multi_create_clause ::= create_subtable_clause */ + 393, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 401, /* (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 */ + 395, /* (185) multi_drop_clause ::= drop_table_clause */ + 395, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 404, /* (187) drop_table_clause ::= exists_opt full_table_name */ + 402, /* (188) specific_cols_opt ::= */ + 402, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 389, /* (190) full_table_name ::= table_name */ + 389, /* (191) full_table_name ::= db_name NK_DOT table_name */ + 390, /* (192) column_def_list ::= column_def */ + 390, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ + 406, /* (194) column_def ::= column_name type_name */ + 399, /* (195) type_name ::= BOOL */ + 399, /* (196) type_name ::= TINYINT */ + 399, /* (197) type_name ::= SMALLINT */ + 399, /* (198) type_name ::= INT */ + 399, /* (199) type_name ::= INTEGER */ + 399, /* (200) type_name ::= BIGINT */ + 399, /* (201) type_name ::= FLOAT */ + 399, /* (202) type_name ::= DOUBLE */ + 399, /* (203) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 399, /* (204) type_name ::= TIMESTAMP */ + 399, /* (205) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 399, /* (206) type_name ::= TINYINT UNSIGNED */ + 399, /* (207) type_name ::= SMALLINT UNSIGNED */ + 399, /* (208) type_name ::= INT UNSIGNED */ + 399, /* (209) type_name ::= BIGINT UNSIGNED */ + 399, /* (210) type_name ::= JSON */ + 399, /* (211) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 399, /* (212) type_name ::= MEDIUMBLOB */ + 399, /* (213) type_name ::= BLOB */ + 399, /* (214) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 399, /* (215) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 399, /* (216) type_name ::= DECIMAL */ + 399, /* (217) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 399, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 391, /* (219) tags_def_opt ::= */ + 391, /* (220) tags_def_opt ::= tags_def */ + 394, /* (221) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 392, /* (222) table_options ::= */ + 392, /* (223) table_options ::= table_options COMMENT NK_STRING */ + 392, /* (224) table_options ::= table_options MAX_DELAY duration_list */ + 392, /* (225) table_options ::= table_options WATERMARK duration_list */ + 392, /* (226) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 392, /* (227) table_options ::= table_options TTL NK_INTEGER */ + 392, /* (228) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 392, /* (229) table_options ::= table_options DELETE_MARK duration_list */ + 397, /* (230) alter_table_options ::= alter_table_option */ + 397, /* (231) alter_table_options ::= alter_table_options alter_table_option */ + 409, /* (232) alter_table_option ::= COMMENT NK_STRING */ + 409, /* (233) alter_table_option ::= TTL NK_INTEGER */ + 407, /* (234) duration_list ::= duration_literal */ + 407, /* (235) duration_list ::= duration_list NK_COMMA duration_literal */ + 408, /* (236) rollup_func_list ::= rollup_func_name */ + 408, /* (237) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 411, /* (238) rollup_func_name ::= function_name */ + 411, /* (239) rollup_func_name ::= FIRST */ + 411, /* (240) rollup_func_name ::= LAST */ + 405, /* (241) col_name_list ::= col_name */ + 405, /* (242) col_name_list ::= col_name_list NK_COMMA col_name */ + 413, /* (243) col_name ::= column_name */ + 354, /* (244) cmd ::= SHOW DNODES */ + 354, /* (245) cmd ::= SHOW USERS */ + 354, /* (246) cmd ::= SHOW USER PRIVILEGES */ + 354, /* (247) cmd ::= SHOW db_kind_opt DATABASES */ + 354, /* (248) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 354, /* (249) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 354, /* (250) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 354, /* (251) cmd ::= SHOW MNODES */ + 354, /* (252) cmd ::= SHOW QNODES */ + 354, /* (253) cmd ::= SHOW ARBGROUPS */ + 354, /* (254) cmd ::= SHOW FUNCTIONS */ + 354, /* (255) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 354, /* (256) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 354, /* (257) cmd ::= SHOW STREAMS */ + 354, /* (258) cmd ::= SHOW ACCOUNTS */ + 354, /* (259) cmd ::= SHOW APPS */ + 354, /* (260) cmd ::= SHOW CONNECTIONS */ + 354, /* (261) cmd ::= SHOW LICENCES */ + 354, /* (262) cmd ::= SHOW GRANTS */ + 354, /* (263) cmd ::= SHOW GRANTS FULL */ + 354, /* (264) cmd ::= SHOW GRANTS LOGS */ + 354, /* (265) cmd ::= SHOW CLUSTER MACHINES */ + 354, /* (266) cmd ::= SHOW CREATE DATABASE db_name */ + 354, /* (267) cmd ::= SHOW CREATE TABLE full_table_name */ + 354, /* (268) cmd ::= SHOW CREATE STABLE full_table_name */ + 354, /* (269) cmd ::= SHOW QUERIES */ + 354, /* (270) cmd ::= SHOW SCORES */ + 354, /* (271) cmd ::= SHOW TOPICS */ + 354, /* (272) cmd ::= SHOW VARIABLES */ + 354, /* (273) cmd ::= SHOW CLUSTER VARIABLES */ + 354, /* (274) cmd ::= SHOW LOCAL VARIABLES */ + 354, /* (275) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 354, /* (276) cmd ::= SHOW BNODES */ + 354, /* (277) cmd ::= SHOW SNODES */ + 354, /* (278) cmd ::= SHOW CLUSTER */ + 354, /* (279) cmd ::= SHOW TRANSACTIONS */ + 354, /* (280) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 354, /* (281) cmd ::= SHOW CONSUMERS */ + 354, /* (282) cmd ::= SHOW SUBSCRIPTIONS */ + 354, /* (283) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 354, /* (284) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 354, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 354, /* (286) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 354, /* (287) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 354, /* (288) cmd ::= SHOW VNODES */ + 354, /* (289) cmd ::= SHOW db_name_cond_opt ALIVE */ + 354, /* (290) cmd ::= SHOW CLUSTER ALIVE */ + 354, /* (291) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + 354, /* (292) cmd ::= SHOW CREATE VIEW full_table_name */ + 354, /* (293) cmd ::= SHOW COMPACTS */ + 354, /* (294) cmd ::= SHOW COMPACT NK_INTEGER */ + 415, /* (295) table_kind_db_name_cond_opt ::= */ + 415, /* (296) table_kind_db_name_cond_opt ::= table_kind */ + 415, /* (297) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 415, /* (298) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 421, /* (299) table_kind ::= NORMAL */ + 421, /* (300) table_kind ::= CHILD */ + 417, /* (301) db_name_cond_opt ::= */ + 417, /* (302) db_name_cond_opt ::= db_name NK_DOT */ + 416, /* (303) like_pattern_opt ::= */ + 416, /* (304) like_pattern_opt ::= LIKE NK_STRING */ + 418, /* (305) table_name_cond ::= table_name */ + 419, /* (306) from_db_opt ::= */ + 419, /* (307) from_db_opt ::= FROM db_name */ + 420, /* (308) tag_list_opt ::= */ + 420, /* (309) tag_list_opt ::= tag_item */ + 420, /* (310) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 422, /* (311) tag_item ::= TBNAME */ + 422, /* (312) tag_item ::= QTAGS */ + 422, /* (313) tag_item ::= column_name */ + 422, /* (314) tag_item ::= column_name column_alias */ + 422, /* (315) tag_item ::= column_name AS column_alias */ + 414, /* (316) db_kind_opt ::= */ + 414, /* (317) db_kind_opt ::= USER */ + 414, /* (318) db_kind_opt ::= SYSTEM */ + 354, /* (319) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 354, /* (320) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 354, /* (321) cmd ::= DROP INDEX exists_opt full_index_name */ + 425, /* (322) full_index_name ::= index_name */ + 425, /* (323) full_index_name ::= db_name NK_DOT index_name */ + 424, /* (324) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 424, /* (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 */ + 427, /* (326) func_list ::= func */ + 427, /* (327) func_list ::= func_list NK_COMMA func */ + 430, /* (328) func ::= sma_func_name NK_LP expression_list NK_RP */ + 431, /* (329) sma_func_name ::= function_name */ + 431, /* (330) sma_func_name ::= COUNT */ + 431, /* (331) sma_func_name ::= FIRST */ + 431, /* (332) sma_func_name ::= LAST */ + 431, /* (333) sma_func_name ::= LAST_ROW */ + 429, /* (334) sma_stream_opt ::= */ + 429, /* (335) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 429, /* (336) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 429, /* (337) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 433, /* (338) with_meta ::= AS */ + 433, /* (339) with_meta ::= WITH META AS */ + 433, /* (340) with_meta ::= ONLY META AS */ + 354, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 354, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 354, /* (343) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 354, /* (344) cmd ::= DROP TOPIC exists_opt topic_name */ + 354, /* (345) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 354, /* (346) cmd ::= DESC full_table_name */ + 354, /* (347) cmd ::= DESCRIBE full_table_name */ + 354, /* (348) cmd ::= RESET QUERY CACHE */ + 354, /* (349) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 354, /* (350) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 437, /* (351) analyze_opt ::= */ + 437, /* (352) analyze_opt ::= ANALYZE */ + 438, /* (353) explain_options ::= */ + 438, /* (354) explain_options ::= explain_options VERBOSE NK_BOOL */ + 438, /* (355) explain_options ::= explain_options RATIO NK_FLOAT */ + 354, /* (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 */ + 354, /* (357) cmd ::= DROP FUNCTION exists_opt function_name */ + 441, /* (358) agg_func_opt ::= */ + 441, /* (359) agg_func_opt ::= AGGREGATE */ + 442, /* (360) bufsize_opt ::= */ + 442, /* (361) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 443, /* (362) language_opt ::= */ + 443, /* (363) language_opt ::= LANGUAGE NK_STRING */ + 440, /* (364) or_replace_opt ::= */ + 440, /* (365) or_replace_opt ::= OR REPLACE */ + 354, /* (366) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 354, /* (367) cmd ::= DROP VIEW exists_opt full_view_name */ + 444, /* (368) full_view_name ::= view_name */ + 444, /* (369) full_view_name ::= db_name NK_DOT view_name */ + 354, /* (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 */ + 354, /* (371) cmd ::= DROP STREAM exists_opt stream_name */ + 354, /* (372) cmd ::= PAUSE STREAM exists_opt stream_name */ + 354, /* (373) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 448, /* (374) col_list_opt ::= */ + 448, /* (375) col_list_opt ::= NK_LP col_name_list NK_RP */ + 449, /* (376) tag_def_or_ref_opt ::= */ + 449, /* (377) tag_def_or_ref_opt ::= tags_def */ + 449, /* (378) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 447, /* (379) stream_options ::= */ + 447, /* (380) stream_options ::= stream_options TRIGGER AT_ONCE */ + 447, /* (381) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 447, /* (382) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 447, /* (383) stream_options ::= stream_options WATERMARK duration_literal */ + 447, /* (384) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 447, /* (385) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 447, /* (386) stream_options ::= stream_options DELETE_MARK duration_literal */ + 447, /* (387) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 450, /* (388) subtable_opt ::= */ + 450, /* (389) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 451, /* (390) ignore_opt ::= */ + 451, /* (391) ignore_opt ::= IGNORE UNTREATED */ + 354, /* (392) cmd ::= KILL CONNECTION NK_INTEGER */ + 354, /* (393) cmd ::= KILL QUERY NK_STRING */ + 354, /* (394) cmd ::= KILL TRANSACTION NK_INTEGER */ + 354, /* (395) cmd ::= KILL COMPACT NK_INTEGER */ + 354, /* (396) cmd ::= BALANCE VGROUP */ + 354, /* (397) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 354, /* (398) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 354, /* (399) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 354, /* (400) cmd ::= SPLIT VGROUP NK_INTEGER */ + 453, /* (401) on_vgroup_id ::= */ + 453, /* (402) on_vgroup_id ::= ON NK_INTEGER */ + 454, /* (403) dnode_list ::= DNODE NK_INTEGER */ + 454, /* (404) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 354, /* (405) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 354, /* (406) cmd ::= query_or_subquery */ + 354, /* (407) cmd ::= insert_query */ + 439, /* (408) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 439, /* (409) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 400, /* (410) tags_literal ::= NK_INTEGER */ + 400, /* (411) tags_literal ::= NK_PLUS NK_INTEGER */ + 400, /* (412) tags_literal ::= NK_MINUS NK_INTEGER */ + 400, /* (413) tags_literal ::= NK_FLOAT */ + 400, /* (414) tags_literal ::= NK_PLUS NK_FLOAT */ + 400, /* (415) tags_literal ::= NK_MINUS NK_FLOAT */ + 400, /* (416) tags_literal ::= NK_BIN */ + 400, /* (417) tags_literal ::= NK_PLUS NK_BIN */ + 400, /* (418) tags_literal ::= NK_MINUS NK_BIN */ + 400, /* (419) tags_literal ::= NK_HEX */ + 400, /* (420) tags_literal ::= NK_PLUS NK_HEX */ + 400, /* (421) tags_literal ::= NK_MINUS NK_HEX */ + 400, /* (422) tags_literal ::= NK_STRING */ + 400, /* (423) tags_literal ::= NK_BOOL */ + 400, /* (424) tags_literal ::= NULL */ + 400, /* (425) tags_literal ::= literal_func */ + 400, /* (426) tags_literal ::= literal_func NK_PLUS duration_literal */ + 400, /* (427) tags_literal ::= literal_func NK_MINUS duration_literal */ + 403, /* (428) tags_literal_list ::= tags_literal */ + 403, /* (429) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + 357, /* (430) literal ::= NK_INTEGER */ + 357, /* (431) literal ::= NK_FLOAT */ + 357, /* (432) literal ::= NK_STRING */ + 357, /* (433) literal ::= NK_BOOL */ + 357, /* (434) literal ::= TIMESTAMP NK_STRING */ + 357, /* (435) literal ::= duration_literal */ + 357, /* (436) literal ::= NULL */ + 357, /* (437) literal ::= NK_QUESTION */ + 410, /* (438) duration_literal ::= NK_VARIABLE */ + 386, /* (439) signed ::= NK_INTEGER */ + 386, /* (440) signed ::= NK_PLUS NK_INTEGER */ + 386, /* (441) signed ::= NK_MINUS NK_INTEGER */ + 386, /* (442) signed ::= NK_FLOAT */ + 386, /* (443) signed ::= NK_PLUS NK_FLOAT */ + 386, /* (444) signed ::= NK_MINUS NK_FLOAT */ + 456, /* (445) signed_literal ::= signed */ + 456, /* (446) signed_literal ::= NK_STRING */ + 456, /* (447) signed_literal ::= NK_BOOL */ + 456, /* (448) signed_literal ::= TIMESTAMP NK_STRING */ + 456, /* (449) signed_literal ::= duration_literal */ + 456, /* (450) signed_literal ::= NULL */ + 456, /* (451) signed_literal ::= literal_func */ + 456, /* (452) signed_literal ::= NK_QUESTION */ + 457, /* (453) literal_list ::= signed_literal */ + 457, /* (454) literal_list ::= literal_list NK_COMMA signed_literal */ + 369, /* (455) db_name ::= NK_ID */ + 370, /* (456) table_name ::= NK_ID */ + 398, /* (457) column_name ::= NK_ID */ + 412, /* (458) function_name ::= NK_ID */ + 445, /* (459) view_name ::= NK_ID */ + 458, /* (460) table_alias ::= NK_ID */ + 423, /* (461) column_alias ::= NK_ID */ + 423, /* (462) column_alias ::= NK_ALIAS */ + 362, /* (463) user_name ::= NK_ID */ + 371, /* (464) topic_name ::= NK_ID */ + 446, /* (465) stream_name ::= NK_ID */ + 436, /* (466) cgroup_name ::= NK_ID */ + 426, /* (467) index_name ::= NK_ID */ + 459, /* (468) expr_or_subquery ::= expression */ + 452, /* (469) expression ::= literal */ + 452, /* (470) expression ::= pseudo_column */ + 452, /* (471) expression ::= column_reference */ + 452, /* (472) expression ::= function_expression */ + 452, /* (473) expression ::= case_when_expression */ + 452, /* (474) expression ::= NK_LP expression NK_RP */ + 452, /* (475) expression ::= NK_PLUS expr_or_subquery */ + 452, /* (476) expression ::= NK_MINUS expr_or_subquery */ + 452, /* (477) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 452, /* (478) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 452, /* (479) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 452, /* (480) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 452, /* (481) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 452, /* (482) expression ::= column_reference NK_ARROW NK_STRING */ + 452, /* (483) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 452, /* (484) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 432, /* (485) expression_list ::= expr_or_subquery */ + 432, /* (486) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 461, /* (487) column_reference ::= column_name */ + 461, /* (488) column_reference ::= table_name NK_DOT column_name */ + 461, /* (489) column_reference ::= NK_ALIAS */ + 461, /* (490) column_reference ::= table_name NK_DOT NK_ALIAS */ + 460, /* (491) pseudo_column ::= ROWTS */ + 460, /* (492) pseudo_column ::= TBNAME */ + 460, /* (493) pseudo_column ::= table_name NK_DOT TBNAME */ + 460, /* (494) pseudo_column ::= QSTART */ + 460, /* (495) pseudo_column ::= QEND */ + 460, /* (496) pseudo_column ::= QDURATION */ + 460, /* (497) pseudo_column ::= WSTART */ + 460, /* (498) pseudo_column ::= WEND */ + 460, /* (499) pseudo_column ::= WDURATION */ + 460, /* (500) pseudo_column ::= IROWTS */ + 460, /* (501) pseudo_column ::= ISFILLED */ + 460, /* (502) pseudo_column ::= QTAGS */ + 462, /* (503) function_expression ::= function_name NK_LP expression_list NK_RP */ + 462, /* (504) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 462, /* (505) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 462, /* (506) function_expression ::= literal_func */ + 455, /* (507) literal_func ::= noarg_func NK_LP NK_RP */ + 455, /* (508) literal_func ::= NOW */ + 455, /* (509) literal_func ::= TODAY */ + 466, /* (510) noarg_func ::= NOW */ + 466, /* (511) noarg_func ::= TODAY */ + 466, /* (512) noarg_func ::= TIMEZONE */ + 466, /* (513) noarg_func ::= DATABASE */ + 466, /* (514) noarg_func ::= CLIENT_VERSION */ + 466, /* (515) noarg_func ::= SERVER_VERSION */ + 466, /* (516) noarg_func ::= SERVER_STATUS */ + 466, /* (517) noarg_func ::= CURRENT_USER */ + 466, /* (518) noarg_func ::= USER */ + 464, /* (519) star_func ::= COUNT */ + 464, /* (520) star_func ::= FIRST */ + 464, /* (521) star_func ::= LAST */ + 464, /* (522) star_func ::= LAST_ROW */ + 465, /* (523) star_func_para_list ::= NK_STAR */ + 465, /* (524) star_func_para_list ::= other_para_list */ + 467, /* (525) other_para_list ::= star_func_para */ + 467, /* (526) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 468, /* (527) star_func_para ::= expr_or_subquery */ + 468, /* (528) star_func_para ::= table_name NK_DOT NK_STAR */ + 463, /* (529) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 463, /* (530) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 469, /* (531) when_then_list ::= when_then_expr */ + 469, /* (532) when_then_list ::= when_then_list when_then_expr */ + 472, /* (533) when_then_expr ::= WHEN common_expression THEN common_expression */ + 470, /* (534) case_when_else_opt ::= */ + 470, /* (535) case_when_else_opt ::= ELSE common_expression */ + 473, /* (536) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 473, /* (537) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 473, /* (538) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 473, /* (539) predicate ::= expr_or_subquery IS NULL */ + 473, /* (540) predicate ::= expr_or_subquery IS NOT NULL */ + 473, /* (541) predicate ::= expr_or_subquery in_op in_predicate_value */ + 474, /* (542) compare_op ::= NK_LT */ + 474, /* (543) compare_op ::= NK_GT */ + 474, /* (544) compare_op ::= NK_LE */ + 474, /* (545) compare_op ::= NK_GE */ + 474, /* (546) compare_op ::= NK_NE */ + 474, /* (547) compare_op ::= NK_EQ */ + 474, /* (548) compare_op ::= LIKE */ + 474, /* (549) compare_op ::= NOT LIKE */ + 474, /* (550) compare_op ::= MATCH */ + 474, /* (551) compare_op ::= NMATCH */ + 474, /* (552) compare_op ::= CONTAINS */ + 475, /* (553) in_op ::= IN */ + 475, /* (554) in_op ::= NOT IN */ + 476, /* (555) in_predicate_value ::= NK_LP literal_list NK_RP */ + 477, /* (556) boolean_value_expression ::= boolean_primary */ + 477, /* (557) boolean_value_expression ::= NOT boolean_primary */ + 477, /* (558) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 477, /* (559) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 478, /* (560) boolean_primary ::= predicate */ + 478, /* (561) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 471, /* (562) common_expression ::= expr_or_subquery */ + 471, /* (563) common_expression ::= boolean_value_expression */ + 479, /* (564) from_clause_opt ::= */ + 479, /* (565) from_clause_opt ::= FROM table_reference_list */ + 480, /* (566) table_reference_list ::= table_reference */ + 480, /* (567) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 481, /* (568) table_reference ::= table_primary */ + 481, /* (569) table_reference ::= joined_table */ + 482, /* (570) table_primary ::= table_name alias_opt */ + 482, /* (571) table_primary ::= db_name NK_DOT table_name alias_opt */ + 482, /* (572) table_primary ::= subquery alias_opt */ + 482, /* (573) table_primary ::= parenthesized_joined_table */ + 484, /* (574) alias_opt ::= */ + 484, /* (575) alias_opt ::= table_alias */ + 484, /* (576) alias_opt ::= AS table_alias */ + 486, /* (577) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 486, /* (578) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 483, /* (579) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 487, /* (580) join_type ::= */ + 487, /* (581) join_type ::= INNER */ + 488, /* (582) 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 */ + 489, /* (583) hint_list ::= */ + 489, /* (584) hint_list ::= NK_HINT */ + 491, /* (585) tag_mode_opt ::= */ + 491, /* (586) tag_mode_opt ::= TAGS */ + 490, /* (587) set_quantifier_opt ::= */ + 490, /* (588) set_quantifier_opt ::= DISTINCT */ + 490, /* (589) set_quantifier_opt ::= ALL */ + 492, /* (590) select_list ::= select_item */ + 492, /* (591) select_list ::= select_list NK_COMMA select_item */ + 500, /* (592) select_item ::= NK_STAR */ + 500, /* (593) select_item ::= common_expression */ + 500, /* (594) select_item ::= common_expression column_alias */ + 500, /* (595) select_item ::= common_expression AS column_alias */ + 500, /* (596) select_item ::= table_name NK_DOT NK_STAR */ + 435, /* (597) where_clause_opt ::= */ + 435, /* (598) where_clause_opt ::= WHERE search_condition */ + 493, /* (599) partition_by_clause_opt ::= */ + 493, /* (600) partition_by_clause_opt ::= PARTITION BY partition_list */ + 501, /* (601) partition_list ::= partition_item */ + 501, /* (602) partition_list ::= partition_list NK_COMMA partition_item */ + 502, /* (603) partition_item ::= expr_or_subquery */ + 502, /* (604) partition_item ::= expr_or_subquery column_alias */ + 502, /* (605) partition_item ::= expr_or_subquery AS column_alias */ + 497, /* (606) twindow_clause_opt ::= */ + 497, /* (607) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 497, /* (608) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 497, /* (609) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 497, /* (610) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 497, /* (611) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 497, /* (612) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + 497, /* (613) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 428, /* (614) sliding_opt ::= */ + 428, /* (615) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 503, /* (616) interval_sliding_duration_literal ::= NK_VARIABLE */ + 503, /* (617) interval_sliding_duration_literal ::= NK_STRING */ + 503, /* (618) interval_sliding_duration_literal ::= NK_INTEGER */ + 496, /* (619) fill_opt ::= */ + 496, /* (620) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 496, /* (621) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 496, /* (622) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 504, /* (623) fill_mode ::= NONE */ + 504, /* (624) fill_mode ::= PREV */ + 504, /* (625) fill_mode ::= NULL */ + 504, /* (626) fill_mode ::= NULL_F */ + 504, /* (627) fill_mode ::= LINEAR */ + 504, /* (628) fill_mode ::= NEXT */ + 498, /* (629) group_by_clause_opt ::= */ + 498, /* (630) group_by_clause_opt ::= GROUP BY group_by_list */ + 505, /* (631) group_by_list ::= expr_or_subquery */ + 505, /* (632) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 499, /* (633) having_clause_opt ::= */ + 499, /* (634) having_clause_opt ::= HAVING search_condition */ + 494, /* (635) range_opt ::= */ + 494, /* (636) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 494, /* (637) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 495, /* (638) every_opt ::= */ + 495, /* (639) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 506, /* (640) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 507, /* (641) query_simple ::= query_specification */ + 507, /* (642) query_simple ::= union_query_expression */ + 511, /* (643) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 511, /* (644) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 512, /* (645) query_simple_or_subquery ::= query_simple */ + 512, /* (646) query_simple_or_subquery ::= subquery */ + 434, /* (647) query_or_subquery ::= query_expression */ + 434, /* (648) query_or_subquery ::= subquery */ + 508, /* (649) order_by_clause_opt ::= */ + 508, /* (650) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 509, /* (651) slimit_clause_opt ::= */ + 509, /* (652) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 509, /* (653) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 509, /* (654) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 510, /* (655) limit_clause_opt ::= */ + 510, /* (656) limit_clause_opt ::= LIMIT NK_INTEGER */ + 510, /* (657) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 510, /* (658) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 485, /* (659) subquery ::= NK_LP query_expression NK_RP */ + 485, /* (660) subquery ::= NK_LP subquery NK_RP */ + 372, /* (661) search_condition ::= common_expression */ + 513, /* (662) sort_specification_list ::= sort_specification */ + 513, /* (663) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 514, /* (664) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 515, /* (665) ordering_specification_opt ::= */ + 515, /* (666) ordering_specification_opt ::= ASC */ + 515, /* (667) ordering_specification_opt ::= DESC */ + 516, /* (668) null_ordering_opt ::= */ + 516, /* (669) null_ordering_opt ::= NULLS FIRST */ + 516, /* (670) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4301,423 +4706,424 @@ 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 */ - -6, /* (578) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 0, /* (579) join_type ::= */ - -1, /* (580) join_type ::= INNER */ - -14, /* (581) 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, /* (582) hint_list ::= */ - -1, /* (583) hint_list ::= NK_HINT */ - 0, /* (584) tag_mode_opt ::= */ - -1, /* (585) tag_mode_opt ::= TAGS */ - 0, /* (586) set_quantifier_opt ::= */ - -1, /* (587) set_quantifier_opt ::= DISTINCT */ - -1, /* (588) set_quantifier_opt ::= ALL */ - -1, /* (589) select_list ::= select_item */ - -3, /* (590) select_list ::= select_list NK_COMMA select_item */ - -1, /* (591) select_item ::= NK_STAR */ - -1, /* (592) select_item ::= common_expression */ - -2, /* (593) select_item ::= common_expression column_alias */ - -3, /* (594) select_item ::= common_expression AS column_alias */ - -3, /* (595) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (596) where_clause_opt ::= */ - -2, /* (597) where_clause_opt ::= WHERE search_condition */ - 0, /* (598) partition_by_clause_opt ::= */ - -3, /* (599) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (600) partition_list ::= partition_item */ - -3, /* (601) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (602) partition_item ::= expr_or_subquery */ - -2, /* (603) partition_item ::= expr_or_subquery column_alias */ - -3, /* (604) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (605) twindow_clause_opt ::= */ - -6, /* (606) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (607) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (608) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (609) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (610) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - -4, /* (611) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - -6, /* (612) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 0, /* (613) sliding_opt ::= */ - -4, /* (614) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (615) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (616) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (617) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (618) fill_opt ::= */ - -4, /* (619) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (620) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (621) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (622) fill_mode ::= NONE */ - -1, /* (623) fill_mode ::= PREV */ - -1, /* (624) fill_mode ::= NULL */ - -1, /* (625) fill_mode ::= NULL_F */ - -1, /* (626) fill_mode ::= LINEAR */ - -1, /* (627) fill_mode ::= NEXT */ - 0, /* (628) group_by_clause_opt ::= */ - -3, /* (629) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (630) group_by_list ::= expr_or_subquery */ - -3, /* (631) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (632) having_clause_opt ::= */ - -2, /* (633) having_clause_opt ::= HAVING search_condition */ - 0, /* (634) range_opt ::= */ - -6, /* (635) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (636) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (637) every_opt ::= */ - -4, /* (638) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (639) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (640) query_simple ::= query_specification */ - -1, /* (641) query_simple ::= union_query_expression */ - -4, /* (642) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (643) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (644) query_simple_or_subquery ::= query_simple */ - -1, /* (645) query_simple_or_subquery ::= subquery */ - -1, /* (646) query_or_subquery ::= query_expression */ - -1, /* (647) query_or_subquery ::= subquery */ - 0, /* (648) order_by_clause_opt ::= */ - -3, /* (649) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (650) slimit_clause_opt ::= */ - -2, /* (651) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (652) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (653) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (654) limit_clause_opt ::= */ - -2, /* (655) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (656) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (657) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (658) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (659) subquery ::= NK_LP subquery NK_RP */ - -1, /* (660) search_condition ::= common_expression */ - -1, /* (661) sort_specification_list ::= sort_specification */ - -3, /* (662) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (663) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (664) ordering_specification_opt ::= */ - -1, /* (665) ordering_specification_opt ::= ASC */ - -1, /* (666) ordering_specification_opt ::= DESC */ - 0, /* (667) null_ordering_opt ::= */ - -2, /* (668) null_ordering_opt ::= NULLS FIRST */ - -2, /* (669) 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 */ + -6, /* (579) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 0, /* (580) join_type ::= */ + -1, /* (581) join_type ::= INNER */ + -14, /* (582) 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, /* (583) hint_list ::= */ + -1, /* (584) hint_list ::= NK_HINT */ + 0, /* (585) tag_mode_opt ::= */ + -1, /* (586) tag_mode_opt ::= TAGS */ + 0, /* (587) set_quantifier_opt ::= */ + -1, /* (588) set_quantifier_opt ::= DISTINCT */ + -1, /* (589) set_quantifier_opt ::= ALL */ + -1, /* (590) select_list ::= select_item */ + -3, /* (591) select_list ::= select_list NK_COMMA select_item */ + -1, /* (592) select_item ::= NK_STAR */ + -1, /* (593) select_item ::= common_expression */ + -2, /* (594) select_item ::= common_expression column_alias */ + -3, /* (595) select_item ::= common_expression AS column_alias */ + -3, /* (596) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (597) where_clause_opt ::= */ + -2, /* (598) where_clause_opt ::= WHERE search_condition */ + 0, /* (599) partition_by_clause_opt ::= */ + -3, /* (600) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (601) partition_list ::= partition_item */ + -3, /* (602) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (603) partition_item ::= expr_or_subquery */ + -2, /* (604) partition_item ::= expr_or_subquery column_alias */ + -3, /* (605) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (606) twindow_clause_opt ::= */ + -6, /* (607) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + -4, /* (608) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (609) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (610) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (611) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + -4, /* (612) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + -6, /* (613) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (614) sliding_opt ::= */ + -4, /* (615) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (616) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (617) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (618) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (619) fill_opt ::= */ + -4, /* (620) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (621) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (622) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (623) fill_mode ::= NONE */ + -1, /* (624) fill_mode ::= PREV */ + -1, /* (625) fill_mode ::= NULL */ + -1, /* (626) fill_mode ::= NULL_F */ + -1, /* (627) fill_mode ::= LINEAR */ + -1, /* (628) fill_mode ::= NEXT */ + 0, /* (629) group_by_clause_opt ::= */ + -3, /* (630) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (631) group_by_list ::= expr_or_subquery */ + -3, /* (632) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (633) having_clause_opt ::= */ + -2, /* (634) having_clause_opt ::= HAVING search_condition */ + 0, /* (635) range_opt ::= */ + -6, /* (636) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (637) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (638) every_opt ::= */ + -4, /* (639) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (640) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (641) query_simple ::= query_specification */ + -1, /* (642) query_simple ::= union_query_expression */ + -4, /* (643) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (644) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (645) query_simple_or_subquery ::= query_simple */ + -1, /* (646) query_simple_or_subquery ::= subquery */ + -1, /* (647) query_or_subquery ::= query_expression */ + -1, /* (648) query_or_subquery ::= subquery */ + 0, /* (649) order_by_clause_opt ::= */ + -3, /* (650) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (651) slimit_clause_opt ::= */ + -2, /* (652) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (653) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (654) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (655) limit_clause_opt ::= */ + -2, /* (656) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (657) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (658) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (659) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (660) subquery ::= NK_LP subquery NK_RP */ + -1, /* (661) search_condition ::= common_expression */ + -1, /* (662) sort_specification_list ::= sort_specification */ + -3, /* (663) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (664) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (665) ordering_specification_opt ::= */ + -1, /* (666) ordering_specification_opt ::= ASC */ + -1, /* (667) ordering_specification_opt ::= DESC */ + 0, /* (668) null_ordering_opt ::= */ + -2, /* (669) null_ordering_opt ::= NULLS FIRST */ + -2, /* (670) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -4747,54 +5153,6 @@ static YYACTIONTYPE yy_reduce( (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; -#ifndef NDEBUG - if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfoNRhs[yyruleno]; - if( yysize ){ - fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", - yyTracePrompt, - yyruleno, yyRuleName[yyruleno], - yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>=yypParser->yystackEnd ){ - yyStackOverflow(yypParser); - /* The call to yyStackOverflow() above pops the stack until it is - ** empty, causing the main parser loop to exit. So the return value - ** is never used and does not matter. */ - return 0; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ - if( yyGrowStack(yypParser) ){ - yyStackOverflow(yypParser); - /* The call to yyStackOverflow() above pops the stack until it is - ** empty, causing the main parser loop to exit. So the return value - ** is never used and does not matter. */ - return 0; - } - yymsp = yypParser->yytos; - } -#endif - } switch( yyruleno ){ /* Beginning here are the reduction cases. A typical example @@ -4808,15 +5166,21 @@ static YYACTIONTYPE yy_reduce( /********** Begin reduce actions **********************************************/ YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ +#line 50 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,354,&yymsp[0].minor); - break; - case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } +#line 5171 "sql.c" yy_destructor(yypParser,355,&yymsp[0].minor); break; + case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ +#line 51 "sql.y" +{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } +#line 5177 "sql.c" + yy_destructor(yypParser,356,&yymsp[0].minor); + break; case 2: /* account_options ::= */ +#line 55 "sql.y" { } +#line 5183 "sql.c" break; case 3: /* account_options ::= account_options PPS literal */ case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4); @@ -4827,20 +5191,26 @@ 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,354,&yymsp[-2].minor); +{ yy_destructor(yypParser,355,&yymsp[-2].minor); +#line 56 "sql.y" { } - yy_destructor(yypParser,356,&yymsp[0].minor); +#line 5197 "sql.c" + yy_destructor(yypParser,357,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,357,&yymsp[0].minor); +{ yy_destructor(yypParser,358,&yymsp[0].minor); +#line 68 "sql.y" { } +#line 5205 "sql.c" } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,355,&yymsp[-1].minor); +{ yy_destructor(yypParser,356,&yymsp[-1].minor); +#line 69 "sql.y" { } - yy_destructor(yypParser,357,&yymsp[0].minor); +#line 5212 "sql.c" + yy_destructor(yypParser,358,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -4853,507 +5223,745 @@ static YYACTIONTYPE yy_reduce( case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21); case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); +#line 73 "sql.y" { } - yy_destructor(yypParser,356,&yymsp[0].minor); +#line 5228 "sql.c" + yy_destructor(yypParser,357,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ -{ yylhsminor.yy136 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy136 = yylhsminor.yy136; +#line 86 "sql.y" +{ yylhsminor.yy552 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 5234 "sql.c" + yymsp[0].minor.yy552 = yylhsminor.yy552; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -{ yylhsminor.yy136 = addNodeToList(pCxt, yymsp[-2].minor.yy136, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy136 = yylhsminor.yy136; +#line 87 "sql.y" +{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 5240 "sql.c" + yymsp[-2].minor.yy552 = yylhsminor.yy552; break; case 26: /* white_list ::= HOST ip_range_list */ -{ yymsp[-1].minor.yy136 = yymsp[0].minor.yy136; } +#line 91 "sql.y" +{ yymsp[-1].minor.yy552 = yymsp[0].minor.yy552; } +#line 5246 "sql.c" 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 598: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==598); - case 628: /* group_by_clause_opt ::= */ yytestcase(yyruleno==628); - case 648: /* order_by_clause_opt ::= */ yytestcase(yyruleno==648); -{ yymsp[1].minor.yy136 = 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 599: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==599); + case 629: /* group_by_clause_opt ::= */ yytestcase(yyruleno==629); + case 649: /* order_by_clause_opt ::= */ yytestcase(yyruleno==649); +#line 95 "sql.y" +{ yymsp[1].minor.yy552 = NULL; } +#line 5259 "sql.c" 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.yy136 = yymsp[0].minor.yy136; } - yymsp[0].minor.yy136 = yylhsminor.yy136; + case 377: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==377); + case 524: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==524); +#line 96 "sql.y" +{ yylhsminor.yy552 = yymsp[0].minor.yy552; } +#line 5267 "sql.c" + yymsp[0].minor.yy552 = yylhsminor.yy552; break; case 29: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ +#line 100 "sql.y" { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy665, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy191); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy136); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy965, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy883); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy552); } +#line 5276 "sql.c" break; case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy665, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +#line 104 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +#line 5281 "sql.c" break; case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy665, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +#line 105 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +#line 5286 "sql.c" break; case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy665, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +#line 106 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +#line 5291 "sql.c" break; case 33: /* cmd ::= ALTER USER user_name ADD white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy665, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy136); } +#line 107 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy552); } +#line 5296 "sql.c" break; case 34: /* cmd ::= ALTER USER user_name DROP white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy665, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy136); } +#line 108 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy965, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy552); } +#line 5301 "sql.c" break; case 35: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy665); } +#line 109 "sql.y" +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy965); } +#line 5306 "sql.c" break; case 36: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy191 = 1; } +#line 113 "sql.y" +{ yymsp[1].minor.yy883 = 1; } +#line 5311 "sql.c" break; case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy191 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +#line 114 "sql.y" +{ yymsp[-1].minor.yy883 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +#line 5316 "sql.c" break; case 38: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy909, &yymsp[-3].minor.yy753, &yymsp[0].minor.yy665, yymsp[-2].minor.yy656); } +#line 117 "sql.y" +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy525, &yymsp[-3].minor.yy665, &yymsp[0].minor.yy965, yymsp[-2].minor.yy718); } +#line 5321 "sql.c" break; case 39: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy909, &yymsp[-3].minor.yy753, &yymsp[0].minor.yy665, yymsp[-2].minor.yy656); } +#line 118 "sql.y" +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy525, &yymsp[-3].minor.yy665, &yymsp[0].minor.yy965, yymsp[-2].minor.yy718); } +#line 5326 "sql.c" break; case 40: /* privileges ::= ALL */ -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_ALL; } +#line 122 "sql.y" +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_ALL; } +#line 5331 "sql.c" break; case 41: /* privileges ::= priv_type_list */ case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43); -{ yylhsminor.yy909 = yymsp[0].minor.yy909; } - yymsp[0].minor.yy909 = yylhsminor.yy909; +#line 123 "sql.y" +{ yylhsminor.yy525 = yymsp[0].minor.yy525; } +#line 5337 "sql.c" + yymsp[0].minor.yy525 = yylhsminor.yy525; break; case 42: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_SUBSCRIBE; } +#line 124 "sql.y" +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_SUBSCRIBE; } +#line 5343 "sql.c" break; case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy909 = yymsp[-2].minor.yy909 | yymsp[0].minor.yy909; } - yymsp[-2].minor.yy909 = yylhsminor.yy909; +#line 129 "sql.y" +{ yylhsminor.yy525 = yymsp[-2].minor.yy525 | yymsp[0].minor.yy525; } +#line 5348 "sql.c" + yymsp[-2].minor.yy525 = yylhsminor.yy525; break; case 45: /* priv_type ::= READ */ -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_READ; } +#line 133 "sql.y" +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_READ; } +#line 5354 "sql.c" break; case 46: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_WRITE; } +#line 134 "sql.y" +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_WRITE; } +#line 5359 "sql.c" break; case 47: /* priv_type ::= ALTER */ -{ yymsp[0].minor.yy909 = PRIVILEGE_TYPE_ALTER; } +#line 135 "sql.y" +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_ALTER; } +#line 5364 "sql.c" break; case 48: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy753.first = yymsp[-2].minor.yy0; yylhsminor.yy753.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy753 = yylhsminor.yy753; +#line 139 "sql.y" +{ yylhsminor.yy665.first = yymsp[-2].minor.yy0; yylhsminor.yy665.second = yymsp[0].minor.yy0; } +#line 5369 "sql.c" + yymsp[-2].minor.yy665 = yylhsminor.yy665; break; case 49: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy753.first = yymsp[-2].minor.yy665; yylhsminor.yy753.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy753 = yylhsminor.yy753; +#line 140 "sql.y" +{ yylhsminor.yy665.first = yymsp[-2].minor.yy965; yylhsminor.yy665.second = yymsp[0].minor.yy0; } +#line 5375 "sql.c" + yymsp[-2].minor.yy665 = yylhsminor.yy665; break; case 50: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy753.first = yymsp[-2].minor.yy665; yylhsminor.yy753.second = yymsp[0].minor.yy665; } - yymsp[-2].minor.yy753 = yylhsminor.yy753; +#line 141 "sql.y" +{ yylhsminor.yy665.first = yymsp[-2].minor.yy965; yylhsminor.yy665.second = yymsp[0].minor.yy965; } +#line 5381 "sql.c" + yymsp[-2].minor.yy665 = yylhsminor.yy665; break; case 51: /* priv_level ::= topic_name */ -{ yylhsminor.yy753.first = yymsp[0].minor.yy665; yylhsminor.yy753.second = nil_token; } - yymsp[0].minor.yy753 = yylhsminor.yy753; +#line 142 "sql.y" +{ yylhsminor.yy665.first = yymsp[0].minor.yy965; yylhsminor.yy665.second = nil_token; } +#line 5387 "sql.c" + yymsp[0].minor.yy665 = yylhsminor.yy665; 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 596: /* where_clause_opt ::= */ yytestcase(yyruleno==596); - case 605: /* twindow_clause_opt ::= */ yytestcase(yyruleno==605); - case 613: /* sliding_opt ::= */ yytestcase(yyruleno==613); - case 618: /* fill_opt ::= */ yytestcase(yyruleno==618); - case 632: /* having_clause_opt ::= */ yytestcase(yyruleno==632); - case 634: /* range_opt ::= */ yytestcase(yyruleno==634); - case 637: /* every_opt ::= */ yytestcase(yyruleno==637); - case 650: /* slimit_clause_opt ::= */ yytestcase(yyruleno==650); - case 654: /* limit_clause_opt ::= */ yytestcase(yyruleno==654); -{ yymsp[1].minor.yy656 = 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 597: /* where_clause_opt ::= */ yytestcase(yyruleno==597); + case 606: /* twindow_clause_opt ::= */ yytestcase(yyruleno==606); + case 614: /* sliding_opt ::= */ yytestcase(yyruleno==614); + case 619: /* fill_opt ::= */ yytestcase(yyruleno==619); + case 633: /* having_clause_opt ::= */ yytestcase(yyruleno==633); + case 635: /* range_opt ::= */ yytestcase(yyruleno==635); + case 638: /* every_opt ::= */ yytestcase(yyruleno==638); + case 651: /* slimit_clause_opt ::= */ yytestcase(yyruleno==651); + case 655: /* limit_clause_opt ::= */ yytestcase(yyruleno==655); +#line 144 "sql.y" +{ yymsp[1].minor.yy718 = NULL; } +#line 5408 "sql.c" break; case 53: /* with_opt ::= WITH search_condition */ - case 564: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==564); - case 597: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==597); - case 633: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==633); -{ yymsp[-1].minor.yy656 = yymsp[0].minor.yy656; } + case 565: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==565); + case 598: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==598); + case 634: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==634); +#line 145 "sql.y" +{ yymsp[-1].minor.yy718 = yymsp[0].minor.yy718; } +#line 5416 "sql.c" break; case 54: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy665, NULL); } +#line 148 "sql.y" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy965, NULL); } +#line 5421 "sql.c" break; case 55: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy0); } +#line 149 "sql.y" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0); } +#line 5426 "sql.c" break; case 56: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy497, false); } +#line 150 "sql.y" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy559, false); } +#line 5431 "sql.c" break; case 57: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy665, yymsp[0].minor.yy497, false); } +#line 151 "sql.y" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy965, yymsp[0].minor.yy559, false); } +#line 5436 "sql.c" break; case 58: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy497); } +#line 152 "sql.y" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy559); } +#line 5441 "sql.c" break; case 59: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy665, false, yymsp[0].minor.yy497); } +#line 153 "sql.y" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy965, false, yymsp[0].minor.yy559); } +#line 5446 "sql.c" break; case 60: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ +#line 154 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } +#line 5451 "sql.c" break; case 61: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ +#line 155 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } +#line 5456 "sql.c" break; case 62: /* cmd ::= ALTER ALL DNODES NK_STRING */ +#line 156 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } +#line 5461 "sql.c" break; case 63: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ +#line 157 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } +#line 5466 "sql.c" break; case 64: /* cmd ::= RESTORE DNODE NK_INTEGER */ +#line 158 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } +#line 5471 "sql.c" break; 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.yy665 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy665 = yylhsminor.yy665; + 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); +#line 162 "sql.y" +{ yylhsminor.yy965 = yymsp[0].minor.yy0; } +#line 5508 "sql.c" + yymsp[0].minor.yy965 = yylhsminor.yy965; 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 584: /* tag_mode_opt ::= */ yytestcase(yyruleno==584); - case 586: /* set_quantifier_opt ::= */ yytestcase(yyruleno==586); -{ yymsp[1].minor.yy497 = 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 585: /* tag_mode_opt ::= */ yytestcase(yyruleno==585); + case 587: /* set_quantifier_opt ::= */ yytestcase(yyruleno==587); +#line 168 "sql.y" +{ yymsp[1].minor.yy559 = false; } +#line 5522 "sql.c" 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 585: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==585); - case 587: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==587); -{ yymsp[0].minor.yy497 = true; } + case 352: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==352); + case 359: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==359); + case 586: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==586); + case 588: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==588); +#line 169 "sql.y" +{ yymsp[0].minor.yy559 = true; } +#line 5532 "sql.c" break; case 71: /* cmd ::= ALTER CLUSTER NK_STRING */ +#line 176 "sql.y" { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 5537 "sql.c" break; case 72: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ +#line 177 "sql.y" { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } +#line 5542 "sql.c" break; case 73: /* cmd ::= ALTER LOCAL NK_STRING */ +#line 180 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 5547 "sql.c" break; case 74: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ +#line 181 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } +#line 5552 "sql.c" break; case 75: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ +#line 184 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } +#line 5557 "sql.c" break; case 76: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ +#line 185 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } +#line 5562 "sql.c" break; case 77: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ +#line 186 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } +#line 5567 "sql.c" break; case 78: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ +#line 189 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } +#line 5572 "sql.c" break; case 79: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ +#line 190 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } +#line 5577 "sql.c" break; case 80: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ +#line 193 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } +#line 5582 "sql.c" break; case 81: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ +#line 194 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } +#line 5587 "sql.c" break; case 82: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ +#line 197 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } +#line 5592 "sql.c" break; case 83: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ +#line 198 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } +#line 5597 "sql.c" break; case 84: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ +#line 199 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } +#line 5602 "sql.c" break; case 85: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ +#line 202 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } +#line 5607 "sql.c" break; case 86: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy497, &yymsp[-1].minor.yy665, yymsp[0].minor.yy656); } +#line 205 "sql.y" +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy559, &yymsp[-1].minor.yy965, yymsp[0].minor.yy718); } +#line 5612 "sql.c" break; case 87: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy497, &yymsp[0].minor.yy665); } +#line 206 "sql.y" +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } +#line 5617 "sql.c" break; case 88: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy665); } +#line 207 "sql.y" +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy965); } +#line 5622 "sql.c" break; case 89: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy665, yymsp[0].minor.yy656); } +#line 208 "sql.y" +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy965, yymsp[0].minor.yy718); } +#line 5627 "sql.c" break; case 90: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy665); } +#line 209 "sql.y" +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy965); } +#line 5632 "sql.c" break; case 91: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy665, yymsp[0].minor.yy676); } +#line 210 "sql.y" +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy965, yymsp[0].minor.yy134); } +#line 5637 "sql.c" break; case 92: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy665, yymsp[-1].minor.yy656, yymsp[0].minor.yy656); } +#line 211 "sql.y" +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy965, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } +#line 5642 "sql.c" break; case 93: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy497 = true; } +#line 215 "sql.y" +{ yymsp[-2].minor.yy559 = true; } +#line 5647 "sql.c" 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.yy497 = true; } + case 365: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==365); + case 391: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==391); +#line 220 "sql.y" +{ yymsp[-1].minor.yy559 = true; } +#line 5654 "sql.c" break; case 97: /* db_options ::= */ -{ yymsp[1].minor.yy656 = createDefaultDatabaseOptions(pCxt); } +#line 223 "sql.y" +{ yymsp[1].minor.yy718 = createDefaultDatabaseOptions(pCxt); } +#line 5659 "sql.c" break; case 98: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 224 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } +#line 5664 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 99: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 225 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } +#line 5670 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 100: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 226 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } +#line 5676 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 101: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 227 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_COMP, &yymsp[0].minor.yy0); } +#line 5682 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 102: /* db_options ::= db_options DURATION NK_INTEGER */ case 103: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==103); -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 228 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } +#line 5689 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 104: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 230 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } +#line 5695 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 105: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 231 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } +#line 5701 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 106: /* db_options ::= db_options KEEP integer_list */ case 107: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==107); -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_KEEP, yymsp[0].minor.yy136); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 232 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_KEEP, yymsp[0].minor.yy552); } +#line 5708 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 108: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 234 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } +#line 5714 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 109: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 235 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } +#line 5720 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 110: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 236 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } +#line 5726 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 111: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 237 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } +#line 5732 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 112: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 238 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } +#line 5738 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 113: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 240 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } +#line 5744 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 114: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 241 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } +#line 5750 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 115: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_RETENTIONS, yymsp[0].minor.yy136); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 242 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_RETENTIONS, yymsp[0].minor.yy552); } +#line 5756 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 116: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 243 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } +#line 5762 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 117: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 244 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL, &yymsp[0].minor.yy0); } +#line 5768 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 118: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 245 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } +#line 5774 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 119: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 246 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } +#line 5780 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 120: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ +#line 247 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-3].minor.yy656, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-3].minor.yy718, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; +#line 5790 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; case 121: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 252 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } +#line 5796 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 122: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ +#line 253 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-3].minor.yy656, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-3].minor.yy718, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; +#line 5806 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; case 123: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 258 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } +#line 5812 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 124: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 259 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } +#line 5818 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 125: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 260 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } +#line 5824 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 126: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy656); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 261 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy718); } +#line 5830 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 127: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy656); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 262 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy718); } +#line 5836 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 128: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -{ yylhsminor.yy656 = setDatabaseOption(pCxt, yymsp[-2].minor.yy656, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 263 "sql.y" +{ yylhsminor.yy718 = setDatabaseOption(pCxt, yymsp[-2].minor.yy718, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } +#line 5842 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 129: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy656 = createAlterDatabaseOptions(pCxt); yylhsminor.yy656 = setAlterDatabaseOption(pCxt, yylhsminor.yy656, &yymsp[0].minor.yy749); } - yymsp[0].minor.yy656 = yylhsminor.yy656; +#line 265 "sql.y" +{ yylhsminor.yy718 = createAlterDatabaseOptions(pCxt); yylhsminor.yy718 = setAlterDatabaseOption(pCxt, yylhsminor.yy718, &yymsp[0].minor.yy959); } +#line 5848 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; case 130: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy656 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy656, &yymsp[0].minor.yy749); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 266 "sql.y" +{ yylhsminor.yy718 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy718, &yymsp[0].minor.yy959); } +#line 5854 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; case 131: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 270 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5860 "sql.c" break; case 132: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 271 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5865 "sql.c" break; case 133: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 272 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5870 "sql.c" break; case 134: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 273 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5875 "sql.c" break; case 135: /* alter_db_option ::= KEEP integer_list */ case 136: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==136); -{ yymsp[-1].minor.yy749.type = DB_OPTION_KEEP; yymsp[-1].minor.yy749.pList = yymsp[0].minor.yy136; } +#line 274 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_KEEP; yymsp[-1].minor.yy959.pList = yymsp[0].minor.yy552; } +#line 5881 "sql.c" break; case 137: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_PAGES; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 276 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_PAGES; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5886 "sql.c" break; case 138: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 277 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5891 "sql.c" break; case 139: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_WAL; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 279 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_WAL; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5896 "sql.c" break; case 140: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 280 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5901 "sql.c" break; case 141: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 281 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5906 "sql.c" break; case 142: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 282 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5911 "sql.c" break; case 143: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ +#line 283 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy749.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy749.val = t; + yymsp[-2].minor.yy959.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy959.val = t; } +#line 5920 "sql.c" break; case 144: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 288 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5925 "sql.c" break; case 145: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ +#line 289 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy749.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy749.val = t; + yymsp[-2].minor.yy959.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy959.val = t; } +#line 5934 "sql.c" break; case 146: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 294 "sql.y" +{ yymsp[-1].minor.yy959.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 5939 "sql.c" break; case 147: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy136 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy136 = yylhsminor.yy136; +#line 298 "sql.y" +{ yylhsminor.yy552 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 5944 "sql.c" + yymsp[0].minor.yy552 = yylhsminor.yy552; break; case 148: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 403: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==403); -{ yylhsminor.yy136 = addNodeToList(pCxt, yymsp[-2].minor.yy136, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy136 = yylhsminor.yy136; + case 404: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==404); +#line 299 "sql.y" +{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 5951 "sql.c" + yymsp[-2].minor.yy552 = yylhsminor.yy552; break; case 149: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy136 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy136 = yylhsminor.yy136; +#line 303 "sql.y" +{ yylhsminor.yy552 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 5957 "sql.c" + yymsp[0].minor.yy552 = yylhsminor.yy552; break; case 150: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy136 = addNodeToList(pCxt, yymsp[-2].minor.yy136, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy136 = yylhsminor.yy136; +#line 304 "sql.y" +{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 5963 "sql.c" + yymsp[-2].minor.yy552 = yylhsminor.yy552; break; case 151: /* retention_list ::= retention */ case 182: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==182); @@ -5361,1345 +5969,2006 @@ 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 589: /* select_list ::= select_item */ yytestcase(yyruleno==589); - case 600: /* partition_list ::= partition_item */ yytestcase(yyruleno==600); - case 661: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==661); -{ yylhsminor.yy136 = createNodeList(pCxt, yymsp[0].minor.yy656); } - yymsp[0].minor.yy136 = yylhsminor.yy136; + 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 590: /* select_list ::= select_item */ yytestcase(yyruleno==590); + case 601: /* partition_list ::= partition_item */ yytestcase(yyruleno==601); + case 662: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==662); +#line 308 "sql.y" +{ yylhsminor.yy552 = createNodeList(pCxt, yymsp[0].minor.yy718); } +#line 5983 "sql.c" + yymsp[0].minor.yy552 = yylhsminor.yy552; 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 590: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==590); - case 601: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==601); - case 662: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==662); -{ yylhsminor.yy136 = addNodeToList(pCxt, yymsp[-2].minor.yy136, yymsp[0].minor.yy656); } - yymsp[-2].minor.yy136 = yylhsminor.yy136; + 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 591: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==591); + case 602: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==602); + case 663: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==663); +#line 309 "sql.y" +{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, yymsp[0].minor.yy718); } +#line 6001 "sql.c" + yymsp[-2].minor.yy552 = yylhsminor.yy552; break; case 153: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ case 154: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==154); -{ yylhsminor.yy656 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 311 "sql.y" +{ yylhsminor.yy718 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 6008 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 155: /* speed_opt ::= */ - case 359: /* bufsize_opt ::= */ yytestcase(yyruleno==359); -{ yymsp[1].minor.yy676 = 0; } + case 360: /* bufsize_opt ::= */ yytestcase(yyruleno==360); +#line 316 "sql.y" +{ yymsp[1].minor.yy134 = 0; } +#line 6015 "sql.c" break; case 156: /* speed_opt ::= BWLIMIT NK_INTEGER */ - case 360: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==360); -{ yymsp[-1].minor.yy676 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 361: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==361); +#line 317 "sql.y" +{ yymsp[-1].minor.yy134 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +#line 6021 "sql.c" break; case 158: /* start_opt ::= START WITH NK_INTEGER */ case 162: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==162); -{ yymsp[-2].minor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +#line 320 "sql.y" +{ yymsp[-2].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +#line 6027 "sql.c" break; case 159: /* start_opt ::= START WITH NK_STRING */ case 163: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==163); -{ yymsp[-2].minor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 321 "sql.y" +{ yymsp[-2].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 6033 "sql.c" 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.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 322 "sql.y" +{ yymsp[-3].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 6039 "sql.c" 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.yy497, yymsp[-5].minor.yy656, yymsp[-3].minor.yy136, yymsp[-1].minor.yy136, yymsp[0].minor.yy656); } +#line 331 "sql.y" +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy559, yymsp[-5].minor.yy718, yymsp[-3].minor.yy552, yymsp[-1].minor.yy552, yymsp[0].minor.yy718); } +#line 6045 "sql.c" break; case 166: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy136); } +#line 332 "sql.y" +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy552); } +#line 6050 "sql.c" break; case 168: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy136); } +#line 335 "sql.y" +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy552); } +#line 6055 "sql.c" break; case 169: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy497, yymsp[0].minor.yy656); } +#line 336 "sql.y" +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy559, yymsp[0].minor.yy718); } +#line 6060 "sql.c" 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.yy656; } + case 406: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==406); + case 407: /* cmd ::= insert_query */ yytestcase(yyruleno==407); +#line 338 "sql.y" +{ pCxt->pRootNode = yymsp[0].minor.yy718; } +#line 6067 "sql.c" break; case 171: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy656); } +#line 339 "sql.y" +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy718); } +#line 6072 "sql.c" break; case 172: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy656 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy656, yymsp[0].minor.yy656); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 341 "sql.y" +{ yylhsminor.yy718 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } +#line 6077 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; case 173: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy656 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy656, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy665, yymsp[0].minor.yy256); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; +#line 343 "sql.y" +{ yylhsminor.yy718 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224); } +#line 6083 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; break; case 174: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy656 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy656, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy665); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; +#line 344 "sql.y" +{ yylhsminor.yy718 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy718, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy965); } +#line 6089 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; case 175: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy656 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy656, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy665, yymsp[0].minor.yy256); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; +#line 346 "sql.y" +{ yylhsminor.yy718 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224); } +#line 6095 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; break; case 176: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy656 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy656, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy665, &yymsp[0].minor.yy665); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; +#line 348 "sql.y" +{ yylhsminor.yy718 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy965, &yymsp[0].minor.yy965); } +#line 6101 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; break; case 177: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy656 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy656, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy665, yymsp[0].minor.yy256); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; +#line 350 "sql.y" +{ yylhsminor.yy718 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224); } +#line 6107 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; break; case 178: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy656 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy656, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy665); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; +#line 351 "sql.y" +{ yylhsminor.yy718 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy718, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy965); } +#line 6113 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; case 179: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy656 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy656, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy665, yymsp[0].minor.yy256); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; +#line 353 "sql.y" +{ yylhsminor.yy718 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224); } +#line 6119 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; break; case 180: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy656 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy656, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy665, &yymsp[0].minor.yy665); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; +#line 355 "sql.y" +{ yylhsminor.yy718 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy718, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy965, &yymsp[0].minor.yy965); } +#line 6125 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; break; case 181: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ -{ yylhsminor.yy656 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy656, &yymsp[-2].minor.yy665, yymsp[0].minor.yy656); } - yymsp[-5].minor.yy656 = yylhsminor.yy656; +#line 357 "sql.y" +{ yylhsminor.yy718 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy718, &yymsp[-2].minor.yy965, yymsp[0].minor.yy718); } +#line 6131 "sql.c" + yymsp[-5].minor.yy718 = yylhsminor.yy718; 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.yy136 = addNodeToList(pCxt, yymsp[-1].minor.yy136, yymsp[0].minor.yy656); } - yymsp[-1].minor.yy136 = yylhsminor.yy136; + case 532: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==532); +#line 362 "sql.y" +{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-1].minor.yy552, yymsp[0].minor.yy718); } +#line 6138 "sql.c" + yymsp[-1].minor.yy552 = yylhsminor.yy552; 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.yy656 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy497, yymsp[-8].minor.yy656, yymsp[-6].minor.yy656, yymsp[-5].minor.yy136, yymsp[-2].minor.yy136, yymsp[0].minor.yy656); } - yymsp[-9].minor.yy656 = yylhsminor.yy656; +#line 366 "sql.y" +{ yylhsminor.yy718 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy559, yymsp[-8].minor.yy718, yymsp[-6].minor.yy718, yymsp[-5].minor.yy552, yymsp[-2].minor.yy552, yymsp[0].minor.yy718); } +#line 6144 "sql.c" + yymsp[-9].minor.yy718 = yylhsminor.yy718; break; case 187: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy656 = createDropTableClause(pCxt, yymsp[-1].minor.yy497, yymsp[0].minor.yy656); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 373 "sql.y" +{ yylhsminor.yy718 = createDropTableClause(pCxt, yymsp[-1].minor.yy559, yymsp[0].minor.yy718); } +#line 6150 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; 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.yy136 = yymsp[-1].minor.yy136; } + case 375: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==375); +#line 378 "sql.y" +{ yymsp[-2].minor.yy552 = yymsp[-1].minor.yy552; } +#line 6157 "sql.c" break; case 190: /* full_table_name ::= table_name */ -{ yylhsminor.yy656 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy665, NULL); } - yymsp[0].minor.yy656 = yylhsminor.yy656; +#line 380 "sql.y" +{ yylhsminor.yy718 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy965, NULL); } +#line 6162 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; case 191: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy656 = createRealTableNode(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy665, NULL); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 381 "sql.y" +{ yylhsminor.yy718 = createRealTableNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965, NULL); } +#line 6168 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 194: /* column_def ::= column_name type_name */ -{ yylhsminor.yy656 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy665, yymsp[0].minor.yy256, NULL); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 388 "sql.y" +{ yylhsminor.yy718 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy965, yymsp[0].minor.yy224, NULL); } +#line 6174 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; case 195: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_BOOL); } +#line 393 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BOOL); } +#line 6180 "sql.c" break; case 196: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_TINYINT); } +#line 394 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TINYINT); } +#line 6185 "sql.c" break; case 197: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +#line 395 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +#line 6190 "sql.c" break; case 198: /* type_name ::= INT */ case 199: /* type_name ::= INTEGER */ yytestcase(yyruleno==199); -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_INT); } +#line 396 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_INT); } +#line 6196 "sql.c" break; case 200: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_BIGINT); } +#line 398 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BIGINT); } +#line 6201 "sql.c" break; case 201: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_FLOAT); } +#line 399 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_FLOAT); } +#line 6206 "sql.c" break; case 202: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +#line 400 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +#line 6211 "sql.c" break; case 203: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy256 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +#line 401 "sql.y" +{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +#line 6216 "sql.c" break; case 204: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +#line 402 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +#line 6221 "sql.c" break; case 205: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy256 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +#line 403 "sql.y" +{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +#line 6226 "sql.c" break; case 206: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy256 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +#line 404 "sql.y" +{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +#line 6231 "sql.c" break; case 207: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy256 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +#line 405 "sql.y" +{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +#line 6236 "sql.c" break; case 208: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy256 = createDataType(TSDB_DATA_TYPE_UINT); } +#line 406 "sql.y" +{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UINT); } +#line 6241 "sql.c" break; case 209: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy256 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +#line 407 "sql.y" +{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +#line 6246 "sql.c" break; case 210: /* type_name ::= JSON */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_JSON); } +#line 408 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_JSON); } +#line 6251 "sql.c" break; case 211: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy256 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +#line 409 "sql.y" +{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +#line 6256 "sql.c" break; case 212: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +#line 410 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +#line 6261 "sql.c" break; case 213: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_BLOB); } +#line 411 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BLOB); } +#line 6266 "sql.c" break; case 214: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy256 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +#line 412 "sql.y" +{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +#line 6271 "sql.c" break; case 215: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy256 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } +#line 413 "sql.y" +{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } +#line 6276 "sql.c" break; case 216: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy256 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 414 "sql.y" +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 6281 "sql.c" break; case 217: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy256 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 415 "sql.y" +{ yymsp[-3].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 6286 "sql.c" break; case 218: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy256 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 416 "sql.y" +{ yymsp[-5].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 6291 "sql.c" 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.yy136 = yymsp[-1].minor.yy136; } + case 378: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==378); +#line 425 "sql.y" +{ yymsp[-3].minor.yy552 = yymsp[-1].minor.yy552; } +#line 6297 "sql.c" break; case 222: /* table_options ::= */ -{ yymsp[1].minor.yy656 = createDefaultTableOptions(pCxt); } +#line 427 "sql.y" +{ yymsp[1].minor.yy718 = createDefaultTableOptions(pCxt); } +#line 6302 "sql.c" break; case 223: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy656 = setTableOption(pCxt, yymsp[-2].minor.yy656, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 428 "sql.y" +{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } +#line 6307 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 224: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy656 = setTableOption(pCxt, yymsp[-2].minor.yy656, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy136); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 429 "sql.y" +{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy552); } +#line 6313 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 225: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy656 = setTableOption(pCxt, yymsp[-2].minor.yy656, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy136); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 430 "sql.y" +{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy552); } +#line 6319 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 226: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy656 = setTableOption(pCxt, yymsp[-4].minor.yy656, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy136); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; +#line 431 "sql.y" +{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-4].minor.yy718, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy552); } +#line 6325 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; break; case 227: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy656 = setTableOption(pCxt, yymsp[-2].minor.yy656, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 432 "sql.y" +{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } +#line 6331 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 228: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy656 = setTableOption(pCxt, yymsp[-4].minor.yy656, TABLE_OPTION_SMA, yymsp[-1].minor.yy136); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; +#line 433 "sql.y" +{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-4].minor.yy718, TABLE_OPTION_SMA, yymsp[-1].minor.yy552); } +#line 6337 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; break; case 229: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy656 = setTableOption(pCxt, yymsp[-2].minor.yy656, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy136); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 434 "sql.y" +{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-2].minor.yy718, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy552); } +#line 6343 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; case 230: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy656 = createAlterTableOptions(pCxt); yylhsminor.yy656 = setTableOption(pCxt, yylhsminor.yy656, yymsp[0].minor.yy749.type, &yymsp[0].minor.yy749.val); } - yymsp[0].minor.yy656 = yylhsminor.yy656; +#line 436 "sql.y" +{ yylhsminor.yy718 = createAlterTableOptions(pCxt); yylhsminor.yy718 = setTableOption(pCxt, yylhsminor.yy718, yymsp[0].minor.yy959.type, &yymsp[0].minor.yy959.val); } +#line 6349 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; case 231: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy656 = setTableOption(pCxt, yymsp[-1].minor.yy656, yymsp[0].minor.yy749.type, &yymsp[0].minor.yy749.val); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 437 "sql.y" +{ yylhsminor.yy718 = setTableOption(pCxt, yymsp[-1].minor.yy718, yymsp[0].minor.yy959.type, &yymsp[0].minor.yy959.val); } +#line 6355 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; case 232: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy749.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 441 "sql.y" +{ yymsp[-1].minor.yy959.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 6361 "sql.c" break; case 233: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy749.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy749.val = yymsp[0].minor.yy0; } +#line 442 "sql.y" +{ yymsp[-1].minor.yy959.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy959.val = yymsp[0].minor.yy0; } +#line 6366 "sql.c" break; case 234: /* duration_list ::= duration_literal */ - case 484: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==484); -{ yylhsminor.yy136 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy656)); } - yymsp[0].minor.yy136 = yylhsminor.yy136; + case 485: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==485); +#line 446 "sql.y" +{ yylhsminor.yy552 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } +#line 6372 "sql.c" + yymsp[0].minor.yy552 = yylhsminor.yy552; 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.yy136 = addNodeToList(pCxt, yymsp[-2].minor.yy136, releaseRawExprNode(pCxt, yymsp[0].minor.yy656)); } - yymsp[-2].minor.yy136 = yylhsminor.yy136; + case 486: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==486); +#line 447 "sql.y" +{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } +#line 6379 "sql.c" + yymsp[-2].minor.yy552 = yylhsminor.yy552; break; case 238: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy656 = createFunctionNode(pCxt, &yymsp[0].minor.yy665, NULL); } - yymsp[0].minor.yy656 = yylhsminor.yy656; +#line 454 "sql.y" +{ yylhsminor.yy718 = createFunctionNode(pCxt, &yymsp[0].minor.yy965, NULL); } +#line 6385 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; 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.yy656 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 312: /* tag_item ::= QTAGS */ yytestcase(yyruleno==312); +#line 455 "sql.y" +{ yylhsminor.yy718 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 6393 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; case 243: /* col_name ::= column_name */ - case 312: /* tag_item ::= column_name */ yytestcase(yyruleno==312); -{ yylhsminor.yy656 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy665); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 313: /* tag_item ::= column_name */ yytestcase(yyruleno==313); +#line 463 "sql.y" +{ yylhsminor.yy718 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy965); } +#line 6400 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; case 244: /* cmd ::= SHOW DNODES */ +#line 466 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } +#line 6406 "sql.c" break; case 245: /* cmd ::= SHOW USERS */ +#line 467 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } +#line 6411 "sql.c" break; case 246: /* cmd ::= SHOW USER PRIVILEGES */ +#line 468 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } +#line 6416 "sql.c" break; case 247: /* cmd ::= SHOW db_kind_opt DATABASES */ +#line 469 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy633); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy101); } +#line 6424 "sql.c" break; case 248: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ +#line 473 "sql.y" { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy493, yymsp[0].minor.yy656, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy91, yymsp[0].minor.yy718, OP_TYPE_LIKE); } +#line 6431 "sql.c" 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.yy656, yymsp[0].minor.yy656, OP_TYPE_LIKE); } +#line 476 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy718, yymsp[0].minor.yy718, OP_TYPE_LIKE); } +#line 6436 "sql.c" break; case 250: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy656, NULL, OP_TYPE_LIKE); } +#line 477 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy718, NULL, OP_TYPE_LIKE); } +#line 6441 "sql.c" break; case 251: /* cmd ::= SHOW MNODES */ +#line 478 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } +#line 6446 "sql.c" break; case 252: /* cmd ::= SHOW QNODES */ +#line 480 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } +#line 6451 "sql.c" break; - case 253: /* cmd ::= SHOW FUNCTIONS */ + case 253: /* cmd ::= SHOW ARBGROUPS */ +#line 481 "sql.y" +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } +#line 6456 "sql.c" + break; + case 254: /* cmd ::= SHOW FUNCTIONS */ +#line 482 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } +#line 6461 "sql.c" 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.yy656, yymsp[-1].minor.yy656, OP_TYPE_EQUAL); } + case 255: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +#line 483 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy718, yymsp[-1].minor.yy718, OP_TYPE_EQUAL); } +#line 6466 "sql.c" 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.yy665), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy665), OP_TYPE_EQUAL); } + case 256: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ +#line 484 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy965), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965), OP_TYPE_EQUAL); } +#line 6471 "sql.c" break; - case 256: /* cmd ::= SHOW STREAMS */ + case 257: /* cmd ::= SHOW STREAMS */ +#line 485 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } +#line 6476 "sql.c" break; - case 257: /* cmd ::= SHOW ACCOUNTS */ + case 258: /* cmd ::= SHOW ACCOUNTS */ +#line 486 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } +#line 6481 "sql.c" break; - case 258: /* cmd ::= SHOW APPS */ + case 259: /* cmd ::= SHOW APPS */ +#line 487 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } +#line 6486 "sql.c" break; - case 259: /* cmd ::= SHOW CONNECTIONS */ + case 260: /* cmd ::= SHOW CONNECTIONS */ +#line 488 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } +#line 6491 "sql.c" 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); +#line 489 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } +#line 6497 "sql.c" break; - case 262: /* cmd ::= SHOW GRANTS FULL */ + case 263: /* cmd ::= SHOW GRANTS FULL */ +#line 491 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } +#line 6502 "sql.c" break; - case 263: /* cmd ::= SHOW GRANTS LOGS */ + case 264: /* cmd ::= SHOW GRANTS LOGS */ +#line 492 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } +#line 6507 "sql.c" break; - case 264: /* cmd ::= SHOW CLUSTER MACHINES */ + case 265: /* cmd ::= SHOW CLUSTER MACHINES */ +#line 493 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } +#line 6512 "sql.c" break; - case 265: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy665); } + case 266: /* cmd ::= SHOW CREATE DATABASE db_name */ +#line 494 "sql.y" +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy965); } +#line 6517 "sql.c" break; - case 266: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy656); } + case 267: /* cmd ::= SHOW CREATE TABLE full_table_name */ +#line 495 "sql.y" +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy718); } +#line 6522 "sql.c" break; - case 267: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy656); } + case 268: /* cmd ::= SHOW CREATE STABLE full_table_name */ +#line 496 "sql.y" +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy718); } +#line 6527 "sql.c" break; - case 268: /* cmd ::= SHOW QUERIES */ + case 269: /* cmd ::= SHOW QUERIES */ +#line 497 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } +#line 6532 "sql.c" break; - case 269: /* cmd ::= SHOW SCORES */ + case 270: /* cmd ::= SHOW SCORES */ +#line 498 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } +#line 6537 "sql.c" break; - case 270: /* cmd ::= SHOW TOPICS */ + case 271: /* cmd ::= SHOW TOPICS */ +#line 499 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } +#line 6542 "sql.c" 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); +#line 500 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } +#line 6548 "sql.c" break; - case 273: /* cmd ::= SHOW LOCAL VARIABLES */ + case 274: /* cmd ::= SHOW LOCAL VARIABLES */ +#line 502 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } +#line 6553 "sql.c" 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.yy656); } + case 275: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ +#line 503 "sql.y" +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy718); } +#line 6558 "sql.c" break; - case 275: /* cmd ::= SHOW BNODES */ + case 276: /* cmd ::= SHOW BNODES */ +#line 504 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } +#line 6563 "sql.c" break; - case 276: /* cmd ::= SHOW SNODES */ + case 277: /* cmd ::= SHOW SNODES */ +#line 505 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } +#line 6568 "sql.c" break; - case 277: /* cmd ::= SHOW CLUSTER */ + case 278: /* cmd ::= SHOW CLUSTER */ +#line 506 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } +#line 6573 "sql.c" break; - case 278: /* cmd ::= SHOW TRANSACTIONS */ + case 279: /* cmd ::= SHOW TRANSACTIONS */ +#line 507 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } +#line 6578 "sql.c" break; - case 279: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy656); } + case 280: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +#line 508 "sql.y" +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy718); } +#line 6583 "sql.c" break; - case 280: /* cmd ::= SHOW CONSUMERS */ + case 281: /* cmd ::= SHOW CONSUMERS */ +#line 509 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } +#line 6588 "sql.c" break; - case 281: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 282: /* cmd ::= SHOW SUBSCRIPTIONS */ +#line 510 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } +#line 6593 "sql.c" 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.yy656, yymsp[-1].minor.yy656, OP_TYPE_EQUAL); } + case 283: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +#line 511 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy718, yymsp[-1].minor.yy718, OP_TYPE_EQUAL); } +#line 6598 "sql.c" 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.yy665), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy665), OP_TYPE_EQUAL); } + case 284: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ +#line 512 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy965), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965), OP_TYPE_EQUAL); } +#line 6603 "sql.c" break; - case 284: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy656, yymsp[0].minor.yy656, yymsp[-3].minor.yy136); } + case 285: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +#line 513 "sql.y" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy718, yymsp[0].minor.yy718, yymsp[-3].minor.yy552); } +#line 6608 "sql.c" 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.yy665), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy665), yymsp[-4].minor.yy136); } + case 286: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ +#line 514 "sql.y" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy965), yymsp[-4].minor.yy552); } +#line 6613 "sql.c" break; - case 286: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + case 287: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ +#line 515 "sql.y" { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } +#line 6618 "sql.c" break; - case 287: /* cmd ::= SHOW VNODES */ + case 288: /* cmd ::= SHOW VNODES */ +#line 516 "sql.y" { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } +#line 6623 "sql.c" break; - case 288: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy656, QUERY_NODE_SHOW_DB_ALIVE_STMT); } + case 289: /* cmd ::= SHOW db_name_cond_opt ALIVE */ +#line 518 "sql.y" +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy718, QUERY_NODE_SHOW_DB_ALIVE_STMT); } +#line 6628 "sql.c" break; - case 289: /* cmd ::= SHOW CLUSTER ALIVE */ + case 290: /* cmd ::= SHOW CLUSTER ALIVE */ +#line 519 "sql.y" { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } +#line 6633 "sql.c" 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.yy656, yymsp[0].minor.yy656, OP_TYPE_LIKE); } + case 291: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ +#line 520 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy718, yymsp[0].minor.yy718, OP_TYPE_LIKE); } +#line 6638 "sql.c" break; - case 291: /* cmd ::= SHOW CREATE VIEW full_table_name */ -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy656); } + case 292: /* cmd ::= SHOW CREATE VIEW full_table_name */ +#line 521 "sql.y" +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy718); } +#line 6643 "sql.c" break; - case 292: /* cmd ::= SHOW COMPACTS */ + case 293: /* cmd ::= SHOW COMPACTS */ +#line 522 "sql.y" { pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } +#line 6648 "sql.c" break; - case 293: /* cmd ::= SHOW COMPACT NK_INTEGER */ + case 294: /* cmd ::= SHOW COMPACT NK_INTEGER */ +#line 523 "sql.y" { pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 6653 "sql.c" break; - case 294: /* table_kind_db_name_cond_opt ::= */ -{ yymsp[1].minor.yy493.kind = SHOW_KIND_ALL; yymsp[1].minor.yy493.dbName = nil_token; } + case 295: /* table_kind_db_name_cond_opt ::= */ +#line 527 "sql.y" +{ yymsp[1].minor.yy91.kind = SHOW_KIND_ALL; yymsp[1].minor.yy91.dbName = nil_token; } +#line 6658 "sql.c" break; - case 295: /* table_kind_db_name_cond_opt ::= table_kind */ -{ yylhsminor.yy493.kind = yymsp[0].minor.yy633; yylhsminor.yy493.dbName = nil_token; } - yymsp[0].minor.yy493 = yylhsminor.yy493; + case 296: /* table_kind_db_name_cond_opt ::= table_kind */ +#line 528 "sql.y" +{ yylhsminor.yy91.kind = yymsp[0].minor.yy101; yylhsminor.yy91.dbName = nil_token; } +#line 6663 "sql.c" + yymsp[0].minor.yy91 = yylhsminor.yy91; break; - case 296: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy493.kind = SHOW_KIND_ALL; yylhsminor.yy493.dbName = yymsp[-1].minor.yy665; } - yymsp[-1].minor.yy493 = yylhsminor.yy493; + case 297: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ +#line 529 "sql.y" +{ yylhsminor.yy91.kind = SHOW_KIND_ALL; yylhsminor.yy91.dbName = yymsp[-1].minor.yy965; } +#line 6669 "sql.c" + yymsp[-1].minor.yy91 = yylhsminor.yy91; break; - case 297: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -{ yylhsminor.yy493.kind = yymsp[-2].minor.yy633; yylhsminor.yy493.dbName = yymsp[-1].minor.yy665; } - yymsp[-2].minor.yy493 = yylhsminor.yy493; + case 298: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ +#line 530 "sql.y" +{ yylhsminor.yy91.kind = yymsp[-2].minor.yy101; yylhsminor.yy91.dbName = yymsp[-1].minor.yy965; } +#line 6675 "sql.c" + yymsp[-2].minor.yy91 = yylhsminor.yy91; break; - case 298: /* table_kind ::= NORMAL */ -{ yymsp[0].minor.yy633 = SHOW_KIND_TABLES_NORMAL; } + case 299: /* table_kind ::= NORMAL */ +#line 534 "sql.y" +{ yymsp[0].minor.yy101 = SHOW_KIND_TABLES_NORMAL; } +#line 6681 "sql.c" break; - case 299: /* table_kind ::= CHILD */ -{ yymsp[0].minor.yy633 = SHOW_KIND_TABLES_CHILD; } + case 300: /* table_kind ::= CHILD */ +#line 535 "sql.y" +{ yymsp[0].minor.yy101 = SHOW_KIND_TABLES_CHILD; } +#line 6686 "sql.c" break; - case 300: /* db_name_cond_opt ::= */ - case 305: /* from_db_opt ::= */ yytestcase(yyruleno==305); -{ yymsp[1].minor.yy656 = createDefaultDatabaseCondValue(pCxt); } + case 301: /* db_name_cond_opt ::= */ + case 306: /* from_db_opt ::= */ yytestcase(yyruleno==306); +#line 537 "sql.y" +{ yymsp[1].minor.yy718 = createDefaultDatabaseCondValue(pCxt); } +#line 6692 "sql.c" break; - case 301: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy656 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy665); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; + case 302: /* db_name_cond_opt ::= db_name NK_DOT */ +#line 538 "sql.y" +{ yylhsminor.yy718 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy965); } +#line 6697 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 303: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 304: /* like_pattern_opt ::= LIKE NK_STRING */ +#line 541 "sql.y" +{ yymsp[-1].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +#line 6703 "sql.c" break; - case 304: /* table_name_cond ::= table_name */ -{ yylhsminor.yy656 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy665); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 305: /* table_name_cond ::= table_name */ +#line 543 "sql.y" +{ yylhsminor.yy718 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965); } +#line 6708 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 306: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy656 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy665); } + case 307: /* from_db_opt ::= FROM db_name */ +#line 546 "sql.y" +{ yymsp[-1].minor.yy718 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy965); } +#line 6714 "sql.c" break; - case 310: /* tag_item ::= TBNAME */ -{ yylhsminor.yy656 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 311: /* tag_item ::= TBNAME */ +#line 554 "sql.y" +{ yylhsminor.yy718 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } +#line 6719 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 313: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy656 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy665), &yymsp[0].minor.yy665); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; + case 314: /* tag_item ::= column_name column_alias */ +#line 557 "sql.y" +{ yylhsminor.yy718 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy965), &yymsp[0].minor.yy965); } +#line 6725 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 314: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy656 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy665), &yymsp[0].minor.yy665); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 315: /* tag_item ::= column_name AS column_alias */ +#line 558 "sql.y" +{ yylhsminor.yy718 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy965), &yymsp[0].minor.yy965); } +#line 6731 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 315: /* db_kind_opt ::= */ -{ yymsp[1].minor.yy633 = SHOW_KIND_ALL; } + case 316: /* db_kind_opt ::= */ +#line 562 "sql.y" +{ yymsp[1].minor.yy101 = SHOW_KIND_ALL; } +#line 6737 "sql.c" break; - case 316: /* db_kind_opt ::= USER */ -{ yymsp[0].minor.yy633 = SHOW_KIND_DATABASES_USER; } + case 317: /* db_kind_opt ::= USER */ +#line 563 "sql.y" +{ yymsp[0].minor.yy101 = SHOW_KIND_DATABASES_USER; } +#line 6742 "sql.c" break; - case 317: /* db_kind_opt ::= SYSTEM */ -{ yymsp[0].minor.yy633 = SHOW_KIND_DATABASES_SYSTEM; } + case 318: /* db_kind_opt ::= SYSTEM */ +#line 564 "sql.y" +{ yymsp[0].minor.yy101 = SHOW_KIND_DATABASES_SYSTEM; } +#line 6747 "sql.c" 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.yy497, yymsp[-3].minor.yy656, yymsp[-1].minor.yy656, NULL, yymsp[0].minor.yy656); } + case 319: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ +#line 568 "sql.y" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy559, yymsp[-3].minor.yy718, yymsp[-1].minor.yy718, NULL, yymsp[0].minor.yy718); } +#line 6752 "sql.c" 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.yy497, yymsp[-5].minor.yy656, yymsp[-3].minor.yy656, yymsp[-1].minor.yy136, NULL); } + case 320: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ +#line 570 "sql.y" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy559, yymsp[-5].minor.yy718, yymsp[-3].minor.yy718, yymsp[-1].minor.yy552, NULL); } +#line 6757 "sql.c" break; - case 320: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy497, yymsp[0].minor.yy656); } + case 321: /* cmd ::= DROP INDEX exists_opt full_index_name */ +#line 571 "sql.y" +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy559, yymsp[0].minor.yy718); } +#line 6762 "sql.c" break; - case 321: /* full_index_name ::= index_name */ -{ yylhsminor.yy656 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy665); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 322: /* full_index_name ::= index_name */ +#line 573 "sql.y" +{ yylhsminor.yy718 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy965); } +#line 6767 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 322: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy656 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy665); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 323: /* full_index_name ::= db_name NK_DOT index_name */ +#line 574 "sql.y" +{ yylhsminor.yy718 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965); } +#line 6773 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; 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.yy656 = createIndexOption(pCxt, yymsp[-7].minor.yy136, releaseRawExprNode(pCxt, yymsp[-3].minor.yy656), NULL, yymsp[-1].minor.yy656, yymsp[0].minor.yy656); } + case 324: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +#line 577 "sql.y" +{ yymsp[-9].minor.yy718 = createIndexOption(pCxt, yymsp[-7].minor.yy552, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), NULL, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } +#line 6779 "sql.c" 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.yy656 = createIndexOption(pCxt, yymsp[-9].minor.yy136, releaseRawExprNode(pCxt, yymsp[-5].minor.yy656), releaseRawExprNode(pCxt, yymsp[-3].minor.yy656), yymsp[-1].minor.yy656, yymsp[0].minor.yy656); } + 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 */ +#line 580 "sql.y" +{ yymsp[-11].minor.yy718 = createIndexOption(pCxt, yymsp[-9].minor.yy552, releaseRawExprNode(pCxt, yymsp[-5].minor.yy718), releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } +#line 6784 "sql.c" break; - case 327: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy656 = createFunctionNode(pCxt, &yymsp[-3].minor.yy665, yymsp[-1].minor.yy136); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; + case 328: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +#line 587 "sql.y" +{ yylhsminor.yy718 = createFunctionNode(pCxt, &yymsp[-3].minor.yy965, yymsp[-1].minor.yy552); } +#line 6789 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 328: /* sma_func_name ::= function_name */ - case 574: /* alias_opt ::= table_alias */ yytestcase(yyruleno==574); -{ yylhsminor.yy665 = yymsp[0].minor.yy665; } - yymsp[0].minor.yy665 = yylhsminor.yy665; + case 329: /* sma_func_name ::= function_name */ + case 575: /* alias_opt ::= table_alias */ yytestcase(yyruleno==575); +#line 591 "sql.y" +{ yylhsminor.yy965 = yymsp[0].minor.yy965; } +#line 6796 "sql.c" + yymsp[0].minor.yy965 = yylhsminor.yy965; break; - case 333: /* sma_stream_opt ::= */ - case 378: /* stream_options ::= */ yytestcase(yyruleno==378); -{ yymsp[1].minor.yy656 = createStreamOptions(pCxt); } + case 334: /* sma_stream_opt ::= */ + case 379: /* stream_options ::= */ yytestcase(yyruleno==379); +#line 597 "sql.y" +{ yymsp[1].minor.yy718 = createStreamOptions(pCxt); } +#line 6803 "sql.c" break; - case 334: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy656)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy656); yylhsminor.yy656 = yymsp[-2].minor.yy656; } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 335: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ +#line 598 "sql.y" +{ ((SStreamOptions*)yymsp[-2].minor.yy718)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); yylhsminor.yy718 = yymsp[-2].minor.yy718; } +#line 6808 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 335: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy656)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy656); yylhsminor.yy656 = yymsp[-2].minor.yy656; } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 336: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +#line 599 "sql.y" +{ ((SStreamOptions*)yymsp[-2].minor.yy718)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); yylhsminor.yy718 = yymsp[-2].minor.yy718; } +#line 6814 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 336: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy656)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy656); yylhsminor.yy656 = yymsp[-2].minor.yy656; } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 337: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +#line 600 "sql.y" +{ ((SStreamOptions*)yymsp[-2].minor.yy718)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); yylhsminor.yy718 = yymsp[-2].minor.yy718; } +#line 6820 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 337: /* with_meta ::= AS */ -{ yymsp[0].minor.yy676 = 0; } + case 338: /* with_meta ::= AS */ +#line 605 "sql.y" +{ yymsp[0].minor.yy134 = 0; } +#line 6826 "sql.c" break; - case 338: /* with_meta ::= WITH META AS */ -{ yymsp[-2].minor.yy676 = 1; } + case 339: /* with_meta ::= WITH META AS */ +#line 606 "sql.y" +{ yymsp[-2].minor.yy134 = 1; } +#line 6831 "sql.c" break; - case 339: /* with_meta ::= ONLY META AS */ -{ yymsp[-2].minor.yy676 = 2; } + case 340: /* with_meta ::= ONLY META AS */ +#line 607 "sql.y" +{ yymsp[-2].minor.yy134 = 2; } +#line 6836 "sql.c" break; - case 340: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy497, &yymsp[-2].minor.yy665, yymsp[0].minor.yy656); } + case 341: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +#line 609 "sql.y" +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy559, &yymsp[-2].minor.yy965, yymsp[0].minor.yy718); } +#line 6841 "sql.c" break; - case 341: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy497, &yymsp[-3].minor.yy665, &yymsp[0].minor.yy665, yymsp[-2].minor.yy676); } + case 342: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ +#line 611 "sql.y" +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy559, &yymsp[-3].minor.yy965, &yymsp[0].minor.yy965, yymsp[-2].minor.yy134); } +#line 6846 "sql.c" 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.yy497, &yymsp[-4].minor.yy665, yymsp[-1].minor.yy656, yymsp[-3].minor.yy676, yymsp[0].minor.yy656); } + case 343: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ +#line 613 "sql.y" +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy559, &yymsp[-4].minor.yy965, yymsp[-1].minor.yy718, yymsp[-3].minor.yy134, yymsp[0].minor.yy718); } +#line 6851 "sql.c" break; - case 343: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy497, &yymsp[0].minor.yy665); } + case 344: /* cmd ::= DROP TOPIC exists_opt topic_name */ +#line 615 "sql.y" +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } +#line 6856 "sql.c" break; - case 344: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy497, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy665); } + case 345: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +#line 616 "sql.y" +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy559, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965); } +#line 6861 "sql.c" 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.yy656); } + case 346: /* cmd ::= DESC full_table_name */ + case 347: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==347); +#line 619 "sql.y" +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy718); } +#line 6867 "sql.c" break; - case 347: /* cmd ::= RESET QUERY CACHE */ + case 348: /* cmd ::= RESET QUERY CACHE */ +#line 623 "sql.y" { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } +#line 6872 "sql.c" 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.yy497, yymsp[-1].minor.yy656, yymsp[0].minor.yy656); } + case 349: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 350: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==350); +#line 626 "sql.y" +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy559, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } +#line 6878 "sql.c" break; - case 352: /* explain_options ::= */ -{ yymsp[1].minor.yy656 = createDefaultExplainOptions(pCxt); } + case 353: /* explain_options ::= */ +#line 634 "sql.y" +{ yymsp[1].minor.yy718 = createDefaultExplainOptions(pCxt); } +#line 6883 "sql.c" break; - case 353: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy656 = setExplainVerbose(pCxt, yymsp[-2].minor.yy656, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 354: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +#line 635 "sql.y" +{ yylhsminor.yy718 = setExplainVerbose(pCxt, yymsp[-2].minor.yy718, &yymsp[0].minor.yy0); } +#line 6888 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 354: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy656 = setExplainRatio(pCxt, yymsp[-2].minor.yy656, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 355: /* explain_options ::= explain_options RATIO NK_FLOAT */ +#line 636 "sql.y" +{ yylhsminor.yy718 = setExplainRatio(pCxt, yymsp[-2].minor.yy718, &yymsp[0].minor.yy0); } +#line 6894 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; 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.yy497, yymsp[-9].minor.yy497, &yymsp[-6].minor.yy665, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy256, yymsp[-1].minor.yy676, &yymsp[0].minor.yy665, yymsp[-10].minor.yy497); } + 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 */ +#line 641 "sql.y" +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy559, yymsp[-9].minor.yy559, &yymsp[-6].minor.yy965, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy224, yymsp[-1].minor.yy134, &yymsp[0].minor.yy965, yymsp[-10].minor.yy559); } +#line 6900 "sql.c" break; - case 356: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy497, &yymsp[0].minor.yy665); } + case 357: /* cmd ::= DROP FUNCTION exists_opt function_name */ +#line 642 "sql.y" +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } +#line 6905 "sql.c" break; - case 361: /* language_opt ::= */ - case 400: /* on_vgroup_id ::= */ yytestcase(yyruleno==400); -{ yymsp[1].minor.yy665 = nil_token; } + case 362: /* language_opt ::= */ + case 401: /* on_vgroup_id ::= */ yytestcase(yyruleno==401); +#line 656 "sql.y" +{ yymsp[1].minor.yy965 = nil_token; } +#line 6911 "sql.c" break; - case 362: /* language_opt ::= LANGUAGE NK_STRING */ - case 401: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==401); -{ yymsp[-1].minor.yy665 = yymsp[0].minor.yy0; } + case 363: /* language_opt ::= LANGUAGE NK_STRING */ + case 402: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==402); +#line 657 "sql.y" +{ yymsp[-1].minor.yy965 = yymsp[0].minor.yy0; } +#line 6917 "sql.c" break; - case 365: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy497, yymsp[-2].minor.yy656, &yymsp[-1].minor.yy0, yymsp[0].minor.yy656); } + case 366: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ +#line 666 "sql.y" +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy559, yymsp[-2].minor.yy718, &yymsp[-1].minor.yy0, yymsp[0].minor.yy718); } +#line 6922 "sql.c" break; - case 366: /* cmd ::= DROP VIEW exists_opt full_view_name */ -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy497, yymsp[0].minor.yy656); } + case 367: /* cmd ::= DROP VIEW exists_opt full_view_name */ +#line 667 "sql.y" +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy559, yymsp[0].minor.yy718); } +#line 6927 "sql.c" break; - case 367: /* full_view_name ::= view_name */ -{ yylhsminor.yy656 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy665); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 368: /* full_view_name ::= view_name */ +#line 669 "sql.y" +{ yylhsminor.yy718 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy965); } +#line 6932 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 368: /* full_view_name ::= db_name NK_DOT view_name */ -{ yylhsminor.yy656 = createViewNode(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy665); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 369: /* full_view_name ::= db_name NK_DOT view_name */ +#line 670 "sql.y" +{ yylhsminor.yy718 = createViewNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965); } +#line 6938 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; 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.yy497, &yymsp[-8].minor.yy665, yymsp[-5].minor.yy656, yymsp[-7].minor.yy656, yymsp[-3].minor.yy136, yymsp[-2].minor.yy656, yymsp[0].minor.yy656, yymsp[-4].minor.yy136); } + 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 */ +#line 675 "sql.y" +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy559, &yymsp[-8].minor.yy965, yymsp[-5].minor.yy718, yymsp[-7].minor.yy718, yymsp[-3].minor.yy552, yymsp[-2].minor.yy718, yymsp[0].minor.yy718, yymsp[-4].minor.yy552); } +#line 6944 "sql.c" break; - case 370: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy497, &yymsp[0].minor.yy665); } + case 371: /* cmd ::= DROP STREAM exists_opt stream_name */ +#line 676 "sql.y" +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } +#line 6949 "sql.c" break; - case 371: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy497, &yymsp[0].minor.yy665); } + case 372: /* cmd ::= PAUSE STREAM exists_opt stream_name */ +#line 677 "sql.y" +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } +#line 6954 "sql.c" break; - case 372: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy497, yymsp[-1].minor.yy497, &yymsp[0].minor.yy665); } + case 373: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ +#line 678 "sql.y" +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy559, yymsp[-1].minor.yy559, &yymsp[0].minor.yy965); } +#line 6959 "sql.c" break; - case 379: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 380: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==380); -{ yylhsminor.yy656 = setStreamOptions(pCxt, yymsp[-2].minor.yy656, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 380: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 381: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==381); +#line 692 "sql.y" +{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-2].minor.yy718, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } +#line 6965 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 381: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy656 = setStreamOptions(pCxt, yymsp[-3].minor.yy656, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy656)); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; + case 382: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +#line 694 "sql.y" +{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-3].minor.yy718, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } +#line 6971 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 382: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy656 = setStreamOptions(pCxt, yymsp[-2].minor.yy656, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy656)); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 383: /* stream_options ::= stream_options WATERMARK duration_literal */ +#line 695 "sql.y" +{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-2].minor.yy718, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } +#line 6977 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 383: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy656 = setStreamOptions(pCxt, yymsp[-3].minor.yy656, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; + case 384: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +#line 696 "sql.y" +{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-3].minor.yy718, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } +#line 6983 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 384: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy656 = setStreamOptions(pCxt, yymsp[-2].minor.yy656, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 385: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +#line 697 "sql.y" +{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-2].minor.yy718, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } +#line 6989 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 385: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy656 = setStreamOptions(pCxt, yymsp[-2].minor.yy656, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy656)); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 386: /* stream_options ::= stream_options DELETE_MARK duration_literal */ +#line 698 "sql.y" +{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-2].minor.yy718, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } +#line 6995 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 386: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy656 = setStreamOptions(pCxt, yymsp[-3].minor.yy656, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; + case 387: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ +#line 699 "sql.y" +{ yylhsminor.yy718 = setStreamOptions(pCxt, yymsp[-3].minor.yy718, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } +#line 7001 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 388: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 614: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==614); - case 638: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==638); -{ yymsp[-3].minor.yy656 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy656); } + case 389: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 615: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==615); + case 639: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==639); +#line 702 "sql.y" +{ yymsp[-3].minor.yy718 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy718); } +#line 7009 "sql.c" break; - case 391: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 392: /* cmd ::= KILL CONNECTION NK_INTEGER */ +#line 710 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } +#line 7014 "sql.c" break; - case 392: /* cmd ::= KILL QUERY NK_STRING */ + case 393: /* cmd ::= KILL QUERY NK_STRING */ +#line 711 "sql.y" { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } +#line 7019 "sql.c" break; - case 393: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 394: /* cmd ::= KILL TRANSACTION NK_INTEGER */ +#line 712 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } +#line 7024 "sql.c" break; - case 394: /* cmd ::= KILL COMPACT NK_INTEGER */ + case 395: /* cmd ::= KILL COMPACT NK_INTEGER */ +#line 713 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } +#line 7029 "sql.c" break; - case 395: /* cmd ::= BALANCE VGROUP */ + case 396: /* cmd ::= BALANCE VGROUP */ +#line 716 "sql.y" { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } +#line 7034 "sql.c" break; - case 396: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy665); } + case 397: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ +#line 717 "sql.y" +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy965); } +#line 7039 "sql.c" break; - case 397: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 398: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ +#line 718 "sql.y" { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } +#line 7044 "sql.c" break; - case 398: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy136); } + case 399: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +#line 719 "sql.y" +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy552); } +#line 7049 "sql.c" break; - case 399: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 400: /* cmd ::= SPLIT VGROUP NK_INTEGER */ +#line 720 "sql.y" { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } +#line 7054 "sql.c" break; - case 402: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy136 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 403: /* dnode_list ::= DNODE NK_INTEGER */ +#line 729 "sql.y" +{ yymsp[-1].minor.yy552 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 7059 "sql.c" break; - case 404: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy656, yymsp[0].minor.yy656); } + case 405: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +#line 736 "sql.y" +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } +#line 7064 "sql.c" break; - case 407: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy656 = createInsertStmt(pCxt, yymsp[-4].minor.yy656, yymsp[-2].minor.yy136, yymsp[0].minor.yy656); } + case 408: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +#line 745 "sql.y" +{ yymsp[-6].minor.yy718 = createInsertStmt(pCxt, yymsp[-4].minor.yy718, yymsp[-2].minor.yy552, yymsp[0].minor.yy718); } +#line 7069 "sql.c" break; - case 408: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy656 = createInsertStmt(pCxt, yymsp[-1].minor.yy656, NULL, yymsp[0].minor.yy656); } + case 409: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +#line 746 "sql.y" +{ yymsp[-3].minor.yy718 = createInsertStmt(pCxt, yymsp[-1].minor.yy718, NULL, yymsp[0].minor.yy718); } +#line 7074 "sql.c" 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.yy656 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 410: /* tags_literal ::= NK_INTEGER */ + case 416: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==416); + case 419: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==419); +#line 749 "sql.y" +{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } +#line 7081 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; 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); +#line 750 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy656 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 7096 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 412: /* tags_literal ::= NK_FLOAT */ -{ yylhsminor.yy656 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 413: /* tags_literal ::= NK_FLOAT */ +#line 760 "sql.y" +{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } +#line 7102 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; 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); +#line 761 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy656 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); + yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 7113 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 421: /* tags_literal ::= NK_STRING */ -{ yylhsminor.yy656 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 422: /* tags_literal ::= NK_STRING */ +#line 795 "sql.y" +{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } +#line 7119 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 422: /* tags_literal ::= NK_BOOL */ -{ yylhsminor.yy656 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 423: /* tags_literal ::= NK_BOOL */ +#line 796 "sql.y" +{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } +#line 7125 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 423: /* tags_literal ::= NULL */ -{ yylhsminor.yy656 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 424: /* tags_literal ::= NULL */ +#line 797 "sql.y" +{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } +#line 7131 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 424: /* tags_literal ::= literal_func */ -{ yylhsminor.yy656 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy656); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 425: /* tags_literal ::= literal_func */ +#line 799 "sql.y" +{ yylhsminor.yy718 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy718); } +#line 7137 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; 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); +#line 800 "sql.y" { - SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); + SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); l.n = (r.z + r.n) - l.z; - yylhsminor.yy656 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy656, yymsp[0].minor.yy656); + yylhsminor.yy718 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy718, yymsp[0].minor.yy718); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7149 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 429: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 430: /* literal ::= NK_INTEGER */ +#line 819 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } +#line 7155 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 430: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 431: /* literal ::= NK_FLOAT */ +#line 820 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } +#line 7161 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 431: /* literal ::= NK_STRING */ -{ yylhsminor.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 432: /* literal ::= NK_STRING */ +#line 821 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 7167 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 432: /* literal ::= NK_BOOL */ -{ yylhsminor.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 433: /* literal ::= NK_BOOL */ +#line 822 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } +#line 7173 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 433: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; + case 434: /* literal ::= TIMESTAMP NK_STRING */ +#line 823 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } +#line 7179 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; 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 640: /* query_simple ::= query_specification */ yytestcase(yyruleno==640); - case 641: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==641); - case 644: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==644); - case 646: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==646); -{ yylhsminor.yy656 = yymsp[0].minor.yy656; } - yymsp[0].minor.yy656 = yylhsminor.yy656; + 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 641: /* query_simple ::= query_specification */ yytestcase(yyruleno==641); + case 642: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==642); + case 645: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==645); + case 647: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==647); +#line 824 "sql.y" +{ yylhsminor.yy718 = yymsp[0].minor.yy718; } +#line 7204 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 435: /* literal ::= NULL */ -{ yylhsminor.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 436: /* literal ::= NULL */ +#line 825 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } +#line 7210 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 436: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 437: /* literal ::= NK_QUESTION */ +#line 826 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 7216 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 437: /* duration_literal ::= NK_VARIABLE */ - case 615: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==615); - case 616: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==616); - case 617: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==617); -{ yylhsminor.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 438: /* duration_literal ::= NK_VARIABLE */ + case 616: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==616); + case 617: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==617); + case 618: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==618); +#line 828 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 7225 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 438: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 439: /* signed ::= NK_INTEGER */ +#line 830 "sql.y" +{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +#line 7231 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 439: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 440: /* signed ::= NK_PLUS NK_INTEGER */ +#line 831 "sql.y" +{ yymsp[-1].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +#line 7237 "sql.c" break; - case 440: /* signed ::= NK_MINUS NK_INTEGER */ + case 441: /* signed ::= NK_MINUS NK_INTEGER */ +#line 832 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 7246 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 441: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 442: /* signed ::= NK_FLOAT */ +#line 837 "sql.y" +{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +#line 7252 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 442: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 443: /* signed ::= NK_PLUS NK_FLOAT */ +#line 838 "sql.y" +{ yymsp[-1].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +#line 7258 "sql.c" break; - case 443: /* signed ::= NK_MINUS NK_FLOAT */ + case 444: /* signed ::= NK_MINUS NK_FLOAT */ +#line 839 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 7267 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 445: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 446: /* signed_literal ::= NK_STRING */ +#line 846 "sql.y" +{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +#line 7273 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 446: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 447: /* signed_literal ::= NK_BOOL */ +#line 847 "sql.y" +{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } +#line 7279 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 447: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 448: /* signed_literal ::= TIMESTAMP NK_STRING */ +#line 848 "sql.y" +{ yymsp[-1].minor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 7285 "sql.c" 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 592: /* select_item ::= common_expression */ yytestcase(yyruleno==592); - case 602: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==602); - case 645: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==645); - case 647: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==647); - case 660: /* search_condition ::= common_expression */ yytestcase(yyruleno==660); -{ yylhsminor.yy656 = releaseRawExprNode(pCxt, yymsp[0].minor.yy656); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + 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 593: /* select_item ::= common_expression */ yytestcase(yyruleno==593); + case 603: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==603); + case 646: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==646); + case 648: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==648); + case 661: /* search_condition ::= common_expression */ yytestcase(yyruleno==661); +#line 849 "sql.y" +{ yylhsminor.yy718 = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); } +#line 7297 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 449: /* signed_literal ::= NULL */ -{ yylhsminor.yy656 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 450: /* signed_literal ::= NULL */ +#line 850 "sql.y" +{ yylhsminor.yy718 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } +#line 7303 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 451: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy656 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 452: /* signed_literal ::= NK_QUESTION */ +#line 852 "sql.y" +{ yylhsminor.yy718 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } +#line 7309 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 469: /* expression ::= pseudo_column */ -{ yylhsminor.yy656 = yymsp[0].minor.yy656; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy656, true); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 470: /* expression ::= pseudo_column */ +#line 914 "sql.y" +{ yylhsminor.yy718 = yymsp[0].minor.yy718; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy718, true); } +#line 7315 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 473: /* expression ::= NK_LP expression NK_RP */ - case 560: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==560); - case 659: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==659); -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy656)); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 474: /* expression ::= NK_LP expression NK_RP */ + case 561: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==561); + case 660: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==660); +#line 918 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } +#line 7323 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 474: /* expression ::= NK_PLUS expr_or_subquery */ + case 475: /* expression ::= NK_PLUS expr_or_subquery */ +#line 919 "sql.y" { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy656)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 7332 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 475: /* expression ::= NK_MINUS expr_or_subquery */ + case 476: /* expression ::= NK_MINUS expr_or_subquery */ +#line 923 "sql.y" { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy656), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy718), NULL)); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 7341 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 476: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 477: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ +#line 927 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7351 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 477: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 478: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ +#line 932 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7361 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 478: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 479: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ +#line 937 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7371 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 479: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 480: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ +#line 942 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7381 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 480: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 481: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ +#line 947 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7391 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 481: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 482: /* expression ::= column_reference NK_ARROW NK_STRING */ +#line 952 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7400 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 482: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 483: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ +#line 956 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7410 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 483: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 484: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ +#line 961 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7420 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 486: /* column_reference ::= column_name */ -{ yylhsminor.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy665, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy665)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 487: /* column_reference ::= column_name */ +#line 972 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy965, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy965)); } +#line 7426 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 487: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy665, createColumnNode(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy665)); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 488: /* column_reference ::= table_name NK_DOT column_name */ +#line 973 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965, createColumnNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy965)); } +#line 7432 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 488: /* column_reference ::= NK_ALIAS */ -{ yylhsminor.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 489: /* column_reference ::= NK_ALIAS */ +#line 974 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } +#line 7438 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 489: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 490: /* column_reference ::= table_name NK_DOT NK_ALIAS */ +#line 975 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0)); } +#line 7444 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; 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.yy656 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + 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); +#line 977 "sql.y" +{ yylhsminor.yy718 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } +#line 7462 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 492: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy665)))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 493: /* pseudo_column ::= table_name NK_DOT TBNAME */ +#line 979 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy965)))); } +#line 7468 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; 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.yy656 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy665, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy665, yymsp[-1].minor.yy136)); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; + 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); +#line 990 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy965, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy965, yymsp[-1].minor.yy552)); } +#line 7475 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 504: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy656), yymsp[-1].minor.yy256)); } - yymsp[-5].minor.yy656 = yylhsminor.yy656; + case 505: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +#line 993 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), yymsp[-1].minor.yy224)); } +#line 7481 "sql.c" + yymsp[-5].minor.yy718 = yylhsminor.yy718; break; - case 506: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy665, NULL)); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 507: /* literal_func ::= noarg_func NK_LP NK_RP */ +#line 996 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy965, NULL)); } +#line 7487 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 522: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy136 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy136 = yylhsminor.yy136; + case 523: /* star_func_para_list ::= NK_STAR */ +#line 1021 "sql.y" +{ yylhsminor.yy552 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } +#line 7493 "sql.c" + yymsp[0].minor.yy552 = yylhsminor.yy552; break; - case 527: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 595: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==595); -{ yylhsminor.yy656 = createColumnNode(pCxt, &yymsp[-2].minor.yy665, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 528: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 596: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==596); +#line 1030 "sql.y" +{ yylhsminor.yy718 = createColumnNode(pCxt, &yymsp[-2].minor.yy965, &yymsp[0].minor.yy0); } +#line 7500 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 528: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy136, yymsp[-1].minor.yy656)); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; + case 529: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +#line 1033 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy552, yymsp[-1].minor.yy718)); } +#line 7506 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 529: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy656), yymsp[-2].minor.yy136, yymsp[-1].minor.yy656)); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; + case 530: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +#line 1035 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), yymsp[-2].minor.yy552, yymsp[-1].minor.yy718)); } +#line 7512 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; break; - case 532: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy656 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656)); } + case 533: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +#line 1042 "sql.y" +{ yymsp[-3].minor.yy718 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718)); } +#line 7518 "sql.c" break; - case 534: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy656 = releaseRawExprNode(pCxt, yymsp[0].minor.yy656); } + case 535: /* case_when_else_opt ::= ELSE common_expression */ +#line 1045 "sql.y" +{ yymsp[-1].minor.yy718 = releaseRawExprNode(pCxt, yymsp[0].minor.yy718); } +#line 7523 "sql.c" 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); +#line 1048 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy836, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy810, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7533 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; 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 */ +#line 1055 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy656), releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy718), releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-4].minor.yy656 = yylhsminor.yy656; +#line 7543 "sql.c" + yymsp[-4].minor.yy718 = yylhsminor.yy718; 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 */ +#line 1061 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy656), releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy718), releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-5].minor.yy656 = yylhsminor.yy656; +#line 7553 "sql.c" + yymsp[-5].minor.yy718 = yylhsminor.yy718; break; - case 538: /* predicate ::= expr_or_subquery IS NULL */ + case 539: /* predicate ::= expr_or_subquery IS NULL */ +#line 1066 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), NULL)); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7562 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 539: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 540: /* predicate ::= expr_or_subquery IS NOT NULL */ +#line 1070 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy656), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), NULL)); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; +#line 7571 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 541: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy836 = OP_TYPE_LOWER_THAN; } + case 542: /* compare_op ::= NK_LT */ +#line 1082 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_LOWER_THAN; } +#line 7577 "sql.c" break; - case 542: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy836 = OP_TYPE_GREATER_THAN; } + case 543: /* compare_op ::= NK_GT */ +#line 1083 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_GREATER_THAN; } +#line 7582 "sql.c" break; - case 543: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy836 = OP_TYPE_LOWER_EQUAL; } + case 544: /* compare_op ::= NK_LE */ +#line 1084 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_LOWER_EQUAL; } +#line 7587 "sql.c" break; - case 544: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy836 = OP_TYPE_GREATER_EQUAL; } + case 545: /* compare_op ::= NK_GE */ +#line 1085 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_GREATER_EQUAL; } +#line 7592 "sql.c" break; - case 545: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy836 = OP_TYPE_NOT_EQUAL; } + case 546: /* compare_op ::= NK_NE */ +#line 1086 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_NOT_EQUAL; } +#line 7597 "sql.c" break; - case 546: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy836 = OP_TYPE_EQUAL; } + case 547: /* compare_op ::= NK_EQ */ +#line 1087 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_EQUAL; } +#line 7602 "sql.c" break; - case 547: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy836 = OP_TYPE_LIKE; } + case 548: /* compare_op ::= LIKE */ +#line 1088 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_LIKE; } +#line 7607 "sql.c" break; - case 548: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy836 = OP_TYPE_NOT_LIKE; } + case 549: /* compare_op ::= NOT LIKE */ +#line 1089 "sql.y" +{ yymsp[-1].minor.yy810 = OP_TYPE_NOT_LIKE; } +#line 7612 "sql.c" break; - case 549: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy836 = OP_TYPE_MATCH; } + case 550: /* compare_op ::= MATCH */ +#line 1090 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_MATCH; } +#line 7617 "sql.c" break; - case 550: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy836 = OP_TYPE_NMATCH; } + case 551: /* compare_op ::= NMATCH */ +#line 1091 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_NMATCH; } +#line 7622 "sql.c" break; - case 551: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy836 = OP_TYPE_JSON_CONTAINS; } + case 552: /* compare_op ::= CONTAINS */ +#line 1092 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_JSON_CONTAINS; } +#line 7627 "sql.c" break; - case 552: /* in_op ::= IN */ -{ yymsp[0].minor.yy836 = OP_TYPE_IN; } + case 553: /* in_op ::= IN */ +#line 1096 "sql.y" +{ yymsp[0].minor.yy810 = OP_TYPE_IN; } +#line 7632 "sql.c" break; - case 553: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy836 = OP_TYPE_NOT_IN; } + case 554: /* in_op ::= NOT IN */ +#line 1097 "sql.y" +{ yymsp[-1].minor.yy810 = OP_TYPE_NOT_IN; } +#line 7637 "sql.c" break; - case 554: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy136)); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 555: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +#line 1099 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy552)); } +#line 7642 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 556: /* boolean_value_expression ::= NOT boolean_primary */ + case 557: /* boolean_value_expression ::= NOT boolean_primary */ +#line 1103 "sql.y" { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy656), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy718), NULL)); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; +#line 7651 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; 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 */ +#line 1108 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7661 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; 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 */ +#line 1114 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy656); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy656); - yylhsminor.yy656 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy718); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy718); + yylhsminor.yy718 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; +#line 7671 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 566: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy656 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy656, yymsp[0].minor.yy656, NULL); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 567: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +#line 1132 "sql.y" +{ yylhsminor.yy718 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy718, yymsp[0].minor.yy718, NULL); } +#line 7677 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 569: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy656 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy665, &yymsp[0].minor.yy665); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; + case 570: /* table_primary ::= table_name alias_opt */ +#line 1138 "sql.y" +{ yylhsminor.yy718 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy965, &yymsp[0].minor.yy965); } +#line 7683 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 570: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy656 = createRealTableNode(pCxt, &yymsp[-3].minor.yy665, &yymsp[-1].minor.yy665, &yymsp[0].minor.yy665); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; + case 571: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +#line 1139 "sql.y" +{ yylhsminor.yy718 = createRealTableNode(pCxt, &yymsp[-3].minor.yy965, &yymsp[-1].minor.yy965, &yymsp[0].minor.yy965); } +#line 7689 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 571: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy656 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy656), &yymsp[0].minor.yy665); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; + case 572: /* table_primary ::= subquery alias_opt */ +#line 1140 "sql.y" +{ yylhsminor.yy718 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718), &yymsp[0].minor.yy965); } +#line 7695 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 573: /* alias_opt ::= */ -{ yymsp[1].minor.yy665 = nil_token; } + case 574: /* alias_opt ::= */ +#line 1145 "sql.y" +{ yymsp[1].minor.yy965 = nil_token; } +#line 7701 "sql.c" break; - case 575: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy665 = yymsp[0].minor.yy665; } + case 576: /* alias_opt ::= AS table_alias */ +#line 1147 "sql.y" +{ yymsp[-1].minor.yy965 = yymsp[0].minor.yy965; } +#line 7706 "sql.c" 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.yy656 = yymsp[-1].minor.yy656; } + 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); +#line 1149 "sql.y" +{ yymsp[-2].minor.yy718 = yymsp[-1].minor.yy718; } +#line 7712 "sql.c" break; - case 578: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy656 = createJoinTableNode(pCxt, yymsp[-4].minor.yy660, yymsp[-5].minor.yy656, yymsp[-2].minor.yy656, yymsp[0].minor.yy656); } - yymsp[-5].minor.yy656 = yylhsminor.yy656; + case 579: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +#line 1154 "sql.y" +{ yylhsminor.yy718 = createJoinTableNode(pCxt, yymsp[-4].minor.yy992, yymsp[-5].minor.yy718, yymsp[-2].minor.yy718, yymsp[0].minor.yy718); } +#line 7717 "sql.c" + yymsp[-5].minor.yy718 = yylhsminor.yy718; break; - case 579: /* join_type ::= */ -{ yymsp[1].minor.yy660 = JOIN_TYPE_INNER; } + case 580: /* join_type ::= */ +#line 1158 "sql.y" +{ yymsp[1].minor.yy992 = JOIN_TYPE_INNER; } +#line 7723 "sql.c" break; - case 580: /* join_type ::= INNER */ -{ yymsp[0].minor.yy660 = JOIN_TYPE_INNER; } + case 581: /* join_type ::= INNER */ +#line 1159 "sql.y" +{ yymsp[0].minor.yy992 = JOIN_TYPE_INNER; } +#line 7728 "sql.c" break; - case 581: /* 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 582: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ +#line 1165 "sql.y" { - yymsp[-13].minor.yy656 = createSelectStmt(pCxt, yymsp[-11].minor.yy497, yymsp[-9].minor.yy136, yymsp[-8].minor.yy656, yymsp[-12].minor.yy136); - yymsp[-13].minor.yy656 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy656, yymsp[-10].minor.yy497); - yymsp[-13].minor.yy656 = addWhereClause(pCxt, yymsp[-13].minor.yy656, yymsp[-7].minor.yy656); - yymsp[-13].minor.yy656 = addPartitionByClause(pCxt, yymsp[-13].minor.yy656, yymsp[-6].minor.yy136); - yymsp[-13].minor.yy656 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy656, yymsp[-2].minor.yy656); - yymsp[-13].minor.yy656 = addGroupByClause(pCxt, yymsp[-13].minor.yy656, yymsp[-1].minor.yy136); - yymsp[-13].minor.yy656 = addHavingClause(pCxt, yymsp[-13].minor.yy656, yymsp[0].minor.yy656); - yymsp[-13].minor.yy656 = addRangeClause(pCxt, yymsp[-13].minor.yy656, yymsp[-5].minor.yy656); - yymsp[-13].minor.yy656 = addEveryClause(pCxt, yymsp[-13].minor.yy656, yymsp[-4].minor.yy656); - yymsp[-13].minor.yy656 = addFillClause(pCxt, yymsp[-13].minor.yy656, yymsp[-3].minor.yy656); + yymsp[-13].minor.yy718 = createSelectStmt(pCxt, yymsp[-11].minor.yy559, yymsp[-9].minor.yy552, yymsp[-8].minor.yy718, yymsp[-12].minor.yy552); + yymsp[-13].minor.yy718 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy718, yymsp[-10].minor.yy559); + yymsp[-13].minor.yy718 = addWhereClause(pCxt, yymsp[-13].minor.yy718, yymsp[-7].minor.yy718); + yymsp[-13].minor.yy718 = addPartitionByClause(pCxt, yymsp[-13].minor.yy718, yymsp[-6].minor.yy552); + yymsp[-13].minor.yy718 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy718, yymsp[-2].minor.yy718); + yymsp[-13].minor.yy718 = addGroupByClause(pCxt, yymsp[-13].minor.yy718, yymsp[-1].minor.yy552); + yymsp[-13].minor.yy718 = addHavingClause(pCxt, yymsp[-13].minor.yy718, yymsp[0].minor.yy718); + yymsp[-13].minor.yy718 = addRangeClause(pCxt, yymsp[-13].minor.yy718, yymsp[-5].minor.yy718); + yymsp[-13].minor.yy718 = addEveryClause(pCxt, yymsp[-13].minor.yy718, yymsp[-4].minor.yy718); + yymsp[-13].minor.yy718 = addFillClause(pCxt, yymsp[-13].minor.yy718, yymsp[-3].minor.yy718); } +#line 7744 "sql.c" break; - case 582: /* hint_list ::= */ -{ yymsp[1].minor.yy136 = createHintNodeList(pCxt, NULL); } + case 583: /* hint_list ::= */ +#line 1180 "sql.y" +{ yymsp[1].minor.yy552 = createHintNodeList(pCxt, NULL); } +#line 7749 "sql.c" break; - case 583: /* hint_list ::= NK_HINT */ -{ yylhsminor.yy136 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy136 = yylhsminor.yy136; + case 584: /* hint_list ::= NK_HINT */ +#line 1181 "sql.y" +{ yylhsminor.yy552 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } +#line 7754 "sql.c" + yymsp[0].minor.yy552 = yylhsminor.yy552; break; - case 588: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy497 = false; } + case 589: /* set_quantifier_opt ::= ALL */ +#line 1192 "sql.y" +{ yymsp[0].minor.yy559 = false; } +#line 7760 "sql.c" break; - case 591: /* select_item ::= NK_STAR */ -{ yylhsminor.yy656 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy656 = yylhsminor.yy656; + case 592: /* select_item ::= NK_STAR */ +#line 1199 "sql.y" +{ yylhsminor.yy718 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } +#line 7765 "sql.c" + yymsp[0].minor.yy718 = yylhsminor.yy718; break; - case 593: /* select_item ::= common_expression column_alias */ - case 603: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==603); -{ yylhsminor.yy656 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy656), &yymsp[0].minor.yy665); } - yymsp[-1].minor.yy656 = yylhsminor.yy656; + case 594: /* select_item ::= common_expression column_alias */ + case 604: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==604); +#line 1201 "sql.y" +{ yylhsminor.yy718 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718), &yymsp[0].minor.yy965); } +#line 7772 "sql.c" + yymsp[-1].minor.yy718 = yylhsminor.yy718; break; - case 594: /* select_item ::= common_expression AS column_alias */ - case 604: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==604); -{ yylhsminor.yy656 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), &yymsp[0].minor.yy665); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 595: /* select_item ::= common_expression AS column_alias */ + case 605: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==605); +#line 1202 "sql.y" +{ yylhsminor.yy718 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), &yymsp[0].minor.yy965); } +#line 7779 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 599: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 629: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==629); - case 649: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==649); -{ yymsp[-2].minor.yy136 = yymsp[0].minor.yy136; } + case 600: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 630: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==630); + case 650: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==650); +#line 1211 "sql.y" +{ yymsp[-2].minor.yy552 = yymsp[0].minor.yy552; } +#line 7787 "sql.c" break; - case 606: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -{ yymsp[-5].minor.yy656 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy656), releaseRawExprNode(pCxt, yymsp[-1].minor.yy656)); } + case 607: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ +#line 1224 "sql.y" +{ yymsp[-5].minor.yy718 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } +#line 7792 "sql.c" break; - case 607: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy656 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy656)); } + case 608: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +#line 1225 "sql.y" +{ yymsp[-3].minor.yy718 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } +#line 7797 "sql.c" break; - case 608: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy656 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy656), NULL, yymsp[-1].minor.yy656, yymsp[0].minor.yy656); } + case 609: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +#line 1227 "sql.y" +{ yymsp[-5].minor.yy718 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), NULL, yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } +#line 7802 "sql.c" break; - case 609: /* 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.yy656 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy656), releaseRawExprNode(pCxt, yymsp[-3].minor.yy656), yymsp[-1].minor.yy656, yymsp[0].minor.yy656); } + case 610: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +#line 1231 "sql.y" +{ yymsp[-7].minor.yy718 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy718), releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), yymsp[-1].minor.yy718, yymsp[0].minor.yy718); } +#line 7807 "sql.c" break; - case 610: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy656 = createEventWindowNode(pCxt, yymsp[-3].minor.yy656, yymsp[0].minor.yy656); } + case 611: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +#line 1233 "sql.y" +{ yymsp[-6].minor.yy718 = createEventWindowNode(pCxt, yymsp[-3].minor.yy718, yymsp[0].minor.yy718); } +#line 7812 "sql.c" break; - case 611: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy656 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } + case 612: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ +#line 1235 "sql.y" +{ yymsp[-3].minor.yy718 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } +#line 7817 "sql.c" break; - case 612: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy656 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } + case 613: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +#line 1237 "sql.y" +{ yymsp[-5].minor.yy718 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } +#line 7822 "sql.c" break; - case 619: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy656 = createFillNode(pCxt, yymsp[-1].minor.yy822, NULL); } + case 620: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +#line 1247 "sql.y" +{ yymsp[-3].minor.yy718 = createFillNode(pCxt, yymsp[-1].minor.yy206, NULL); } +#line 7827 "sql.c" break; - case 620: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy656 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy136)); } + case 621: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +#line 1248 "sql.y" +{ yymsp[-5].minor.yy718 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy552)); } +#line 7832 "sql.c" break; - case 621: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy656 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy136)); } + case 622: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +#line 1249 "sql.y" +{ yymsp[-5].minor.yy718 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy552)); } +#line 7837 "sql.c" break; - case 622: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy822 = FILL_MODE_NONE; } + case 623: /* fill_mode ::= NONE */ +#line 1253 "sql.y" +{ yymsp[0].minor.yy206 = FILL_MODE_NONE; } +#line 7842 "sql.c" break; - case 623: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy822 = FILL_MODE_PREV; } + case 624: /* fill_mode ::= PREV */ +#line 1254 "sql.y" +{ yymsp[0].minor.yy206 = FILL_MODE_PREV; } +#line 7847 "sql.c" break; - case 624: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy822 = FILL_MODE_NULL; } + case 625: /* fill_mode ::= NULL */ +#line 1255 "sql.y" +{ yymsp[0].minor.yy206 = FILL_MODE_NULL; } +#line 7852 "sql.c" break; - case 625: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy822 = FILL_MODE_NULL_F; } + case 626: /* fill_mode ::= NULL_F */ +#line 1256 "sql.y" +{ yymsp[0].minor.yy206 = FILL_MODE_NULL_F; } +#line 7857 "sql.c" break; - case 626: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy822 = FILL_MODE_LINEAR; } + case 627: /* fill_mode ::= LINEAR */ +#line 1257 "sql.y" +{ yymsp[0].minor.yy206 = FILL_MODE_LINEAR; } +#line 7862 "sql.c" break; - case 627: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy822 = FILL_MODE_NEXT; } + case 628: /* fill_mode ::= NEXT */ +#line 1258 "sql.y" +{ yymsp[0].minor.yy206 = FILL_MODE_NEXT; } +#line 7867 "sql.c" break; - case 630: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy136 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); } - yymsp[0].minor.yy136 = yylhsminor.yy136; + case 631: /* group_by_list ::= expr_or_subquery */ +#line 1267 "sql.y" +{ yylhsminor.yy552 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } +#line 7872 "sql.c" + yymsp[0].minor.yy552 = yylhsminor.yy552; break; - case 631: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy136 = addNodeToList(pCxt, yymsp[-2].minor.yy136, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy656))); } - yymsp[-2].minor.yy136 = yylhsminor.yy136; + case 632: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +#line 1268 "sql.y" +{ yylhsminor.yy552 = addNodeToList(pCxt, yymsp[-2].minor.yy552, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy718))); } +#line 7878 "sql.c" + yymsp[-2].minor.yy552 = yylhsminor.yy552; break; - case 635: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy656 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy656), releaseRawExprNode(pCxt, yymsp[-1].minor.yy656)); } + case 636: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +#line 1275 "sql.y" +{ yymsp[-5].minor.yy718 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy718), releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } +#line 7884 "sql.c" break; - case 636: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy656 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy656)); } + case 637: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +#line 1277 "sql.y" +{ yymsp[-3].minor.yy718 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy718)); } +#line 7889 "sql.c" break; - case 639: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 640: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ +#line 1284 "sql.y" { - yylhsminor.yy656 = addOrderByClause(pCxt, yymsp[-3].minor.yy656, yymsp[-2].minor.yy136); - yylhsminor.yy656 = addSlimitClause(pCxt, yylhsminor.yy656, yymsp[-1].minor.yy656); - yylhsminor.yy656 = addLimitClause(pCxt, yylhsminor.yy656, yymsp[0].minor.yy656); + yylhsminor.yy718 = addOrderByClause(pCxt, yymsp[-3].minor.yy718, yymsp[-2].minor.yy552); + yylhsminor.yy718 = addSlimitClause(pCxt, yylhsminor.yy718, yymsp[-1].minor.yy718); + yylhsminor.yy718 = addLimitClause(pCxt, yylhsminor.yy718, yymsp[0].minor.yy718); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; +#line 7898 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 642: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy656 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy656, yymsp[0].minor.yy656); } - yymsp[-3].minor.yy656 = yylhsminor.yy656; + case 643: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +#line 1294 "sql.y" +{ yylhsminor.yy718 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy718, yymsp[0].minor.yy718); } +#line 7904 "sql.c" + yymsp[-3].minor.yy718 = yylhsminor.yy718; break; - case 643: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy656 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy656, yymsp[0].minor.yy656); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 644: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +#line 1296 "sql.y" +{ yylhsminor.yy718 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy718, yymsp[0].minor.yy718); } +#line 7910 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 651: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 655: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==655); -{ yymsp[-1].minor.yy656 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 652: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 656: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==656); +#line 1310 "sql.y" +{ yymsp[-1].minor.yy718 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 7917 "sql.c" break; - case 652: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 656: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==656); -{ yymsp[-3].minor.yy656 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 653: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 657: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==657); +#line 1311 "sql.y" +{ yymsp[-3].minor.yy718 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } +#line 7923 "sql.c" break; - case 653: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 657: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==657); -{ yymsp[-3].minor.yy656 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 654: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 658: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==658); +#line 1312 "sql.y" +{ yymsp[-3].minor.yy718 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } +#line 7929 "sql.c" break; - case 658: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy656 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy656); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 659: /* subquery ::= NK_LP query_expression NK_RP */ +#line 1320 "sql.y" +{ yylhsminor.yy718 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy718); } +#line 7934 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 663: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy656 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy656), yymsp[-1].minor.yy674, yymsp[0].minor.yy73); } - yymsp[-2].minor.yy656 = yylhsminor.yy656; + case 664: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +#line 1334 "sql.y" +{ yylhsminor.yy718 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy718), yymsp[-1].minor.yy576, yymsp[0].minor.yy345); } +#line 7940 "sql.c" + yymsp[-2].minor.yy718 = yylhsminor.yy718; break; - case 664: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy674 = ORDER_ASC; } + case 665: /* ordering_specification_opt ::= */ +#line 1338 "sql.y" +{ yymsp[1].minor.yy576 = ORDER_ASC; } +#line 7946 "sql.c" break; - case 665: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy674 = ORDER_ASC; } + case 666: /* ordering_specification_opt ::= ASC */ +#line 1339 "sql.y" +{ yymsp[0].minor.yy576 = ORDER_ASC; } +#line 7951 "sql.c" break; - case 666: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy674 = ORDER_DESC; } + case 667: /* ordering_specification_opt ::= DESC */ +#line 1340 "sql.y" +{ yymsp[0].minor.yy576 = ORDER_DESC; } +#line 7956 "sql.c" break; - case 667: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy73 = NULL_ORDER_DEFAULT; } + case 668: /* null_ordering_opt ::= */ +#line 1344 "sql.y" +{ yymsp[1].minor.yy345 = NULL_ORDER_DEFAULT; } +#line 7961 "sql.c" break; - case 668: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy73 = NULL_ORDER_FIRST; } + case 669: /* null_ordering_opt ::= NULLS FIRST */ +#line 1345 "sql.y" +{ yymsp[-1].minor.yy345 = NULL_ORDER_FIRST; } +#line 7966 "sql.c" break; - case 669: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy73 = NULL_ORDER_LAST; } + case 670: /* null_ordering_opt ::= NULLS LAST */ +#line 1346 "sql.y" +{ yymsp[-1].minor.yy345 = NULL_ORDER_LAST; } +#line 7971 "sql.c" break; default: break; @@ -6761,6 +8030,7 @@ static void yy_syntax_error( ParseCTX_FETCH #define TOKEN yyminor /************ Begin %syntax_error code ****************************************/ +#line 29 "sql.y" if (TSDB_CODE_SUCCESS == pCxt->errCode) { if(TOKEN.z) { @@ -6771,6 +8041,7 @@ static void yy_syntax_error( } else if (TSDB_CODE_PAR_DB_NOT_SPECIFIED == pCxt->errCode && TK_NK_FLOAT == TOKEN.type) { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); } +#line 8044 "sql.c" /************ End %syntax_error code ******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ ParseCTX_STORE @@ -6856,12 +8127,56 @@ void Parse( } #endif - do{ + while(1){ /* Exit by "break" */ + assert( yypParser->yytos>=yypParser->yystack ); assert( yyact==yypParser->yytos->stateno ); yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); if( yyact >= YY_MIN_REDUCE ){ - yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor, - yyminor ParseCTX_PARAM); + unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */ +#ifndef NDEBUG + assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ); + if( yyTraceFILE ){ + int yysize = yyRuleInfoNRhs[yyruleno]; + if( yysize ){ + fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", + yyTracePrompt, + yyruleno, yyRuleName[yyruleno], + yyrulenoyytos[yysize].stateno); + }else{ + fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n", + yyTracePrompt, yyruleno, yyRuleName[yyruleno], + yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ + yypParser->yyhwm++; + assert( yypParser->yyhwm == + (int)(yypParser->yytos - yypParser->yystack)); + } +#endif +#if YYSTACKDEPTH>0 + if( yypParser->yytos>=yypParser->yystackEnd ){ + yyStackOverflow(yypParser); + break; + } +#else + if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ + if( yyGrowStack(yypParser) ){ + yyStackOverflow(yypParser); + break; + } + } +#endif + } + yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ParseCTX_PARAM); }else if( yyact <= YY_MAX_SHIFTREDUCE ){ yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor); #ifndef YYNOERRORRECOVERY @@ -6917,14 +8232,13 @@ void Parse( yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); yymajor = YYNOCODE; }else{ - while( yypParser->yytos >= yypParser->yystack - && (yyact = yy_find_reduce_action( - yypParser->yytos->stateno, - YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE - ){ + while( yypParser->yytos > yypParser->yystack ){ + yyact = yy_find_reduce_action(yypParser->yytos->stateno, + YYERRORSYMBOL); + if( yyact<=YY_MAX_SHIFTREDUCE ) break; yy_pop_parser_stack(yypParser); } - if( yypParser->yytos < yypParser->yystack || yymajor==0 ){ + if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){ yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_parse_failed(yypParser); #ifndef YYNOERRORRECOVERY @@ -6974,7 +8288,7 @@ void Parse( break; #endif } - }while( yypParser->yytos>yypParser->yystack ); + } #ifndef NDEBUG if( yyTraceFILE ){ yyStackEntry *i; 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/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..c4f7d68f3b 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,25 @@ 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) { + 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..ba7d6cb448 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,49 @@ 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; + } + + 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 +786,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 +814,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 +1047,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 +1199,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 +1273,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 +1441,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 +2044,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 +2170,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 +2507,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 +2642,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 +3151,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 +3307,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 +3337,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 +3468,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 +3517,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..d88a00879e 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(); + sprintf(buf, "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 877e1f776a..8723f227dd 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") @@ -706,7 +710,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/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)