From 3711fdd8650c41dee52287f1dae96ad4a71302d4 Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 18 Jul 2023 16:09:38 +0800 Subject: [PATCH 01/46] feat/TD-22970 --- include/common/tmsg.h | 8 +- include/common/tmsgdef.h | 1 + include/libs/sync/sync.h | 5 +- source/common/src/tmsg.c | 12 +- source/dnode/mgmt/mgmt_mnode/src/mmHandle.c | 2 + source/dnode/mgmt/mgmt_vnode/inc/vmInt.h | 1 + source/dnode/mgmt/mgmt_vnode/src/vmHandle.c | 66 +- source/dnode/mgmt/mgmt_vnode/src/vmInt.c | 2 +- source/dnode/mgmt/mgmt_vnode/src/vmWorker.c | 3 + source/dnode/mnode/impl/inc/mndDef.h | 2 + source/dnode/mnode/impl/src/mndDnode.c | 1 + source/dnode/mnode/impl/src/mndSync.c | 2 +- source/dnode/mnode/impl/src/mndTrans.c | 2 +- source/dnode/mnode/impl/src/mndVgroup.c | 211 ++++++- source/dnode/vnode/inc/vnode.h | 2 +- source/dnode/vnode/src/inc/vnd.h | 2 +- source/dnode/vnode/src/vnd/vnodeCfg.c | 8 +- source/dnode/vnode/src/vnd/vnodeCommit.c | 6 +- source/dnode/vnode/src/vnd/vnodeOpen.c | 4 +- source/dnode/vnode/src/vnd/vnodeQuery.c | 1 + source/dnode/vnode/src/vnd/vnodeSvr.c | 22 +- source/dnode/vnode/src/vnd/vnodeSync.c | 4 +- source/libs/sync/inc/syncIndexMgr.h | 1 + source/libs/sync/inc/syncInt.h | 5 +- source/libs/sync/inc/syncPipeline.h | 4 +- source/libs/sync/inc/syncRaftEntry.h | 2 +- source/libs/sync/src/syncAppendEntries.c | 7 +- source/libs/sync/src/syncIndexMgr.c | 21 + source/libs/sync/src/syncMain.c | 650 +++++++++++++++++++- source/libs/sync/src/syncPipeline.c | 98 ++- source/libs/sync/src/syncRaftCfg.c | 8 +- 31 files changed, 1060 insertions(+), 103 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index b9365172d5..4e0a5edad9 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -77,7 +77,8 @@ static inline bool tmsgIsValid(tmsg_t type) { } static inline bool vnodeIsMsgBlock(tmsg_t type) { return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) || - (type == TDMT_VND_UPDATE_TAG_VAL) || (type == TDMT_VND_ALTER_CONFIRM) || (type == TDMT_VND_COMMIT); + (type == TDMT_VND_UPDATE_TAG_VAL) || (type == TDMT_VND_ALTER_CONFIRM) || (type == TDMT_VND_COMMIT) || + (type == TDMT_SYNC_CONFIG_CHANGE); } static inline bool syncUtilUserCommit(tmsg_t msgType) { @@ -1175,6 +1176,7 @@ typedef struct { int64_t numOfBatchInsertReqs; int64_t numOfBatchInsertSuccessReqs; int32_t numOfCachedTables; + int32_t learnerProgress; // use one reservered } SVnodeLoad; typedef struct { @@ -1314,6 +1316,7 @@ typedef struct { int8_t learnerReplica; int8_t learnerSelfIndex; SReplica learnerReplicas[TSDB_MAX_LEARNER_REPLICA]; + int32_t changeVersion; } SCreateVnodeReq; int32_t tSerializeSCreateVnodeReq(void* buf, int32_t bufLen, SCreateVnodeReq* pReq); @@ -1388,7 +1391,8 @@ typedef struct { int8_t learnerSelfIndex; int8_t learnerReplica; SReplica learnerReplicas[TSDB_MAX_LEARNER_REPLICA]; -} SAlterVnodeReplicaReq, SAlterVnodeTypeReq; + int32_t changeVersion; +} SAlterVnodeReplicaReq, SAlterVnodeTypeReq, SCheckLearnCatchupReq; int32_t tSerializeSAlterVnodeReplicaReq(void* buf, int32_t bufLen, SAlterVnodeReplicaReq* pReq); int32_t tDeserializeSAlterVnodeReplicaReq(void* buf, int32_t bufLen, SAlterVnodeReplicaReq* pReq); diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 8ebf07bfcc..9015d2f8e3 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -85,6 +85,7 @@ enum { TD_DEF_MSG_TYPE(TDMT_DND_MAX_MSG, "dnd-max", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_DND_ALTER_MNODE_TYPE, "dnode-alter-mnode-type", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_DND_ALTER_VNODE_TYPE, "dnode-alter-vnode-type", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP, "dnode-check-vnode-learner-catchup", NULL, NULL) TD_NEW_MSG_SEG(TDMT_MND_MSG) TD_DEF_MSG_TYPE(TDMT_MND_CONNECT, "connect", NULL, NULL) diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index 2a0a4b0f63..f28e75c68a 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -101,6 +101,7 @@ typedef struct SSyncCfg { int32_t myIndex; SNodeInfo nodeInfo[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA]; SyncIndex lastIndex; + int32_t changeVersion; } SSyncCfg; typedef struct SFsmCbMeta { @@ -239,16 +240,18 @@ typedef struct SSyncState { ESyncState state; bool restored; bool canRead; + int32_t progress; } SSyncState; int32_t syncInit(); void syncCleanUp(); -int64_t syncOpen(SSyncInfo* pSyncInfo); +int64_t syncOpen(SSyncInfo* pSyncInfo, bool isFirst); int32_t syncStart(int64_t rid); void syncStop(int64_t rid); void syncPreStop(int64_t rid); void syncPostStop(int64_t rid); 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); int32_t syncProcessMsg(int64_t rid, SRpcMsg* pMsg); diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index a25ee04a1b..1e66eee069 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -1078,7 +1078,7 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { if (tEncodeI64(&encoder, pload->compStorage) < 0) return -1; if (tEncodeI64(&encoder, pload->pointsWritten) < 0) return -1; if (tEncodeI32(&encoder, pload->numOfCachedTables) < 0) return -1; - if (tEncodeI32(&encoder, reserved) < 0) return -1; + if (tEncodeI32(&encoder, pload->learnerProgress) < 0) return -1; if (tEncodeI64(&encoder, reserved) < 0) return -1; if (tEncodeI64(&encoder, reserved) < 0) return -1; } @@ -1157,7 +1157,7 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { if (tDecodeI64(&decoder, &vload.compStorage) < 0) return -1; if (tDecodeI64(&decoder, &vload.pointsWritten) < 0) return -1; if (tDecodeI32(&decoder, &vload.numOfCachedTables) < 0) return -1; - if (tDecodeI32(&decoder, (int32_t *)&reserved) < 0) return -1; + if (tDecodeI32(&decoder, &vload.learnerProgress) < 0) return -1; if (tDecodeI64(&decoder, &reserved) < 0) return -1; if (tDecodeI64(&decoder, &reserved) < 0) return -1; if (taosArrayPush(pReq->pVloads, &vload) == NULL) { @@ -4290,6 +4290,7 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR SReplica *pReplica = &pReq->learnerReplicas[i]; if (tEncodeSReplica(&encoder, pReplica) < 0) return -1; } + if (tEncodeI32(&encoder, pReq->changeVersion) < 0) return -1; tEndEncode(&encoder); @@ -4376,6 +4377,9 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq * if (tDecodeSReplica(&decoder, pReplica) < 0) return -1; } } + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI32(&decoder, &pReq->changeVersion) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); @@ -4608,6 +4612,7 @@ int32_t tSerializeSAlterVnodeReplicaReq(void *buf, int32_t bufLen, SAlterVnodeRe SReplica *pReplica = &pReq->learnerReplicas[i]; if (tEncodeSReplica(&encoder, pReplica) < 0) return -1; } + if (tEncodeI32(&encoder, pReq->changeVersion) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -4639,6 +4644,9 @@ int32_t tDeserializeSAlterVnodeReplicaReq(void *buf, int32_t bufLen, SAlterVnode if (tDecodeSReplica(&decoder, pReplica) < 0) return -1; } } + if (!tDecodeIsEnd(&decoder)){ + if (tDecodeI32(&decoder, &pReq->changeVersion) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index d975eb1cd1..302d4dafd1 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -106,6 +106,8 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_DND_CONFIG_DNODE_RSP, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_DND_ALTER_MNODE_TYPE_RSP, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_DND_ALTER_VNODE_TYPE_RSP, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP_RSP, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_CONFIG_CHANGE_RSP, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_CONNECT, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_CREATE_ACCT, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h index d1dc872f4b..43df6a172a 100644 --- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h +++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h @@ -94,6 +94,7 @@ int32_t vmProcessAlterVnodeReplicaReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); 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); // 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 7e9f1f795f..16d1c9fbe1 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -133,6 +133,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) { pCfg->standby = 0; pCfg->syncCfg.replicaNum = 0; pCfg->syncCfg.totalReplicaNum = 0; + pCfg->syncCfg.changeVersion = pCreate->changeVersion; memset(&pCfg->syncCfg.nodeInfo, 0, sizeof(pCfg->syncCfg.nodeInfo)); for (int32_t i = 0; i < pCreate->replica; ++i) { @@ -211,14 +212,15 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { ", days:%d keep0:%d keep1:%d keep2:%d tsma:%d precision:%d compression:%d minRows:%d maxRows:%d" ", wal fsync:%d level:%d retentionPeriod:%d retentionSize:%" PRId64 " rollPeriod:%d segSize:%" PRId64 ", hash method:%d begin:%u end:%u prefix:%d surfix:%d replica:%d selfIndex:%d " - "learnerReplica:%d learnerSelfIndex:%d strict:%d", + "learnerReplica:%d learnerSelfIndex:%d strict:%d changeVersion:%d", req.vgId, TMSG_INFO(pMsg->msgType), req.pages, req.pageSize, req.buffer, req.pageSize * 1024, (uint64_t)req.buffer * 1024 * 1024, req.cacheLast, req.cacheLastSize, req.sstTrigger, req.tsdbPageSize, req.tsdbPageSize * 1024, req.db, req.dbUid, req.daysPerFile, req.daysToKeep0, req.daysToKeep1, req.daysToKeep2, req.isTsma, req.precision, req.compression, req.minRows, req.maxRows, req.walFsyncPeriod, req.walLevel, req.walRetentionPeriod, req.walRetentionSize, req.walRollPeriod, req.walSegmentSize, req.hashMethod, req.hashBegin, req.hashEnd, req.hashPrefix, - req.hashSuffix, req.replica, req.selfIndex, req.learnerReplica, req.learnerSelfIndex, req.strict); + req.hashSuffix, req.replica, req.selfIndex, req.learnerReplica, req.learnerSelfIndex, req.strict, + req.changeVersion); for (int32_t i = 0; i < req.replica; ++i) { dInfo("vgId:%d, replica:%d ep:%s:%u dnode:%d", req.vgId, i, req.replicas[i].fqdn, req.replicas[i].port, req.replicas[i].id); @@ -272,7 +274,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { goto _OVER; } - SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb, true); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode since %s", req.vgId, terrstr()); code = terrno; @@ -321,6 +323,7 @@ _OVER: return code; } +//alter replica doesn't use this, but restore dnode still use this int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { SAlterVnodeTypeReq req = {0}; if (tDeserializeSAlterVnodeReplicaReq(pMsg->pCont, pMsg->contLen, &req) != 0) { @@ -417,12 +420,12 @@ int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, begin to open vnode", vgId); - SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb, true); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", vgId, path, terrstr()); return -1; } - + if (vmOpenVnode(pMgmt, &wrapperCfg, pImpl) != 0) { dError("vgId:%d, failed to open vnode mgmt since %s", vgId, terrstr()); return -1; @@ -438,6 +441,53 @@ int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return 0; } +int32_t vmProcessCheckLearnCatchupReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { + SCheckLearnCatchupReq req = {0}; + if (tDeserializeSAlterVnodeReplicaReq(pMsg->pCont, pMsg->contLen, &req) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + if(req.learnerReplicas == 0){ + req.learnerSelfIndex = -1; + } + + dInfo("vgId:%d, vnode management handle msgType:%s, start to process check-learner-catchup-request", + req.vgId, TMSG_INFO(pMsg->msgType)); + + SVnodeObj *pVnode = vmAcquireVnode(pMgmt, req.vgId); + if (pVnode == NULL) { + dError("vgId:%d, failed to alter vnode type since %s", req.vgId, terrstr()); + terrno = TSDB_CODE_VND_NOT_EXIST; + return -1; + } + + ESyncRole role = vnodeGetRole(pVnode->pImpl); + dInfo("vgId:%d, checking node role:%d", req.vgId, role); + if(role == TAOS_SYNC_ROLE_VOTER){ + dError("vgId:%d, failed to alter vnode type since node already is role:%d", req.vgId, role); + terrno = TSDB_CODE_VND_ALREADY_IS_VOTER; + vmReleaseVnode(pMgmt, pVnode); + return -1; + } + + dInfo("vgId:%d, checking node catch up", req.vgId); + if(vnodeIsCatchUp(pVnode->pImpl) != 1){ + terrno = TSDB_CODE_VND_NOT_CATCH_UP; + vmReleaseVnode(pMgmt, pVnode); + return -1; + } + + dInfo("node:%s, catched up leader, continue to process alter-node-type-request", pMgmt->name); + + vmReleaseVnode(pMgmt, pVnode); + + dInfo("vgId:%d, vnode management handle msgType:%s, end to process check-learner-catchup-request", + req.vgId, TMSG_INFO(pMsg->msgType)); + + return 0; +} + int32_t vmProcessDisableVnodeWriteReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { SDisableVnodeWriteReq req = {0}; if (tDeserializeSDisableVnodeWriteReq(pMsg->pCont, pMsg->contLen, &req) != 0) { @@ -515,7 +565,7 @@ int32_t vmProcessAlterHashRangeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, open vnode", dstVgId); - SVnode *pImpl = vnodeOpen(dstPath, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(dstPath, pMgmt->pTfs, pMgmt->msgCb, true); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", dstVgId, dstPath, terrstr()); return -1; @@ -616,7 +666,7 @@ int32_t vmProcessAlterVnodeReplicaReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, begin to open vnode", vgId); - SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb, true); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", vgId, path, terrstr()); return -1; @@ -748,6 +798,8 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_DND_CREATE_VNODE, vmPutMsgToMgmtQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_DND_DROP_VNODE, vmPutMsgToMgmtQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_DND_ALTER_VNODE_TYPE, vmPutMsgToMgmtQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP, vmPutMsgToMgmtQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_CONFIG_CHANGE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_TIMEOUT_ELECTION, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_CLIENT_REQUEST, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index db46ce3ca0..6653f95606 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -207,7 +207,7 @@ static void *vmOpenVnodeInThread(void *param) { snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, pCfg->vgId); - SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb); + SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb, false); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode by thread:%d", pCfg->vgId, pThread->threadIndex); pThread->failed++; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index 247c1729a3..1a85ac5e2f 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -52,6 +52,9 @@ static void vmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { case TDMT_DND_ALTER_VNODE_TYPE: code = vmProcessAlterVnodeTypeReq(pMgmt, pMsg); break; + case TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP: + code = vmProcessCheckLearnCatchupReq(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/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 1f4bc19e33..ffc099cc88 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -349,6 +349,7 @@ typedef struct { bool syncRestore; bool syncCanRead; ESyncRole nodeRole; + int32_t learnerProgress; } SVnodeGid; typedef struct { @@ -372,6 +373,7 @@ typedef struct { SVnodeGid vnodeGid[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA]; void* pTsma; int32_t numOfCachedTables; + int32_t syncConfChangeVer; } SVgObj; typedef struct { diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 11825a4e50..349e162bed 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -501,6 +501,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { pGid->syncState = pVload->syncState; pGid->syncRestore = pVload->syncRestore; pGid->syncCanRead = pVload->syncCanRead; + pGid->learnerProgress = pVload->learnerProgress; roleChanged = true; } break; diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 68bfe09b5e..4bcc3637d9 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -476,7 +476,7 @@ int32_t mndInitSync(SMnode *pMnode) { } tsem_init(&pMgmt->syncSem, 0, 0); - pMgmt->sync = syncOpen(&syncInfo); + pMgmt->sync = syncOpen(&syncInfo, true); if (pMgmt->sync <= 0) { mError("failed to open sync since %s", terrstr()); return -1; diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 7ebaf6dda5..1ab3f76841 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -1125,7 +1125,7 @@ static int32_t mndTransSendSingleMsg(SMnode *pMnode, STrans *pTrans, STransActio int32_t code = tmsgSendReq(&pAction->epSet, &rpcMsg); if (code == 0) { pAction->msgSent = 1; - pAction->msgReceived = 0; + //pAction->msgReceived = 0; pAction->errCode = TSDB_CODE_ACTION_IN_PROGRESS; mInfo("trans:%d, %s:%d is sent, %s", pTrans->id, mndTransStr(pAction->stage), pAction->id, detail); diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 444d066afe..81ea033dba 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -27,7 +27,7 @@ #include "mndUser.h" #include "tmisce.h" -#define VGROUP_VER_NUMBER 1 +#define VGROUP_VER_NUMBER 2 #define VGROUP_RESERVE_SIZE 64 static int32_t mndVgroupActionInsert(SSdb *pSdb, SVgObj *pVgroup); @@ -65,6 +65,8 @@ int32_t mndInitVgroup(SMnode *pMnode) { mndSetMsgHandle(pMnode, TDMT_VND_DISABLE_WRITE_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_SYNC_FORCE_FOLLOWER_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_DND_ALTER_VNODE_TYPE_RSP, mndTransProcessRsp); + mndSetMsgHandle(pMnode, TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP_RSP, mndTransProcessRsp); + mndSetMsgHandle(pMnode, TDMT_SYNC_CONFIG_CHANGE_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_MND_REDISTRIBUTE_VGROUP, mndProcessRedistributeVgroupMsg); mndSetMsgHandle(pMnode, TDMT_MND_SPLIT_VGROUP, mndProcessSplitVgroupMsg); @@ -103,6 +105,7 @@ SSdbRaw *mndVgroupActionEncode(SVgObj *pVgroup) { SVnodeGid *pVgid = &pVgroup->vnodeGid[i]; SDB_SET_INT32(pRaw, dataPos, pVgid->dnodeId, _OVER) } + SDB_SET_INT32(pRaw, dataPos, pVgroup->syncConfChangeVer, _OVER) SDB_SET_RESERVE(pRaw, dataPos, VGROUP_RESERVE_SIZE, _OVER) SDB_SET_DATALEN(pRaw, dataPos, _OVER) @@ -127,7 +130,7 @@ SSdbRow *mndVgroupActionDecode(SSdbRaw *pRaw) { int8_t sver = 0; if (sdbGetRawSoftVer(pRaw, &sver) != 0) goto _OVER; - if (sver != VGROUP_VER_NUMBER) { + if (sver < 1 || sver > VGROUP_VER_NUMBER) { terrno = TSDB_CODE_SDB_INVALID_DATA_VER; goto _OVER; } @@ -156,6 +159,10 @@ SSdbRow *mndVgroupActionDecode(SSdbRaw *pRaw) { pVgid->syncState = TAOS_SYNC_STATE_LEADER; } } + if(sver > 1){ + SDB_GET_INT32(pRaw, dataPos, &pVgroup->syncConfChangeVer, _OVER) + } + SDB_GET_RESERVE(pRaw, dataPos, VGROUP_RESERVE_SIZE, _OVER) terrno = 0; @@ -207,6 +214,7 @@ static int32_t mndVgroupActionUpdate(SSdb *pSdb, SVgObj *pOld, SVgObj *pNew) { pNew->pointsWritten = pOld->pointsWritten; pNew->compact = pOld->compact; memcpy(pOld->vnodeGid, pNew->vnodeGid, (TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA) * sizeof(SVnodeGid)); + pOld->syncConfChangeVer = pNew->syncConfChangeVer; return 0; } @@ -312,6 +320,8 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg return NULL; } + createReq.changeVersion = pVgroup->syncConfChangeVer; + mInfo("vgId:%d, build create vnode req, replica:%d selfIndex:%d learnerReplica:%d learnerSelfIndex:%d strict:%d", createReq.vgId, createReq.replica, createReq.selfIndex, createReq.learnerReplica, createReq.learnerReplica, createReq.strict); @@ -392,6 +402,7 @@ static void *mndBuildAlterVnodeReplicaReq(SMnode *pMnode, SDbObj *pDb, SVgObj *p .learnerReplica = 0, .selfIndex = -1, .learnerSelfIndex = -1, + .changeVersion = pVgroup->syncConfChangeVer, }; for (int32_t v = 0; v < pVgroup->replica; ++v) { @@ -848,6 +859,28 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p } } snprintf(role, sizeof(role), "%s%s", syncStr(pVgroup->vnodeGid[i].syncState), star); + /* + mInfo("db:%s, learner progress:%d", pDb->name, pVgroup->vnodeGid[i].learnerProgress); + + if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEARNER) { + if(pVgroup->vnodeGid[i].learnerProgress < 0){ + snprintf(role, sizeof(role), "%s-", + syncStr(pVgroup->vnodeGid[i].syncState)); + + } + else if(pVgroup->vnodeGid[i].learnerProgress >= 100){ + snprintf(role, sizeof(role), "%s--", + syncStr(pVgroup->vnodeGid[i].syncState)); + } + else{ + snprintf(role, sizeof(role), "%s%d", + syncStr(pVgroup->vnodeGid[i].syncState), pVgroup->vnodeGid[i].learnerProgress); + } + } + else{ + snprintf(role, sizeof(role), "%s%s", syncStr(pVgroup->vnodeGid[i].syncState), star); + } + */ } else { } STR_WITH_MAXSIZE_TO_VARSTR(buf1, role, pShow->pMeta->pSchemas[cols].bytes); @@ -1132,6 +1165,51 @@ _OVER: return 0; } +static int32_t mndRemoveVnodeFromVgroupWithoutSave(SMnode *pMnode, STrans *pTrans, SVgObj *pVgroup, SArray *pArray, + SVnodeGid *pDelVgid) { + taosArraySort(pArray, (__compar_fn_t)mndCompareDnodeVnodes); + for (int32_t i = 0; i < taosArrayGetSize(pArray); ++i) { + SDnodeObj *pDnode = taosArrayGet(pArray, i); + mInfo("dnode:%d, equivalent vnodes:%d others:%d", pDnode->id, pDnode->numOfVnodes, pDnode->numOfOtherNodes); + } + + int32_t code = -1; + for (int32_t d = taosArrayGetSize(pArray) - 1; d >= 0; --d) { + SDnodeObj *pDnode = taosArrayGet(pArray, d); + + for (int32_t vn = 0; vn < pVgroup->replica; ++vn) { + SVnodeGid *pVgid = &pVgroup->vnodeGid[vn]; + if (pVgid->dnodeId == pDnode->id) { + int64_t vgMem = mndGetVgroupMemory(pMnode, NULL, pVgroup); + pDnode->memUsed -= vgMem; + mInfo("db:%s, vgId:%d, vn:%d is removed, memory:%" PRId64 ", dnode:%d avail:%" PRId64 " used:%" PRId64, + pVgroup->dbName, pVgroup->vgId, vn, vgMem, pVgid->dnodeId, pDnode->memAvail, pDnode->memUsed); + pDnode->numOfVnodes--; + pVgroup->replica--; + *pDelVgid = *pVgid; + *pVgid = pVgroup->vnodeGid[pVgroup->replica]; + memset(&pVgroup->vnodeGid[pVgroup->replica], 0, sizeof(SVnodeGid)); + code = 0; + goto _OVER; + } + } + } + +_OVER: + if (code != 0) { + terrno = TSDB_CODE_APP_ERROR; + mError("db:%s, failed to remove vnode from vgId:%d since %s", pVgroup->dbName, pVgroup->vgId, terrstr()); + return -1; + } + + for (int32_t vn = 0; vn < pVgroup->replica; ++vn) { + SVnodeGid *pVgid = &pVgroup->vnodeGid[vn]; + mInfo("db:%s, vgId:%d, vn:%d dnode:%d is reserved", pVgroup->dbName, pVgroup->vgId, vn, pVgid->dnodeId); + } + + return 0; +} + int32_t mndAddCreateVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SVnodeGid *pVgid) { STransAction action = {0}; @@ -1208,6 +1286,40 @@ int32_t mndAddAlterVnodeConfirmAction(SMnode *pMnode, STrans *pTrans, SDbObj *pD return 0; } +int32_t mndAddChangeConfigAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, + SVgObj *pOldVgroup, SVgObj *pNewVgroup, int32_t dnodeId) { + STransAction action = {0}; + action.epSet = mndGetVgroupEpset(pMnode, pNewVgroup); + + int32_t contLen = 0; + void *pReq = mndBuildAlterVnodeReplicaReq(pMnode, pDb, pNewVgroup, dnodeId, &contLen); + if (pReq == NULL) return -1; + + int32_t totallen = contLen + sizeof(SMsgHead); + + SMsgHead *pHead = taosMemoryMalloc(totallen); + if (pHead == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return -1; + } + + pHead->contLen = htonl(totallen); + pHead->vgId = htonl(pNewVgroup->vgId); + + memcpy((void*)(pHead + 1), pReq, contLen); + + action.pCont = pHead; + action.contLen = totallen; + action.msgType = TDMT_SYNC_CONFIG_CHANGE; + + if (mndTransAppendRedoAction(pTrans, &action) != 0) { + taosMemoryFree(pReq); + return -1; + } + + return 0; +} + static int32_t mndAddAlterVnodeHashRangeAction(SMnode *pMnode, STrans *pTrans, int32_t srcVgId, SVgObj *pVgroup) { STransAction action = {0}; action.epSet = mndGetVgroupEpset(pMnode, pVgroup); @@ -1288,7 +1400,7 @@ int32_t mndAddAlterVnodeReplicaAction(SMnode *pMnode, STrans *pTrans, SDbObj *pD return 0; } -int32_t mndAddAlterVnodeTypeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int32_t dnodeId) { +int32_t mndAddCheckLearnerCatchupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int32_t dnodeId) { SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId); if (pDnode == NULL) return -1; @@ -1302,7 +1414,7 @@ int32_t mndAddAlterVnodeTypeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, action.pCont = pReq; action.contLen = contLen; - action.msgType = TDMT_DND_ALTER_VNODE_TYPE; + action.msgType = TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP; action.acceptableCode = TSDB_CODE_VND_ALREADY_IS_VOTER; action.retryCode = TSDB_CODE_VND_NOT_CATCH_UP; @@ -2130,62 +2242,101 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb mndTransSetSerial(pTrans); + mInfo("trans:%d, vgid:%d alter vgroup, syncConfChangeVer:%d, version:%d, replica:%d", + pTrans->id, pVgroup->vgId, pVgroup->syncConfChangeVer, pVgroup->version, pVgroup->replica); + if (newVgroup.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; + //add third + if (mndAddVnodeToVgroup(pMnode, pTrans, &newVgroup, pArray) != 0) return -1; - //learner stage + //add 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) - return -1; - + newVgroup.vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_LEARNER; + newVgroup.syncConfChangeVer++; + if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; + //if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1; + - //follower stage + //check learner + newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; 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) + newVgroup.vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_VOTER; + if (mndAddCheckLearnerCatchupAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) return -1; + if (mndAddCheckLearnerCatchupAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[2].dnodeId) != 0) return -1; + + //change raft type + newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; + newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; + newVgroup.vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_LEARNER; + newVgroup.syncConfChangeVer++; + if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; - //add third - if (mndAddVnodeToVgroup(pMnode, pTrans, &newVgroup, 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) + newVgroup.syncConfChangeVer++; + if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) - return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + + SSdbRaw *pVgRaw = mndVgroupActionEncode(&newVgroup); + if (pVgRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pVgRaw) != 0) { + sdbFreeRaw(pVgRaw); + return -1; + } + (void)sdbSetRawStatus(pVgRaw, SDB_STATUS_READY); } else if (newVgroup.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) - return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) - return -1; + if (mndRemoveVnodeFromVgroupWithoutSave(pMnode, pTrans, &newVgroup, pArray, &del1) != 0) return -1; + + newVgroup.syncConfChangeVer++; + if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 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 (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del1, true) != 0) return -1; + + SSdbRaw *pVgRaw = mndVgroupActionEncode(&newVgroup); + if (pVgRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pVgRaw) != 0) { + sdbFreeRaw(pVgRaw); return -1; + } + (void)sdbSetRawStatus(pVgRaw, SDB_STATUS_READY); + + SVnodeGid del2 = {0}; + if (mndRemoveVnodeFromVgroupWithoutSave(pMnode, pTrans, &newVgroup, pArray, &del2) != 0) return -1; + + newVgroup.syncConfChangeVer++; + if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + + if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del2, true) != 0) return -1; + + pVgRaw = mndVgroupActionEncode(&newVgroup); + if (pVgRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pVgRaw) != 0) { + sdbFreeRaw(pVgRaw); + return -1; + } + (void)sdbSetRawStatus(pVgRaw, SDB_STATUS_READY); } else { return -1; } diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 0b7820c030..0f48314c6c 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -56,7 +56,7 @@ int32_t vnodeAlterReplica(const char *path, SAlterVnodeReplicaReq *pReq, STfs *p int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnodeHashRangeReq *pReq, STfs *pTfs); int32_t vnodeRestoreVgroupId(const char *srcPath, const char *dstPath, int32_t srcVgId, int32_t dstVgId, STfs *pTfs); void vnodeDestroy(const char *path, STfs *pTfs); -SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb); +SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb, bool isFirst); void vnodePreClose(SVnode *pVnode); void vnodePostClose(SVnode *pVnode); void vnodeSyncCheckTimeout(SVnode *pVnode); diff --git a/source/dnode/vnode/src/inc/vnd.h b/source/dnode/vnode/src/inc/vnd.h index ac352e764c..99cb4f19cb 100644 --- a/source/dnode/vnode/src/inc/vnd.h +++ b/source/dnode/vnode/src/inc/vnd.h @@ -109,7 +109,7 @@ int32_t vnodeAsyncCommit(SVnode* pVnode); bool vnodeShouldRollback(SVnode* pVnode); // vnodeSync.c -int32_t vnodeSyncOpen(SVnode* pVnode, char* path); +int32_t vnodeSyncOpen(SVnode* pVnode, char* path, bool isFirst); int32_t vnodeSyncStart(SVnode* pVnode); void vnodeSyncPreClose(SVnode* pVnode); void vnodeSyncPostClose(SVnode* pVnode); diff --git a/source/dnode/vnode/src/vnd/vnodeCfg.c b/source/dnode/vnode/src/vnd/vnodeCfg.c index efe82e1783..3dc1cd800a 100644 --- a/source/dnode/vnode/src/vnd/vnodeCfg.c +++ b/source/dnode/vnode/src/vnd/vnodeCfg.c @@ -141,6 +141,7 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) { if (tjsonAddIntegerToObject(pJson, "syncCfg.replicaNum", pCfg->syncCfg.replicaNum) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "syncCfg.myIndex", pCfg->syncCfg.myIndex) < 0) return -1; + if (tjsonAddIntegerToObject(pJson, "syncCfg.changeVersion", pCfg->syncCfg.changeVersion) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "vndStats.stables", pCfg->vndStats.numOfSTables) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "vndStats.ctables", pCfg->vndStats.numOfCTables) < 0) return -1; @@ -151,8 +152,9 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) { SJson *nodeInfo = tjsonCreateArray(); if (nodeInfo == NULL) return -1; if (tjsonAddItemToObject(pJson, "syncCfg.nodeInfo", nodeInfo) < 0) return -1; - vDebug("vgId:%d, encode config, replicas:%d totalReplicas:%d selfIndex:%d", pCfg->vgId, pCfg->syncCfg.replicaNum, - pCfg->syncCfg.totalReplicaNum, pCfg->syncCfg.myIndex); + vDebug("vgId:%d, encode config, replicas:%d totalReplicas:%d selfIndex:%d changeVersion:%d", + pCfg->vgId, pCfg->syncCfg.replicaNum, + pCfg->syncCfg.totalReplicaNum, pCfg->syncCfg.myIndex, pCfg->syncCfg.changeVersion); for (int i = 0; i < pCfg->syncCfg.totalReplicaNum; ++i) { SJson *info = tjsonCreateObject(); SNodeInfo *pNode = (SNodeInfo *)&pCfg->syncCfg.nodeInfo[i]; @@ -263,6 +265,8 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) { if (code < 0) return -1; tjsonGetNumberValue(pJson, "syncCfg.myIndex", pCfg->syncCfg.myIndex, code); if (code < 0) return -1; + tjsonGetNumberValue(pJson, "syncCfg.changeVersion", pCfg->syncCfg.changeVersion, code); + if (code < 0) return -1; tjsonGetNumberValue(pJson, "vndStats.stables", pCfg->vndStats.numOfSTables, code); if (code < 0) return -1; diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index b2360a57da..f54e854ace 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -195,8 +195,10 @@ int vnodeSaveInfo(const char *dir, const SVnodeInfo *pInfo) { // free info binary taosMemoryFree(data); - vInfo("vgId:%d, vnode info is saved, fname:%s replica:%d selfIndex:%d", pInfo->config.vgId, fname, - pInfo->config.syncCfg.replicaNum, pInfo->config.syncCfg.myIndex); + vInfo("vgId:%d, vnode info is saved, fname:%s replica:%d selfIndex:%d changeVersion:%d", + pInfo->config.vgId, fname, + pInfo->config.syncCfg.replicaNum, pInfo->config.syncCfg.myIndex, + pInfo->config.syncCfg.changeVersion); return 0; diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 541c695ba0..b826e7c110 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -284,7 +284,7 @@ void vnodeDestroy(const char *path, STfs *pTfs) { tfsRmdir(pTfs, path); } -SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) { +SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb, bool isFirst) { SVnode *pVnode = NULL; SVnodeInfo info = {0}; char dir[TSDB_FILENAME_LEN] = {0}; @@ -407,7 +407,7 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) { } // open sync - if (vnodeSyncOpen(pVnode, dir)) { + if (vnodeSyncOpen(pVnode, dir, isFirst)) { vError("vgId:%d, failed to open sync since %s", TD_VID(pVnode), tstrerror(terrno)); goto _err; } diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index 51f4cee40c..90322dc306 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -381,6 +381,7 @@ int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) { pLoad->syncState = state.state; pLoad->syncRestore = state.restored; pLoad->syncCanRead = state.canRead; + pLoad->learnerProgress = state.progress; pLoad->cacheUsage = tsdbCacheGetUsage(pVnode); pLoad->numOfCachedTables = tsdbCacheGetElems(pVnode); pLoad->numOfTables = metaGetTbNum(pVnode->pMeta); diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index e4a7ed224c..f39f813d6a 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -36,6 +36,7 @@ static int32_t vnodeProcessBatchDeleteReq(SVnode *pVnode, int64_t ver, void *pRe 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 vnodePreprocessCreateTableReq(SVnode *pVnode, SDecoder *pCoder, int64_t btime, int64_t *pUid) { int32_t code = 0; @@ -392,10 +393,13 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t ver, SRpcMsg return -1; } - vDebug("vgId:%d, start to process write request %s, index:%" PRId64, TD_VID(pVnode), TMSG_INFO(pMsg->msgType), ver); + vDebug("vgId:%d, start to process write request %s, index:%" PRId64 ", applied:%" PRId64 + ", state.applyTerm:%" PRId64 ", conn.applyTerm:%" PRId64, + TD_VID(pVnode), TMSG_INFO(pMsg->msgType), ver, pVnode->state.applied, + pVnode->state.applyTerm, pMsg->info.conn.applyTerm); ASSERT(pVnode->state.applyTerm <= pMsg->info.conn.applyTerm); - ASSERT(pVnode->state.applied + 1 == ver); + ASSERTS(pVnode->state.applied + 1 == ver, "applied:%" PRId64 ", ver:%" PRId64, pVnode->state.applied, ver); atomic_store_64(&pVnode->state.applied, ver); atomic_store_64(&pVnode->state.applyTerm, pMsg->info.conn.applyTerm); @@ -518,6 +522,9 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t ver, SRpcMsg case TDMT_VND_COMPACT: vnodeProcessCompactVnodeReq(pVnode, ver, pReq, len, pRsp); goto _exit; + case TDMT_SYNC_CONFIG_CHANGE: + vnodeProcessConfigChangeReq(pVnode, ver, pReq, len, pRsp); + break; default: vError("vgId:%d, unprocessed msg, %d", TD_VID(pVnode), pMsg->msgType); return -1; @@ -1834,6 +1841,17 @@ static int32_t vnodeProcessCompactVnodeReq(SVnode *pVnode, int64_t ver, void *pR return vnodeProcessCompactVnodeReqImpl(pVnode, ver, pReq, len, pRsp); } +static int32_t vnodeProcessConfigChangeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp) { + syncCheckMember(pVnode->sync); + + pRsp->msgType = TDMT_SYNC_CONFIG_CHANGE_RSP; + pRsp->code = TSDB_CODE_SUCCESS; + pRsp->pCont = NULL; + pRsp->contLen = 0; + + return 0; +} + #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 360da41482..468db28c39 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -637,7 +637,7 @@ static SSyncFSM *vnodeSyncMakeFsm(SVnode *pVnode) { return pFsm; } -int32_t vnodeSyncOpen(SVnode *pVnode, char *path) { +int32_t vnodeSyncOpen(SVnode *pVnode, char *path, bool isFirst) { SSyncInfo syncInfo = { .snapshotStrategy = SYNC_STRATEGY_WAL_FIRST, .batchSize = 1, @@ -664,7 +664,7 @@ int32_t vnodeSyncOpen(SVnode *pVnode, char *path) { pNode->nodeId, pNode->clusterId); } - pVnode->sync = syncOpen(&syncInfo); + pVnode->sync = syncOpen(&syncInfo, isFirst); if (pVnode->sync <= 0) { vError("vgId:%d, failed to open sync since %s", pVnode->config.vgId, terrstr()); return -1; diff --git a/source/libs/sync/inc/syncIndexMgr.h b/source/libs/sync/inc/syncIndexMgr.h index a4e83dc495..3c372a3b12 100644 --- a/source/libs/sync/inc/syncIndexMgr.h +++ b/source/libs/sync/inc/syncIndexMgr.h @@ -40,6 +40,7 @@ void syncIndexMgrDestroy(SSyncIndexMgr *pIndexMgr); void syncIndexMgrClear(SSyncIndexMgr *pIndexMgr); void syncIndexMgrSetIndex(SSyncIndexMgr *pIndexMgr, const SRaftId *pRaftId, SyncIndex index); SyncIndex syncIndexMgrGetIndex(SSyncIndexMgr *pIndexMgr, const SRaftId *pRaftId); +void syncIndexMgrCopyIfExist(SSyncIndexMgr * pNewIndex, SSyncIndexMgr * pOldIndex, SRaftId *oldReplicasId); void syncIndexMgrSetStartTime(SSyncIndexMgr *pIndexMgr, const SRaftId *pRaftId, int64_t startTime); int64_t syncIndexMgrGetStartTime(SSyncIndexMgr *pIndexMgr, const SRaftId *pRaftId); diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index 7d336c8313..7613fde169 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -228,7 +228,7 @@ typedef struct SSyncNode { } SSyncNode; // open/close -------------- -SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo); +SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, bool isFirst); int32_t syncNodeStart(SSyncNode* pSyncNode); int32_t syncNodeStartStandBy(SSyncNode* pSyncNode); void syncNodeClose(SSyncNode* pSyncNode); @@ -238,6 +238,9 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int int32_t syncNodeRestore(SSyncNode* pSyncNode); void syncHbTimerDataFree(SSyncHbTimerData* pData); +// config +int32_t syncNodeChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry, char* str); + // on message --------------------- int32_t syncNodeOnTimeout(SSyncNode* ths, const SRpcMsg* pMsg); int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIndex); diff --git a/source/libs/sync/inc/syncPipeline.h b/source/libs/sync/inc/syncPipeline.h index 65e2cc22a0..ddc036b606 100644 --- a/source/libs/sync/inc/syncPipeline.h +++ b/source/libs/sync/inc/syncPipeline.h @@ -105,7 +105,7 @@ bool syncLogBufferIsEmpty(SSyncLogBuffer* pBuf); int32_t syncLogBufferAppend(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEntry* pEntry); int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEntry* pEntry, SyncTerm prevTerm); -int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* pMatchTerm); +int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* pMatchTerm, char *str); int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t commitIndex); int32_t syncLogBufferReset(SSyncLogBuffer* pBuf, SSyncNode* pNode); @@ -115,7 +115,7 @@ int32_t syncLogBufferValidate(SSyncLogBuffer* pBuf); int32_t syncLogBufferRollback(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncIndex toIndex); int32_t syncFsmExecute(SSyncNode* pNode, SSyncFSM* pFsm, ESyncState role, SyncTerm term, SSyncRaftEntry* pEntry, - int32_t applyCode); + int32_t applyCode, bool force); #ifdef __cplusplus } #endif diff --git a/source/libs/sync/inc/syncRaftEntry.h b/source/libs/sync/inc/syncRaftEntry.h index f9447e0168..b13c69e471 100644 --- a/source/libs/sync/inc/syncRaftEntry.h +++ b/source/libs/sync/inc/syncRaftEntry.h @@ -46,7 +46,7 @@ void syncEntryDestroy(SSyncRaftEntry* pEntry); void syncEntry2OriginalRpc(const SSyncRaftEntry* pEntry, SRpcMsg* pRpcMsg); // step 7 static FORCE_INLINE bool syncLogReplBarrier(SSyncRaftEntry* pEntry) { - return pEntry->originalRpcType == TDMT_SYNC_NOOP; + return pEntry->originalRpcType == TDMT_SYNC_NOOP || pEntry->originalRpcType == TDMT_SYNC_CONFIG_CHANGE; } #ifdef __cplusplus diff --git a/source/libs/sync/src/syncAppendEntries.c b/source/libs/sync/src/syncAppendEntries.c index 6f065f56e8..925988f43a 100644 --- a/source/libs/sync/src/syncAppendEntries.c +++ b/source/libs/sync/src/syncAppendEntries.c @@ -151,8 +151,9 @@ int32_t syncNodeOnAppendEntries(SSyncNode* ths, const SRpcMsg* pRpcMsg) { } sTrace("vgId:%d, recv append entries msg. index:%" PRId64 ", term:%" PRId64 ", preLogIndex:%" PRId64 - ", prevLogTerm:%" PRId64 " commitIndex:%" PRId64 "", - pMsg->vgId, pMsg->prevLogIndex + 1, pMsg->term, pMsg->prevLogIndex, pMsg->prevLogTerm, pMsg->commitIndex); + ", prevLogTerm:%" PRId64 " commitIndex:%" PRId64 " entryterm:%" PRId64, + pMsg->vgId, pMsg->prevLogIndex + 1, pMsg->term, pMsg->prevLogIndex, pMsg->prevLogTerm, pMsg->commitIndex, + pEntry->term); // accept if (syncLogBufferAccept(ths->pLogBuf, ths, pEntry, pMsg->prevLogTerm) < 0) { @@ -162,7 +163,7 @@ int32_t syncNodeOnAppendEntries(SSyncNode* ths, const SRpcMsg* pRpcMsg) { _SEND_RESPONSE: pEntry = NULL; - pReply->matchIndex = syncLogBufferProceed(ths->pLogBuf, ths, &pReply->lastMatchTerm); + pReply->matchIndex = syncLogBufferProceed(ths->pLogBuf, ths, &pReply->lastMatchTerm, "OnAppn"); bool matched = (pReply->matchIndex >= pReply->lastSendIndex); if (accepted && matched) { pReply->success = true; diff --git a/source/libs/sync/src/syncIndexMgr.c b/source/libs/sync/src/syncIndexMgr.c index e3c3f63a4f..add2f1a5dd 100644 --- a/source/libs/sync/src/syncIndexMgr.c +++ b/source/libs/sync/src/syncIndexMgr.c @@ -70,6 +70,27 @@ void syncIndexMgrSetIndex(SSyncIndexMgr *pIndexMgr, const SRaftId *pRaftId, Sync DID(pRaftId), CID(pRaftId)); } +void syncIndexMgrCopyIfExist(SSyncIndexMgr * pNewIndex, SSyncIndexMgr * pOldIndex, SRaftId *oldReplicasId){ + for(int j = 0; j < pOldIndex->totalReplicaNum; ++j){ + sDebug("old Index j:%d, index:%"PRId64, j, pOldIndex->index[j]); + } + + for (int i = 0; i < pNewIndex->totalReplicaNum; ++i) { + for(int j = 0; j < pOldIndex->totalReplicaNum; ++j){ + if (syncUtilSameId(/*(const SRaftId*)*/&((oldReplicasId[j])), &((*(pNewIndex->replicas))[i]))) { + pNewIndex->index[i] = pOldIndex->index[j]; + pNewIndex->privateTerm[i] = pOldIndex->privateTerm[j]; + pNewIndex->startTimeArr[i] = pOldIndex->startTimeArr[j]; + pNewIndex->recvTimeArr[i] = pOldIndex->recvTimeArr[j]; + } + } + } + + for (int i = 0; i < pNewIndex->totalReplicaNum; ++i){ + sDebug("new index i:%d, index:%"PRId64, i, pNewIndex->index[i]); + } +} + SSyncLogReplMgr *syncNodeGetLogReplMgr(SSyncNode *pNode, SRaftId *pRaftId) { for (int i = 0; i < pNode->totalReplicaNum; i++) { if (syncUtilSameId(&pNode->replicasId[i], pRaftId)) { diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index f8e21af2c3..d4faf271ca 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -59,8 +59,8 @@ static int32_t syncDoLeaderTransfer(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyncRaftE static ESyncStrategy syncNodeStrategy(SSyncNode* pSyncNode); -int64_t syncOpen(SSyncInfo* pSyncInfo) { - SSyncNode* pSyncNode = syncNodeOpen(pSyncInfo); +int64_t syncOpen(SSyncInfo* pSyncInfo, bool isFirst) { + SSyncNode* pSyncNode = syncNodeOpen(pSyncInfo, isFirst); if (pSyncNode == NULL) { sError("vgId:%d, failed to open sync node", pSyncInfo->vgId); return -1; @@ -514,6 +514,20 @@ SSyncState syncGetState(int64_t rid) { } else { state.canRead = state.restored; } + /* + double progress = 0; + if(pSyncNode->pLogBuf->totalIndex > 0 && pSyncNode->pLogBuf->commitIndex > 0){ + progress = (double)pSyncNode->pLogBuf->commitIndex/(double)pSyncNode->pLogBuf->totalIndex; + state.progress = (int32_t)(progress * 100); + } + else{ + state.progress = -1; + } + sDebug("vgId:%d, learner progress state, commitIndex:%" PRId64 " totalIndex:%" PRId64 ", " + "progress:%lf, progress:%d", + pSyncNode->vgId, + pSyncNode->pLogBuf->commitIndex, pSyncNode->pLogBuf->totalIndex, progress, state.progress); + */ syncNodeRelease(pSyncNode); } @@ -570,6 +584,20 @@ int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak, int64_t* seq) { return ret; } +int32_t syncCheckMember(int64_t rid) { + SSyncNode* pSyncNode = syncNodeAcquire(rid); + if (pSyncNode == NULL) { + sError("sync propose error"); + return -1; + } + + if(pSyncNode->myNodeInfo.nodeRole == TAOS_SYNC_ROLE_LEARNER){ + return -1; + } + + return 0; +} + int32_t syncIsCatchUp(int64_t rid) { SSyncNode* pSyncNode = syncNodeAcquire(rid); if (pSyncNode == NULL) { @@ -631,15 +659,26 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_ } // optimized one replica - if (syncNodeIsOptimizedOneReplica(pSyncNode, pMsg)) { + if (syncNodeIsOptimizedOneReplica(pSyncNode, pMsg)) { SyncIndex retIndex; int32_t code = syncNodeOnClientRequest(pSyncNode, pMsg, &retIndex); - if (code == 0) { + if (code >= 0) { pMsg->info.conn.applyIndex = retIndex; pMsg->info.conn.applyTerm = raftStoreGetTerm(pSyncNode); - sTrace("vgId:%d, propose optimized msg, index:%" PRId64 " type:%s", pSyncNode->vgId, retIndex, - TMSG_INFO(pMsg->msgType)); - return 1; + + //after raft member change, need to handle 1->2 switching point + //at this point, need to switch entry handling thread + if(pSyncNode->replicaNum == 1){ + sTrace("vgId:%d, propose optimized msg, index:%" PRId64 " type:%s", pSyncNode->vgId, retIndex, + TMSG_INFO(pMsg->msgType)); + return 1; + } + else{ + sTrace("vgId:%d, propose optimized msg, return to normal, index:%" PRId64 " type:%s, " + "handle:%p", pSyncNode->vgId, retIndex, + TMSG_INFO(pMsg->msgType), pMsg->info.handle); + return 0; + } } else { terrno = TSDB_CODE_SYN_INTERNAL_ERROR; sError("vgId:%d, failed to propose optimized msg, index:%" PRId64 " type:%s", pSyncNode->vgId, retIndex, @@ -739,7 +778,7 @@ int32_t syncNodeLogStoreRestoreOnNeed(SSyncNode* pNode) { } // open/close -------------- -SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { +SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, bool isFirst) { SSyncNode* pSyncNode = taosMemoryCalloc(1, sizeof(SSyncNode)); if (pSyncNode == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -759,7 +798,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { TD_DIRSEP); snprintf(pSyncNode->configPath, sizeof(pSyncNode->configPath), "%s%sraft_config.json", pSyncInfo->path, TD_DIRSEP); - if (!taosCheckExistFile(pSyncNode->configPath)) { + if (!taosCheckExistFile(pSyncNode->configPath) && isFirst) { // create a new raft config file sInfo("vgId:%d, create a new raft config file", pSyncNode->vgId); pSyncNode->raftCfg.isStandBy = pSyncInfo->isStandBy; @@ -781,20 +820,23 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { goto _error; } - if (pSyncInfo->syncCfg.totalReplicaNum > 0 && syncIsConfigChanged(&pSyncNode->raftCfg.cfg, &pSyncInfo->syncCfg)) { - sInfo("vgId:%d, use sync config from input options and write to cfg file", pSyncNode->vgId); - pSyncNode->raftCfg.cfg = pSyncInfo->syncCfg; - if (syncWriteCfgFile(pSyncNode) != 0) { - sError("vgId:%d, failed to write sync cfg file", pSyncNode->vgId); - goto _error; + if(isFirst){ + if (pSyncInfo->syncCfg.totalReplicaNum > 0 && syncIsConfigChanged(&pSyncNode->raftCfg.cfg, &pSyncInfo->syncCfg)) { + sInfo("vgId:%d, use sync config from input options and write to cfg file", pSyncNode->vgId); + pSyncNode->raftCfg.cfg = pSyncInfo->syncCfg; + if (syncWriteCfgFile(pSyncNode) != 0) { + sError("vgId:%d, failed to write sync cfg file", pSyncNode->vgId); + goto _error; + } + } else { + sInfo("vgId:%d, use sync config from sync cfg file", pSyncNode->vgId); + pSyncInfo->syncCfg = pSyncNode->raftCfg.cfg; } - } else { - sInfo("vgId:%d, use sync config from sync cfg file", pSyncNode->vgId); - pSyncInfo->syncCfg = pSyncNode->raftCfg.cfg; } } - // init by SSyncInfo + + // init by SSyncInfo pSyncNode->vgId = pSyncInfo->vgId; SSyncCfg* pCfg = &pSyncNode->raftCfg.cfg; bool updated = false; @@ -809,14 +851,16 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { pNode->nodeId, pNode->clusterId); } - if (updated) { - sInfo("vgId:%d, save config info since dnode info changed", pSyncNode->vgId); - if (syncWriteCfgFile(pSyncNode) != 0) { - sError("vgId:%d, failed to write sync cfg file on dnode info updated", pSyncNode->vgId); - goto _error; + if(isFirst){ + if (updated) { + sInfo("vgId:%d, save config info since dnode info changed", pSyncNode->vgId); + if (syncWriteCfgFile(pSyncNode) != 0) { + sError("vgId:%d, failed to write sync cfg file on dnode info updated", pSyncNode->vgId); + goto _error; + } } } - + pSyncNode->pWal = pSyncInfo->pWal; pSyncNode->msgcb = pSyncInfo->msgcb; pSyncNode->syncSendMSg = pSyncInfo->syncSendMSg; @@ -2250,6 +2294,526 @@ int32_t syncCacheEntry(SSyncLogStore* pLogStore, SSyncRaftEntry* pEntry, LRUHand return code; } +void syncBuildConfigFromReq(SAlterVnodeReplicaReq *pReq, SSyncCfg *cfg){//TODO SAlterVnodeReplicaReq name is proper? + cfg->replicaNum = 0; + cfg->totalReplicaNum = 0; + + for (int i = 0; i < pReq->replica; ++i) { + SNodeInfo *pNode = &cfg->nodeInfo[i]; + pNode->nodeId = pReq->replicas[i].id; + pNode->nodePort = pReq->replicas[i].port; + tstrncpy(pNode->nodeFqdn, pReq->replicas[i].fqdn, sizeof(pNode->nodeFqdn)); + pNode->nodeRole = TAOS_SYNC_ROLE_VOTER; + (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + sInfo("vgId:%d, replica:%d ep:%s:%u dnode:%d nodeRole:%d", pReq->vgId, i, pNode->nodeFqdn, pNode->nodePort, pNode->nodeId, pNode->nodeRole); + cfg->replicaNum++; + } + if(pReq->selfIndex != -1){ + cfg->myIndex = pReq->selfIndex; + } + for (int i = cfg->replicaNum; i < pReq->replica + pReq->learnerReplica; ++i) { + SNodeInfo *pNode = &cfg->nodeInfo[i]; + pNode->nodeId = pReq->learnerReplicas[cfg->totalReplicaNum].id; + pNode->nodePort = pReq->learnerReplicas[cfg->totalReplicaNum].port; + pNode->nodeRole = TAOS_SYNC_ROLE_LEARNER; + tstrncpy(pNode->nodeFqdn, pReq->learnerReplicas[cfg->totalReplicaNum].fqdn, sizeof(pNode->nodeFqdn)); + (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + sInfo("vgId:%d, replica:%d ep:%s:%u dnode:%d nodeRole:%d", pReq->vgId, i, pNode->nodeFqdn, pNode->nodePort, pNode->nodeId, pNode->nodeRole); + cfg->totalReplicaNum++; + } + cfg->totalReplicaNum += pReq->replica; + if(pReq->learnerSelfIndex != -1){ + cfg->myIndex = pReq->replica + pReq->learnerSelfIndex; + } + cfg->changeVersion = pReq->changeVersion; +} + +int32_t syncNodeCheckChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry){ + if(pEntry->originalRpcType != TDMT_SYNC_CONFIG_CHANGE){ + return -1; + } + + SMsgHead *head = (SMsgHead *)pEntry->data; + void *pReq = POINTER_SHIFT(head, sizeof(SMsgHead)); + + SAlterVnodeTypeReq req = {0}; + if (tDeserializeSAlterVnodeReplicaReq(pReq, head->contLen, &req) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + SSyncCfg cfg = {0}; + syncBuildConfigFromReq(&req, &cfg); + + if(cfg.totalReplicaNum >= 1 && ths->state == TAOS_SYNC_STATE_LEADER){ + bool incfg = false; + for(int32_t j = 0; j < cfg.totalReplicaNum; ++j){ + if(strcmp(ths->myNodeInfo.nodeFqdn, cfg.nodeInfo[j].nodeFqdn) == 0 + && ths->myNodeInfo.nodePort == cfg.nodeInfo[j].nodePort){ + incfg = true; + break; + } + } + + if(!incfg){ + SyncTerm currentTerm = raftStoreGetTerm(ths); + syncNodeStepDown(ths, currentTerm); + return 1; + } + } + return 0; +} + +void syncNodeLogConfigInfo(SSyncNode* ths, SSyncCfg *cfg, char *str){ + sInfo("vgId:%d, %s. SyncNode, replicaNum:%d, peersNum:%d, lastConfigIndex:%" PRId64 ", changeVersion:%d, " + "restoreFinish:%d", + ths->vgId, str, + ths->replicaNum, ths->peersNum, ths->raftCfg.lastConfigIndex, ths->raftCfg.cfg.changeVersion, + ths->restoreFinish); + + sInfo("vgId:%d, %s, myNodeInfo, clusterId:%" PRId64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", + ths->vgId, str, ths->myNodeInfo.clusterId, ths->myNodeInfo.nodeId, ths->myNodeInfo.nodeFqdn, + ths->myNodeInfo.nodePort, ths->myNodeInfo.nodeRole); + + for (int32_t i = 0; i < ths->peersNum; ++i){ + sInfo("vgId:%d, %s, peersNodeInfo%d, clusterId:%" PRId64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", + ths->vgId, str, i, ths->peersNodeInfo[i].clusterId, + ths->peersNodeInfo[i].nodeId, ths->peersNodeInfo[i].nodeFqdn, + ths->peersNodeInfo[i].nodePort, ths->peersNodeInfo[i].nodeRole); + } + + for (int32_t i = 0; i < ths->raftCfg.cfg.totalReplicaNum; ++i){ + sInfo("vgId:%d, %s, nodeInfo%d, clusterId:%" PRId64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", + ths->vgId, str, i, ths->raftCfg.cfg.nodeInfo[i].clusterId, + ths->raftCfg.cfg.nodeInfo[i].nodeId, ths->raftCfg.cfg.nodeInfo[i].nodeFqdn, + ths->raftCfg.cfg.nodeInfo[i].nodePort, ths->raftCfg.cfg.nodeInfo[i].nodeRole); + } +} + +int32_t syncNodeRebuildPeerAndCfg(SSyncNode* ths, SSyncCfg *cfg){ + int32_t i = 0; + + //change peersNodeInfo + i = 0; + for(int32_t j = 0; j < cfg->totalReplicaNum; ++j){ + if(!(strcmp(ths->myNodeInfo.nodeFqdn, cfg->nodeInfo[j].nodeFqdn) == 0 + && ths->myNodeInfo.nodePort == cfg->nodeInfo[j].nodePort)){ + ths->peersNodeInfo[i].nodeRole = cfg->nodeInfo[j].nodeRole; + ths->peersNodeInfo[i].clusterId = cfg->nodeInfo[j].clusterId; + tstrncpy(ths->peersNodeInfo[i].nodeFqdn, cfg->nodeInfo[j].nodeFqdn, TSDB_FQDN_LEN); + ths->peersNodeInfo[i].nodeId = cfg->nodeInfo[j].nodeId; + ths->peersNodeInfo[i].nodePort = cfg->nodeInfo[j].nodePort; + + syncUtilNodeInfo2EpSet(&ths->peersNodeInfo[i], &ths->peersEpset[i]); + + if (!syncUtilNodeInfo2RaftId(&ths->peersNodeInfo[i], ths->vgId, &ths->peersId[i])) { + sError("vgId:%d, failed to determine raft member id, peer:%d", ths->vgId, i); + return -1; + } + + i++; + } + } + ths->peersNum = i; + + //change cfg nodeInfo + ths->raftCfg.cfg.replicaNum = 0; + i = 0; + for(int32_t j = 0; j < cfg->totalReplicaNum; ++j) { + if(cfg->nodeInfo[j].nodeRole == TAOS_SYNC_ROLE_VOTER){ + ths->raftCfg.cfg.replicaNum++; + } + ths->raftCfg.cfg.nodeInfo[i].nodeRole = cfg->nodeInfo[j].nodeRole; + ths->raftCfg.cfg.nodeInfo[i].clusterId = cfg->nodeInfo[j].clusterId; + tstrncpy(ths->raftCfg.cfg.nodeInfo[i].nodeFqdn, cfg->nodeInfo[j].nodeFqdn, TSDB_FQDN_LEN); + ths->raftCfg.cfg.nodeInfo[i].nodeId = cfg->nodeInfo[j].nodeId; + ths->raftCfg.cfg.nodeInfo[i].nodePort = cfg->nodeInfo[j].nodePort; + i++; + } + ths->raftCfg.cfg.totalReplicaNum = i; + + return 0; +} + +void syncNodeChangePeerAndCfgToVoter(SSyncNode* ths, SSyncCfg *cfg){ + //change peersNodeInfo + for (int32_t i = 0; i < ths->peersNum; ++i) { + for(int32_t j = 0; j < cfg->totalReplicaNum; ++j){ + if(strcmp(ths->peersNodeInfo[i].nodeFqdn, cfg->nodeInfo[j].nodeFqdn) == 0 + && ths->peersNodeInfo[i].nodePort == cfg->nodeInfo[j].nodePort){ + if(cfg->nodeInfo[j].nodeRole == TAOS_SYNC_ROLE_VOTER){ + ths->peersNodeInfo[i].nodeRole = TAOS_SYNC_ROLE_VOTER; + } + } + } + } + + //change cfg nodeInfo + ths->raftCfg.cfg.replicaNum = 0; + for (int32_t i = 0; i < ths->raftCfg.cfg.totalReplicaNum; ++i) { + for(int32_t j = 0; j < cfg->totalReplicaNum; ++j){ + if(strcmp(ths->raftCfg.cfg.nodeInfo[i].nodeFqdn, cfg->nodeInfo[j].nodeFqdn) == 0 + && ths->raftCfg.cfg.nodeInfo[i].nodePort == cfg->nodeInfo[j].nodePort){ + if(cfg->nodeInfo[j].nodeRole == TAOS_SYNC_ROLE_VOTER){ + ths->raftCfg.cfg.nodeInfo[i].nodeRole = TAOS_SYNC_ROLE_VOTER; + ths->raftCfg.cfg.replicaNum++; + } + } + } + } +} + +int32_t syncNodeRebuildAndCopyIfExist(SSyncNode* ths, int32_t oldtotalReplicaNum){ + //1.rebuild replicasId, remove deleted one + SRaftId oldReplicasId[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA]; + memcpy(oldReplicasId, ths->replicasId, sizeof(oldReplicasId)); + + ths->replicaNum = ths->raftCfg.cfg.replicaNum; + ths->totalReplicaNum = ths->raftCfg.cfg.totalReplicaNum; + for (int32_t i = 0; i < ths->raftCfg.cfg.totalReplicaNum; ++i) { + syncUtilNodeInfo2RaftId(&ths->raftCfg.cfg.nodeInfo[i], ths->vgId, &ths->replicasId[i]); + } + + + //2.rebuild MatchIndex, remove deleted one + SSyncIndexMgr *oldIndex = ths->pMatchIndex; + + ths->pMatchIndex = syncIndexMgrCreate(ths); + + syncIndexMgrCopyIfExist(ths->pMatchIndex, oldIndex, oldReplicasId); + + syncIndexMgrDestroy(oldIndex); + + + //3.rebuild NextIndex, remove deleted one + SSyncIndexMgr *oldNextIndex = ths->pNextIndex; + + ths->pNextIndex = syncIndexMgrCreate(ths); + + syncIndexMgrCopyIfExist(ths->pNextIndex, oldNextIndex, oldReplicasId); + + syncIndexMgrDestroy(oldNextIndex); + + + //4.rebuild pVotesGranted, pVotesRespond, no need to keep old vote state, only rebuild + voteGrantedUpdate(ths->pVotesGranted, ths); + votesRespondUpdate(ths->pVotesRespond, ths); + + + //5.rebuild logReplMgr + for(int i = 0; i < oldtotalReplicaNum; ++i){ + sDebug("vgId:%d, old logReplMgrs i:%d, peerId:%d, restoreed:%d, [%" PRId64 " %" PRId64 ", %" PRId64 ")", ths->vgId, i, + ths->logReplMgrs[i]->peerId, ths->logReplMgrs[i]->restored, ths->logReplMgrs[i]->startIndex, + ths->logReplMgrs[i]->matchIndex, ths->logReplMgrs[i]->endIndex); + } + + SSyncLogReplMgr oldLogReplMgrs[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0}; + SSyncLogReplMgr *pOldLogReplMgrs[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0}; + + for(int i = 0; i < oldtotalReplicaNum; i++){ + oldLogReplMgrs[i] = *(ths->logReplMgrs[i]); + pOldLogReplMgrs[i] = ths->logReplMgrs[i]; + } + + for(int i = 0; i < ths->totalReplicaNum; ++i){ + ths->logReplMgrs[i] = syncLogReplCreate(); + if(ths->logReplMgrs[i] == NULL){ + return -1; + } + + for(int j = 0; j < oldtotalReplicaNum; j++){ + if (syncUtilSameId(&ths->replicasId[i], &oldReplicasId[j])) { + *(ths->logReplMgrs[i]) = oldLogReplMgrs[j]; + } + } + + ths->logReplMgrs[i]->peerId = i; + } + + for(int i = 0; i < oldtotalReplicaNum; i++){ + syncLogReplDestroy(pOldLogReplMgrs[i]); + } + + for(int i = 0; i < ths->totalReplicaNum; ++i){ + sDebug("vgId:%d, new logReplMgrs i:%d, peerId:%d, restoreed:%d, [%" PRId64 " %" PRId64 ", %" PRId64 ")" , ths->vgId, i, + ths->logReplMgrs[i]->peerId, ths->logReplMgrs[i]->restored, ths->logReplMgrs[i]->startIndex, + ths->logReplMgrs[i]->matchIndex, ths->logReplMgrs[i]->endIndex); + } + + + //6.rebuild sender + for(int i = 0; i < oldtotalReplicaNum; ++i){ + sDebug("vgId:%d, old sender i:%d, replicaIndex:%d, lastSendTime:%" PRId64, + ths->vgId, i, ths->senders[i]->replicaIndex, ths->senders[i]->lastSendTime) + } + + SSyncSnapshotSender oldSender[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0}; + SSyncSnapshotSender *pOldSender[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0}; + for(int i = 0; i < oldtotalReplicaNum; i++){ + oldSender[i] = *(ths->senders[i]); + pOldSender[i] = ths->senders[i]; + } + + for(int i = 0; i < ths->totalReplicaNum; i++){ + ths->senders[i] = snapshotSenderCreate(ths, i); + + for(int j = 0; j < oldtotalReplicaNum; j++){ + if (syncUtilSameId(&ths->replicasId[i], &oldReplicasId[j])){ + *(ths->senders[i]) = oldSender[j]; + } + } + } + + for(int i = 0; i < oldtotalReplicaNum; i++){ + snapshotSenderDestroy(pOldSender[i]); + } + + for(int i = 0; i < ths->totalReplicaNum; i++){ + sDebug("vgId:%d, new sender i:%d, replicaIndex:%d, lastSendTime:%" PRId64, + ths->vgId, i, ths->senders[i]->replicaIndex, ths->senders[i]->lastSendTime) + } + + + //7.rebuild synctimer + syncNodeStopHeartbeatTimer(ths); + + for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) { + syncHbTimerInit(ths, &ths->peerHeartbeatTimerArr[i], ths->replicasId[i]); + } + + syncNodeStartHeartbeatTimer(ths); + + + //8.rebuild peerStates + SPeerState oldState[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0}; + for(int i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; i++){ + oldState[i] = ths->peerStates[i]; + } + + for(int i = 0; i < ths->totalReplicaNum; i++){ + for(int j = 0; j < oldtotalReplicaNum; j++){ + if (syncUtilSameId(&ths->replicasId[i], &oldReplicasId[j])){ + ths->peerStates[i] = oldState[j]; + } + } + } + + return 0; +} + +void syncNodeChangeToVoter(SSyncNode* ths){ + //replicasId, only need to change replicaNum when 1->3 + ths->replicaNum = ths->raftCfg.cfg.replicaNum; + sDebug("vgId:%d, totalReplicaNum:%d", ths->vgId, ths->totalReplicaNum); + for (int32_t i = 0; i < ths->totalReplicaNum; ++i){ + sDebug("vgId:%d, i:%d, replicaId.addr:%" PRIx64, ths->vgId, i, ths->replicasId[i].addr); + } + + //pMatchIndex, pNextIndex, only need to change replicaNum when 1->3 + ths->pMatchIndex->replicaNum = ths->raftCfg.cfg.replicaNum; + ths->pNextIndex->replicaNum = ths->raftCfg.cfg.replicaNum; + + sDebug("vgId:%d, pMatchIndex->totalReplicaNum:%d", ths->vgId, ths->pMatchIndex->totalReplicaNum); + for (int32_t i = 0; i < ths->pMatchIndex->totalReplicaNum; ++i){ + sDebug("vgId:%d, i:%d, match.index:%" PRId64, ths->vgId, i, ths->pMatchIndex->index[i]); + } + + //pVotesGranted, pVotesRespond + voteGrantedUpdate(ths->pVotesGranted, ths); + votesRespondUpdate(ths->pVotesRespond, ths); + + //logRepMgrs + //no need to change logRepMgrs when 1->3 +} + +void syncNodeResetPeerAndCfg(SSyncNode* ths){ + SNodeInfo node = {0}; + for (int32_t i = 0; i < ths->peersNum; ++i) { + memcpy(&ths->peersNodeInfo[i], &node, sizeof(SNodeInfo)); + } + + for (int32_t i = 0; i < ths->raftCfg.cfg.totalReplicaNum; ++i) { + memcpy(&ths->raftCfg.cfg.nodeInfo[i], &node, sizeof(SNodeInfo)); + } +} + +int32_t syncNodeChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry, char* str){ + if(pEntry->originalRpcType != TDMT_SYNC_CONFIG_CHANGE){ + return -1; + } + + SMsgHead *head = (SMsgHead *)pEntry->data; + void *pReq = POINTER_SHIFT(head, sizeof(SMsgHead)); + + SAlterVnodeTypeReq req = {0}; + if (tDeserializeSAlterVnodeReplicaReq(pReq, head->contLen, &req) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + SSyncCfg *cfg = taosMemoryMalloc(sizeof(SSyncCfg)); + if(cfg == NULL){ + terrno = TSDB_CODE_OUT_OF_MEMORY; + return -1; + } + syncBuildConfigFromReq(&req, cfg); + + if(cfg->changeVersion <= ths->raftCfg.cfg.changeVersion){ + sInfo("vgId:%d, skip conf change entry since lower version. " + "this entry, index:%" PRId64 ", term:%" PRId64 ", totalReplicaNum:%d, changeVersion:%d; " + "current node, replicaNum:%d, peersNum:%d, lastConfigIndex:%" PRId64", changeVersion:%d", + ths->vgId, + pEntry->index, pEntry->term, cfg->totalReplicaNum, cfg->changeVersion, + ths->replicaNum, ths->peersNum, ths->raftCfg.lastConfigIndex, ths->raftCfg.cfg.changeVersion); + return 0; + } + + if(strcmp(str, "Commit") == 0){ + sInfo("vgId:%d, change config from %s. " + "this, i:%" PRId64 ", trNum:%d, vers:%d; " + "node, rNum:%d, pNum:%d, trNum:%d, " + "buffer: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 "), " + "cond:(next i:%" PRId64 ", t:%" PRId64 " ==%s)", + ths->vgId, str, pEntry->index - 1, cfg->totalReplicaNum, cfg->changeVersion, + ths->replicaNum, ths->peersNum, ths->totalReplicaNum, + ths->pLogBuf->startIndex, ths->pLogBuf->commitIndex, ths->pLogBuf->matchIndex, ths->pLogBuf->endIndex, + pEntry->index, pEntry->term, TMSG_INFO(pEntry->originalRpcType)); + } + else{ + sInfo("vgId:%d, change config from %s. " + "this, i:%" PRId64 ", t:%" PRId64 ", trNum:%d, vers:%d; " + "node, rNum:%d, pNum:%d, trNum:%d, " + "buffer: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 "), " + "cond:(pre i:%" PRId64 "==ci:%" PRId64 ", bci:%" PRId64 ")", + ths->vgId, str, pEntry->index, pEntry->term, cfg->totalReplicaNum, cfg->changeVersion, + ths->replicaNum, ths->peersNum, ths->totalReplicaNum, + ths->pLogBuf->startIndex, ths->pLogBuf->commitIndex, ths->pLogBuf->matchIndex, ths->pLogBuf->endIndex, + pEntry->index -1, ths->commitIndex, ths->pLogBuf->commitIndex); + } + + syncNodeLogConfigInfo(ths, cfg, "before config change"); + + int32_t oldTotalReplicaNum = ths->totalReplicaNum; + + if(cfg->totalReplicaNum == 1 || cfg->totalReplicaNum == 2){//remove replica + + bool incfg = false; + for(int32_t j = 0; j < cfg->totalReplicaNum; ++j){ + if(strcmp(ths->myNodeInfo.nodeFqdn, cfg->nodeInfo[j].nodeFqdn) == 0 + && ths->myNodeInfo.nodePort == cfg->nodeInfo[j].nodePort){ + incfg = true; + break; + } + } + + if(incfg){//remove other + syncNodeResetPeerAndCfg(ths); + + //no need to change myNodeInfo + + if(syncNodeRebuildPeerAndCfg(ths, cfg) != 0){ + return -1; + }; + + if(syncNodeRebuildAndCopyIfExist(ths, oldTotalReplicaNum) != 0){ + return -1; + }; + } + else{//remove myself + //no need to do anything actually, to change the following to reduce distruptive server chance + + syncNodeResetPeerAndCfg(ths); + + //change myNodeInfo + ths->myNodeInfo.nodeRole = TAOS_SYNC_ROLE_LEARNER; + + //change peer and cfg + ths->peersNum = 0; + memcpy(&ths->raftCfg.cfg.nodeInfo[0], &ths->myNodeInfo, sizeof(SNodeInfo)); + ths->raftCfg.cfg.replicaNum = 0; + ths->raftCfg.cfg.totalReplicaNum = 1; + + //change other + if(syncNodeRebuildAndCopyIfExist(ths, oldTotalReplicaNum) != 0){ + return -1; + } + + //change state + ths->state = TAOS_SYNC_STATE_LEARNER; + } + + ths->restoreFinish = false; + } + else{//add replica, or change replica type + if(ths->totalReplicaNum == 3){ //change replica type + sInfo("vgId:%d, begin change replica type", ths->vgId); + + //change myNodeInfo + for(int32_t j = 0; j < cfg->totalReplicaNum; ++j){ + if(strcmp(ths->myNodeInfo.nodeFqdn, cfg->nodeInfo[j].nodeFqdn) == 0 + && ths->myNodeInfo.nodePort == cfg->nodeInfo[j].nodePort){ + if(cfg->nodeInfo[j].nodeRole == TAOS_SYNC_ROLE_VOTER){ + ths->myNodeInfo.nodeRole = TAOS_SYNC_ROLE_VOTER; + } + } + } + + //change peer and cfg + syncNodeChangePeerAndCfgToVoter(ths, cfg); + + //change other + syncNodeChangeToVoter(ths); + + //change state + if(ths->state ==TAOS_SYNC_STATE_LEARNER){ + if(ths->myNodeInfo.nodeRole == TAOS_SYNC_ROLE_VOTER ){ + ths->state = TAOS_SYNC_STATE_FOLLOWER; + } + } + + ths->restoreFinish = false; + } + else{//add replica + sInfo("vgId:%d, begin add replica", ths->vgId); + + //no need to change myNodeInfo + + //change peer and cfg + if(syncNodeRebuildPeerAndCfg(ths, cfg) != 0){ + return -1; + }; + + //change other + if(syncNodeRebuildAndCopyIfExist(ths, oldTotalReplicaNum) != 0){ + return -1; + }; + + //no need to change state + + if(ths->myNodeInfo.nodeRole == TAOS_SYNC_ROLE_LEARNER){ + ths->restoreFinish = false; + } + } + } + + ths->quorum = syncUtilQuorum(ths->replicaNum); + + ths->raftCfg.lastConfigIndex = pEntry->index; + ths->raftCfg.cfg.lastIndex = pEntry->index; + ths->raftCfg.cfg.changeVersion = cfg->changeVersion; + + syncNodeLogConfigInfo(ths, cfg, "after config change"); + + if(syncWriteCfgFile(ths) != 0){ + sError("vgId:%d, failed to create sync cfg file", ths->vgId); + return -1; + }; + + taosMemoryFree(cfg); + + return 0; +} + int32_t syncNodeAppend(SSyncNode* ths, SSyncRaftEntry* pEntry) { if (pEntry->dataLen < sizeof(SMsgHead)) { sError("vgId:%d, cannot append an invalid client request with no msg head. type:%s, dataLen:%d", ths->vgId, @@ -2262,13 +2826,13 @@ int32_t syncNodeAppend(SSyncNode* ths, SSyncRaftEntry* pEntry) { if (syncLogBufferAppend(ths->pLogBuf, ths, pEntry) < 0) { sError("vgId:%d, failed to enqueue sync log buffer, index:%" PRId64, ths->vgId, pEntry->index); ASSERT(terrno != 0); - (void)syncFsmExecute(ths, ths->pFsm, ths->state, raftStoreGetTerm(ths), pEntry, terrno); + (void)syncFsmExecute(ths, ths->pFsm, ths->state, raftStoreGetTerm(ths), pEntry, terrno, false); syncEntryDestroy(pEntry); return -1; } - + // proceed match index, with replicating on needed - SyncIndex matchIndex = syncLogBufferProceed(ths->pLogBuf, ths, NULL); + SyncIndex matchIndex = syncLogBufferProceed(ths->pLogBuf, ths, NULL, "Append"); sTrace("vgId:%d, append raft entry. index:%" PRId64 ", term:%" PRId64 " pBuf: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 ")", @@ -2299,6 +2863,9 @@ bool syncNodeHeartbeatReplyTimeout(SSyncNode* pSyncNode) { int32_t toCount = 0; int64_t tsNow = taosGetTimestampMs(); for (int32_t i = 0; i < pSyncNode->peersNum; ++i) { + if(pSyncNode->peersNodeInfo[i].nodeRole == TAOS_SYNC_ROLE_LEARNER){ + continue; + } int64_t recvTime = syncIndexMgrGetRecvTime(pSyncNode->pMatchIndex, &(pSyncNode->peersId[i])); if (recvTime == 0 || recvTime == -1) { continue; @@ -2560,6 +3127,14 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn pEntry = syncEntryBuildFromRpcMsg(pMsg, term, index); } + //1->2, config change is add in write thread, and will continue in sync thread + //need save message for it + if(pMsg->msgType == TDMT_SYNC_CONFIG_CHANGE){ + SRespStub stub = {.createTime = taosGetTimestampMs(), .rpcMsg = *pMsg}; + uint64_t seqNum = syncRespMgrAdd(ths->pSyncRespMgr, &stub); + pEntry->seqNum = seqNum; + } + if (pEntry == NULL) { sError("vgId:%d, failed to process client request since %s.", ths->vgId, terrstr()); return -1; @@ -2570,7 +3145,24 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn (*pRetIndex) = index; } - int32_t code = syncNodeAppend(ths, pEntry); + if(pEntry->originalRpcType == TDMT_SYNC_CONFIG_CHANGE){ + int32_t code = syncNodeCheckChangeConfig(ths, pEntry); + if(code < 0){ + sError("vgId:%d, failed to check change config since %s.", ths->vgId, terrstr()); + return -1; + } + + if(code > 0){ + SRpcMsg rsp = {.code = pMsg->code, .info = pMsg->info}; + (void)syncRespMgrGetAndDel(ths->pSyncRespMgr, pEntry->seqNum, &rsp.info); + if (rsp.info.handle != NULL) { + tmsgSendRsp(&rsp); + } + return -1; + } + } + + code = syncNodeAppend(ths, pEntry); return code; } else { syncEntryDestroy(pEntry); diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 92f34db16d..9ab00cb4af 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -25,6 +25,8 @@ #include "syncRespMgr.h" #include "syncSnapshot.h" #include "syncUtil.h" +#include "syncRaftCfg.h" +#include "syncVoteMgr.h" static bool syncIsMsgBlock(tmsg_t type) { return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) || @@ -428,7 +430,7 @@ int32_t syncLogStorePersist(SSyncLogStore* pLogStore, SSyncNode* pNode, SSyncRaf return 0; } -int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* pMatchTerm) { +int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* pMatchTerm, char *str) { taosThreadMutexLock(&pBuf->mutex); syncLogBufferValidate(pBuf); @@ -475,9 +477,6 @@ int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* p sTrace("vgId:%d, log buffer proceed. start index:%" PRId64 ", match index:%" PRId64 ", end index:%" PRId64, pNode->vgId, pBuf->startIndex, pBuf->matchIndex, pBuf->endIndex); - // replicate on demand - (void)syncNodeReplicateWithoutLock(pNode); - // persist if (syncLogStorePersist(pLogStore, pNode, pEntry) < 0) { sError("vgId:%d, failed to persist sync log entry from buffer since %s. index:%" PRId64, pNode->vgId, terrstr(), @@ -485,6 +484,39 @@ 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. " + "current entry, index:%" PRId64 ", term:%" PRId64", " + "node, restore:%d, commitIndex:%" PRId64 ", " + "cond: (pre entry index:%" PRId64 "== buf commit index:%" PRId64 ")", + pNode->vgId, str, + pEntry->index, pEntry->term, + pNode->restoreFinish, pNode->commitIndex, + pEntry->index - 1, pNode->pLogBuf->commitIndex); + if(syncNodeChangeConfig(pNode, pEntry, str) != 0){ + sError("vgId:%d, failed to change config from Append since %s. index:%" PRId64, pNode->vgId, terrstr(), + pEntry->index); + goto _out; + } + } + else{ + sInfo("vgId:%d, delay change config from Node %s. " + "curent entry, index:%" PRId64 ", term:%" PRId64 ", " + "node, commitIndex:%" PRId64 ", pBuf: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 "), " + "cond:( pre entry index:%" PRId64" != buf commit index:%" PRId64 ")", + pNode->vgId, str, + pEntry->index, pEntry->term, + pNode->commitIndex, pNode->pLogBuf->startIndex, pNode->pLogBuf->commitIndex, + pNode->pLogBuf->matchIndex, pNode->pLogBuf->endIndex, + pEntry->index - 1, pNode->pLogBuf->commitIndex); + } + } + + // replicate on demand + (void)syncNodeReplicateWithoutLock(pNode); + ASSERT(pEntry->index == pBuf->matchIndex); // update my match index @@ -503,8 +535,16 @@ _out: } int32_t syncFsmExecute(SSyncNode* pNode, SSyncFSM* pFsm, ESyncState role, SyncTerm term, SSyncRaftEntry* pEntry, - int32_t applyCode) { - if (pNode->replicaNum == 1 && pNode->restoreFinish && pNode->vgId != 1) { + int32_t applyCode, bool force) { + //learner need to execute fsm when it catch up entry log + //if force is true, keep all contition check to execute fsm + if (pNode->replicaNum == 1 && pNode->restoreFinish && pNode->vgId != 1 + && pNode->raftCfg.cfg.nodeInfo[pNode->raftCfg.cfg.myIndex].nodeRole != TAOS_SYNC_ROLE_LEARNER + && force == false) { + sDebug("vgId:%d, not to execute fsm, index:%" PRId64 ", term:%" PRId64 ", type:%s code:0x%x, replicaNum:%d," + "role:%d, restoreFinish:%d", + pNode->vgId, pEntry->index, pEntry->term, TMSG_INFO(pEntry->originalRpcType), applyCode, + pNode->replicaNum, pNode->raftCfg.cfg.nodeInfo[pNode->raftCfg.cfg.myIndex].nodeRole, pNode->restoreFinish); return 0; } @@ -559,6 +599,8 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm int64_t upperIndex = TMIN(commitIndex, pBuf->matchIndex); SSyncRaftEntry* pEntry = NULL; bool inBuf = false; + SSyncRaftEntry* pNextEntry = NULL; + bool nextInBuf = false; if (commitIndex <= pBuf->commitIndex) { sDebug("vgId:%d, stale commit index. current:%" PRId64 ", notified:%" PRId64 "", vgId, pBuf->commitIndex, @@ -584,7 +626,7 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm pEntry->term, TMSG_INFO(pEntry->originalRpcType)); } - if (syncFsmExecute(pNode, pFsm, role, currentTerm, pEntry, 0) != 0) { + if (syncFsmExecute(pNode, pFsm, role, currentTerm, pEntry, 0, false) != 0) { sError("vgId:%d, failed to execute sync log entry. index:%" PRId64 ", term:%" PRId64 ", role:%d, current term:%" PRId64, vgId, pEntry->index, pEntry->term, role, currentTerm); @@ -595,10 +637,50 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm sTrace("vgId:%d, committed index:%" PRId64 ", term:%" PRId64 ", role:%d, current term:%" PRId64 "", pNode->vgId, pEntry->index, pEntry->term, role, currentTerm); + pNextEntry = syncLogBufferGetOneEntry(pBuf, pNode, index + 1, &nextInBuf); + if (pNextEntry != NULL && pNextEntry->originalRpcType == TDMT_SYNC_CONFIG_CHANGE) { + sInfo("vgId:%d, to change config at Commit. " + "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, + role, currentTerm, pNode->restoreFinish, + pNextEntry->index, TMSG_INFO(pNextEntry->originalRpcType)); + + if(syncNodeChangeConfig(pNode, pNextEntry, "Commit") != 0){ + sError("vgId:%d, failed to change config from Commit. index:%" PRId64 ", term:%" PRId64 + ", role:%d, current term:%" PRId64, + vgId, pNextEntry->index, pNextEntry->term, role, currentTerm); + goto _out; + } + + //for 2->1, need to apply config change entry in sync thread, + if(pNode->replicaNum == 1){ + if (syncFsmExecute(pNode, pFsm, role, currentTerm, pNextEntry, 0, true) != 0) { + sError("vgId:%d, failed to execute sync log entry. index:%" PRId64 ", term:%" PRId64 + ", role:%d, current term:%" PRId64, + vgId, pNextEntry->index, pNextEntry->term, role, currentTerm); + goto _out; + } + + index++; + pBuf->commitIndex = index; + + sTrace("vgId:%d, committed index:%" PRId64 ", term:%" PRId64 ", role:%d, current term:%" PRId64 "", pNode->vgId, + pNextEntry->index, pNextEntry->term, role, currentTerm); + } + + if (!nextInBuf) { + syncEntryDestroy(pNextEntry); + pNextEntry = NULL; + } + } + if (!inBuf) { syncEntryDestroy(pEntry); pEntry = NULL; - } + } } // recycle diff --git a/source/libs/sync/src/syncRaftCfg.c b/source/libs/sync/src/syncRaftCfg.c index 480ed4b2af..4b57fbde2c 100644 --- a/source/libs/sync/src/syncRaftCfg.c +++ b/source/libs/sync/src/syncRaftCfg.c @@ -44,6 +44,7 @@ static int32_t syncEncodeSyncCfg(const void *pObj, SJson *pJson) { SSyncCfg *pCfg = (SSyncCfg *)pObj; if (tjsonAddDoubleToObject(pJson, "replicaNum", pCfg->replicaNum) < 0) return -1; if (tjsonAddDoubleToObject(pJson, "myIndex", pCfg->myIndex) < 0) return -1; + if (tjsonAddDoubleToObject(pJson, "changeVersion", pCfg->changeVersion) < 0) return -1; SJson *nodeInfo = tjsonCreateArray(); if (nodeInfo == NULL) return -1; @@ -113,8 +114,9 @@ int32_t syncWriteCfgFile(SSyncNode *pNode) { if (taosRenameFile(file, realfile) != 0) goto _OVER; code = 0; - sInfo("vgId:%d, succeed to write sync cfg file:%s, len:%d, lastConfigIndex:%" PRId64, pNode->vgId, - realfile, len, pNode->raftCfg.lastConfigIndex); + sInfo("vgId:%d, succeed to write sync cfg file:%s, len:%d, lastConfigIndex:%" PRId64 ", " + "changeVersion:%d", pNode->vgId, + realfile, len, pNode->raftCfg.lastConfigIndex, pNode->raftCfg.cfg.changeVersion); _OVER: if (pJson != NULL) tjsonDelete(pJson); @@ -136,6 +138,8 @@ static int32_t syncDecodeSyncCfg(const SJson *pJson, void *pObj) { if (code < 0) return -1; tjsonGetInt32ValueFromDouble(pJson, "myIndex", pCfg->myIndex, code); if (code < 0) return -1; + tjsonGetInt32ValueFromDouble(pJson, "changeVersion", pCfg->changeVersion, code); + if (code < 0) return -1; SJson *nodeInfo = tjsonGetObjectItem(pJson, "nodeInfo"); if (nodeInfo == NULL) return -1; From 93766f8c965e7dea3ea9c3304e96d909ff67ff67 Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 19 Jul 2023 08:32:16 +0800 Subject: [PATCH 02/46] memory leak --- source/dnode/mnode/impl/src/mndVgroup.c | 4 +- source/libs/sync/src/syncMain.c | 95 ++++++++++--------------- 2 files changed, 42 insertions(+), 57 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 81ea033dba..0adb460c9b 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1299,6 +1299,7 @@ int32_t mndAddChangeConfigAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SMsgHead *pHead = taosMemoryMalloc(totallen); if (pHead == NULL) { + taosMemoryFree(pReq); terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } @@ -1307,13 +1308,14 @@ int32_t mndAddChangeConfigAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, pHead->vgId = htonl(pNewVgroup->vgId); memcpy((void*)(pHead + 1), pReq, contLen); + taosMemoryFree(pReq); action.pCont = pHead; action.contLen = totallen; action.msgType = TDMT_SYNC_CONFIG_CHANGE; if (mndTransAppendRedoAction(pTrans, &action) != 0) { - taosMemoryFree(pReq); + taosMemoryFree(pHead); return -1; } diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index d4faf271ca..1c27c4110f 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -2508,64 +2508,53 @@ int32_t syncNodeRebuildAndCopyIfExist(SSyncNode* ths, int32_t oldtotalReplicaNum } SSyncLogReplMgr oldLogReplMgrs[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0}; - SSyncLogReplMgr *pOldLogReplMgrs[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0}; for(int i = 0; i < oldtotalReplicaNum; i++){ oldLogReplMgrs[i] = *(ths->logReplMgrs[i]); - pOldLogReplMgrs[i] = ths->logReplMgrs[i]; } - for(int i = 0; i < ths->totalReplicaNum; ++i){ - ths->logReplMgrs[i] = syncLogReplCreate(); - if(ths->logReplMgrs[i] == NULL){ - return -1; - } + syncNodeLogReplDestroy(ths); + syncNodeLogReplInit(ths); + for(int i = 0; i < ths->totalReplicaNum; ++i){ for(int j = 0; j < oldtotalReplicaNum; j++){ if (syncUtilSameId(&ths->replicasId[i], &oldReplicasId[j])) { *(ths->logReplMgrs[i]) = oldLogReplMgrs[j]; } - } - - ths->logReplMgrs[i]->peerId = i; + } } - for(int i = 0; i < oldtotalReplicaNum; i++){ - syncLogReplDestroy(pOldLogReplMgrs[i]); - } - for(int i = 0; i < ths->totalReplicaNum; ++i){ sDebug("vgId:%d, new logReplMgrs i:%d, peerId:%d, restoreed:%d, [%" PRId64 " %" PRId64 ", %" PRId64 ")" , ths->vgId, i, ths->logReplMgrs[i]->peerId, ths->logReplMgrs[i]->restored, ths->logReplMgrs[i]->startIndex, ths->logReplMgrs[i]->matchIndex, ths->logReplMgrs[i]->endIndex); } - //6.rebuild sender for(int i = 0; i < oldtotalReplicaNum; ++i){ sDebug("vgId:%d, old sender i:%d, replicaIndex:%d, lastSendTime:%" PRId64, ths->vgId, i, ths->senders[i]->replicaIndex, ths->senders[i]->lastSendTime) } - SSyncSnapshotSender oldSender[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0}; - SSyncSnapshotSender *pOldSender[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0}; - for(int i = 0; i < oldtotalReplicaNum; i++){ - oldSender[i] = *(ths->senders[i]); - pOldSender[i] = ths->senders[i]; - } + for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) { + if (ths->senders[i] != NULL) { + sDebug("vgId:%d, snapshot sender destroy while close, data:%p", ths->vgId, ths->senders[i]); - for(int i = 0; i < ths->totalReplicaNum; i++){ - ths->senders[i] = snapshotSenderCreate(ths, i); - - for(int j = 0; j < oldtotalReplicaNum; j++){ - if (syncUtilSameId(&ths->replicasId[i], &oldReplicasId[j])){ - *(ths->senders[i]) = oldSender[j]; + if (snapshotSenderIsStart(ths->senders[i])) { + snapshotSenderStop(ths->senders[i], false); } - } + + snapshotSenderDestroy(ths->senders[i]); + ths->senders[i] = NULL; + } } - for(int i = 0; i < oldtotalReplicaNum; i++){ - snapshotSenderDestroy(pOldSender[i]); + for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) { + SSyncSnapshotSender* pSender = snapshotSenderCreate(ths, i); + if (pSender == NULL) return -1; + + ths->senders[i] = pSender; + sSDebug(pSender, "snapshot sender create while open sync node, data:%p", pSender); } for(int i = 0; i < ths->totalReplicaNum; i++){ @@ -2651,19 +2640,15 @@ int32_t syncNodeChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry, char* str){ return -1; } - SSyncCfg *cfg = taosMemoryMalloc(sizeof(SSyncCfg)); - if(cfg == NULL){ - terrno = TSDB_CODE_OUT_OF_MEMORY; - return -1; - } - syncBuildConfigFromReq(&req, cfg); + SSyncCfg cfg = {0}; + syncBuildConfigFromReq(&req, &cfg); - if(cfg->changeVersion <= ths->raftCfg.cfg.changeVersion){ + if(cfg.changeVersion <= ths->raftCfg.cfg.changeVersion){ sInfo("vgId:%d, skip conf change entry since lower version. " "this entry, index:%" PRId64 ", term:%" PRId64 ", totalReplicaNum:%d, changeVersion:%d; " "current node, replicaNum:%d, peersNum:%d, lastConfigIndex:%" PRId64", changeVersion:%d", ths->vgId, - pEntry->index, pEntry->term, cfg->totalReplicaNum, cfg->changeVersion, + pEntry->index, pEntry->term, cfg.totalReplicaNum, cfg.changeVersion, ths->replicaNum, ths->peersNum, ths->raftCfg.lastConfigIndex, ths->raftCfg.cfg.changeVersion); return 0; } @@ -2674,7 +2659,7 @@ int32_t syncNodeChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry, char* str){ "node, rNum:%d, pNum:%d, trNum:%d, " "buffer: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 "), " "cond:(next i:%" PRId64 ", t:%" PRId64 " ==%s)", - ths->vgId, str, pEntry->index - 1, cfg->totalReplicaNum, cfg->changeVersion, + ths->vgId, str, pEntry->index - 1, cfg.totalReplicaNum, cfg.changeVersion, ths->replicaNum, ths->peersNum, ths->totalReplicaNum, ths->pLogBuf->startIndex, ths->pLogBuf->commitIndex, ths->pLogBuf->matchIndex, ths->pLogBuf->endIndex, pEntry->index, pEntry->term, TMSG_INFO(pEntry->originalRpcType)); @@ -2685,22 +2670,22 @@ int32_t syncNodeChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry, char* str){ "node, rNum:%d, pNum:%d, trNum:%d, " "buffer: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 "), " "cond:(pre i:%" PRId64 "==ci:%" PRId64 ", bci:%" PRId64 ")", - ths->vgId, str, pEntry->index, pEntry->term, cfg->totalReplicaNum, cfg->changeVersion, + ths->vgId, str, pEntry->index, pEntry->term, cfg.totalReplicaNum, cfg.changeVersion, ths->replicaNum, ths->peersNum, ths->totalReplicaNum, ths->pLogBuf->startIndex, ths->pLogBuf->commitIndex, ths->pLogBuf->matchIndex, ths->pLogBuf->endIndex, pEntry->index -1, ths->commitIndex, ths->pLogBuf->commitIndex); } - syncNodeLogConfigInfo(ths, cfg, "before config change"); + syncNodeLogConfigInfo(ths, &cfg, "before config change"); int32_t oldTotalReplicaNum = ths->totalReplicaNum; - if(cfg->totalReplicaNum == 1 || cfg->totalReplicaNum == 2){//remove replica + if(cfg.totalReplicaNum == 1 || cfg.totalReplicaNum == 2){//remove replica bool incfg = false; - for(int32_t j = 0; j < cfg->totalReplicaNum; ++j){ - if(strcmp(ths->myNodeInfo.nodeFqdn, cfg->nodeInfo[j].nodeFqdn) == 0 - && ths->myNodeInfo.nodePort == cfg->nodeInfo[j].nodePort){ + for(int32_t j = 0; j < cfg.totalReplicaNum; ++j){ + if(strcmp(ths->myNodeInfo.nodeFqdn, cfg.nodeInfo[j].nodeFqdn) == 0 + && ths->myNodeInfo.nodePort == cfg.nodeInfo[j].nodePort){ incfg = true; break; } @@ -2711,7 +2696,7 @@ int32_t syncNodeChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry, char* str){ //no need to change myNodeInfo - if(syncNodeRebuildPeerAndCfg(ths, cfg) != 0){ + if(syncNodeRebuildPeerAndCfg(ths, &cfg) != 0){ return -1; }; @@ -2749,17 +2734,17 @@ int32_t syncNodeChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry, char* str){ sInfo("vgId:%d, begin change replica type", ths->vgId); //change myNodeInfo - for(int32_t j = 0; j < cfg->totalReplicaNum; ++j){ - if(strcmp(ths->myNodeInfo.nodeFqdn, cfg->nodeInfo[j].nodeFqdn) == 0 - && ths->myNodeInfo.nodePort == cfg->nodeInfo[j].nodePort){ - if(cfg->nodeInfo[j].nodeRole == TAOS_SYNC_ROLE_VOTER){ + for(int32_t j = 0; j < cfg.totalReplicaNum; ++j){ + if(strcmp(ths->myNodeInfo.nodeFqdn, cfg.nodeInfo[j].nodeFqdn) == 0 + && ths->myNodeInfo.nodePort == cfg.nodeInfo[j].nodePort){ + if(cfg.nodeInfo[j].nodeRole == TAOS_SYNC_ROLE_VOTER){ ths->myNodeInfo.nodeRole = TAOS_SYNC_ROLE_VOTER; } } } //change peer and cfg - syncNodeChangePeerAndCfgToVoter(ths, cfg); + syncNodeChangePeerAndCfgToVoter(ths, &cfg); //change other syncNodeChangeToVoter(ths); @@ -2779,7 +2764,7 @@ int32_t syncNodeChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry, char* str){ //no need to change myNodeInfo //change peer and cfg - if(syncNodeRebuildPeerAndCfg(ths, cfg) != 0){ + if(syncNodeRebuildPeerAndCfg(ths, &cfg) != 0){ return -1; }; @@ -2800,17 +2785,15 @@ int32_t syncNodeChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry, char* str){ ths->raftCfg.lastConfigIndex = pEntry->index; ths->raftCfg.cfg.lastIndex = pEntry->index; - ths->raftCfg.cfg.changeVersion = cfg->changeVersion; + ths->raftCfg.cfg.changeVersion = cfg.changeVersion; - syncNodeLogConfigInfo(ths, cfg, "after config change"); + syncNodeLogConfigInfo(ths, &cfg, "after config change"); if(syncWriteCfgFile(ths) != 0){ sError("vgId:%d, failed to create sync cfg file", ths->vgId); return -1; }; - taosMemoryFree(cfg); - return 0; } From e7dfb8c26d8fee32c3c7a511ad3287174396db90 Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 19 Jul 2023 10:36:55 +0800 Subject: [PATCH 03/46] memory leak --- source/libs/sync/src/syncPipeline.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 9ab00cb4af..9ffd790281 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -708,6 +708,10 @@ _out: syncEntryDestroy(pEntry); pEntry = NULL; } + if (!nextInBuf) { + syncEntryDestroy(pNextEntry); + pNextEntry = NULL; + } syncLogBufferValidate(pBuf); taosThreadMutexUnlock(&pBuf->mutex); return ret; From 74687496666300cb168de33d6350efce10799a2f Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 19 Jul 2023 10:48:04 +0800 Subject: [PATCH 04/46] memory leak --- source/libs/sync/src/syncMain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 1c27c4110f..039c039c72 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -3132,6 +3132,8 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn int32_t code = syncNodeCheckChangeConfig(ths, pEntry); if(code < 0){ sError("vgId:%d, failed to check change config since %s.", ths->vgId, terrstr()); + syncEntryDestroy(pEntry); + pEntry = NULL; return -1; } @@ -3141,6 +3143,8 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn if (rsp.info.handle != NULL) { tmsgSendRsp(&rsp); } + syncEntryDestroy(pEntry); + pEntry = NULL; return -1; } } From 8062d603b760f6738e65debcb3263bc005b5da4b Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 19 Jul 2023 15:35:37 +0800 Subject: [PATCH 05/46] restore old change replica --- source/dnode/mnode/impl/inc/mndVgroup.h | 2 + source/dnode/mnode/impl/src/mndDb.c | 2 +- source/dnode/mnode/impl/src/mndVgroup.c | 114 ++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 1 deletion(-) diff --git a/source/dnode/mnode/impl/inc/mndVgroup.h b/source/dnode/mnode/impl/inc/mndVgroup.h index 7c2f8b5b65..9986e0c437 100644 --- a/source/dnode/mnode/impl/inc/mndVgroup.h +++ b/source/dnode/mnode/impl/inc/mndVgroup.h @@ -47,6 +47,8 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb SArray *pArray); 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, + SArray *pArray); void *mndBuildCreateVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen); void *mndBuildDropVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen); diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 2cc60e6fcc..a5bd521a3b 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -852,7 +852,7 @@ 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) { + if (mndBuildRaftAlterVgroupAction(pMnode, pTrans, pOldDb, pNewDb, pVgroup, pArray) != 0) { sdbCancelFetch(pSdb, pIter); sdbRelease(pSdb, pVgroup); taosArrayDestroy(pArray); diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 0adb460c9b..0d34e1e0aa 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1428,6 +1428,32 @@ int32_t mndAddCheckLearnerCatchupAction(SMnode *pMnode, STrans *pTrans, SDbObj * return 0; } +int32_t mndAddAlterVnodeTypeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int32_t dnodeId) { + SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId); + if (pDnode == NULL) return -1; + + STransAction action = {0}; + action.epSet = mndGetDnodeEpset(pDnode); + mndReleaseDnode(pMnode, pDnode); + + int32_t contLen = 0; + void *pReq = mndBuildAlterVnodeReplicaReq(pMnode, pDb, pVgroup, dnodeId, &contLen); + if (pReq == NULL) return -1; + + action.pCont = pReq; + action.contLen = contLen; + action.msgType = TDMT_DND_ALTER_VNODE_TYPE; + action.acceptableCode = TSDB_CODE_VND_ALREADY_IS_VOTER; + action.retryCode = TSDB_CODE_VND_NOT_CATCH_UP; + + if (mndTransAppendRedoAction(pTrans, &action) != 0) { + taosMemoryFree(pReq); + return -1; + } + + return 0; +} + int32_t mndRestoreAddAlterVnodeTypeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SDnodeObj *pDnode) { STransAction action = {0}; @@ -2244,6 +2270,94 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb mndTransSetSerial(pTrans); + if (newVgroup.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; + + //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) + return -1; + + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.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) + return -1; + + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + + //add third + if (mndAddVnodeToVgroup(pMnode, pTrans, &newVgroup, 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) + return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) + return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1; + + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + } else if (newVgroup.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) + return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) + return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 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) + return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + } else { + return -1; + } + + mndSortVnodeGid(&newVgroup); + + { + SSdbRaw *pVgRaw = mndVgroupActionEncode(&newVgroup); + if (pVgRaw == NULL) return -1; + if (mndTransAppendCommitlog(pTrans, pVgRaw) != 0) { + sdbFreeRaw(pVgRaw); + return -1; + } + (void)sdbSetRawStatus(pVgRaw, SDB_STATUS_READY); + } + + return 0; +} + +int32_t mndBuildRaftAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pVgroup, + SArray *pArray) { + SVgObj newVgroup = {0}; + memcpy(&newVgroup, 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; + return 0; + } + + mndTransSetSerial(pTrans); + mInfo("trans:%d, vgid:%d alter vgroup, syncConfChangeVer:%d, version:%d, replica:%d", pTrans->id, pVgroup->vgId, pVgroup->syncConfChangeVer, pVgroup->version, pVgroup->replica); From 154bc177a736c4037127773d9a86a1a98bb46173 Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 19 Jul 2023 17:33:55 +0800 Subject: [PATCH 06/46] memory leak --- source/libs/sync/src/syncPipeline.c | 57 +++++++++++++++-------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 9ffd790281..532a6955cf 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -638,39 +638,40 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm pEntry->index, pEntry->term, role, currentTerm); pNextEntry = syncLogBufferGetOneEntry(pBuf, pNode, index + 1, &nextInBuf); - if (pNextEntry != NULL && pNextEntry->originalRpcType == TDMT_SYNC_CONFIG_CHANGE) { - sInfo("vgId:%d, to change config at Commit. " - "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, - role, currentTerm, pNode->restoreFinish, - pNextEntry->index, TMSG_INFO(pNextEntry->originalRpcType)); + if (pNextEntry != NULL) { + if(pNextEntry->originalRpcType == TDMT_SYNC_CONFIG_CHANGE){ + sInfo("vgId:%d, to change config at Commit. " + "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, + role, currentTerm, pNode->restoreFinish, + pNextEntry->index, TMSG_INFO(pNextEntry->originalRpcType)); - if(syncNodeChangeConfig(pNode, pNextEntry, "Commit") != 0){ - sError("vgId:%d, failed to change config from Commit. index:%" PRId64 ", term:%" PRId64 - ", role:%d, current term:%" PRId64, - vgId, pNextEntry->index, pNextEntry->term, role, currentTerm); - goto _out; - } - - //for 2->1, need to apply config change entry in sync thread, - if(pNode->replicaNum == 1){ - if (syncFsmExecute(pNode, pFsm, role, currentTerm, pNextEntry, 0, true) != 0) { - sError("vgId:%d, failed to execute sync log entry. index:%" PRId64 ", term:%" PRId64 - ", role:%d, current term:%" PRId64, - vgId, pNextEntry->index, pNextEntry->term, role, currentTerm); - goto _out; + if(syncNodeChangeConfig(pNode, pNextEntry, "Commit") != 0){ + sError("vgId:%d, failed to change config from Commit. index:%" PRId64 ", term:%" PRId64 + ", role:%d, current term:%" PRId64, + vgId, pNextEntry->index, pNextEntry->term, role, currentTerm); + goto _out; } - index++; - pBuf->commitIndex = index; + //for 2->1, need to apply config change entry in sync thread, + if(pNode->replicaNum == 1){ + if (syncFsmExecute(pNode, pFsm, role, currentTerm, pNextEntry, 0, true) != 0) { + sError("vgId:%d, failed to execute sync log entry. index:%" PRId64 ", term:%" PRId64 + ", role:%d, current term:%" PRId64, + vgId, pNextEntry->index, pNextEntry->term, role, currentTerm); + goto _out; + } - sTrace("vgId:%d, committed index:%" PRId64 ", term:%" PRId64 ", role:%d, current term:%" PRId64 "", pNode->vgId, - pNextEntry->index, pNextEntry->term, role, currentTerm); + index++; + pBuf->commitIndex = index; + + sTrace("vgId:%d, committed index:%" PRId64 ", term:%" PRId64 ", role:%d, current term:%" PRId64 "", pNode->vgId, + pNextEntry->index, pNextEntry->term, role, currentTerm); + } } - if (!nextInBuf) { syncEntryDestroy(pNextEntry); pNextEntry = NULL; From 7d480cf3accea10b2784b04d8e945c0cb5f7e33e Mon Sep 17 00:00:00 2001 From: dmchen Date: Fri, 21 Jul 2023 10:31:53 +0800 Subject: [PATCH 07/46] compatible old sync config --- include/common/tmsg.h | 3 +- include/libs/sync/sync.h | 2 +- source/common/src/tmsg.c | 6 +- source/dnode/mgmt/mgmt_vnode/src/vmHandle.c | 16 +-- source/dnode/mgmt/mgmt_vnode/src/vmInt.c | 2 +- source/dnode/mnode/impl/src/mndDb.c | 2 +- source/dnode/mnode/impl/src/mndVgroup.c | 107 +++++++++++++++++--- source/dnode/vnode/inc/vnode.h | 2 +- source/dnode/vnode/src/inc/vnd.h | 2 +- source/dnode/vnode/src/vnd/vnodeOpen.c | 11 +- source/dnode/vnode/src/vnd/vnodeSync.c | 4 +- source/libs/sync/inc/syncInt.h | 2 +- source/libs/sync/src/syncMain.c | 43 ++++++-- source/libs/sync/src/syncRaftCfg.c | 3 +- 14 files changed, 162 insertions(+), 43 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 4e0a5edad9..5dc5b7f514 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1410,7 +1410,8 @@ typedef struct { int32_t dstVgId; uint32_t hashBegin; uint32_t hashEnd; - int64_t reserved; + int32_t changeVersion; + int32_t reserved; } SAlterVnodeHashRangeReq; int32_t tSerializeSAlterVnodeHashRangeReq(void* buf, int32_t bufLen, SAlterVnodeHashRangeReq* pReq); diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index f28e75c68a..76b504ea99 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -245,7 +245,7 @@ typedef struct SSyncState { int32_t syncInit(); void syncCleanUp(); -int64_t syncOpen(SSyncInfo* pSyncInfo, bool isFirst); +int64_t syncOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion); int32_t syncStart(int64_t rid); void syncStop(int64_t rid); void syncPreStop(int64_t rid); diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 1e66eee069..835bb5553b 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -4690,7 +4690,8 @@ int32_t tSerializeSAlterVnodeHashRangeReq(void *buf, int32_t bufLen, SAlterVnode if (tEncodeI32(&encoder, pReq->dstVgId) < 0) return -1; if (tEncodeI32(&encoder, pReq->hashBegin) < 0) return -1; if (tEncodeI32(&encoder, pReq->hashEnd) < 0) return -1; - if (tEncodeI64(&encoder, pReq->reserved) < 0) return -1; + if (tEncodeI32(&encoder, pReq->changeVersion) < 0) return -1; + if (tEncodeI32(&encoder, pReq->reserved) < 0) return -1; tEndEncode(&encoder); @@ -4708,7 +4709,8 @@ int32_t tDeserializeSAlterVnodeHashRangeReq(void *buf, int32_t bufLen, SAlterVno if (tDecodeI32(&decoder, &pReq->dstVgId) < 0) return -1; if (tDecodeI32(&decoder, &pReq->hashBegin) < 0) return -1; if (tDecodeI32(&decoder, &pReq->hashEnd) < 0) return -1; - if (tDecodeI64(&decoder, &pReq->reserved) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->changeVersion) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->reserved) < 0) return -1; tEndDecode(&decoder); tDecoderClear(&decoder); diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index 6531cab68b..adceeb9ec3 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -277,7 +277,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { goto _OVER; } - SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, true); + SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode since %s", req.vgId, terrstr()); code = terrno; @@ -367,8 +367,8 @@ int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { dInfo("node:%s, catched up leader, continue to process alter-node-type-request", pMgmt->name); int32_t vgId = req.vgId; - dInfo("vgId:%d, start to alter vnode type replica:%d selfIndex:%d strict:%d", vgId, req.replica, req.selfIndex, - req.strict); + dInfo("vgId:%d, start to alter vnode type replica:%d selfIndex:%d strict:%d changeVersion:%d", + vgId, req.replica, req.selfIndex, req.strict, req.changeVersion); for (int32_t i = 0; i < req.replica; ++i) { SReplica *pReplica = &req.replicas[i]; dInfo("vgId:%d, replica:%d ep:%s:%u dnode:%d", vgId, i, pReplica->fqdn, pReplica->port, pReplica->id); @@ -425,7 +425,7 @@ int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, begin to open vnode", vgId); - SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, true); + SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", vgId, path, terrstr()); return -1; @@ -572,7 +572,7 @@ int32_t vmProcessAlterHashRangeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, open vnode", dstVgId); - SVnode *pImpl = vnodeOpen(dstPath, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, true); + SVnode *pImpl = vnodeOpen(dstPath, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", dstVgId, dstPath, terrstr()); @@ -612,9 +612,9 @@ int32_t vmProcessAlterVnodeReplicaReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { int32_t vgId = alterReq.vgId; dInfo("vgId:%d,vnode management handle msgType:%s, start to alter vnode replica:%d selfIndex:%d leanerReplica:%d " - "learnerSelfIndex:%d strict:%d", + "learnerSelfIndex:%d strict:%d changeVersion:%d", vgId, TMSG_INFO(pMsg->msgType), alterReq.replica, alterReq.selfIndex, alterReq.learnerReplica, - alterReq.learnerSelfIndex, alterReq.strict); + alterReq.learnerSelfIndex, alterReq.strict, alterReq.changeVersion); for (int32_t i = 0; i < alterReq.replica; ++i) { SReplica *pReplica = &alterReq.replicas[i]; dInfo("vgId:%d, replica:%d ep:%s:%u dnode:%d", vgId, i, pReplica->fqdn, pReplica->port, pReplica->port); @@ -676,7 +676,7 @@ int32_t vmProcessAlterVnodeReplicaReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, begin to open vnode", vgId); - SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, true); + SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", vgId, path, terrstr()); return -1; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 02f27cec97..894b19abc7 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -266,7 +266,7 @@ static void *vmOpenVnodeInThread(void *param) { int32_t diskPrimary = pCfg->diskPrimary; snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, pCfg->vgId); - SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, false); + SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb); if (pImpl == NULL) { dError("vgId:%d, failed to open vnode by thread:%d since %s", pCfg->vgId, pThread->threadIndex, terrstr()); diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index a5bd521a3b..67892ec57c 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -634,10 +634,10 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate, mndTransSetOper(pTrans, MND_OPER_CREATE_DB); if (mndSetPrepareNewVgActions(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; + if (mndSetCreateDbRedoActions(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndSetCreateDbRedoLogs(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndSetCreateDbUndoLogs(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndSetCreateDbCommitLogs(pMnode, pTrans, &dbObj, pVgroups, pNewUserDuped) != 0) goto _OVER; - if (mndSetCreateDbRedoActions(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndSetCreateDbUndoActions(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER; diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 0d34e1e0aa..186927fdc6 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -274,6 +274,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg createReq.hashPrefix = pDb->cfg.hashPrefix; createReq.hashSuffix = pDb->cfg.hashSuffix; createReq.tsdbPageSize = pDb->cfg.tsdbPageSize; + createReq.changeVersion= ++(pVgroup->syncConfChangeVer); for (int32_t v = 0; v < pVgroup->replica; ++v) { SReplica *pReplica = NULL; @@ -322,9 +323,10 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg createReq.changeVersion = pVgroup->syncConfChangeVer; - mInfo("vgId:%d, build create vnode req, replica:%d selfIndex:%d learnerReplica:%d learnerSelfIndex:%d strict:%d", + 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.strict); + createReq.learnerReplica, 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); } @@ -402,7 +404,7 @@ static void *mndBuildAlterVnodeReplicaReq(SMnode *pMnode, SDbObj *pDb, SVgObj *p .learnerReplica = 0, .selfIndex = -1, .learnerSelfIndex = -1, - .changeVersion = pVgroup->syncConfChangeVer, + .changeVersion = ++(pVgroup->syncConfChangeVer), }; for (int32_t v = 0; v < pVgroup->replica; ++v) { @@ -438,9 +440,10 @@ static void *mndBuildAlterVnodeReplicaReq(SMnode *pMnode, SDbObj *pDb, SVgObj *p } } - mInfo("vgId:%d, build alter vnode req, replica:%d selfIndex:%d learnerReplica:%d learnerSelfIndex:%d strict:%d", + mInfo("vgId:%d, build alter vnode req, replica:%d selfIndex:%d learnerReplica:%d learnerSelfIndex:%d strict:%d " + "changeVersion:%d", alterReq.vgId, alterReq.replica, alterReq.selfIndex, alterReq.learnerReplica, - alterReq.learnerSelfIndex, alterReq.strict); + alterReq.learnerSelfIndex, alterReq.strict, alterReq.changeVersion); for (int32_t i = 0; i < alterReq.replica; ++i) { mInfo("vgId:%d, replica:%d ep:%s:%u", alterReq.vgId, i, alterReq.replicas[i].fqdn, alterReq.replicas[i].port); } @@ -471,6 +474,83 @@ static void *mndBuildAlterVnodeReplicaReq(SMnode *pMnode, SDbObj *pDb, SVgObj *p return pReq; } +static void *mndBuildCheckLearnCatchupReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_t dnodeId, + int32_t *pContLen) { + SCheckLearnCatchupReq req = { + .vgId = pVgroup->vgId, + .strict = pDb->cfg.strict, + .replica = 0, + .learnerReplica = 0, + .selfIndex = -1, + .learnerSelfIndex = -1, + }; + + for (int32_t v = 0; v < pVgroup->replica; ++v) { + SReplica *pReplica = NULL; + + if(pVgroup->vnodeGid[v].nodeRole == TAOS_SYNC_ROLE_VOTER){ + pReplica = &req.replicas[req.replica]; + req.replica++; + } + else{ + pReplica = &req.learnerReplicas[req.learnerReplica]; + req.learnerReplica++; + } + + SVnodeGid *pVgid = &pVgroup->vnodeGid[v]; + SDnodeObj *pVgidDnode = mndAcquireDnode(pMnode, pVgid->dnodeId); + if (pVgidDnode == NULL) return NULL; + + pReplica->id = pVgidDnode->id; + pReplica->port = pVgidDnode->port; + memcpy(pReplica->fqdn, pVgidDnode->fqdn, TSDB_FQDN_LEN); + mndReleaseDnode(pMnode, pVgidDnode); + + if(pVgroup->vnodeGid[v].nodeRole == TAOS_SYNC_ROLE_VOTER){ + if (dnodeId == pVgid->dnodeId) { + req.selfIndex = v; + } + } + else{ + if (dnodeId == pVgid->dnodeId) { + req.learnerSelfIndex = v; + } + } + } + + mInfo("vgId:%d, build alter vnode req, replica:%d selfIndex:%d learnerReplica:%d learnerSelfIndex:%d strict:%d", + req.vgId, req.replica, req.selfIndex, req.learnerReplica, + req.learnerSelfIndex, req.strict); + for (int32_t i = 0; i < req.replica; ++i) { + mInfo("vgId:%d, replica:%d ep:%s:%u", req.vgId, i, req.replicas[i].fqdn, req.replicas[i].port); + } + for (int32_t i = 0; i < req.learnerReplica; ++i) { + mInfo("vgId:%d, learnerReplica:%d ep:%s:%u", req.vgId, i, + req.learnerReplicas[i].fqdn, req.learnerReplicas[i].port); + } + + if (req.selfIndex == -1 && req.learnerSelfIndex == -1) { + terrno = TSDB_CODE_APP_ERROR; + return NULL; + } + + int32_t contLen = tSerializeSAlterVnodeReplicaReq(NULL, 0, &req); + if (contLen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + + void *pReq = taosMemoryMalloc(contLen); + if (pReq == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + + tSerializeSAlterVnodeReplicaReq(pReq, contLen, &req); + *pContLen = contLen; + return pReq; +} + static void *mndBuildDisableVnodeWriteReq(SMnode *pMnode, SDbObj *pDb, int32_t vgId, int32_t *pContLen) { SDisableVnodeWriteReq disableReq = { .vgId = vgId, @@ -501,6 +581,7 @@ static void *mndBuildAlterVnodeHashRangeReq(SMnode *pMnode, int32_t srcVgId, SVg .dstVgId = pVgroup->vgId, .hashBegin = pVgroup->hashBegin, .hashEnd = pVgroup->hashEnd, + .changeVersion = ++(pVgroup->syncConfChangeVer), }; mInfo("vgId:%d, build alter vnode hashrange req, dstVgId:%d, hashrange:[%u, %u]", srcVgId, pVgroup->vgId, @@ -1411,7 +1492,7 @@ int32_t mndAddCheckLearnerCatchupAction(SMnode *pMnode, STrans *pTrans, SDbObj * mndReleaseDnode(pMnode, pDnode); int32_t contLen = 0; - void *pReq = mndBuildAlterVnodeReplicaReq(pMnode, pDb, pVgroup, dnodeId, &contLen); + void *pReq = mndBuildCheckLearnCatchupReq(pMnode, pDb, pVgroup, dnodeId, &contLen); if (pReq == NULL) return -1; action.pCont = pReq; @@ -2358,7 +2439,7 @@ int32_t mndBuildRaftAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pO mndTransSetSerial(pTrans); - mInfo("trans:%d, vgid:%d alter vgroup, syncConfChangeVer:%d, version:%d, replica:%d", + mInfo("trans:%d, vgId:%d, alter vgroup, syncConfChangeVer:%d, version:%d, replica:%d", pTrans->id, pVgroup->vgId, pVgroup->syncConfChangeVer, pVgroup->version, pVgroup->replica); if (newVgroup.replica == 1 && pNewDb->cfg.replications == 3) { @@ -2374,11 +2455,15 @@ int32_t mndBuildRaftAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pO newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_LEARNER; newVgroup.vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_LEARNER; - newVgroup.syncConfChangeVer++; if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; - //if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; + mInfo("trans:%d, vgId:%d, add change config, syncConfChangeVer:%d, version:%d, replica:%d", + pTrans->id, pVgroup->vgId, newVgroup.syncConfChangeVer, pVgroup->version, pVgroup->replica); if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1; + mInfo("trans:%d, vgId:%d, create vnode, syncConfChangeVer:%d, version:%d, replica:%d", + pTrans->id, pVgroup->vgId, newVgroup.syncConfChangeVer, pVgroup->version, pVgroup->replica); if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1; + mInfo("trans:%d, vgId:%d, create vnode, syncConfChangeVer:%d, version:%d, replica:%d", + pTrans->id, pVgroup->vgId, newVgroup.syncConfChangeVer, pVgroup->version, pVgroup->replica); //check learner @@ -2392,7 +2477,6 @@ int32_t mndBuildRaftAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pO newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; newVgroup.vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_LEARNER; - newVgroup.syncConfChangeVer++; if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; @@ -2401,7 +2485,6 @@ int32_t mndBuildRaftAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pO newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; newVgroup.vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_VOTER; - newVgroup.syncConfChangeVer++; if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; @@ -2421,7 +2504,6 @@ int32_t mndBuildRaftAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pO SVnodeGid del1 = {0}; if (mndRemoveVnodeFromVgroupWithoutSave(pMnode, pTrans, &newVgroup, pArray, &del1) != 0) return -1; - newVgroup.syncConfChangeVer++; if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; @@ -2439,7 +2521,6 @@ int32_t mndBuildRaftAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pO SVnodeGid del2 = {0}; if (mndRemoveVnodeFromVgroupWithoutSave(pMnode, pTrans, &newVgroup, pArray, &del2) != 0) return -1; - newVgroup.syncConfChangeVer++; if (mndAddChangeConfigAction(pMnode, pTrans, pNewDb, pVgroup, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 5ff24c73f5..38216e1414 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -58,7 +58,7 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod int32_t vnodeRestoreVgroupId(const char *srcPath, const char *dstPath, int32_t srcVgId, int32_t dstVgId, int32_t diskPrimary, STfs *pTfs); void vnodeDestroy(const char *path, STfs *pTfs); -SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgCb, bool isFirst); +SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgCb); void vnodePreClose(SVnode *pVnode); void vnodePostClose(SVnode *pVnode); void vnodeSyncCheckTimeout(SVnode *pVnode); diff --git a/source/dnode/vnode/src/inc/vnd.h b/source/dnode/vnode/src/inc/vnd.h index de1abf9416..a75d5d9307 100644 --- a/source/dnode/vnode/src/inc/vnd.h +++ b/source/dnode/vnode/src/inc/vnd.h @@ -109,7 +109,7 @@ int32_t vnodeAsyncCommit(SVnode* pVnode); bool vnodeShouldRollback(SVnode* pVnode); // vnodeSync.c -int32_t vnodeSyncOpen(SVnode* pVnode, char* path, bool isFirst); +int32_t vnodeSyncOpen(SVnode *pVnode, char *path, int32_t vnodeVersion); int32_t vnodeSyncStart(SVnode* pVnode); void vnodeSyncPreClose(SVnode* pVnode); void vnodeSyncPostClose(SVnode* pVnode); diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index af0eb2156f..db3b35867d 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -117,9 +117,10 @@ int32_t vnodeAlterReplica(const char *path, SAlterVnodeReplicaReq *pReq, int32_t if(pReq->learnerSelfIndex != -1){ pCfg->myIndex = pReq->replica + pReq->learnerSelfIndex; } + pCfg->changeVersion = pReq->changeVersion; - vInfo("vgId:%d, save config while alter, replicas:%d totalReplicas:%d selfIndex:%d", - pReq->vgId, pCfg->replicaNum, pCfg->totalReplicaNum, pCfg->myIndex); + vInfo("vgId:%d, save config while alter, replicas:%d totalReplicas:%d selfIndex:%d changeVersion:%d", + pReq->vgId, pCfg->replicaNum, pCfg->totalReplicaNum, pCfg->myIndex, pCfg->changeVersion); info.config.syncCfg = *pCfg; ret = vnodeSaveInfo(dir, &info); @@ -216,6 +217,7 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod info.config.hashEnd = pReq->hashEnd; info.config.hashChange = true; info.config.walCfg.vgId = pReq->dstVgId; + info.config.syncCfg.changeVersion = pReq->changeVersion; SSyncCfg *pCfg = &info.config.syncCfg; pCfg->myIndex = 0; @@ -311,7 +313,7 @@ static int32_t vnodeCheckDisk(int32_t diskPrimary, STfs *pTfs) { return 0; } -SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgCb, bool isFirst) { +SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgCb) { SVnode *pVnode = NULL; SVnodeInfo info = {0}; char dir[TSDB_FILENAME_LEN] = {0}; @@ -439,7 +441,8 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC } // open sync - if (vnodeSyncOpen(pVnode, dir, isFirst)) { + vInfo("vgId:%d, start to open sync, changeVersion:%d", TD_VID(pVnode), info.config.syncCfg.changeVersion); + if (vnodeSyncOpen(pVnode, dir, info.config.syncCfg.changeVersion)) { vError("vgId:%d, failed to open sync since %s", TD_VID(pVnode), tstrerror(terrno)); goto _err; } diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 468db28c39..d140c4a122 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -637,7 +637,7 @@ static SSyncFSM *vnodeSyncMakeFsm(SVnode *pVnode) { return pFsm; } -int32_t vnodeSyncOpen(SVnode *pVnode, char *path, bool isFirst) { +int32_t vnodeSyncOpen(SVnode *pVnode, char *path, int32_t vnodeVersion) { SSyncInfo syncInfo = { .snapshotStrategy = SYNC_STRATEGY_WAL_FIRST, .batchSize = 1, @@ -664,7 +664,7 @@ int32_t vnodeSyncOpen(SVnode *pVnode, char *path, bool isFirst) { pNode->nodeId, pNode->clusterId); } - pVnode->sync = syncOpen(&syncInfo, isFirst); + pVnode->sync = syncOpen(&syncInfo, vnodeVersion); if (pVnode->sync <= 0) { vError("vgId:%d, failed to open sync since %s", pVnode->config.vgId, terrstr()); return -1; diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index 7613fde169..e79e7a3f75 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -228,7 +228,7 @@ typedef struct SSyncNode { } SSyncNode; // open/close -------------- -SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, bool isFirst); +SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion); int32_t syncNodeStart(SSyncNode* pSyncNode); int32_t syncNodeStartStandBy(SSyncNode* pSyncNode); void syncNodeClose(SSyncNode* pSyncNode); diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 039c039c72..617b141fef 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -59,8 +59,8 @@ static int32_t syncDoLeaderTransfer(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyncRaftE static ESyncStrategy syncNodeStrategy(SSyncNode* pSyncNode); -int64_t syncOpen(SSyncInfo* pSyncInfo, bool isFirst) { - SSyncNode* pSyncNode = syncNodeOpen(pSyncInfo, isFirst); +int64_t syncOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) { + SSyncNode* pSyncNode = syncNodeOpen(pSyncInfo, vnodeVersion); if (pSyncNode == NULL) { sError("vgId:%d, failed to open sync node", pSyncInfo->vgId); return -1; @@ -778,7 +778,7 @@ int32_t syncNodeLogStoreRestoreOnNeed(SSyncNode* pNode) { } // open/close -------------- -SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, bool isFirst) { +SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) { SSyncNode* pSyncNode = taosMemoryCalloc(1, sizeof(SSyncNode)); if (pSyncNode == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -798,7 +798,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, bool isFirst) { TD_DIRSEP); snprintf(pSyncNode->configPath, sizeof(pSyncNode->configPath), "%s%sraft_config.json", pSyncInfo->path, TD_DIRSEP); - if (!taosCheckExistFile(pSyncNode->configPath) && isFirst) { + if (!taosCheckExistFile(pSyncNode->configPath)) { // create a new raft config file sInfo("vgId:%d, create a new raft config file", pSyncNode->vgId); pSyncNode->raftCfg.isStandBy = pSyncInfo->isStandBy; @@ -820,7 +820,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, bool isFirst) { goto _error; } - if(isFirst){ + if(vnodeVersion > pSyncNode->raftCfg.cfg.changeVersion){ if (pSyncInfo->syncCfg.totalReplicaNum > 0 && syncIsConfigChanged(&pSyncNode->raftCfg.cfg, &pSyncInfo->syncCfg)) { sInfo("vgId:%d, use sync config from input options and write to cfg file", pSyncNode->vgId); pSyncNode->raftCfg.cfg = pSyncInfo->syncCfg; @@ -833,6 +833,10 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, bool isFirst) { pSyncInfo->syncCfg = pSyncNode->raftCfg.cfg; } } + else{ + sInfo("vgId:%d, skip save sync cfg file since request ver:%d <= file ver:%d", + pSyncNode->vgId, vnodeVersion, pSyncInfo->syncCfg.changeVersion); + } } @@ -851,7 +855,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, bool isFirst) { pNode->nodeId, pNode->clusterId); } - if(isFirst){ + if(vnodeVersion > pSyncInfo->syncCfg.changeVersion){ if (updated) { sInfo("vgId:%d, save config info since dnode info changed", pSyncNode->vgId); if (syncWriteCfgFile(pSyncNode) != 0) { @@ -2382,12 +2386,38 @@ void syncNodeLogConfigInfo(SSyncNode* ths, SSyncCfg *cfg, char *str){ ths->peersNodeInfo[i].nodePort, ths->peersNodeInfo[i].nodeRole); } + for (int32_t i = 0; i < ths->peersNum; ++i){ + char buf[256]; + int32_t len = 256; + int32_t n = 0; + n += snprintf(buf + n, len - n, "%s", "{"); + for (int i = 0; i < ths->peersEpset->numOfEps; i++) { + n += snprintf(buf + n, len - n, "%s:%d%s", ths->peersEpset->eps[i].fqdn, ths->peersEpset->eps[i].port, + (i + 1 < ths->peersEpset->numOfEps ? ", " : "")); + } + n += snprintf(buf + n, len - n, "%s", "}"); + + sInfo("vgId:%d, %s, peersEpset%d, %s, inUse:%d", + ths->vgId, str, i, buf, ths->peersEpset->inUse); + } + + for (int32_t i = 0; i < ths->peersNum; ++i){ + sInfo("vgId:%d, %s, peersId%d, addr:%"PRId64, + ths->vgId, str, i, ths->peersId[i].addr); + } + for (int32_t i = 0; i < ths->raftCfg.cfg.totalReplicaNum; ++i){ sInfo("vgId:%d, %s, nodeInfo%d, clusterId:%" PRId64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", ths->vgId, str, i, ths->raftCfg.cfg.nodeInfo[i].clusterId, ths->raftCfg.cfg.nodeInfo[i].nodeId, ths->raftCfg.cfg.nodeInfo[i].nodeFqdn, ths->raftCfg.cfg.nodeInfo[i].nodePort, ths->raftCfg.cfg.nodeInfo[i].nodeRole); } + + for (int32_t i = 0; i < ths->raftCfg.cfg.totalReplicaNum; ++i){ + sInfo("vgId:%d, %s, replicasId%d, addr:%" PRId64, + ths->vgId, str, i, ths->replicasId[i].addr); + } + } int32_t syncNodeRebuildPeerAndCfg(SSyncNode* ths, SSyncCfg *cfg){ @@ -2520,6 +2550,7 @@ int32_t syncNodeRebuildAndCopyIfExist(SSyncNode* ths, int32_t oldtotalReplicaNum for(int j = 0; j < oldtotalReplicaNum; j++){ if (syncUtilSameId(&ths->replicasId[i], &oldReplicasId[j])) { *(ths->logReplMgrs[i]) = oldLogReplMgrs[j]; + ths->logReplMgrs[i]->peerId = i; } } } diff --git a/source/libs/sync/src/syncRaftCfg.c b/source/libs/sync/src/syncRaftCfg.c index 4b57fbde2c..0dcc3eee29 100644 --- a/source/libs/sync/src/syncRaftCfg.c +++ b/source/libs/sync/src/syncRaftCfg.c @@ -246,7 +246,8 @@ int32_t syncReadCfgFile(SSyncNode *pNode) { } code = 0; - sInfo("vgId:%d, succceed to read sync cfg file %s", pNode->vgId, file); + sInfo("vgId:%d, succceed to read sync cfg file %s, changeVersion:%d", + pNode->vgId, file, pCfg->cfg.changeVersion); _OVER: if (pData != NULL) taosMemoryFree(pData); From 5d4f0cbc717c3bec17d3086264f8d30a55026174 Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 2 Aug 2023 16:36:07 +0800 Subject: [PATCH 08/46] myindex --- source/libs/sync/src/syncMain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 617b141fef..f200212538 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -2458,6 +2458,10 @@ int32_t syncNodeRebuildPeerAndCfg(SSyncNode* ths, SSyncCfg *cfg){ tstrncpy(ths->raftCfg.cfg.nodeInfo[i].nodeFqdn, cfg->nodeInfo[j].nodeFqdn, TSDB_FQDN_LEN); ths->raftCfg.cfg.nodeInfo[i].nodeId = cfg->nodeInfo[j].nodeId; ths->raftCfg.cfg.nodeInfo[i].nodePort = cfg->nodeInfo[j].nodePort; + if((strcmp(ths->myNodeInfo.nodeFqdn, cfg->nodeInfo[j].nodeFqdn) == 0 + && ths->myNodeInfo.nodePort == cfg->nodeInfo[j].nodePort)){ + ths->raftCfg.cfg.myIndex = i; + } i++; } ths->raftCfg.cfg.totalReplicaNum = i; From bbd88e7924be601a8bf58b659d4ee8571285470e Mon Sep 17 00:00:00 2001 From: dmchen Date: Thu, 3 Aug 2023 17:46:45 +0800 Subject: [PATCH 09/46] fix wrong merge --- source/common/src/tmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index ba65fba4c6..ad5c5225fa 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -1160,7 +1160,7 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { if (tDecodeI64(&decoder, &vload.compStorage) < 0) return -1; if (tDecodeI64(&decoder, &vload.pointsWritten) < 0) return -1; if (tDecodeI32(&decoder, &vload.numOfCachedTables) < 0) return -1; - if (tDecodeI32(&decoder, &vload.learnerProgress) < 0) return -1 + if (tDecodeI32(&decoder, &vload.learnerProgress) < 0) return -1; if (tDecodeI64(&decoder, &reserved) < 0) return -1; if (tDecodeI64(&decoder, &reserved) < 0) return -1; if (taosArrayPush(pReq->pVloads, &vload) == NULL) { From 8fd6b122d3a4d202f5c35ff4ad98cb6e5882b3a0 Mon Sep 17 00:00:00 2001 From: dmchen Date: Mon, 14 Aug 2023 15:26:59 +0800 Subject: [PATCH 10/46] mnode ver --- source/dnode/mnode/impl/src/mndVgroup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 1b5826e7cc..44b19472e0 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -27,7 +27,7 @@ #include "mndUser.h" #include "tmisce.h" -#define VGROUP_VER_NUMBER 2 +#define VGROUP_VER_NUMBER 1 #define VGROUP_RESERVE_SIZE 64 static int32_t mndVgroupActionInsert(SSdb *pSdb, SVgObj *pVgroup); @@ -159,9 +159,9 @@ SSdbRow *mndVgroupActionDecode(SSdbRaw *pRaw) { pVgid->syncState = TAOS_SYNC_STATE_LEADER; } } - if(sver > 1){ - SDB_GET_INT32(pRaw, dataPos, &pVgroup->syncConfChangeVer, _OVER) - } + //if(sver > 1){ + SDB_GET_INT32(pRaw, dataPos, &pVgroup->syncConfChangeVer, _OVER) + //} SDB_GET_RESERVE(pRaw, dataPos, VGROUP_RESERVE_SIZE, _OVER) From f0090cf799d32f3d296262986333c80e5708a989 Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 15 Aug 2023 14:46:54 +0800 Subject: [PATCH 11/46] vgroup version --- source/dnode/mnode/impl/src/mndVgroup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 44b19472e0..1b5826e7cc 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -27,7 +27,7 @@ #include "mndUser.h" #include "tmisce.h" -#define VGROUP_VER_NUMBER 1 +#define VGROUP_VER_NUMBER 2 #define VGROUP_RESERVE_SIZE 64 static int32_t mndVgroupActionInsert(SSdb *pSdb, SVgObj *pVgroup); @@ -159,9 +159,9 @@ SSdbRow *mndVgroupActionDecode(SSdbRaw *pRaw) { pVgid->syncState = TAOS_SYNC_STATE_LEADER; } } - //if(sver > 1){ - SDB_GET_INT32(pRaw, dataPos, &pVgroup->syncConfChangeVer, _OVER) - //} + if(sver > 1){ + SDB_GET_INT32(pRaw, dataPos, &pVgroup->syncConfChangeVer, _OVER) + } SDB_GET_RESERVE(pRaw, dataPos, VGROUP_RESERVE_SIZE, _OVER) From 18ef0f7d828224198cceadb4c7e812da8dfc06f5 Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 15 Aug 2023 17:13:58 +0800 Subject: [PATCH 12/46] vgroup version --- source/dnode/mnode/impl/src/mndVgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 1b5826e7cc..e764c4091b 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -27,7 +27,7 @@ #include "mndUser.h" #include "tmisce.h" -#define VGROUP_VER_NUMBER 2 +#define VGROUP_VER_NUMBER 1 #define VGROUP_RESERVE_SIZE 64 static int32_t mndVgroupActionInsert(SSdb *pSdb, SVgObj *pVgroup); @@ -159,7 +159,7 @@ SSdbRow *mndVgroupActionDecode(SSdbRaw *pRaw) { pVgid->syncState = TAOS_SYNC_STATE_LEADER; } } - if(sver > 1){ + if(dataPos + sizeof(int32_t) + VGROUP_RESERVE_SIZE <= pRaw->dataLen){ SDB_GET_INT32(pRaw, dataPos, &pVgroup->syncConfChangeVer, _OVER) } From de5aedd8f36f36938cf0c169070fc709278fcdac Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 16 Aug 2023 10:20:48 +0800 Subject: [PATCH 13/46] vnode.json --- include/libs/sync/sync.h | 2 ++ source/dnode/vnode/src/vnd/vnodeCommit.c | 3 +++ source/libs/sync/src/syncMain.c | 16 ++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index b4c52fbc56..b1fc046211 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -272,6 +272,8 @@ SSyncState syncGetState(int64_t rid); void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet); const char* syncStr(ESyncState state); +SSyncCfg syncNodeGetConfig(int64_t rid); + #ifdef __cplusplus } #endif diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index fd701d7b95..a54297af85 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -15,6 +15,7 @@ #include "vnd.h" #include "vnodeInt.h" +#include "sync.h" extern int32_t tsdbPreCommit(STsdb *pTsdb); extern int32_t tsdbCommitBegin(STsdb *pTsdb, SCommitInfo *pInfo); @@ -287,6 +288,8 @@ static int32_t vnodePrepareCommit(SVnode *pVnode, SCommitInfo *pInfo) { tsem_wait(&pVnode->canCommit); + pVnode->config.syncCfg = syncNodeGetConfig(pVnode->sync); + pVnode->state.commitTerm = pVnode->state.applyTerm; pInfo->info.config = pVnode->config; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index ace4a7c9c5..9c903dcbf8 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -106,6 +106,22 @@ _err: return -1; } +SSyncCfg syncNodeGetConfig(int64_t rid){ + SSyncNode* pSyncNode = syncNodeAcquire(rid); + + SSyncCfg cfg = {0}; + if (pSyncNode == NULL) { + sError("failed to acquire rid:%" PRId64 " of tsNodeReftId for pSyncNode", rid); + return cfg; + } + + cfg = pSyncNode->raftCfg.cfg; + + syncNodeRelease(pSyncNode); + + return cfg; +} + void syncStop(int64_t rid) { SSyncNode* pSyncNode = syncNodeAcquire(rid); if (pSyncNode != NULL) { From fee4b875d1e2c70698e81b476b1a310edd4d7d19 Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 16 Aug 2023 17:49:17 +0800 Subject: [PATCH 14/46] error code --- include/libs/sync/sync.h | 2 +- source/dnode/vnode/src/vnd/vnodeCommit.c | 2 +- source/libs/sync/src/syncMain.c | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index b1fc046211..2ac25ff5e6 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -272,7 +272,7 @@ SSyncState syncGetState(int64_t rid); void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet); const char* syncStr(ESyncState state); -SSyncCfg syncNodeGetConfig(int64_t rid); +int32_t syncNodeGetConfig(int64_t rid, SSyncCfg *cfg); #ifdef __cplusplus } diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index a54297af85..136168c5cc 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -288,7 +288,7 @@ static int32_t vnodePrepareCommit(SVnode *pVnode, SCommitInfo *pInfo) { tsem_wait(&pVnode->canCommit); - pVnode->config.syncCfg = syncNodeGetConfig(pVnode->sync); + if(syncNodeGetConfig(pVnode->sync, &pVnode->config.syncCfg) != 0) goto _exit; pVnode->state.commitTerm = pVnode->state.applyTerm; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 9c903dcbf8..e8cece60e9 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -106,20 +106,19 @@ _err: return -1; } -SSyncCfg syncNodeGetConfig(int64_t rid){ +int32_t syncNodeGetConfig(int64_t rid, SSyncCfg *cfg){ SSyncNode* pSyncNode = syncNodeAcquire(rid); - SSyncCfg cfg = {0}; if (pSyncNode == NULL) { sError("failed to acquire rid:%" PRId64 " of tsNodeReftId for pSyncNode", rid); - return cfg; + return -1; } - cfg = pSyncNode->raftCfg.cfg; + *cfg = pSyncNode->raftCfg.cfg; syncNodeRelease(pSyncNode); - return cfg; + return 0; } void syncStop(int64_t rid) { From d85d6980746a971fc32d7521b9dcb3a2564992b0 Mon Sep 17 00:00:00 2001 From: dmchen Date: Wed, 16 Aug 2023 18:48:12 +0800 Subject: [PATCH 15/46] drop vnode --- source/dnode/mgmt/mgmt_vnode/src/vmInt.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 40256d5cfe..970cf8929c 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -305,11 +305,18 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) { return -1; } - pMgmt->state.totalVnodes = numOfVnodes; + int32_t numOfDropped = 0; + for (int32_t v = 0; v < numOfVnodes; ++v){ + if(pCfgs[v].dropped == 1) numOfDropped++; + } + + dInfo("there are %d dropped vnodes", numOfDropped); + + pMgmt->state.totalVnodes = numOfVnodes - numOfDropped; int32_t threadNum = tsNumOfCores / 2; if (threadNum < 1) threadNum = 1; - int32_t vnodesPerThread = numOfVnodes / threadNum + 1; + int32_t vnodesPerThread = (numOfVnodes - numOfDropped) / threadNum + 1; SVnodeThread *threads = taosMemoryCalloc(threadNum, sizeof(SVnodeThread)); for (int32_t t = 0; t < threadNum; ++t) { @@ -319,12 +326,13 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) { } for (int32_t v = 0; v < numOfVnodes; ++v) { + if(pCfgs[v].dropped == 1) continue; int32_t t = v % threadNum; SVnodeThread *pThread = &threads[t]; pThread->pCfgs[pThread->vnodeNum++] = pCfgs[v]; } - dInfo("open %d vnodes with %d threads", numOfVnodes, threadNum); + dInfo("open %d vnodes with %d threads", numOfVnodes - numOfDropped, threadNum); for (int32_t t = 0; t < threadNum; ++t) { SVnodeThread *pThread = &threads[t]; @@ -365,7 +373,7 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) { return -1; } - dInfo("successfully opened %d vnodes", pMgmt->state.totalVnodes); + dInfo("successfully opened %d vnodes, %d dropped vnodes", pMgmt->state.totalVnodes, numOfDropped); return 0; } From 4448e7d1599965053aa7003bfdefa99152152729 Mon Sep 17 00:00:00 2001 From: dmchen Date: Thu, 17 Aug 2023 11:57:17 +0800 Subject: [PATCH 16/46] revert drop vnode --- source/dnode/mgmt/mgmt_vnode/src/vmInt.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 970cf8929c..40256d5cfe 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -305,18 +305,11 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) { return -1; } - int32_t numOfDropped = 0; - for (int32_t v = 0; v < numOfVnodes; ++v){ - if(pCfgs[v].dropped == 1) numOfDropped++; - } - - dInfo("there are %d dropped vnodes", numOfDropped); - - pMgmt->state.totalVnodes = numOfVnodes - numOfDropped; + pMgmt->state.totalVnodes = numOfVnodes; int32_t threadNum = tsNumOfCores / 2; if (threadNum < 1) threadNum = 1; - int32_t vnodesPerThread = (numOfVnodes - numOfDropped) / threadNum + 1; + int32_t vnodesPerThread = numOfVnodes / threadNum + 1; SVnodeThread *threads = taosMemoryCalloc(threadNum, sizeof(SVnodeThread)); for (int32_t t = 0; t < threadNum; ++t) { @@ -326,13 +319,12 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) { } for (int32_t v = 0; v < numOfVnodes; ++v) { - if(pCfgs[v].dropped == 1) continue; int32_t t = v % threadNum; SVnodeThread *pThread = &threads[t]; pThread->pCfgs[pThread->vnodeNum++] = pCfgs[v]; } - dInfo("open %d vnodes with %d threads", numOfVnodes - numOfDropped, threadNum); + dInfo("open %d vnodes with %d threads", numOfVnodes, threadNum); for (int32_t t = 0; t < threadNum; ++t) { SVnodeThread *pThread = &threads[t]; @@ -373,7 +365,7 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) { return -1; } - dInfo("successfully opened %d vnodes, %d dropped vnodes", pMgmt->state.totalVnodes, numOfDropped); + dInfo("successfully opened %d vnodes", pMgmt->state.totalVnodes); return 0; } From 5f138941f888c2b6baae2bd437c5ebd36594b993 Mon Sep 17 00:00:00 2001 From: dmchen Date: Thu, 17 Aug 2023 17:58:35 +0800 Subject: [PATCH 17/46] tsdb snap core --- source/dnode/vnode/src/tsdb/tsdbSnapshot.c | 30 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index f547119f49..8601248a69 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -551,8 +551,8 @@ struct STsdbSnapWriter { int32_t fid; STFileSet* fset; SDiskID did; - bool hasData; - bool hasTomb; + bool hasData; // if have time series data + bool hasTomb; // if have tomb data // reader SDataFileReader* dataReader; @@ -630,6 +630,15 @@ static int32_t tsdbSnapWriteFileSetOpenReader(STsdbSnapWriter* writer) { dataFileReaderConfig.files[ftype].exist = true; dataFileReaderConfig.files[ftype].file = writer->ctx->fset->farr[ftype]->f[0]; + + STFileOp fileOp = { + .optype = TSDB_FOP_REMOVE, + .fid = writer->ctx->fset->fid, + .of = writer->ctx->fset->farr[ftype]->f[0], + }; + + code = TARRAY2_APPEND(writer->fopArr, fileOp); + TSDB_CHECK_CODE(code, lino, _exit); } code = tsdbDataFileReaderOpen(NULL, &dataFileReaderConfig, &writer->ctx->dataReader); @@ -653,6 +662,15 @@ static int32_t tsdbSnapWriteFileSetOpenReader(STsdbSnapWriter* writer) { code = TARRAY2_APPEND(writer->ctx->sttReaderArr, reader); TSDB_CHECK_CODE(code, lino, _exit); + + STFileOp fileOp = { + .optype = TSDB_FOP_REMOVE, + .fid = fobj->f->fid, + .of = fobj->f[0], + }; + + code = TARRAY2_APPEND(writer->fopArr, fileOp); + TSDB_CHECK_CODE(code, lino, _exit); } } } @@ -862,6 +880,7 @@ static int32_t tsdbSnapWriteFileSetEnd(STsdbSnapWriter* writer) { int32_t code = 0; int32_t lino = 0; + // end timeseries data write SRowInfo row = { .suid = INT64_MAX, .uid = INT64_MAX, @@ -870,6 +889,7 @@ static int32_t tsdbSnapWriteFileSetEnd(STsdbSnapWriter* writer) { code = tsdbSnapWriteTimeSeriesRow(writer, &row); TSDB_CHECK_CODE(code, lino, _exit); + // end tombstone data write STombRecord record = { .suid = INT64_MAX, .uid = INT64_MAX, @@ -1008,6 +1028,10 @@ int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, STsdbSnapWr int32_t code = 0; int32_t lino = 0; + // disable background tasks + tsdbFSDisableBgTask(pTsdb->pFS); + + // start to write writer[0] = taosMemoryCalloc(1, sizeof(*writer[0])); if (writer[0] == NULL) return TSDB_CODE_OUT_OF_MEMORY; @@ -1026,8 +1050,6 @@ int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, STsdbSnapWr code = tsdbFSCreateCopySnapshot(pTsdb->pFS, &writer[0]->fsetArr); TSDB_CHECK_CODE(code, lino, _exit); - tsdbFSDisableBgTask(pTsdb->pFS); - _exit: if (code) { tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); From e56f54db5b9cfc714e7e22fba113ecf46f32f4e2 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Mon, 21 Aug 2023 17:21:18 +0800 Subject: [PATCH 18/46] relase 3.1.0.2 --- docs/en/28-releases/01-tdengine.md | 4 ++++ docs/zh/28-releases/01-tdengine.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/en/28-releases/01-tdengine.md b/docs/en/28-releases/01-tdengine.md index 31484dc1c5..ff6a36440f 100644 --- a/docs/en/28-releases/01-tdengine.md +++ b/docs/en/28-releases/01-tdengine.md @@ -10,6 +10,10 @@ For TDengine 2.x installation packages by version, please visit [here](https://t import Release from "/components/ReleaseV3"; +## 3.1.0.2 + + + ## 3.1.0.0 :::note IMPORTANT diff --git a/docs/zh/28-releases/01-tdengine.md b/docs/zh/28-releases/01-tdengine.md index afdf2a76d3..d316b3ab68 100644 --- a/docs/zh/28-releases/01-tdengine.md +++ b/docs/zh/28-releases/01-tdengine.md @@ -10,6 +10,10 @@ TDengine 2.x 各版本安装包请访问[这里](https://www.taosdata.com/all-do import Release from "/components/ReleaseV3"; +## 3.1.0.2 + + + ## 3.1.0.0 From 63d186afa130265e3f8feb94652c129d5e90ee3b Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 22 Aug 2023 09:15:29 +0800 Subject: [PATCH 19/46] test:kill tmq_sim process when start cases in windows --- tests/pytest/util/dnodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index 8633fc660f..d34e50b510 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -812,7 +812,7 @@ class TDDnodes: time.sleep(1) processID = subprocess.check_output( psCmd, shell=True).decode("utf-8").strip() - psCmd = "for /f %a in ('wmic process where \"name='tmq_sim'\" get processId ^| xargs echo ^| awk '{print $2}' ^&^& echo aa') do @(ps | grep %a | awk '{print $1}' | xargs)" + psCmd = "for /f %a in ('wmic process where \"name='tmq_simm.exe'\" get processId ^| xargs echo ^| awk '{print $2}' ^&^& echo aa') do @(ps | grep %a | awk '{print $1}' | xargs)" processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip() while(processID): print(processID) From 9f004c209a595841c89a1c04576566baf9214690 Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 22 Aug 2023 11:28:50 +0800 Subject: [PATCH 20/46] keep version change --- source/dnode/mnode/impl/src/mndDb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index f2969d9982..b0e3dc4331 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -659,10 +659,10 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate, mndTransSetOper(pTrans, MND_OPER_CREATE_DB); if (mndSetCreateDbPrepareAction(pMnode, pTrans, &dbObj) != 0) goto _OVER; + if (mndSetCreateDbRedoActions(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndSetNewVgPrepareActions(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndSetCreateDbUndoLogs(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndSetCreateDbCommitLogs(pMnode, pTrans, &dbObj, pVgroups, pNewUserDuped) != 0) goto _OVER; - if (mndSetCreateDbRedoActions(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndSetCreateDbUndoActions(pMnode, pTrans, &dbObj, pVgroups) != 0) goto _OVER; if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER; From 8be670aee8b77c0662f378bf43adab9858ee69c3 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Tue, 22 Aug 2023 11:30:40 +0800 Subject: [PATCH 21/46] enh: place vnodeSyncPreStop ahead of vnodeQueryPreStop in vnodePreClose --- source/dnode/vnode/src/vnd/vnodeOpen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index c8b383a6a8..131aa22732 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -473,8 +473,8 @@ _err: } void vnodePreClose(SVnode *pVnode) { - vnodeQueryPreClose(pVnode); vnodeSyncPreClose(pVnode); + vnodeQueryPreClose(pVnode); } void vnodePostClose(SVnode *pVnode) { vnodeSyncPostClose(pVnode); } From 5faf7d967d8b2b3d518c81ce801ee9ab8f72517d Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 22 Aug 2023 13:55:45 +0800 Subject: [PATCH 22/46] fix: table version release issue --- source/libs/planner/src/planOptimizer.c | 2 +- source/libs/qworker/src/qwUtil.c | 2 +- tests/system-test/2-query/stbJoin.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 2db0c8c54b..7ce6994ce6 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -3192,7 +3192,7 @@ static bool stbJoinOptShouldBeOptimized(SLogicNode* pNode) { } SJoinLogicNode* pJoin = (SJoinLogicNode*)pNode; - if (pJoin->isSingleTableJoin || NULL == pJoin->pTagEqCond || pNode->pChildren->length != 2 + if (pJoin->isSingleTableJoin || NULL == pJoin->pTagEqCond || NULL != pJoin->pTagOnCond || pNode->pChildren->length != 2 || pJoin->hasSubQuery || pJoin->joinAlgo != JOIN_ALGO_UNKNOWN || pJoin->isLowLevelJoin) { if (pJoin->joinAlgo == JOIN_ALGO_UNKNOWN) { pJoin->joinAlgo = JOIN_ALGO_MERGE; diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index 2ce920a9d2..3b127ee780 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -314,7 +314,6 @@ void qwFreeTaskCtx(SQWTaskCtx *ctx) { } taosArrayDestroy(ctx->tbInfo); - ctx->tbInfo = NULL; } int32_t qwDropTaskCtx(QW_FPARAMS_DEF) { @@ -341,6 +340,7 @@ int32_t qwDropTaskCtx(QW_FPARAMS_DEF) { } qwFreeTaskCtx(&octx); + ctx->tbInfo = NULL; QW_TASK_DLOG_E("task ctx dropped"); diff --git a/tests/system-test/2-query/stbJoin.py b/tests/system-test/2-query/stbJoin.py index ce6da6eb1c..3913a8159f 100644 --- a/tests/system-test/2-query/stbJoin.py +++ b/tests/system-test/2-query/stbJoin.py @@ -103,6 +103,8 @@ class TDTestCase: tdSql.query(f"select /*+ no_batch_scan() */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") tdSql.checkRows(3) + tdSql.query(f"select a.ts, b.ts from sta a, stb b where a.ts=b.ts and (a.t0=b.t0 and a.t0 > b.t0);") + tdSql.checkRows(0) # tdSql.checkData(0,1,10) From 345743aba537ae7f1ef3989522ef7b1765f4eb6f Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 22 Aug 2023 14:44:32 +0800 Subject: [PATCH 23/46] fix(tsdb/file): save errno for shell reporting --- source/dnode/vnode/src/tsdb/tsdbReaderWriter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c index 0a462c21e3..651dbebdfd 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c +++ b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c @@ -35,6 +35,7 @@ int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsdbFD **p pFD->flag = flag; pFD->pFD = taosOpenFile(path, flag); if (pFD->pFD == NULL) { + int errsv = errno; const char *object_name = taosDirEntryBaseName((char *)path); long s3_size = s3Size(object_name); if (!strncmp(path + strlen(path) - 5, ".data", 5) && s3_size > 0) { @@ -49,7 +50,7 @@ int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsdbFD **p goto _exit; } } else { - code = TAOS_SYSTEM_ERROR(errno); + code = TAOS_SYSTEM_ERROR(errsv); taosMemoryFree(pFD); goto _exit; } From 2c1a46a3de62be3b225091e78c3faa88cc56a3c5 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 22 Aug 2023 14:57:39 +0800 Subject: [PATCH 24/46] fix(s3): cmake apu & curl fixes --- cmake/apr-util_CMakeLists.txt.in | 2 +- cmake/curl_CMakeLists.txt.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/apr-util_CMakeLists.txt.in b/cmake/apr-util_CMakeLists.txt.in index 5a68020dd7..015084e710 100644 --- a/cmake/apr-util_CMakeLists.txt.in +++ b/cmake/apr-util_CMakeLists.txt.in @@ -11,7 +11,7 @@ ExternalProject_Add(aprutil-1 BUILD_IN_SOURCE TRUE BUILD_ALWAYS 1 #UPDATE_COMMAND "" - CONFIGURE_COMMAND ./configure --prefix=$ENV{HOME}/.cos-local.1/ --with-apr=$ENV{HOME}/.cos-local.1 + CONFIGURE_COMMAND ./configure --prefix=$ENV{HOME}/.cos-local.1/ --with-apr=$ENV{HOME}/.cos-local.1 --without-expat #CONFIGURE_COMMAND ./configure --with-apr=/usr/local/apr BUILD_COMMAND make INSTALL_COMMAND make install diff --git a/cmake/curl_CMakeLists.txt.in b/cmake/curl_CMakeLists.txt.in index 0fe0c2256f..d02e9d5bbf 100644 --- a/cmake/curl_CMakeLists.txt.in +++ b/cmake/curl_CMakeLists.txt.in @@ -9,7 +9,7 @@ ExternalProject_Add(curl BUILD_IN_SOURCE TRUE BUILD_ALWAYS 1 #UPDATE_COMMAND "" - CONFIGURE_COMMAND ./configure --prefix=$ENV{HOME}/.cos-local.1 --without-ssl --enable-shared=no --disable-ldap --disable-ldaps --without-brotli + CONFIGURE_COMMAND ./configure --prefix=$ENV{HOME}/.cos-local.1 --without-ssl --enable-shared=no --disable-ldap --disable-ldaps --without-brotli --without-zstd #CONFIGURE_COMMAND ./configure --without-ssl BUILD_COMMAND make INSTALL_COMMAND make install From fb51be4a78bf764241610881a1b8dcd8994384a9 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 22 Aug 2023 14:58:42 +0800 Subject: [PATCH 25/46] fix: add hint test cases --- tests/parallel_test/cases.task | 4 ++ tests/system-test/2-query/hint.py | 87 +++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 tests/system-test/2-query/hint.py diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 210961a547..326a754654 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -10,6 +10,10 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stbJoin.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stbJoin.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/stbJoin.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/hint.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/hint.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/hint.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/hint.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_str.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/nestedQuery_math.py diff --git a/tests/system-test/2-query/hint.py b/tests/system-test/2-query/hint.py new file mode 100644 index 0000000000..8c1216ab8e --- /dev/null +++ b/tests/system-test/2-query/hint.py @@ -0,0 +1,87 @@ +from wsgiref.headers import tspecials +from util.log import * +from util.cases import * +from util.sql import * +import numpy as np + + +class TDTestCase: + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor()) + + self.rowNum = 10 + self.batchNum = 5 + self.ts = 1537146000000 + + def run(self): + dbname = "db" + tdSql.prepare() + + tdSql.execute(f'''create table sta(ts timestamp, col1 int, col2 bigint) tags(tg1 int, tg2 binary(20))''') + tdSql.execute(f"create table sta1 using sta tags(1, 'a')") + tdSql.execute(f"create table sta2 using sta tags(2, 'b')") + tdSql.execute(f"create table sta3 using sta tags(3, 'c')") + tdSql.execute(f"create table sta4 using sta tags(4, 'a')") + tdSql.execute(f"insert into sta1 values(1537146000001, 11, 110)") + tdSql.execute(f"insert into sta1 values(1537146000002, 12, 120)") + tdSql.execute(f"insert into sta1 values(1537146000003, 13, 130)") + tdSql.execute(f"insert into sta2 values(1537146000001, 21, 210)") + tdSql.execute(f"insert into sta2 values(1537146000002, 22, 220)") + tdSql.execute(f"insert into sta2 values(1537146000003, 23, 230)") + tdSql.execute(f"insert into sta3 values(1537146000001, 31, 310)") + tdSql.execute(f"insert into sta3 values(1537146000002, 32, 320)") + tdSql.execute(f"insert into sta3 values(1537146000003, 33, 330)") + tdSql.execute(f"insert into sta4 values(1537146000001, 41, 410)") + tdSql.execute(f"insert into sta4 values(1537146000002, 42, 420)") + tdSql.execute(f"insert into sta4 values(1537146000003, 43, 430)") + + tdSql.execute(f'''create table stb(ts timestamp, col1 int, col2 bigint) tags(tg1 int, tg2 binary(20))''') + tdSql.execute(f"create table stb1 using stb tags(1, 'a')") + tdSql.execute(f"create table stb2 using stb tags(2, 'b')") + tdSql.execute(f"create table stb3 using stb tags(3, 'c')") + tdSql.execute(f"create table stb4 using stb tags(4, 'a')") + tdSql.execute(f"insert into stb1 values(1537146000001, 911, 9110)") + tdSql.execute(f"insert into stb1 values(1537146000002, 912, 9120)") + tdSql.execute(f"insert into stb1 values(1537146000003, 913, 9130)") + tdSql.execute(f"insert into stb2 values(1537146000001, 921, 9210)") + tdSql.execute(f"insert into stb2 values(1537146000002, 922, 9220)") + tdSql.execute(f"insert into stb2 values(1537146000003, 923, 9230)") + tdSql.execute(f"insert into stb3 values(1537146000001, 931, 9310)") + tdSql.execute(f"insert into stb3 values(1537146000002, 932, 9320)") + tdSql.execute(f"insert into stb3 values(1537146000003, 933, 9330)") + tdSql.execute(f"insert into stb4 values(1537146000001, 941, 9410)") + tdSql.execute(f"insert into stb4 values(1537146000002, 942, 9420)") + tdSql.execute(f"insert into stb4 values(1537146000003, 943, 9430)") + + tdSql.query(f"select /*+ batch_scan() */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") + tdSql.checkRows(3) + + tdSql.query(f"select /*+ no_batch_scan() */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") + tdSql.checkRows(3) + + tdSql.query(f"select /*+ batch_scan(a) */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") + tdSql.checkRows(3) + + tdSql.query(f"select /*+ batch_scan(a,) */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") + tdSql.checkRows(3) + + tdSql.query(f"select /*+ a,a */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") + tdSql.checkRows(3) + + tdSql.query(f"select /*+*/ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") + tdSql.checkRows(3) + + tdSql.query(f"select /*+ batch_scan(),no_batch_scan() */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") + tdSql.checkRows(3) + + tdSql.query(f"select /*+ no_batch_scan() batch_scan() */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") + tdSql.checkRows(3) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) From 8181c912196c51932a03ace9f79e4c6b48eac50a Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 22 Aug 2023 15:16:36 +0800 Subject: [PATCH 26/46] fix: fix case issue --- tests/system-test/2-query/stbJoin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/2-query/stbJoin.py b/tests/system-test/2-query/stbJoin.py index 3913a8159f..b4d6301424 100644 --- a/tests/system-test/2-query/stbJoin.py +++ b/tests/system-test/2-query/stbJoin.py @@ -103,7 +103,7 @@ class TDTestCase: tdSql.query(f"select /*+ no_batch_scan() */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") tdSql.checkRows(3) - tdSql.query(f"select a.ts, b.ts from sta a, stb b where a.ts=b.ts and (a.t0=b.t0 and a.t0 > b.t0);") + tdSql.query(f"select a.ts, b.ts from sta a, stb b where a.ts=b.ts and (a.tg1=b.tg1 and a.tg1 > b.tg1);") tdSql.checkRows(0) # tdSql.checkData(0,1,10) From dba7c68de10e9b92a2aadd93cb2474a4d423c8c3 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 22 Aug 2023 15:41:04 +0800 Subject: [PATCH 27/46] test: add test cases for timeline function used for select * union query --- tests/system-test/2-query/union.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/system-test/2-query/union.py b/tests/system-test/2-query/union.py index 82dcfe12e6..96c29a2222 100644 --- a/tests/system-test/2-query/union.py +++ b/tests/system-test/2-query/union.py @@ -231,6 +231,31 @@ class TDTestCase: tdSql.execute(f"{sqls[j+i]} union {sqls[i]}") else: tdSql.error(f"{sqls[i]} union {sqls[j+i]}") + # check union with timeline function + tdSql.query(f"select first(c1) from (select * from t1 union select * from t1 order by ts)") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 9) + tdSql.query(f"select last(c1) from (select * from t1 union select * from t1 order by ts desc)") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 2147450880) + tdSql.query(f"select irate(c1) from (select * from t1 union select * from t1 order by ts)") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 9.102222222222222) + tdSql.query(f"select elapsed(ts) from (select * from t1 union select * from t1 order by ts)") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 46800000.000000000000000) + tdSql.query(f"select diff(c1) from (select * from t1 union select * from t1 order by ts)") + tdSql.checkRows(14) + tdSql.query(f"select derivative(c1, 1s, 0) from (select * from t1 union select * from t1 order by ts)") + tdSql.checkRows(11) + + tdSql.error(f"select first(c1) from (select * from t1 union select * from t1)") + tdSql.error(f"select last(c1) from (select * from t1 union select * from t1)") + tdSql.error(f"select irate(c1) from (select * from t1 union select * from t1)") + tdSql.error(f"select elapsed(ts) from (select * from t1 union select * from t1)") + tdSql.error(f"select diff(c1) from (select * from t1 union select * from t1)") + tdSql.error(f"select derivative(c1, 1s, 0) from (select * from t1 union select * from t1)") + def __test_error(self, dbname="db"): From 502788215b07ba0e0c7d016ecfe3e04c675a6d78 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 22 Aug 2023 17:32:36 +0800 Subject: [PATCH 28/46] fix error --- tests/system-test/2-query/union.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/system-test/2-query/union.py b/tests/system-test/2-query/union.py index 96c29a2222..e359164a4f 100644 --- a/tests/system-test/2-query/union.py +++ b/tests/system-test/2-query/union.py @@ -231,30 +231,31 @@ class TDTestCase: tdSql.execute(f"{sqls[j+i]} union {sqls[i]}") else: tdSql.error(f"{sqls[i]} union {sqls[j+i]}") + # check union with timeline function - tdSql.query(f"select first(c1) from (select * from t1 union select * from t1 order by ts)") + tdSql.query(f"select first(c1) from (select * from {dbname}.t1 union select * from {dbname}.t1 order by ts)") tdSql.checkRows(1) tdSql.checkData(0, 0, 9) - tdSql.query(f"select last(c1) from (select * from t1 union select * from t1 order by ts desc)") + tdSql.query(f"select last(c1) from (select * from {dbname}.t1 union select * from {dbname}.t1 order by ts desc)") tdSql.checkRows(1) tdSql.checkData(0, 0, 2147450880) - tdSql.query(f"select irate(c1) from (select * from t1 union select * from t1 order by ts)") + tdSql.query(f"select irate(c1) from (select * from {dbname}.t1 union select * from {dbname}.t1 order by ts)") tdSql.checkRows(1) tdSql.checkData(0, 0, 9.102222222222222) - tdSql.query(f"select elapsed(ts) from (select * from t1 union select * from t1 order by ts)") + tdSql.query(f"select elapsed(ts) from (select * from {dbname}.t1 union select * from {dbname}.t1 order by ts)") tdSql.checkRows(1) tdSql.checkData(0, 0, 46800000.000000000000000) - tdSql.query(f"select diff(c1) from (select * from t1 union select * from t1 order by ts)") + tdSql.query(f"select diff(c1) from (select * from {dbname}.t1 union select * from {dbname}.t1 order by ts)") tdSql.checkRows(14) - tdSql.query(f"select derivative(c1, 1s, 0) from (select * from t1 union select * from t1 order by ts)") + tdSql.query(f"select derivative(c1, 1s, 0) from (select * from {dbname}.t1 union select * from {dbname}.t1 order by ts)") tdSql.checkRows(11) - tdSql.error(f"select first(c1) from (select * from t1 union select * from t1)") - tdSql.error(f"select last(c1) from (select * from t1 union select * from t1)") - tdSql.error(f"select irate(c1) from (select * from t1 union select * from t1)") - tdSql.error(f"select elapsed(ts) from (select * from t1 union select * from t1)") - tdSql.error(f"select diff(c1) from (select * from t1 union select * from t1)") - tdSql.error(f"select derivative(c1, 1s, 0) from (select * from t1 union select * from t1)") + tdSql.error(f"select first(c1) from (select * from {dbname}.t1 union select * from {dbname}.t1)") + tdSql.error(f"select last(c1) from (select * from {dbname}.t1 union select * from {dbname}.t1)") + tdSql.error(f"select irate(c1) from (select * from {dbname}.t1 union select * from {dbname}.t1)") + tdSql.error(f"select elapsed(ts) from (select * from {dbname}.t1 union select * from {dbname}.t1)") + tdSql.error(f"select diff(c1) from (select * from {dbname}.t1 union select * from {dbname}.t1)") + tdSql.error(f"select derivative(c1, 1s, 0) from (select * from {dbname}.t1 union select * from {dbname}.t1)") def __test_error(self, dbname="db"): From 458fd0797690205d734dc57599c4557e7770a24d Mon Sep 17 00:00:00 2001 From: Shungang Li Date: Fri, 18 Aug 2023 14:45:16 +0800 Subject: [PATCH 29/46] enh: ttl split flush and drop table config: 1. ttlFlushThreshold: maximum number of dirty items in memory 2. tsTtlBatchDropNum: number of tables dropped per batch 3. tsTrimVDbIntervalSec: interval of trimming db in all vgroups --- include/common/tglobal.h | 5 +- include/common/tmsg.h | 3 + include/common/tmsgdef.h | 13 +- source/common/src/tglobal.c | 43 +++++- source/common/src/tmsg.c | 30 ++++ source/dnode/mgmt/mgmt_mnode/src/mmHandle.c | 7 +- source/dnode/mnode/impl/src/mndDnode.c | 32 ++++- source/dnode/mnode/impl/src/mndMain.c | 16 ++- source/dnode/mnode/impl/src/mndStb.c | 61 ++++++-- source/dnode/vnode/src/inc/metaTtl.h | 20 +-- source/dnode/vnode/src/inc/vnodeInt.h | 5 +- source/dnode/vnode/src/meta/metaOpen.c | 2 +- source/dnode/vnode/src/meta/metaTable.c | 53 ++++--- source/dnode/vnode/src/meta/metaTtl.c | 152 ++++++++------------ source/dnode/vnode/src/vnd/vnodeSvr.c | 108 +++++++++++--- 15 files changed, 377 insertions(+), 173 deletions(-) diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 5fd174e873..6ef2703d54 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -130,6 +130,7 @@ extern bool tsKeepColumnName; extern bool tsEnableQueryHb; extern bool tsEnableScience; extern bool tsTtlChangeOnWrite; +extern int32_t tsTtlFlushThreshold; extern int32_t tsRedirectPeriod; extern int32_t tsRedirectFactor; extern int32_t tsRedirectMaxPeriod; @@ -185,7 +186,9 @@ extern int32_t tsTransPullupInterval; extern int32_t tsMqRebalanceInterval; extern int32_t tsStreamCheckpointTickInterval; extern int32_t tsTtlUnit; -extern int32_t tsTtlPushInterval; +extern int32_t tsTtlPushIntervalSec; +extern int32_t tsTtlBatchDropNum; +extern int32_t tsTrimVDbIntervalSec; extern int32_t tsGrantHBInterval; extern int32_t tsUptimeInterval; diff --git a/include/common/tmsg.h b/include/common/tmsg.h index c6bb599a7d..21cad322bb 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1161,6 +1161,9 @@ int32_t tDeserializeSVTrimDbReq(void* buf, int32_t bufLen, SVTrimDbReq* pReq); typedef struct { int32_t timestampSec; + int32_t ttlDropMaxCount; + int32_t nUids; + SArray* pTbUids; } SVDropTtlTableReq; int32_t tSerializeSVDropTtlTableReq(void* buf, int32_t bufLen, SVDropTtlTableReq* pReq); diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 483122b070..3be49361d2 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -89,15 +89,15 @@ enum { TD_NEW_MSG_SEG(TDMT_MND_MSG) TD_DEF_MSG_TYPE(TDMT_MND_CONNECT, "connect", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_CREATE_ACCT, "create-acct", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_CREATE_ACCT, "create-acct", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_ALTER_ACCT, "alter-acct", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_DROP_ACCT, "drop-acct", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_CREATE_USER, "create-user", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_CREATE_USER, "create-user", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_ALTER_USER, "alter-user", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_DROP_USER, "drop-user", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_GET_USER_AUTH, "get-user-auth", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_DROP_USER, "drop-user", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_GET_USER_AUTH, "get-user-auth", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_CREATE_DNODE, "create-dnode", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_CONFIG_DNODE, "config-dnode", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_CONFIG_DNODE, "config-dnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_DROP_DNODE, "drop-dnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_CREATE_MNODE, "create-mnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_ALTER_MNODE, "alter-mnode", NULL, NULL) @@ -156,6 +156,7 @@ enum { TD_DEF_MSG_TYPE(TDMT_MND_TELEM_TIMER, "telem-tmr", SMTimerReq, SMTimerReq) TD_DEF_MSG_TYPE(TDMT_MND_TRANS_TIMER, "trans-tmr", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_TTL_TIMER, "ttl-tmr", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_TRIM_DB_TIMER, "trim-db-tmr", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_GRANT_HB_TIMER, "grant-hb-tmr", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_KILL_TRANS, "kill-trans", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_KILL_QUERY, "kill-query", NULL, NULL) @@ -296,7 +297,7 @@ enum { TD_DEF_MSG_TYPE(TDMT_SYNC_PRE_SNAPSHOT_REPLY, "sync-pre-snapshot-reply", NULL, NULL) // no longer used TD_DEF_MSG_TYPE(TDMT_SYNC_MAX_MSG, "sync-max", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_FORCE_FOLLOWER, "sync-force-become-follower", NULL, NULL) - + TD_NEW_MSG_SEG(TDMT_VND_STREAM_MSG) TD_DEF_MSG_TYPE(TDMT_VND_STREAM_TRIGGER, "vnode-stream-trigger", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_STREAM_SCAN_HISTORY, "vnode-stream-scan-history", NULL, NULL) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index e080c2d2ec..6851fcc3a4 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -124,7 +124,6 @@ int32_t tsQueryRspPolicy = 0; int64_t tsQueryMaxConcurrentTables = 200; // unit is TSDB_TABLE_NUM_UNIT bool tsEnableQueryHb = true; bool tsEnableScience = false; // on taos-cli show float and doulbe with scientific notation if true -bool tsTtlChangeOnWrite = false; // ttl delete time changes on last write if true int32_t tsQuerySmaOptimize = 0; int32_t tsQueryRsmaTolerance = 1000; // the tolerance time (ms) to judge from which level to query rsma data. bool tsQueryPlannerTrace = false; @@ -225,12 +224,20 @@ bool tsStartUdfd = true; // wal int64_t tsWalFsyncDataSizeLimit = (100 * 1024 * 1024L); +// ttl +bool tsTtlChangeOnWrite = false; // if true, ttl delete time changes on last write +int32_t tsTtlFlushThreshold = 100; /* maximum number of dirty items in memory. + * if -1, flush will not be triggered by write-ops + */ +int32_t tsTtlBatchDropNum = 10000; // number of tables dropped per batch + // internal int32_t tsTransPullupInterval = 2; int32_t tsMqRebalanceInterval = 2; int32_t tsStreamCheckpointTickInterval = 1; int32_t tsTtlUnit = 86400; -int32_t tsTtlPushInterval = 3600; +int32_t tsTtlPushIntervalSec = 10; +int32_t tsTrimVDbIntervalSec = 60 * 60; // interval of trimming db in all vgroups int32_t tsGrantHBInterval = 60; int32_t tsUptimeInterval = 300; // seconds char tsUdfdResFuncs[512] = ""; // udfd resident funcs that teardown when udfd exits @@ -605,8 +612,11 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { if (cfgAddInt32(pCfg, "transPullupInterval", tsTransPullupInterval, 1, 10000, CFG_SCOPE_SERVER) != 0) return -1; if (cfgAddInt32(pCfg, "mqRebalanceInterval", tsMqRebalanceInterval, 1, 10000, CFG_SCOPE_SERVER) != 0) return -1; if (cfgAddInt32(pCfg, "ttlUnit", tsTtlUnit, 1, 86400 * 365, CFG_SCOPE_SERVER) != 0) return -1; - if (cfgAddInt32(pCfg, "ttlPushInterval", tsTtlPushInterval, 1, 100000, CFG_SCOPE_SERVER) != 0) return -1; + if (cfgAddInt32(pCfg, "ttlPushInterval", tsTtlPushIntervalSec, 1, 100000, CFG_SCOPE_SERVER) != 0) return -1; + if (cfgAddInt32(pCfg, "ttlBatchDropNum", tsTtlBatchDropNum, 0, INT32_MAX, CFG_SCOPE_SERVER) != 0) return -1; if (cfgAddBool(pCfg, "ttlChangeOnWrite", tsTtlChangeOnWrite, CFG_SCOPE_SERVER) != 0) return -1; + if (cfgAddInt32(pCfg, "ttlFlushThreshold", tsTtlFlushThreshold, -1, 1000000, CFG_SCOPE_SERVER) != 0) return -1; + if (cfgAddInt32(pCfg, "trimVDbIntervalSec", tsTrimVDbIntervalSec, 1, 100000, CFG_SCOPE_SERVER) != 0) return -1; if (cfgAddInt32(pCfg, "uptimeInterval", tsUptimeInterval, 1, 100000, CFG_SCOPE_SERVER) != 0) return -1; if (cfgAddInt32(pCfg, "queryRsmaTolerance", tsQueryRsmaTolerance, 0, 900000, CFG_SCOPE_SERVER) != 0) return -1; @@ -990,6 +1000,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsEnableTelem = cfgGetItem(pCfg, "telemetryReporting")->bval; tsEnableCrashReport = cfgGetItem(pCfg, "crashReporting")->bval; tsTtlChangeOnWrite = cfgGetItem(pCfg, "ttlChangeOnWrite")->bval; + tsTtlFlushThreshold = cfgGetItem(pCfg, "ttlFlushThreshold")->i32; tsTelemInterval = cfgGetItem(pCfg, "telemetryInterval")->i32; tstrncpy(tsTelemServer, cfgGetItem(pCfg, "telemetryServer")->str, TSDB_FQDN_LEN); tsTelemPort = (uint16_t)cfgGetItem(pCfg, "telemetryPort")->i32; @@ -999,7 +1010,9 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsTransPullupInterval = cfgGetItem(pCfg, "transPullupInterval")->i32; tsMqRebalanceInterval = cfgGetItem(pCfg, "mqRebalanceInterval")->i32; tsTtlUnit = cfgGetItem(pCfg, "ttlUnit")->i32; - tsTtlPushInterval = cfgGetItem(pCfg, "ttlPushInterval")->i32; + tsTtlPushIntervalSec = cfgGetItem(pCfg, "ttlPushInterval")->i32; + tsTtlBatchDropNum = cfgGetItem(pCfg, "ttlBatchDropNum")->i32; + tsTrimVDbIntervalSec = cfgGetItem(pCfg, "trimVDbIntervalSec")->i32; tsUptimeInterval = cfgGetItem(pCfg, "uptimeInterval")->i32; tsQueryRsmaTolerance = cfgGetItem(pCfg, "queryRsmaTolerance")->i32; @@ -1400,13 +1413,19 @@ int32_t taosApplyLocalCfg(SConfig *pCfg, char *name) { } else if (strcasecmp("ttlUnit", name) == 0) { tsTtlUnit = cfgGetItem(pCfg, "ttlUnit")->i32; } else if (strcasecmp("ttlPushInterval", name) == 0) { - tsTtlPushInterval = cfgGetItem(pCfg, "ttlPushInterval")->i32; + tsTtlPushIntervalSec = cfgGetItem(pCfg, "ttlPushInterval")->i32; + } else if (strcasecmp("ttlBatchDropNum", name) == 0) { + tsTtlBatchDropNum = cfgGetItem(pCfg, "ttlBatchDropNum")->i32; + } else if (strcasecmp("trimVDbIntervalSec", name) == 0) { + tsTrimVDbIntervalSec = cfgGetItem(pCfg, "trimVDbIntervalSec")->i32; } else if (strcasecmp("tmrDebugFlag", name) == 0) { tmrDebugFlag = cfgGetItem(pCfg, "tmrDebugFlag")->i32; } else if (strcasecmp("tsdbDebugFlag", name) == 0) { tsdbDebugFlag = cfgGetItem(pCfg, "tsdbDebugFlag")->i32; } else if (strcasecmp("tqDebugFlag", name) == 0) { tqDebugFlag = cfgGetItem(pCfg, "tqDebugFlag")->i32; + } else if (strcasecmp("ttlFlushThreshold", name) == 0) { + tsTtlFlushThreshold = cfgGetItem(pCfg, "ttlFlushThreshold")->i32; } break; } @@ -1608,6 +1627,20 @@ void taosCfgDynamicOptions(const char *option, const char *value) { return; } + if (strcasecmp(option, "ttlPushInterval") == 0) { + int32_t newTtlPushInterval = atoi(value); + uInfo("ttlPushInterval set from %d to %d", tsTtlPushIntervalSec, newTtlPushInterval); + tsTtlPushIntervalSec = newTtlPushInterval; + return; + } + + if (strcasecmp(option, "ttlBatchDropNum") == 0) { + int32_t newTtlBatchDropNum = atoi(value); + uInfo("ttlBatchDropNum set from %d to %d", tsTtlBatchDropNum, newTtlBatchDropNum); + tsTtlBatchDropNum = newTtlBatchDropNum; + return; + } + const char *options[] = { "dDebugFlag", "vDebugFlag", "mDebugFlag", "wDebugFlag", "sDebugFlag", "tsdbDebugFlag", "tqDebugFlag", "fsDebugFlag", "udfDebugFlag", "smaDebugFlag", "idxDebugFlag", "tdbDebugFlag", "tmrDebugFlag", "uDebugFlag", diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index de76881467..27b6499497 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3179,6 +3179,12 @@ int32_t tSerializeSVDropTtlTableReq(void *buf, int32_t bufLen, SVDropTtlTableReq if (tStartEncode(&encoder) < 0) return -1; if (tEncodeI32(&encoder, pReq->timestampSec) < 0) return -1; + if (tEncodeI32(&encoder, pReq->ttlDropMaxCount) < 0) return -1; + if (tEncodeI32(&encoder, pReq->nUids) < 0) return -1; + for (int32_t i = 0; i < pReq->nUids; ++i) { + tb_uid_t *pTbUid = taosArrayGet(pReq->pTbUids, i); + if (tEncodeI64(&encoder, *pTbUid) < 0) return -1; + } tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -3192,6 +3198,30 @@ int32_t tDeserializeSVDropTtlTableReq(void *buf, int32_t bufLen, SVDropTtlTableR if (tStartDecode(&decoder) < 0) return -1; if (tDecodeI32(&decoder, &pReq->timestampSec) < 0) return -1; + pReq->ttlDropMaxCount = INT32_MAX; + pReq->nUids = 0; + pReq->pTbUids = NULL; + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI32(&decoder, &pReq->ttlDropMaxCount) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->nUids) < 0) return -1; + + if (pReq->nUids > 0) { + pReq->pTbUids = taosArrayInit(pReq->nUids, sizeof(tb_uid_t)); + if (pReq->pTbUids == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return -1; + } + } + + tb_uid_t tbUid = 0; + for (int32_t i = 0; i < pReq->nUids; ++i) { + if (tDecodeI64(&decoder, &tbUid) < 0) return -1; + if (taosArrayPush(pReq->pTbUids, &tbUid) == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return -1; + } + } + } tEndDecode(&decoder); tDecoderClear(&decoder); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index 302d4dafd1..ae1b46a21d 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -33,10 +33,10 @@ int32_t mmProcessCreateReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg) { return -1; } - SMnodeOpt option = {.deploy = true, .numOfReplicas = createReq.replica, - .numOfTotalReplicas = createReq.replica + createReq.learnerReplica, + SMnodeOpt option = {.deploy = true, .numOfReplicas = createReq.replica, + .numOfTotalReplicas = createReq.replica + createReq.learnerReplica, .selfIndex = -1, .lastIndex = createReq.lastIndex}; - + memcpy(option.replicas, createReq.replicas, sizeof(createReq.replicas)); for (int32_t i = 0; i < createReq.replica; ++i) { if (createReq.replicas[i].id == pInput->pData->dnodeId) { @@ -191,6 +191,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_STB_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_STB_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_TTL_TABLE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_TRIM_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_CREATE_SMA_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_SMA_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_TMQ_SUBSCRIBE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 39285ced5d..917c6a00bc 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -1123,6 +1123,36 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) { strcpy(dcfgReq.config, "keeptimeoffset"); snprintf(dcfgReq.value, TSDB_DNODE_VALUE_LEN, "%d", flag); + } else if (strncasecmp(cfgReq.config, "ttlpushinterval", 14) == 0) { + int32_t optLen = strlen("ttlpushinterval"); + int32_t flag = -1; + int32_t code = mndMCfgGetValInt32(&cfgReq, optLen, &flag); + if (code < 0) return code; + + if (flag < 0 || flag > 100000) { + mError("dnode:%d, failed to config ttlPushInterval since value:%d. Valid range: [0, 100000]", cfgReq.dnodeId, + flag); + terrno = TSDB_CODE_INVALID_CFG; + return -1; + } + + strcpy(dcfgReq.config, "ttlpushinterval"); + snprintf(dcfgReq.value, TSDB_DNODE_VALUE_LEN, "%d", flag); + } else if (strncasecmp(cfgReq.config, "ttlbatchdropnum", 15) == 0) { + int32_t optLen = strlen("ttlbatchdropnum"); + int32_t flag = -1; + int32_t code = mndMCfgGetValInt32(&cfgReq, optLen, &flag); + if (code < 0) return code; + + if (flag < 0) { + mError("dnode:%d, failed to config ttlBatchDropNum since value:%d. Valid range: [0, %d]", cfgReq.dnodeId, + flag, INT32_MAX); + terrno = TSDB_CODE_INVALID_CFG; + return -1; + } + + strcpy(dcfgReq.config, "ttlbatchdropnum"); + snprintf(dcfgReq.value, TSDB_DNODE_VALUE_LEN, "%d", flag); #ifdef TD_ENTERPRISE } else if (strncasecmp(cfgReq.config, "activeCode", 10) == 0 || strncasecmp(cfgReq.config, "cActiveCode", 11) == 0) { int8_t opt = strncasecmp(cfgReq.config, "a", 1) == 0 ? DND_ACTIVE_CODE : DND_CONN_ACTIVE_CODE; @@ -1376,7 +1406,7 @@ static int32_t mndMCfgGetValInt32(SMCfgDnodeReq *pMCfgReq, int32_t opLen, int32_ return 0; _err: - mError("dnode:%d, failed to config keeptimeoffset since invalid conf:%s", pMCfgReq->dnodeId, pMCfgReq->config); + mError("dnode:%d, failed to config since invalid conf:%s", pMCfgReq->dnodeId, pMCfgReq->config); terrno = TSDB_CODE_INVALID_CFG; return -1; } diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index b28ad207ea..fd4ebf549f 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -119,6 +119,14 @@ static void mndPullupTtl(SMnode *pMnode) { tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); } +static void mndPullupTrimDb(SMnode *pMnode) { + mTrace("pullup trim"); + int32_t contLen = 0; + void *pReq = mndBuildTimerMsg(&contLen); + SRpcMsg rpcMsg = {.msgType = TDMT_MND_TRIM_DB_TIMER, .pCont = pReq, .contLen = contLen}; + tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); +} + static void mndCalMqRebalance(SMnode *pMnode) { mTrace("calc mq rebalance"); int32_t contLen = 0; @@ -255,10 +263,14 @@ static void *mndThreadFp(void *param) { if (lastTime % 10 != 0) continue; int64_t sec = lastTime / 10; - if (sec % tsTtlPushInterval == 0) { + if (sec % tsTtlPushIntervalSec == 0) { mndPullupTtl(pMnode); } + if (sec % tsTrimVDbIntervalSec == 0) { + mndPullupTrimDb(pMnode); + } + if (sec % tsTransPullupInterval == 0) { mndPullupTrans(pMnode); } @@ -661,7 +673,7 @@ static int32_t mndCheckMnodeState(SRpcMsg *pMsg) { _OVER: if (pMsg->msgType == TDMT_MND_TMQ_TIMER || pMsg->msgType == TDMT_MND_TELEM_TIMER || pMsg->msgType == TDMT_MND_TRANS_TIMER || pMsg->msgType == TDMT_MND_TTL_TIMER || - pMsg->msgType == TDMT_MND_UPTIME_TIMER) { + pMsg->msgType == TDMT_MND_TRIM_DB_TIMER || pMsg->msgType == TDMT_MND_UPTIME_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; diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index c3899ec433..0d41650394 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -40,10 +40,12 @@ static int32_t mndStbActionInsert(SSdb *pSdb, SStbObj *pStb); static int32_t mndStbActionDelete(SSdb *pSdb, SStbObj *pStb); static int32_t mndStbActionUpdate(SSdb *pSdb, SStbObj *pOld, SStbObj *pNew); static int32_t mndProcessTtlTimer(SRpcMsg *pReq); +static int32_t mndProcessTrimDbTimer(SRpcMsg *pReq); static int32_t mndProcessCreateStbReq(SRpcMsg *pReq); static int32_t mndProcessAlterStbReq(SRpcMsg *pReq); static int32_t mndProcessDropStbReq(SRpcMsg *pReq); -static int32_t mndProcessDropTtltbReq(SRpcMsg *pReq); +static int32_t mndProcessDropTtltbRsp(SRpcMsg *pReq); +static int32_t mndProcessTrimDbRsp(SRpcMsg *pReq); static int32_t mndProcessTableMetaReq(SRpcMsg *pReq); static int32_t mndRetrieveStb(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); @@ -72,11 +74,13 @@ int32_t mndInitStb(SMnode *pMnode) { mndSetMsgHandle(pMnode, TDMT_MND_ALTER_STB, mndProcessAlterStbReq); mndSetMsgHandle(pMnode, TDMT_MND_DROP_STB, mndProcessDropStbReq); mndSetMsgHandle(pMnode, TDMT_VND_CREATE_STB_RSP, mndTransProcessRsp); - mndSetMsgHandle(pMnode, TDMT_VND_DROP_TTL_TABLE_RSP, mndProcessDropTtltbReq); + mndSetMsgHandle(pMnode, TDMT_VND_DROP_TTL_TABLE_RSP, mndProcessDropTtltbRsp); + mndSetMsgHandle(pMnode, TDMT_VND_TRIM_RSP, mndProcessTrimDbRsp); mndSetMsgHandle(pMnode, TDMT_VND_ALTER_STB_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_VND_DROP_STB_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_MND_TABLE_META, mndProcessTableMetaReq); mndSetMsgHandle(pMnode, TDMT_MND_TTL_TIMER, mndProcessTtlTimer); + mndSetMsgHandle(pMnode, TDMT_MND_TRIM_DB_TIMER, mndProcessTrimDbTimer); mndSetMsgHandle(pMnode, TDMT_MND_TABLE_CFG, mndProcessTableCfgReq); // mndSetMsgHandle(pMnode, TDMT_MND_SYSTABLE_RETRIEVE, mndProcessRetrieveStbReq); @@ -919,11 +923,12 @@ static int32_t mndProcessTtlTimer(SRpcMsg *pReq) { SSdb *pSdb = pMnode->pSdb; SVgObj *pVgroup = NULL; void *pIter = NULL; - SVDropTtlTableReq ttlReq = {.timestampSec = taosGetTimestampSec()}; - int32_t reqLen = tSerializeSVDropTtlTableReq(NULL, 0, &ttlReq); - int32_t contLen = reqLen + sizeof(SMsgHead); + SVDropTtlTableReq ttlReq = { + .timestampSec = taosGetTimestampSec(), .ttlDropMaxCount = tsTtlBatchDropNum, .nUids = 0, .pTbUids = NULL}; + int32_t reqLen = tSerializeSVDropTtlTableReq(NULL, 0, &ttlReq); + int32_t contLen = reqLen + sizeof(SMsgHead); - mInfo("start to process ttl timer"); + mDebug("start to process ttl timer"); while (1) { pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); @@ -936,7 +941,7 @@ static int32_t mndProcessTtlTimer(SRpcMsg *pReq) { } pHead->contLen = htonl(contLen); pHead->vgId = htonl(pVgroup->vgId); - tSerializeSVDropTtlTableReq((char *)pHead + sizeof(SMsgHead), contLen, &ttlReq); + tSerializeSVDropTtlTableReq((char *)pHead + sizeof(SMsgHead), reqLen, &ttlReq); SRpcMsg rpcMsg = {.msgType = TDMT_VND_DROP_TTL_TABLE, .pCont = pHead, .contLen = contLen, .info = pReq->info}; SEpSet epSet = mndGetVgroupEpset(pMnode, pVgroup); @@ -944,7 +949,44 @@ static int32_t mndProcessTtlTimer(SRpcMsg *pReq) { if (code != 0) { mError("vgId:%d, failed to send drop ttl table request to vnode since 0x%x", pVgroup->vgId, code); } else { - mInfo("vgId:%d, send drop ttl table request to vnode, time:%" PRId32, pVgroup->vgId, ttlReq.timestampSec); + mDebug("vgId:%d, send drop ttl table request to vnode, time:%" PRId32, pVgroup->vgId, ttlReq.timestampSec); + } + sdbRelease(pSdb, pVgroup); + } + + return 0; +} + +static int32_t mndProcessTrimDbTimer(SRpcMsg *pReq) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + SVgObj *pVgroup = NULL; + void *pIter = NULL; + SVTrimDbReq trimReq = {.timestamp = taosGetTimestampSec()}; + int32_t reqLen = tSerializeSVTrimDbReq(NULL, 0, &trimReq); + int32_t contLen = reqLen + sizeof(SMsgHead); + + while (1) { + pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); + if (pIter == NULL) break; + + SMsgHead *pHead = rpcMallocCont(contLen); + if (pHead == NULL) { + sdbCancelFetch(pSdb, pVgroup); + sdbRelease(pSdb, pVgroup); + continue; + } + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(pVgroup->vgId); + tSerializeSVTrimDbReq((char *)pHead + sizeof(SMsgHead), reqLen, &trimReq); + + SRpcMsg rpcMsg = {.msgType = TDMT_VND_TRIM, .pCont = pHead, .contLen = contLen}; + SEpSet epSet = mndGetVgroupEpset(pMnode, pVgroup); + int32_t code = tmsgSendReq(&epSet, &rpcMsg); + if (code != 0) { + mError("vgId:%d, timer failed to send vnode-trim request to vnode since 0x%x", pVgroup->vgId, code); + } else { + mInfo("vgId:%d, timer send vnode-trim request to vnode, time:%d", pVgroup->vgId, trimReq.timestamp); } sdbRelease(pSdb, pVgroup); } @@ -2405,7 +2447,8 @@ static int32_t mndCheckDropStbForStream(SMnode *pMnode, const char *stbFullName, return 0; } -static int32_t mndProcessDropTtltbReq(SRpcMsg *pRsp) { return 0; } +static int32_t mndProcessDropTtltbRsp(SRpcMsg *pRsp) { return 0; } +static int32_t mndProcessTrimDbRsp(SRpcMsg *pRsp) { return 0; } static int32_t mndProcessDropStbReq(SRpcMsg *pReq) { SMnode *pMnode = pReq->info.node; diff --git a/source/dnode/vnode/src/inc/metaTtl.h b/source/dnode/vnode/src/inc/metaTtl.h index 45faceb1ea..c2cd389dab 100644 --- a/source/dnode/vnode/src/inc/metaTtl.h +++ b/source/dnode/vnode/src/inc/metaTtl.h @@ -31,15 +31,14 @@ typedef enum DirtyEntryType { } DirtyEntryType; typedef struct STtlManger { - TdThreadRwlock lock; + TTB* pOldTtlIdx; // btree<{deleteTime, tuid}, NULL> - TTB* pOldTtlIdx; // btree<{deleteTime, tuid}, NULL> - - SHashObj* pTtlCache; // key: tuid, value: {ttl, ctime} - SHashObj* pDirtyUids; // dirty tuid + SHashObj* pTtlCache; // hash + SHashObj* pDirtyUids; // hash TTB* pTtlIdx; // btree<{deleteTime, tuid}, ttl> - char* logPrefix; + char* logPrefix; + int32_t flushThreshold; // max dirty entry number in memory. if -1, flush will not be triggered by write-ops } STtlManger; typedef struct { @@ -68,23 +67,24 @@ typedef struct { typedef struct { tb_uid_t uid; int64_t changeTimeMs; + TXN* pTxn; } STtlUpdCtimeCtx; typedef struct { tb_uid_t uid; int64_t changeTimeMs; int64_t ttlDays; + TXN* pTxn; } STtlUpdTtlCtx; typedef struct { tb_uid_t uid; - TXN* pTxn; int64_t ttlDays; + TXN* pTxn; } STtlDelTtlCtx; -int ttlMgrOpen(STtlManger** ppTtlMgr, TDB* pEnv, int8_t rollback, const char* logPrefix); +int ttlMgrOpen(STtlManger** ppTtlMgr, TDB* pEnv, int8_t rollback, const char* logPrefix, int32_t flushThreshold); void ttlMgrClose(STtlManger* pTtlMgr); -int ttlMgrPostOpen(STtlManger* pTtlMgr, void* pMeta); bool ttlMgrNeedUpgrade(TDB* pEnv); int ttlMgrUpgrade(STtlManger* pTtlMgr, void* pMeta); @@ -94,7 +94,7 @@ int ttlMgrDeleteTtl(STtlManger* pTtlMgr, const STtlDelTtlCtx* pDelCtx); int ttlMgrUpdateChangeTime(STtlManger* pTtlMgr, const STtlUpdCtimeCtx* pUpdCtimeCtx); int ttlMgrFlush(STtlManger* pTtlMgr, TXN* pTxn); -int ttlMgrFindExpired(STtlManger* pTtlMgr, int64_t timePointMs, SArray* pTbUids); +int ttlMgrFindExpired(STtlManger* pTtlMgr, int64_t timePointMs, SArray* pTbUids, int32_t ttlDropMaxCount); #ifdef __cplusplus } diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 50b8e625f9..be663c2be9 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -151,9 +151,10 @@ int metaDropSTable(SMeta* pMeta, int64_t verison, SVDropStbReq* pReq int metaCreateTable(SMeta* pMeta, int64_t version, SVCreateTbReq* pReq, STableMetaRsp** pMetaRsp); int metaDropTable(SMeta* pMeta, int64_t version, SVDropTbReq* pReq, SArray* tbUids, int64_t* tbUid); int32_t metaTrimTables(SMeta* pMeta); -int metaTtlDropTable(SMeta* pMeta, int64_t timePointMs, SArray* tbUids); +void metaDropTables(SMeta* pMeta, SArray* tbUids); +int metaTtlFindExpired(SMeta* pMeta, int64_t timePointMs, SArray* tbUids, int32_t ttlDropMaxCount); int metaAlterTable(SMeta* pMeta, int64_t version, SVAlterTbReq* pReq, STableMetaRsp* pMetaRsp); -int metaUpdateChangeTime(SMeta* pMeta, tb_uid_t uid, int64_t changeTimeMs); +int metaUpdateChangeTimeWithLock(SMeta* pMeta, tb_uid_t uid, int64_t changeTimeMs); SSchemaWrapper* metaGetTableSchema(SMeta* pMeta, tb_uid_t uid, int32_t sver, int lock); STSchema* metaGetTbTSchema(SMeta* pMeta, tb_uid_t uid, int32_t sver, int lock); int32_t metaGetTbTSchemaEx(SMeta* pMeta, tb_uid_t suid, tb_uid_t uid, int32_t sver, STSchema** ppTSchema); diff --git a/source/dnode/vnode/src/meta/metaOpen.c b/source/dnode/vnode/src/meta/metaOpen.c index 517d9692c7..3d445acd67 100644 --- a/source/dnode/vnode/src/meta/metaOpen.c +++ b/source/dnode/vnode/src/meta/metaOpen.c @@ -130,7 +130,7 @@ int metaOpen(SVnode *pVnode, SMeta **ppMeta, int8_t rollback) { // open pTtlMgr ("ttlv1.idx") char logPrefix[128] = {0}; sprintf(logPrefix, "vgId:%d", TD_VID(pVnode)); - ret = ttlMgrOpen(&pMeta->pTtlMgr, pMeta->pEnv, 0, logPrefix); + ret = ttlMgrOpen(&pMeta->pTtlMgr, pMeta->pEnv, 0, logPrefix, tsTtlFlushThreshold); if (ret < 0) { metaError("vgId:%d, failed to open meta ttl index since %s", TD_VID(pVnode), tstrerror(terrno)); goto _err; diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index f56837f759..9a298a4bb7 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -21,6 +21,7 @@ static int metaSaveToTbDb(SMeta *pMeta, const SMetaEntry *pME); static int metaUpdateUidIdx(SMeta *pMeta, const SMetaEntry *pME); static int metaUpdateNameIdx(SMeta *pMeta, const SMetaEntry *pME); static int metaUpdateTtl(SMeta *pMeta, const SMetaEntry *pME); +static int metaUpdateChangeTime(SMeta *pMeta, tb_uid_t uid, int64_t changeTimeMs); static int metaSaveToSkmDb(SMeta *pMeta, const SMetaEntry *pME); static int metaUpdateCtbIdx(SMeta *pMeta, const SMetaEntry *pME); static int metaUpdateSuidIdx(SMeta *pMeta, const SMetaEntry *pME); @@ -842,9 +843,11 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq, SArray *tbUi return 0; } -static void metaDropTables(SMeta *pMeta, SArray *tbUids) { +void metaDropTables(SMeta *pMeta, SArray *tbUids) { + if (taosArrayGetSize(tbUids) == 0) return; + metaWLock(pMeta); - for (int i = 0; i < TARRAY_SIZE(tbUids); ++i) { + for (int i = 0; i < taosArrayGetSize(tbUids); ++i) { tb_uid_t uid = *(tb_uid_t *)taosArrayGet(tbUids, i); metaDropTableByUid(pMeta, uid, NULL); metaDebug("batch drop table:%" PRId64, uid); @@ -927,26 +930,23 @@ end: return code; } -int metaTtlDropTable(SMeta *pMeta, int64_t timePointMs, SArray *tbUids) { +int metaTtlFindExpired(SMeta *pMeta, int64_t timePointMs, SArray *tbUids, int32_t ttlDropMaxCount) { + metaWLock(pMeta); int ret = ttlMgrFlush(pMeta->pTtlMgr, pMeta->txn); if (ret != 0) { metaError("ttl failed to flush, ret:%d", ret); - return ret; + goto _err; } - ret = ttlMgrFindExpired(pMeta->pTtlMgr, timePointMs, tbUids); + ret = ttlMgrFindExpired(pMeta->pTtlMgr, timePointMs, tbUids, ttlDropMaxCount); if (ret != 0) { metaError("ttl failed to find expired table, ret:%d", ret); - return ret; - } - if (TARRAY_SIZE(tbUids) == 0) { - return 0; + goto _err; } - metaInfo("ttl find expired table count: %zu", TARRAY_SIZE(tbUids)); - - metaDropTables(pMeta, tbUids); - return 0; +_err: + metaULock(pMeta); + return ret; } static int metaBuildBtimeIdxKey(SBtimeIdxKey *btimeKey, const SMetaEntry *pME) { @@ -1326,10 +1326,10 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl metaSaveToSkmDb(pMeta, &entry); - metaULock(pMeta); - metaUpdateChangeTime(pMeta, entry.uid, pAlterTbReq->ctimeMs); + metaULock(pMeta); + metaUpdateMetaRsp(uid, pAlterTbReq->tbName, pSchema, pMetaRsp); if (entry.pBuf) taosMemoryFree(entry.pBuf); @@ -1515,10 +1515,10 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA metaUidCacheClear(pMeta, ctbEntry.ctbEntry.suid); metaTbGroupCacheClear(pMeta, ctbEntry.ctbEntry.suid); - metaULock(pMeta); - metaUpdateChangeTime(pMeta, ctbEntry.uid, pAlterTbReq->ctimeMs); + metaULock(pMeta); + tDecoderClear(&dc1); tDecoderClear(&dc2); taosMemoryFree((void *)ctbEntry.ctbEntry.pTags); @@ -1630,10 +1630,10 @@ static int metaUpdateTableOptions(SMeta *pMeta, int64_t version, SVAlterTbReq *p // save to table db metaSaveToTbDb(pMeta, &entry); metaUpdateUidIdx(pMeta, &entry); - metaULock(pMeta); - metaUpdateChangeTime(pMeta, entry.uid, pAlterTbReq->ctimeMs); + metaULock(pMeta); + tdbTbcClose(pTbDbc); tdbTbcClose(pUidIdxc); tDecoderClear(&dc); @@ -1981,7 +1981,7 @@ static int metaUpdateNameIdx(SMeta *pMeta, const SMetaEntry *pME) { static int metaUpdateTtl(SMeta *pMeta, const SMetaEntry *pME) { if (pME->type != TSDB_CHILD_TABLE && pME->type != TSDB_NORMAL_TABLE) return 0; - STtlUpdTtlCtx ctx = {.uid = pME->uid}; + STtlUpdTtlCtx ctx = {.uid = pME->uid, .pTxn = pMeta->txn}; if (pME->type == TSDB_CHILD_TABLE) { ctx.ttlDays = pME->ctbEntry.ttlDays; ctx.changeTimeMs = pME->ctbEntry.btime; @@ -1993,7 +1993,7 @@ static int metaUpdateTtl(SMeta *pMeta, const SMetaEntry *pME) { return ttlMgrInsertTtl(pMeta->pTtlMgr, &ctx); } -int metaUpdateChangeTime(SMeta *pMeta, tb_uid_t uid, int64_t changeTimeMs) { +static int metaUpdateChangeTime(SMeta *pMeta, tb_uid_t uid, int64_t changeTimeMs) { if (!tsTtlChangeOnWrite) return 0; if (changeTimeMs <= 0) { @@ -2001,11 +2001,20 @@ int metaUpdateChangeTime(SMeta *pMeta, tb_uid_t uid, int64_t changeTimeMs) { return TSDB_CODE_VERSION_NOT_COMPATIBLE; } - STtlUpdCtimeCtx ctx = {.uid = uid, .changeTimeMs = changeTimeMs}; + STtlUpdCtimeCtx ctx = {.uid = uid, .changeTimeMs = changeTimeMs, .pTxn = pMeta->txn}; return ttlMgrUpdateChangeTime(pMeta->pTtlMgr, &ctx); } +int metaUpdateChangeTimeWithLock(SMeta *pMeta, tb_uid_t uid, int64_t changeTimeMs) { + if (!tsTtlChangeOnWrite) return 0; + + metaWLock(pMeta); + int ret = metaUpdateChangeTime(pMeta, uid, changeTimeMs); + metaULock(pMeta); + return ret; +} + static int metaUpdateCtbIdx(SMeta *pMeta, const SMetaEntry *pME) { SCtbIdxKey ctbIdxKey = {.suid = pME->ctbEntry.suid, .uid = pME->uid}; diff --git a/source/dnode/vnode/src/meta/metaTtl.c b/source/dnode/vnode/src/meta/metaTtl.c index 45f697258c..3c45982311 100644 --- a/source/dnode/vnode/src/meta/metaTtl.c +++ b/source/dnode/vnode/src/meta/metaTtl.c @@ -21,6 +21,13 @@ typedef struct { SMeta *pMeta; } SConvertData; +typedef struct { + int32_t ttlDropMaxCount; + int32_t count; + STtlIdxKeyV1 expiredKey; + SArray *pTbUids; +} STtlExpiredCtx; + static void ttlMgrCleanup(STtlManger *pTtlMgr); static int ttlMgrConvert(TTB *pOldTtlIdx, TTB *pNewTtlIdx, void *pMeta); @@ -31,15 +38,15 @@ static int ttlIdxKeyV1Cmpr(const void *pKey1, int kLen1, const void *pKey2, static int ttlMgrFillCache(STtlManger *pTtlMgr); static int32_t ttlMgrFillCacheOneEntry(const void *pKey, int keyLen, const void *pVal, int valLen, void *pTtlCache); static int32_t ttlMgrConvertOneEntry(const void *pKey, int keyLen, const void *pVal, int valLen, void *pConvertData); +static int32_t ttlMgrFindExpiredOneEntry(const void *pKey, int keyLen, const void *pVal, int valLen, + void *pExpiredInfo); -static int32_t ttlMgrWLock(STtlManger *pTtlMgr); -static int32_t ttlMgrRLock(STtlManger *pTtlMgr); -static int32_t ttlMgrULock(STtlManger *pTtlMgr); +static bool ttlMgrNeedFlush(STtlManger *pTtlMgr); const char *ttlTbname = "ttl.idx"; const char *ttlV1Tbname = "ttlv1.idx"; -int ttlMgrOpen(STtlManger **ppTtlMgr, TDB *pEnv, int8_t rollback, const char *logPrefix) { +int ttlMgrOpen(STtlManger **ppTtlMgr, TDB *pEnv, int8_t rollback, const char *logPrefix, int32_t flushThreshold) { int ret = TSDB_CODE_SUCCESS; int64_t startNs = taosGetTimestampNs(); @@ -55,6 +62,7 @@ int ttlMgrOpen(STtlManger **ppTtlMgr, TDB *pEnv, int8_t rollback, const char *lo } strcpy(logBuffer, logPrefix); pTtlMgr->logPrefix = logBuffer; + pTtlMgr->flushThreshold = flushThreshold; ret = tdbTbOpen(ttlV1Tbname, TDB_VARIANT_LEN, TDB_VARIANT_LEN, ttlIdxKeyV1Cmpr, pEnv, &pTtlMgr->pTtlIdx, rollback); if (ret < 0) { @@ -66,8 +74,6 @@ int ttlMgrOpen(STtlManger **ppTtlMgr, TDB *pEnv, int8_t rollback, const char *lo pTtlMgr->pTtlCache = taosHashInit(8192, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK); pTtlMgr->pDirtyUids = taosHashInit(8192, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK); - taosThreadRwlockInit(&pTtlMgr->lock, NULL); - ret = ttlMgrFillCache(pTtlMgr); if (ret < 0) { metaError("%s, failed to fill hash since %s", pTtlMgr->logPrefix, tstrerror(terrno)); @@ -130,6 +136,7 @@ int ttlMgrUpgrade(STtlManger *pTtlMgr, void *pMeta) { int64_t endNs = taosGetTimestampNs(); metaInfo("%s, ttl mgr upgrade end, hash size: %d, time consumed: %" PRId64 " ns", pTtlMgr->logPrefix, taosHashGetSize(pTtlMgr->pTtlCache), endNs - startNs); + _out: tdbTbClose(pTtlMgr->pOldTtlIdx); pTtlMgr->pOldTtlIdx = NULL; @@ -142,7 +149,6 @@ static void ttlMgrCleanup(STtlManger *pTtlMgr) { taosHashCleanup(pTtlMgr->pTtlCache); taosHashCleanup(pTtlMgr->pDirtyUids); tdbTbClose(pTtlMgr->pTtlIdx); - taosThreadRwlockDestroy(&pTtlMgr->lock); taosMemoryFree(pTtlMgr); } @@ -229,10 +235,25 @@ static int ttlMgrConvertOneEntry(const void *pKey, int keyLen, const void *pVal, } ret = 0; + _out: return ret; } +static int32_t ttlMgrFindExpiredOneEntry(const void *pKey, int keyLen, const void *pVal, int valLen, + void *pExpiredCtx) { + STtlExpiredCtx *pCtx = (STtlExpiredCtx *)pExpiredCtx; + if (pCtx->count >= pCtx->ttlDropMaxCount) return -1; + + int c = ttlIdxKeyV1Cmpr(&pCtx->expiredKey, sizeof(pCtx->expiredKey), pKey, keyLen); + if (c > 0) { + taosArrayPush(pCtx->pTbUids, &((STtlIdxKeyV1 *)pKey)->uid); + pCtx->count++; + } + + return c; +} + static int ttlMgrConvert(TTB *pOldTtlIdx, TTB *pNewTtlIdx, void *pMeta) { SMeta *meta = pMeta; @@ -255,8 +276,6 @@ int ttlMgrInsertTtl(STtlManger *pTtlMgr, const STtlUpdTtlCtx *updCtx) { STtlCacheEntry cacheEntry = {.ttlDays = updCtx->ttlDays, .changeTimeMs = updCtx->changeTimeMs}; STtlDirtyEntry dirtryEntry = {.type = ENTRY_TYPE_UPSERT}; - ttlMgrWLock(pTtlMgr); - int ret = taosHashPut(pTtlMgr->pTtlCache, &updCtx->uid, sizeof(updCtx->uid), &cacheEntry, sizeof(cacheEntry)); if (ret < 0) { metaError("%s, ttlMgr insert failed to update ttl cache since %s", pTtlMgr->logPrefix, tstrerror(terrno)); @@ -269,10 +288,13 @@ int ttlMgrInsertTtl(STtlManger *pTtlMgr, const STtlUpdTtlCtx *updCtx) { goto _out; } - ret = 0; -_out: - ttlMgrULock(pTtlMgr); + if (ttlMgrNeedFlush(pTtlMgr)) { + ttlMgrFlush(pTtlMgr, updCtx->pTxn); + } + ret = 0; + +_out: metaDebug("%s, ttl mgr insert ttl, uid: %" PRId64 ", ctime: %" PRId64 ", ttlDays: %" PRId64, pTtlMgr->logPrefix, updCtx->uid, updCtx->changeTimeMs, updCtx->ttlDays); @@ -281,7 +303,6 @@ _out: int ttlMgrDeleteTtl(STtlManger *pTtlMgr, const STtlDelTtlCtx *delCtx) { if (delCtx->ttlDays == 0) return 0; - ttlMgrWLock(pTtlMgr); STtlDirtyEntry dirtryEntry = {.type = ENTRY_TYPE_DEL}; @@ -291,18 +312,19 @@ int ttlMgrDeleteTtl(STtlManger *pTtlMgr, const STtlDelTtlCtx *delCtx) { goto _out; } - ret = 0; -_out: - ttlMgrULock(pTtlMgr); + if (ttlMgrNeedFlush(pTtlMgr)) { + ttlMgrFlush(pTtlMgr, delCtx->pTxn); + } + ret = 0; + +_out: metaDebug("%s, ttl mgr delete ttl, uid: %" PRId64, pTtlMgr->logPrefix, delCtx->uid); return ret; } int ttlMgrUpdateChangeTime(STtlManger *pTtlMgr, const STtlUpdCtimeCtx *pUpdCtimeCtx) { - ttlMgrWLock(pTtlMgr); - int ret = 0; STtlCacheEntry *oldData = taosHashGet(pTtlMgr->pTtlCache, &pUpdCtimeCtx->uid, sizeof(pUpdCtimeCtx->uid)); @@ -327,59 +349,35 @@ int ttlMgrUpdateChangeTime(STtlManger *pTtlMgr, const STtlUpdCtimeCtx *pUpdCtime goto _out; } - ret = 0; -_out: - ttlMgrULock(pTtlMgr); + if (ttlMgrNeedFlush(pTtlMgr)) { + ttlMgrFlush(pTtlMgr, pUpdCtimeCtx->pTxn); + } + ret = 0; + +_out: metaDebug("%s, ttl mgr update ctime, uid: %" PRId64 ", ctime: %" PRId64, pTtlMgr->logPrefix, pUpdCtimeCtx->uid, pUpdCtimeCtx->changeTimeMs); return ret; } -int ttlMgrFindExpired(STtlManger *pTtlMgr, int64_t timePointMs, SArray *pTbUids) { - ttlMgrRLock(pTtlMgr); +int ttlMgrFindExpired(STtlManger *pTtlMgr, int64_t timePointMs, SArray *pTbUids, int32_t ttlDropMaxCount) { + STtlIdxKeyV1 ttlKey = {.deleteTimeMs = timePointMs, .uid = INT64_MAX}; + STtlExpiredCtx expiredCtx = { + .ttlDropMaxCount = ttlDropMaxCount, .count = 0, .expiredKey = ttlKey, .pTbUids = pTbUids}; + return tdbTbTraversal(pTtlMgr->pTtlIdx, &expiredCtx, ttlMgrFindExpiredOneEntry); +} - TBC *pCur; - int ret = tdbTbcOpen(pTtlMgr->pTtlIdx, &pCur, NULL); - if (ret < 0) { - goto _out; - } - - STtlIdxKeyV1 ttlKey = {0}; - ttlKey.deleteTimeMs = timePointMs; - ttlKey.uid = INT64_MAX; - int c = 0; - tdbTbcMoveTo(pCur, &ttlKey, sizeof(ttlKey), &c); - if (c < 0) { - tdbTbcMoveToPrev(pCur); - } - - void *pKey = NULL; - int kLen = 0; - while (1) { - ret = tdbTbcPrev(pCur, &pKey, &kLen, NULL, NULL); - if (ret < 0) { - ret = 0; - break; - } - ttlKey = *(STtlIdxKeyV1 *)pKey; - taosArrayPush(pTbUids, &ttlKey.uid); - } - - tdbFree(pKey); - tdbTbcClose(pCur); - - ret = 0; -_out: - ttlMgrULock(pTtlMgr); - return ret; +static bool ttlMgrNeedFlush(STtlManger *pTtlMgr) { + return pTtlMgr->flushThreshold > 0 && taosHashGetSize(pTtlMgr->pDirtyUids) > pTtlMgr->flushThreshold; } int ttlMgrFlush(STtlManger *pTtlMgr, TXN *pTxn) { - ttlMgrWLock(pTtlMgr); + int64_t startNs = taosGetTimestampNs(); + int64_t endNs = startNs; - metaDebug("%s, ttl mgr flush start. dirty uids:%d", pTtlMgr->logPrefix, taosHashGetSize(pTtlMgr->pDirtyUids)); + metaTrace("%s, ttl mgr flush start. dirty uids:%d", pTtlMgr->logPrefix, taosHashGetSize(pTtlMgr->pDirtyUids)); int ret = -1; @@ -430,40 +428,10 @@ int ttlMgrFlush(STtlManger *pTtlMgr, TXN *pTxn) { taosHashClear(pTtlMgr->pDirtyUids); ret = 0; + _out: - ttlMgrULock(pTtlMgr); - - metaDebug("%s, ttl mgr flush end.", pTtlMgr->logPrefix); - - return ret; -} - -static int32_t ttlMgrRLock(STtlManger *pTtlMgr) { - int32_t ret = 0; - - metaTrace("%s, ttlMgr rlock %p", pTtlMgr->logPrefix, &pTtlMgr->lock); - - ret = taosThreadRwlockRdlock(&pTtlMgr->lock); - - return ret; -} - -static int32_t ttlMgrWLock(STtlManger *pTtlMgr) { - int32_t ret = 0; - - metaTrace("%s, ttlMgr wlock %p", pTtlMgr->logPrefix, &pTtlMgr->lock); - - ret = taosThreadRwlockWrlock(&pTtlMgr->lock); - - return ret; -} - -static int32_t ttlMgrULock(STtlManger *pTtlMgr) { - int32_t ret = 0; - - metaTrace("%s, ttlMgr ulock %p", pTtlMgr->logPrefix, &pTtlMgr->lock); - - ret = taosThreadRwlockUnlock(&pTtlMgr->lock); + endNs = taosGetTimestampNs(); + metaTrace("%s, ttl mgr flush end, time consumed: %" PRId64 " ns", pTtlMgr->logPrefix, endNs - startNs); return ret; } diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 52c36fcb1b..a9399e4db1 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -142,6 +142,74 @@ _exit: return code; } +static int32_t vnodePreProcessDropTtlMsg(SVnode *pVnode, SRpcMsg *pMsg) { + int32_t code = TSDB_CODE_INVALID_MSG; + int32_t lino = 0; + + SMsgHead *pContOld = pMsg->pCont; + int32_t reqLenOld = pMsg->contLen - sizeof(SMsgHead); + + SArray *tbUids = NULL; + int64_t timestampMs = 0; + + SVDropTtlTableReq ttlReq = {0}; + if (tDeserializeSVDropTtlTableReq((char *)pContOld + sizeof(SMsgHead), reqLenOld, &ttlReq) != 0) { + code = TSDB_CODE_INVALID_MSG; + TSDB_CHECK_CODE(code, lino, _exit); + } + + { // find expired uids + tbUids = taosArrayInit(8, sizeof(int64_t)); + if (tbUids == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + TSDB_CHECK_CODE(code, lino, _exit); + } + + timestampMs = (int64_t)ttlReq.timestampSec * 1000; + code = metaTtlFindExpired(pVnode->pMeta, timestampMs, tbUids, ttlReq.ttlDropMaxCount); + if (code != 0) { + code = TSDB_CODE_INVALID_MSG; + TSDB_CHECK_CODE(code, lino, _exit); + } + + ttlReq.nUids = taosArrayGetSize(tbUids); + ttlReq.pTbUids = tbUids; + } + + { // prepare new content + int32_t reqLenNew = tSerializeSVDropTtlTableReq(NULL, 0, &ttlReq); + int32_t contLenNew = reqLenNew + sizeof(SMsgHead); + + SMsgHead *pContNew = rpcMallocCont(contLenNew); + if (pContNew == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + TSDB_CHECK_CODE(code, lino, _exit); + } + + tSerializeSVDropTtlTableReq((char *)pContNew + sizeof(SMsgHead), reqLenNew, &ttlReq); + pContNew->contLen = htonl(reqLenNew); + pContNew->vgId = pContOld->vgId; + + rpcFreeCont(pContOld); + pMsg->pCont = pContNew; + pMsg->contLen = contLenNew; + } + + code = 0; + +_exit: + taosArrayDestroy(tbUids); + + if (code) { + vError("vgId:%d, %s:%d failed to preprocess drop ttl request since %s, msg type:%s", TD_VID(pVnode), __func__, lino, + tstrerror(code), TMSG_INFO(pMsg->msgType)); + } else { + vTrace("vgId:%d, %s done, timestampSec:%d, nUids:%d", TD_VID(pVnode), __func__, ttlReq.timestampSec, ttlReq.nUids); + } + + return code; +} + extern int64_t tsMaxKeyByPrecision[]; static int32_t vnodePreProcessSubmitTbData(SVnode *pVnode, SDecoder *pCoder, int64_t btimeMs, int64_t ctimeMs) { int32_t code = 0; @@ -371,6 +439,9 @@ int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) { case TDMT_VND_ALTER_TABLE: { code = vnodePreProcessAlterTableMsg(pVnode, pMsg); } break; + case TDMT_VND_DROP_TTL_TABLE: { + code = vnodePreProcessDropTtlMsg(pVnode, pMsg); + } break; case TDMT_VND_SUBMIT: { code = vnodePreProcessSubmitMsg(pVnode, pMsg); } break; @@ -405,10 +476,10 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t ver, SRpcMsg return -1; } - vDebug("vgId:%d, start to process write request %s, index:%" PRId64 ", applied:%" PRId64 - ", state.applyTerm:%" PRId64 ", conn.applyTerm:%" PRId64, - TD_VID(pVnode), TMSG_INFO(pMsg->msgType), ver, pVnode->state.applied, - pVnode->state.applyTerm, pMsg->info.conn.applyTerm); + vDebug("vgId:%d, start to process write request %s, index:%" PRId64 ", applied:%" PRId64 ", state.applyTerm:%" PRId64 + ", conn.applyTerm:%" PRId64, + TD_VID(pVnode), TMSG_INFO(pMsg->msgType), ver, pVnode->state.applied, pVnode->state.applyTerm, + pMsg->info.conn.applyTerm); ASSERT(pVnode->state.applyTerm <= pMsg->info.conn.applyTerm); ASSERTS(pVnode->state.applied + 1 == ver, "applied:%" PRId64 ", ver:%" PRId64, pVnode->state.applied, ver); @@ -727,28 +798,27 @@ _exit: } static int32_t vnodeProcessDropTtlTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp) { - SArray *tbUids = taosArrayInit(8, sizeof(int64_t)); - if (tbUids == NULL) return TSDB_CODE_OUT_OF_MEMORY; - SVDropTtlTableReq ttlReq = {0}; if (tDeserializeSVDropTtlTableReq(pReq, len, &ttlReq) != 0) { terrno = TSDB_CODE_INVALID_MSG; goto end; } - vDebug("vgId:%d, drop ttl table req will be processed, time:%" PRId32, pVnode->config.vgId, ttlReq.timestampSec); - int32_t ret = metaTtlDropTable(pVnode->pMeta, (int64_t)ttlReq.timestampSec * 1000, tbUids); - if (ret != 0) { - goto end; - } - if (taosArrayGetSize(tbUids) > 0) { - tqUpdateTbUidList(pVnode->pTq, tbUids, false); + ASSERT(ttlReq.nUids == taosArrayGetSize(ttlReq.pTbUids)); + + if (ttlReq.nUids != 0) { + vInfo("vgId:%d, drop ttl table req will be processed, time:%d, ntbUids:%d", pVnode->config.vgId, + ttlReq.timestampSec, ttlReq.nUids); } - vnodeDoRetention(pVnode, ttlReq.timestampSec); + int ret = 0; + if (ttlReq.nUids > 0) { + metaDropTables(pVnode->pMeta, ttlReq.pTbUids); + tqUpdateTbUidList(pVnode->pTq, ttlReq.pTbUids, false); + } end: - taosArrayDestroy(tbUids); + taosArrayDestroy(ttlReq.pTbUids); return ret; } @@ -1482,7 +1552,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, in code = tsdbInsertTableData(pVnode->pTsdb, ver, pSubmitTbData, &affectedRows); if (code) goto _exit; - code = metaUpdateChangeTime(pVnode->pMeta, pSubmitTbData->uid, pSubmitTbData->ctimeMs); + code = metaUpdateChangeTimeWithLock(pVnode->pMeta, pSubmitTbData->uid, pSubmitTbData->ctimeMs); if (code) goto _exit; pSubmitRsp->affectedRows += affectedRows; @@ -1739,7 +1809,7 @@ static int32_t vnodeProcessBatchDeleteReq(SVnode *pVnode, int64_t ver, void *pRe TD_VID(pVnode), terrstr(), deleteReq.suid, uid, pOneReq->startTs, pOneReq->endTs); } - code = metaUpdateChangeTime(pVnode->pMeta, uid, deleteReq.ctimeMs); + code = metaUpdateChangeTimeWithLock(pVnode->pMeta, uid, deleteReq.ctimeMs); if (code < 0) { terrno = code; vError("vgId:%d, update change time error since %s, suid:%" PRId64 ", uid:%" PRId64 ", start ts:%" PRId64 @@ -1778,7 +1848,7 @@ static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, in uint64_t uid = *(uint64_t *)taosArrayGet(pRes->uidList, iUid); code = tsdbDeleteTableData(pVnode->pTsdb, ver, pRes->suid, uid, pRes->skey, pRes->ekey); if (code) goto _err; - code = metaUpdateChangeTime(pVnode->pMeta, uid, pRes->ctimeMs); + code = metaUpdateChangeTimeWithLock(pVnode->pMeta, uid, pRes->ctimeMs); if (code) goto _err; } From 9545c7882ac939d593ef886f7dea2d67f8bba709 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Wed, 23 Aug 2023 14:13:46 +0800 Subject: [PATCH 30/46] Update dnodes.py --- tests/pytest/util/dnodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index d34e50b510..948188803d 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -812,7 +812,7 @@ class TDDnodes: time.sleep(1) processID = subprocess.check_output( psCmd, shell=True).decode("utf-8").strip() - psCmd = "for /f %a in ('wmic process where \"name='tmq_simm.exe'\" get processId ^| xargs echo ^| awk '{print $2}' ^&^& echo aa') do @(ps | grep %a | awk '{print $1}' | xargs)" + psCmd = "for /f %a in ('wmic process where \"name='tmq_sim.exe'\" get processId ^| xargs echo ^| awk '{print $2}' ^&^& echo aa') do @(ps | grep %a | awk '{print $1}' | xargs)" processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip() while(processID): print(processID) @@ -870,4 +870,4 @@ class TDDnodes: def getAsan(self): return self.asan -tdDnodes = TDDnodes() \ No newline at end of file +tdDnodes = TDDnodes() From 7bee618ee1440f7ee9b0a314b1c6ca0ed8bd163e Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 23 Aug 2023 14:16:14 +0800 Subject: [PATCH 31/46] test:kill tmq_sim process when start cases in windows --- tests/pytest/util/dnodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index 948188803d..e91d9d3f6b 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -870,4 +870,4 @@ class TDDnodes: def getAsan(self): return self.asan -tdDnodes = TDDnodes() +tdDnodes = TDDnodes() \ No newline at end of file From 6a20420f0728c33165ca4e5495410f34d0cbe309 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 23 Aug 2023 16:41:29 +0800 Subject: [PATCH 32/46] feat: add minDiskFreeSize cfg --- cmake/apr-util_CMakeLists.txt.in | 2 +- include/common/tglobal.h | 1 + include/util/tdef.h | 18 +++++++++--------- source/common/src/tglobal.c | 15 ++++++++++----- source/libs/tfs/src/tfsTier.c | 6 ++++-- source/util/src/tconfig.c | 2 +- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/cmake/apr-util_CMakeLists.txt.in b/cmake/apr-util_CMakeLists.txt.in index 015084e710..a39100897b 100644 --- a/cmake/apr-util_CMakeLists.txt.in +++ b/cmake/apr-util_CMakeLists.txt.in @@ -11,7 +11,7 @@ ExternalProject_Add(aprutil-1 BUILD_IN_SOURCE TRUE BUILD_ALWAYS 1 #UPDATE_COMMAND "" - CONFIGURE_COMMAND ./configure --prefix=$ENV{HOME}/.cos-local.1/ --with-apr=$ENV{HOME}/.cos-local.1 --without-expat + CONFIGURE_COMMAND ./configure --prefix=$ENV{HOME}/.cos-local.1/ --with-apr=$ENV{HOME}/.cos-local.1 #CONFIGURE_COMMAND ./configure --with-apr=/usr/local/apr BUILD_COMMAND make INSTALL_COMMAND make install diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 5fd174e873..763c4ae6e7 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -161,6 +161,7 @@ extern char tsCompressor[]; // tfs extern int32_t tsDiskCfgNum; extern SDiskCfg tsDiskCfg[]; +extern int64_t tsMinDiskFreeSize; // udf extern bool tsStartUdfd; diff --git a/include/util/tdef.h b/include/util/tdef.h index 1e12f12087..e9ed47465a 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -200,7 +200,7 @@ typedef enum ELogicConditionType { #define TSDB_STREAM_NAME_LEN 193 // it is a null-terminated string #define TSDB_DB_NAME_LEN 65 #define TSDB_DB_FNAME_LEN (TSDB_ACCT_ID_LEN + TSDB_DB_NAME_LEN + TSDB_NAME_DELIMITER_LEN) -#define TSDB_PRIVILEDGE_CONDITION_LEN 48*1024 +#define TSDB_PRIVILEDGE_CONDITION_LEN 48 * 1024 #define TSDB_FUNC_NAME_LEN 65 #define TSDB_FUNC_COMMENT_LEN 1024 * 1024 @@ -228,8 +228,8 @@ typedef enum ELogicConditionType { #define TSDB_MAX_SQL_SHOW_LEN 1024 #define TSDB_MAX_ALLOWED_SQL_LEN (1 * 1024 * 1024u) // sql length should be less than 1mb -#define TSDB_APP_NAME_LEN TSDB_UNI_LEN -#define TSDB_TB_COMMENT_LEN 1025 +#define TSDB_APP_NAME_LEN TSDB_UNI_LEN +#define TSDB_TB_COMMENT_LEN 1025 #define TSDB_COL_COMMENT_LEN 1025 #define TSDB_QUERY_ID_LEN 26 @@ -377,12 +377,12 @@ typedef enum ELogicConditionType { #define TSDB_MAX_STT_TRIGGER 1 #define TSDB_DEFAULT_SST_TRIGGER 1 #endif -#define TSDB_MIN_HASH_PREFIX (2 - TSDB_TABLE_NAME_LEN) -#define TSDB_MAX_HASH_PREFIX (TSDB_TABLE_NAME_LEN - 2) -#define TSDB_DEFAULT_HASH_PREFIX 0 -#define TSDB_MIN_HASH_SUFFIX (2 - TSDB_TABLE_NAME_LEN) -#define TSDB_MAX_HASH_SUFFIX (TSDB_TABLE_NAME_LEN - 2) -#define TSDB_DEFAULT_HASH_SUFFIX 0 +#define TSDB_MIN_HASH_PREFIX (2 - TSDB_TABLE_NAME_LEN) +#define TSDB_MAX_HASH_PREFIX (TSDB_TABLE_NAME_LEN - 2) +#define TSDB_DEFAULT_HASH_PREFIX 0 +#define TSDB_MIN_HASH_SUFFIX (2 - TSDB_TABLE_NAME_LEN) +#define TSDB_MAX_HASH_SUFFIX (TSDB_TABLE_NAME_LEN - 2) +#define TSDB_DEFAULT_HASH_SUFFIX 0 #define TSDB_DB_MIN_WAL_RETENTION_PERIOD -1 #define TSDB_REP_DEF_DB_WAL_RET_PERIOD 3600 diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index e080c2d2ec..6879ea05da 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -186,6 +186,7 @@ int32_t tsCacheLazyLoadThreshold = 500; int32_t tsDiskCfgNum = 0; SDiskCfg tsDiskCfg[TFS_MAX_DISKS] = {0}; +int64_t tsMinDiskFreeSize = TFS_MIN_DISK_FREE_SIZE; // stream scheduler bool tsDeployOnSnode = true; @@ -239,8 +240,8 @@ bool tsDisableStream = false; int64_t tsStreamBufferSize = 128 * 1024 * 1024; int64_t tsCheckpointInterval = 3 * 60 * 60 * 1000; bool tsFilterScalarMode = false; -int32_t tsKeepTimeOffset = 0; // latency of data migration -int tsResolveFQDNRetryTime = 100; //seconds +int32_t tsKeepTimeOffset = 0; // latency of data migration +int tsResolveFQDNRetryTime = 100; // seconds char tsS3Endpoint[TSDB_FQDN_LEN] = ""; char tsS3AccessKey[TSDB_FQDN_LEN] = ""; @@ -305,9 +306,7 @@ int32_t taosSetS3Cfg(SConfig *pCfg) { return 0; } -struct SConfig *taosGetCfg() { - return tsCfg; -} +struct SConfig *taosGetCfg() { return tsCfg; } static int32_t taosLoadCfg(SConfig *pCfg, const char **envCmd, const char *inputCfgDir, const char *envFile, char *apolloUrl) { @@ -635,6 +634,11 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { if (cfgAddString(pCfg, "s3Endpoint", tsS3Endpoint, CFG_SCOPE_SERVER) != 0) return -1; if (cfgAddString(pCfg, "s3BucketName", tsS3BucketName, CFG_SCOPE_SERVER) != 0) return -1; + // min free disk space used to check if the disk is full [50MB, 1GB] + if (cfgAddInt64(pCfg, "minDiskFreeSize", tsMinDiskFreeSize, TFS_MIN_DISK_FREE_SIZE, 1024 * 1024 * 1024, + CFG_SCOPE_SERVER) != 0) + return -1; + GRANT_CFG_ADD; return 0; } @@ -1034,6 +1038,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsMaxStreamBackendCache = cfgGetItem(pCfg, "maxStreamBackendCache")->i32; tsPQSortMemThreshold = cfgGetItem(pCfg, "pqSortMemThreshold")->i32; tsResolveFQDNRetryTime = cfgGetItem(pCfg, "resolveFQDNRetryTime")->i32; + tsMinDiskFreeSize = cfgGetItem(pCfg, "minDiskFreeSize")->i64; GRANT_CFG_GET; return 0; diff --git a/source/libs/tfs/src/tfsTier.c b/source/libs/tfs/src/tfsTier.c index 2ad021cbb5..a24e3cf021 100644 --- a/source/libs/tfs/src/tfsTier.c +++ b/source/libs/tfs/src/tfsTier.c @@ -16,6 +16,8 @@ #define _DEFAULT_SOURCE #include "tfsInt.h" +extern int64_t tsMinDiskFreeSize; + int32_t tfsInitTier(STfsTier *pTier, int32_t level) { memset(pTier, 0, sizeof(STfsTier)); @@ -114,7 +116,7 @@ int32_t tfsAllocDiskOnTier(STfsTier *pTier) { if (pDisk == NULL) continue; - if (pDisk->size.avail < TFS_MIN_DISK_FREE_SIZE) continue; + if (pDisk->size.avail < tsMinDiskFreeSize) continue; retId = diskId; terrno = 0; @@ -132,7 +134,7 @@ void tfsPosNextId(STfsTier *pTier) { for (int32_t id = 1; id < pTier->ndisk; id++) { STfsDisk *pLDisk = pTier->disks[nextid]; STfsDisk *pDisk = pTier->disks[id]; - if (pDisk->size.avail > TFS_MIN_DISK_FREE_SIZE && pDisk->size.avail > pLDisk->size.avail) { + if (pDisk->size.avail > tsMinDiskFreeSize && pDisk->size.avail > pLDisk->size.avail) { nextid = id; } } diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index 3681c7a423..848e977687 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -1019,7 +1019,7 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) { code = cfgSetItem(pConfig, name, value, CFG_STYPE_APOLLO_URL); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; - + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_APOLLO_URL); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; From 2d72543f69f768c83928a086d4f9d9db4bea67e6 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 23 Aug 2023 19:13:45 +0800 Subject: [PATCH 33/46] test:kill other process when start cases in windows --- tests/pytest/util/dnodes.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index e91d9d3f6b..cd873ca0f2 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -806,21 +806,33 @@ class TDDnodes: psCmd = "for /f %a in ('wmic process where \"name='taosd.exe'\" get processId ^| xargs echo ^| awk '{print $2}' ^&^& echo aa') do @(ps | grep %a | awk '{print $1}' | xargs)" processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip() while(processID): - print(processID) + print(f"pid of taosd.exe:{processID}") killCmd = "kill -9 %s > nul 2>&1" % processID os.system(killCmd) time.sleep(1) processID = subprocess.check_output( psCmd, shell=True).decode("utf-8").strip() + psCmd = "for /f %a in ('wmic process where \"name='tmq_sim.exe'\" get processId ^| xargs echo ^| awk '{print $2}' ^&^& echo aa') do @(ps | grep %a | awk '{print $1}' | xargs)" processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip() while(processID): - print(processID) + print(f"pid of tmq_sim.exe:{processID}") killCmd = "kill -9 %s > nul 2>&1" % processID os.system(killCmd) time.sleep(1) processID = subprocess.check_output( psCmd, shell=True).decode("utf-8").strip() + + psCmd = "for /f %a in ('wmic process where \"name='taosBenchmark.exe'\" get processId ^| xargs echo ^| awk '{print $2}' ^&^& echo aa') do @(ps | grep %a | awk '{print $1}' | xargs)" + processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip() + while(processID): + print(f"pid of taosBenchmark.exe:{processID}") + killCmd = "kill -9 %s > nul 2>&1" % processID + os.system(killCmd) + time.sleep(1) + processID = subprocess.check_output( + psCmd, shell=True).decode("utf-8").strip() + else: psCmd = "ps -ef | grep -w taosd | grep 'root' | grep -v grep| grep -v defunct | awk '{print $2}' | xargs" processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip() From bae7bee3896fa04587c8250331dbd64e55bb690d Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 23 Aug 2023 23:59:24 +0800 Subject: [PATCH 34/46] fix error --- tests/system-test/2-query/union.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/2-query/union.py b/tests/system-test/2-query/union.py index e359164a4f..9086d7754d 100644 --- a/tests/system-test/2-query/union.py +++ b/tests/system-test/2-query/union.py @@ -191,7 +191,7 @@ class TDTestCase: if tdSql.cursor.istype(col, "BIGINT UNSIGNED"): return "BIGINT UNSIGNED" - def union_check(self): + def union_check(self, dbname = "db"): sqls = self.sql_list() for i in range(len(sqls)): tdSql.query(sqls[i]) From dda7b5dc7e18aad05d3b47fde9c82f578e9ec064 Mon Sep 17 00:00:00 2001 From: huolibo Date: Thu, 27 Jul 2023 16:52:08 +0800 Subject: [PATCH 35/46] feat(driver): add committed assignment API for jdbc --- .../jni/com_taosdata_jdbc_tmq_TMQConnector.h | 15 +++ source/client/src/clientTmqConnector.c | 108 +++++++++++++++++- 2 files changed, 122 insertions(+), 1 deletion(-) diff --git a/source/client/jni/com_taosdata_jdbc_tmq_TMQConnector.h b/source/client/jni/com_taosdata_jdbc_tmq_TMQConnector.h index 422bcd57ac..ebc4eacdf9 100644 --- a/source/client/jni/com_taosdata_jdbc_tmq_TMQConnector.h +++ b/source/client/jni/com_taosdata_jdbc_tmq_TMQConnector.h @@ -92,6 +92,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqSubscriptionIm */ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitSync(JNIEnv *, jobject, jlong, jlong); +JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitAllSync(JNIEnv *, jobject, jlong); + +JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitOffsetSyncImp(JNIEnv *, jobject, jlong, jstring, + jint, jlong); /* * Class: com_taosdata_jdbc_tmq_TMQConnector * Method: tmqCommitAsync @@ -102,6 +106,12 @@ JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitAsync(JN JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_consumerCommitAsync(JNIEnv *, jobject, jlong, jlong, jobject); +JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_consumerCommitAllAsync(JNIEnv *, jobject, jlong, + jobject); + +JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_consumerCommitOffsetAsync(JNIEnv *, jobject, jlong, + jstring, jint, jlong, jobject); + /* * Class: com_taosdata_jdbc_tmq_TMQConnector * Method: tmqUnsubscribeImp @@ -179,6 +189,11 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqSeekImp(JNIEnv JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqGetTopicAssignmentImp(JNIEnv *, jobject, jlong, jstring, jobject); +JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommittedImp(JNIEnv *, jobject, jlong, jstring, + jint); + +JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqPositionImp(JNIEnv *, jobject, jlong, jstring, jint); + #ifdef __cplusplus } #endif diff --git a/source/client/src/clientTmqConnector.c b/source/client/src/clientTmqConnector.c index 6ec82aa6ef..487a86a589 100644 --- a/source/client/src/clientTmqConnector.c +++ b/source/client/src/clientTmqConnector.c @@ -291,6 +291,39 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitSync(JNI TAOS_RES *res = (TAOS_RES *)jres; return tmq_commit_sync(tmq, res); } +JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitAllSync(JNIEnv *env, jobject jobj, jlong jtmq) { + tmq_t *tmq = (tmq_t *)jtmq; + if (tmq == NULL) { + jniError("jobj:%p, tmq is closed", jobj); + return TMQ_CONSUMER_NULL; + } + + return tmq_commit_sync(tmq, NULL); +} + +JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitOffsetSyncImp(JNIEnv *env, jobject jobj, + jlong jtmq, jstring jtopic, + jint vgId, jlong offset) { + tmq_t *tmq = (tmq_t *)jtmq; + if (tmq == NULL) { + jniDebug("jobj:%p, tmq is closed", jobj); + return TMQ_CONSUMER_NULL; + } + + if (jtopic == NULL) { + jniDebug("jobj:%p, topic is null", jobj); + return TMQ_TOPIC_NULL; + } + const char *topicName = (*env)->GetStringUTFChars(env, jtopic, NULL); + + int code = tmq_commit_offset_sync(tmq, topicName, vgId, offset); + if (code != TSDB_CODE_SUCCESS) { + jniError("jobj:%p, tmq commit offset error, code:%d, msg:%s", jobj, code, tmq_err2str(code)); + } + + (*env)->ReleaseStringUTFChars(env, jtopic, topicName); + return code; +} // deprecated JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommitAsync(JNIEnv *env, jobject jobj, jlong jtmq, @@ -319,6 +352,27 @@ JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_consumerCommitAsy tmq_commit_async(tmq, res, consumer_callback, offset); } +JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_consumerCommitAllAsync(JNIEnv *env, jobject jobj, + jlong jtmq, jobject offset) { + tmqGlobalMethod(env); + tmq_t *tmq = (tmq_t *)jtmq; + + offset = (*env)->NewGlobalRef(env, offset); + tmq_commit_async(tmq, NULL, consumer_callback, offset); +} + +JNIEXPORT void JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_consumerCommitOffsetAsync(JNIEnv *env, jobject jobj, + jlong jtmq, jstring jtopic, + jint vgId, jlong offset, + jobject callback) { + tmqGlobalMethod(env); + tmq_t *tmq = (tmq_t *)jtmq; + const char *topicName = (*env)->GetStringUTFChars(env, jtopic, NULL); + + callback = (*env)->NewGlobalRef(env, callback); + tmq_commit_offset_async(tmq, topicName, vgId, offset, consumer_callback, callback); +} + JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqUnsubscribeImp(JNIEnv *env, jobject jobj, jlong jtmq) { tmq_t *tmq = (tmq_t *)jtmq; @@ -497,9 +551,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqGetTopicAssign int32_t res = tmq_get_topic_assignment(tmq, topicName, &pAssign, &numOfAssignment); if (res != TSDB_CODE_SUCCESS) { - (*env)->ReleaseStringUTFChars(env, jtopic, topicName); jniError("jobj:%p, tmq get topic assignment error, topic:%s, code:%d, msg:%s", jobj, topicName, res, tmq_err2str(res)); + (*env)->ReleaseStringUTFChars(env, jtopic, topicName); tmq_free_assignment(pAssign); return (jint)res; } @@ -518,3 +572,55 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqGetTopicAssign tmq_free_assignment(pAssign); return JNI_SUCCESS; } + +JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommittedImp(JNIEnv *env, jobject jobj, jlong jtmq, + jstring jtopic, jint vgId) { + tmq_t *tmq = (tmq_t *)jtmq; + if (tmq == NULL) { + jniDebug("jobj:%p, tmq is closed", jobj); + return TMQ_CONSUMER_NULL; + } + + if (jtopic == NULL) { + jniDebug("jobj:%p, topic is null", jobj); + return TMQ_TOPIC_NULL; + } + + const char *topicName = (*env)->GetStringUTFChars(env, jtopic, NULL); + + int64_t offset = tmq_committed(tmq, topicName, vgId); + + if (offset < JNI_SUCCESS) { + jniError("jobj:%p, tmq get committed offset error, topic:%s, vgId:%d, code:0x%" PRIx64 ", msg:%s", jobj, topicName, + vgId, offset, tmq_err2str(offset)); + } + + (*env)->ReleaseStringUTFChars(env, jtopic, topicName); + return (jlong)offset; +} + +JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqPositionImp(JNIEnv *env, jobject jobj, jlong jtmq, + jstring jtopic, jint vgId) { + tmq_t *tmq = (tmq_t *)jtmq; + if (tmq == NULL) { + jniDebug("jobj:%p, tmq is closed", jobj); + return TMQ_CONSUMER_NULL; + } + + if (jtopic == NULL) { + jniDebug("jobj:%p, topic is null", jobj); + return TMQ_TOPIC_NULL; + } + + const char *topicName = (*env)->GetStringUTFChars(env, jtopic, NULL); + + int64_t offset = tmq_position(tmq, topicName, vgId); + + if (offset < JNI_SUCCESS) { + jniError("jobj:%p, tmq get position error, topic:%s, vgId:%d, code:0x%" PRIx64 ", msg:%s", jobj, topicName, vgId, + offset, tmq_err2str(offset)); + } + + (*env)->ReleaseStringUTFChars(env, jtopic, topicName); + return (jlong)offset; +} \ No newline at end of file From a3d4d0c57e78c13d1e5806c24dadbb1ae30ae109 Mon Sep 17 00:00:00 2001 From: huolibo Date: Thu, 24 Aug 2023 10:55:41 +0800 Subject: [PATCH 36/46] fix: jni error log --- source/client/src/clientTmqConnector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/client/src/clientTmqConnector.c b/source/client/src/clientTmqConnector.c index 487a86a589..2bea738c23 100644 --- a/source/client/src/clientTmqConnector.c +++ b/source/client/src/clientTmqConnector.c @@ -590,7 +590,7 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqCommittedImp( int64_t offset = tmq_committed(tmq, topicName, vgId); - if (offset < JNI_SUCCESS) { + if (offset < JNI_SUCCESS && offset != -2147467247) { jniError("jobj:%p, tmq get committed offset error, topic:%s, vgId:%d, code:0x%" PRIx64 ", msg:%s", jobj, topicName, vgId, offset, tmq_err2str(offset)); } From 171cf049bc75d63d42e0d0df9bff9264e1064605 Mon Sep 17 00:00:00 2001 From: Shungang Li Date: Thu, 24 Aug 2023 11:03:06 +0800 Subject: [PATCH 37/46] fix: new msg should be appended to segment tail --- include/common/tmsgdef.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 3be49361d2..323b2de6ba 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -65,7 +65,7 @@ enum { #define TD_NEW_MSG_SEG(TYPE) TYPE = ((TYPE##_SEG_CODE) << 8), #define TD_DEF_MSG_TYPE(TYPE, MSG, REQ, RSP) TYPE, TYPE##_RSP, -enum { +enum { // WARN: new msg should be appended to segment tail #endif TD_NEW_MSG_SEG(TDMT_DND_MSG) TD_DEF_MSG_TYPE(TDMT_DND_CREATE_MNODE, "dnode-create-mnode", NULL, NULL) @@ -156,7 +156,6 @@ enum { TD_DEF_MSG_TYPE(TDMT_MND_TELEM_TIMER, "telem-tmr", SMTimerReq, SMTimerReq) TD_DEF_MSG_TYPE(TDMT_MND_TRANS_TIMER, "trans-tmr", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_TTL_TIMER, "ttl-tmr", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_TRIM_DB_TIMER, "trim-db-tmr", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_GRANT_HB_TIMER, "grant-hb-tmr", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_KILL_TRANS, "kill-trans", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_KILL_QUERY, "kill-query", NULL, NULL) @@ -183,6 +182,7 @@ enum { TD_DEF_MSG_TYPE(TDMT_MND_RESTORE_DNODE, "restore-dnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_PAUSE_STREAM, "pause-stream", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_RESUME_STREAM, "resume-stream", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_TRIM_DB_TIMER, "trim-db-tmr", NULL, NULL) TD_NEW_MSG_SEG(TDMT_VND_MSG) TD_DEF_MSG_TYPE(TDMT_VND_SUBMIT, "submit", SSubmitReq, SSubmitRsp) From 08fc2d1eb53f5931560ce687527ef98d2d9c908a Mon Sep 17 00:00:00 2001 From: wangjiaming0909 <604227650@qq.com> Date: Thu, 24 Aug 2023 11:29:15 +0800 Subject: [PATCH 38/46] add doc for column comment --- docs/en/12-taos-sql/03-table.md | 7 +++++-- docs/zh/12-taos-sql/03-table.md | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/en/12-taos-sql/03-table.md b/docs/en/12-taos-sql/03-table.md index 10c44848c9..b84c17bfac 100644 --- a/docs/en/12-taos-sql/03-table.md +++ b/docs/en/12-taos-sql/03-table.md @@ -91,12 +91,15 @@ ALTER TABLE [db_name.]tb_name alter_table_clause alter_table_clause: { alter_table_options - | ADD COLUMN col_name column_type + | ADD COLUMN col_name column_definition | DROP COLUMN col_name - | MODIFY COLUMN col_name column_type + | MODIFY COLUMN col_name column_definition | RENAME COLUMN old_col_name new_col_name } +column_definition: + type_name [comment 'string_value'] + alter_table_options: alter_table_option ... diff --git a/docs/zh/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md index 9258258263..f5540aeb63 100644 --- a/docs/zh/12-taos-sql/03-table.md +++ b/docs/zh/12-taos-sql/03-table.md @@ -23,7 +23,10 @@ create_subtable_clause: { } create_definition: - col_name column_type + col_name column_definition + +column_definition: + type_name [comment 'string_value'] table_options: table_option ... @@ -89,12 +92,15 @@ ALTER TABLE [db_name.]tb_name alter_table_clause alter_table_clause: { alter_table_options - | ADD COLUMN col_name column_type + | ADD COLUMN col_name column_definition | DROP COLUMN col_name - | MODIFY COLUMN col_name column_type + | MODIFY COLUMN col_name column_definition | RENAME COLUMN old_col_name new_col_name } +column_definition: + type_name [comment 'string_value'] + alter_table_options: alter_table_option ... From 7fad1de84135696de20d2b0ea31aef8cc6b307e1 Mon Sep 17 00:00:00 2001 From: wangjiaming0909 <604227650@qq.com> Date: Thu, 24 Aug 2023 13:38:41 +0800 Subject: [PATCH 39/46] Revert "feat: show create table, desc table with col comments" This reverts commit 16754b5ac166380677927960bed6b014fed2d48d. --- include/libs/nodes/cmdnodes.h | 9 ++++----- source/common/src/tmsg.c | 4 ++-- source/dnode/vnode/src/vnd/vnodeQuery.c | 2 +- source/libs/command/src/command.c | 23 +++-------------------- source/libs/parser/src/parTranslater.c | 4 ---- tests/system-test/0-others/show.py | 9 --------- 6 files changed, 10 insertions(+), 41 deletions(-) diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index ff02070882..78b7f1babf 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -23,11 +23,10 @@ extern "C" { #include "query.h" #include "querynodes.h" -#define DESCRIBE_RESULT_COLS 5 -#define DESCRIBE_RESULT_FIELD_LEN (TSDB_COL_NAME_LEN - 1 + VARSTR_HEADER_SIZE) -#define DESCRIBE_RESULT_TYPE_LEN (20 + VARSTR_HEADER_SIZE) -#define DESCRIBE_RESULT_NOTE_LEN (8 + VARSTR_HEADER_SIZE) -#define DESCRIBE_RESULT_COL_COMMENT_LEN (TSDB_COL_COMMENT_LEN) +#define DESCRIBE_RESULT_COLS 4 +#define DESCRIBE_RESULT_FIELD_LEN (TSDB_COL_NAME_LEN - 1 + VARSTR_HEADER_SIZE) +#define DESCRIBE_RESULT_TYPE_LEN (20 + VARSTR_HEADER_SIZE) +#define DESCRIBE_RESULT_NOTE_LEN (8 + VARSTR_HEADER_SIZE) #define SHOW_CREATE_DB_RESULT_COLS 2 #define SHOW_CREATE_DB_RESULT_FIELD1_LEN (TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 27b6499497..6131b15e53 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -2327,7 +2327,7 @@ int32_t tDeserializeSTableCfgRsp(void *buf, int32_t bufLen, STableCfgRsp *pRsp) } int32_t totalCols = pRsp->numOfTags + pRsp->numOfColumns; - pRsp->pSchemas = taosMemoryCalloc(totalCols, sizeof(SSchema)); + pRsp->pSchemas = taosMemoryMalloc(sizeof(SSchema) * totalCols); if (pRsp->pSchemas == NULL) return -1; for (int32_t i = 0; i < totalCols; ++i) { @@ -3740,7 +3740,7 @@ static int32_t tDecodeSTableMetaRsp(SDecoder *pDecoder, STableMetaRsp *pRsp) { int32_t totalCols = pRsp->numOfTags + pRsp->numOfColumns; if (totalCols > 0) { - pRsp->pSchemas = taosMemoryCalloc(totalCols, sizeof(SSchema)); + pRsp->pSchemas = taosMemoryMalloc(sizeof(SSchema) * totalCols); if (pRsp->pSchemas == NULL) return -1; for (int32_t i = 0; i < totalCols; ++i) { diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index 95404ee9f2..1554d58d56 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -216,7 +216,7 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) { cfgRsp.numOfTags = schemaTag.nCols; cfgRsp.numOfColumns = schema.nCols; - cfgRsp.pSchemas = (SSchema *)taosMemoryCalloc(cfgRsp.numOfColumns + cfgRsp.numOfTags, sizeof(SSchema)); + cfgRsp.pSchemas = (SSchema *)taosMemoryMalloc(sizeof(SSchema) * (cfgRsp.numOfColumns + cfgRsp.numOfTags)); memcpy(cfgRsp.pSchemas, schema.pSchema, sizeof(SSchema) * schema.nCols); if (schemaTag.nCols) { diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 1fa97904e4..921ec41021 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -78,10 +78,6 @@ static int32_t buildDescResultDataBlock(SSDataBlock** pOutput) { infoData = createColumnInfoData(TSDB_DATA_TYPE_VARCHAR, DESCRIBE_RESULT_NOTE_LEN, 4); code = blockDataAppendColInfo(pBlock, &infoData); } - if (TSDB_CODE_SUCCESS == code) { - infoData = createColumnInfoData(TSDB_DATA_TYPE_VARCHAR, DESCRIBE_RESULT_COL_COMMENT_LEN, 5); - code = blockDataAppendColInfo(pBlock, &infoData); - } if (TSDB_CODE_SUCCESS == code) { *pOutput = pBlock; @@ -103,9 +99,7 @@ static int32_t setDescResultIntoDataBlock(bool sysInfoUser, SSDataBlock* pBlock, SColumnInfoData* pCol3 = taosArrayGet(pBlock->pDataBlock, 2); // Note SColumnInfoData* pCol4 = taosArrayGet(pBlock->pDataBlock, 3); - // Comment - SColumnInfoData* pCol5 = taosArrayGet(pBlock->pDataBlock, 4); - char buf[DESCRIBE_RESULT_COL_COMMENT_LEN + VARSTR_HEADER_SIZE] = {0}; + char buf[DESCRIBE_RESULT_FIELD_LEN] = {0}; for (int32_t i = 0; i < numOfRows; ++i) { if (invisibleColumn(sysInfoUser, pMeta->tableType, pMeta->schema[i].flags)) { continue; @@ -118,8 +112,6 @@ static int32_t setDescResultIntoDataBlock(bool sysInfoUser, SSDataBlock* pBlock, colDataSetVal(pCol3, pBlock->info.rows, (const char*)&bytes, false); STR_TO_VARSTR(buf, i >= pMeta->tableInfo.numOfColumns ? "TAG" : ""); colDataSetVal(pCol4, pBlock->info.rows, buf, false); - STR_TO_VARSTR(buf, pMeta->schema[i].comment); - colDataSetVal(pCol5, pBlock->info.rows, buf, false); ++(pBlock->info.rows); } if (pBlock->info.rows <= 0) { @@ -464,19 +456,14 @@ void appendColumnFields(char* buf, int32_t* len, STableCfg* pCfg) { for (int32_t i = 0; i < pCfg->numOfColumns; ++i) { SSchema* pSchema = pCfg->pSchemas + i; char type[32]; - char comments[TSDB_COL_COMMENT_LEN + 16] = {0}; sprintf(type, "%s", tDataTypes[pSchema->type].name); if (TSDB_DATA_TYPE_VARCHAR == pSchema->type || TSDB_DATA_TYPE_GEOMETRY == pSchema->type) { sprintf(type + strlen(type), "(%d)", (int32_t)(pSchema->bytes - VARSTR_HEADER_SIZE)); } else if (TSDB_DATA_TYPE_NCHAR == pSchema->type) { sprintf(type + strlen(type), "(%d)", (int32_t)((pSchema->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); } - if (pSchema->comment[0]) { - sprintf(comments, " COMMENT '%s'", pSchema->comment); - } - *len += - sprintf(buf + VARSTR_HEADER_SIZE + *len, "%s`%s` %s%s", ((i > 0) ? ", " : ""), pSchema->name, type, comments); + *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, "%s`%s` %s", ((i > 0) ? ", " : ""), pSchema->name, type); } } @@ -484,18 +471,14 @@ void appendTagFields(char* buf, int32_t* len, STableCfg* pCfg) { for (int32_t i = 0; i < pCfg->numOfTags; ++i) { SSchema* pSchema = pCfg->pSchemas + pCfg->numOfColumns + i; char type[32]; - char comments[TSDB_COL_COMMENT_LEN + 16] = {0}; sprintf(type, "%s", tDataTypes[pSchema->type].name); if (TSDB_DATA_TYPE_VARCHAR == pSchema->type || TSDB_DATA_TYPE_GEOMETRY == pSchema->type) { sprintf(type + strlen(type), "(%d)", (int32_t)(pSchema->bytes - VARSTR_HEADER_SIZE)); } else if (TSDB_DATA_TYPE_NCHAR == pSchema->type) { sprintf(type + strlen(type), "(%d)", (int32_t)((pSchema->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); } - if (pSchema->comment[0]) { - sprintf(comments, " COMMENT '%s'", pSchema->comment); - } - *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, "%s`%s` %s%s", ((i > 0) ? ", " : ""), pSchema->name, type, comments); + *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, "%s`%s` %s", ((i > 0) ? ", " : ""), pSchema->name, type); } } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 473d177066..3288538af3 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -7699,10 +7699,6 @@ static int32_t extractDescribeResultSchema(int32_t* numOfCols, SSchema** pSchema (*pSchema)[3].bytes = DESCRIBE_RESULT_NOTE_LEN; strcpy((*pSchema)[3].name, "note"); - (*pSchema)[4].type = TSDB_DATA_TYPE_BINARY; - (*pSchema)[4].bytes = DESCRIBE_RESULT_COL_COMMENT_LEN; - strcpy((*pSchema)[4].name, "comment"); - return TSDB_CODE_SUCCESS; } diff --git a/tests/system-test/0-others/show.py b/tests/system-test/0-others/show.py index d9cc4895b1..864c3e8a31 100644 --- a/tests/system-test/0-others/show.py +++ b/tests/system-test/0-others/show.py @@ -222,15 +222,6 @@ class TDTestCase: tdSql.query('show create table super_table') create_sql = "create stable `super_table` (`ts` timestamp, `c2` int) tags (`tg` int)" tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - - tdSql.query("desc normal_table") - tdSql.checkCols(5) - tdSql.checkData(0, 4, "") - - tdSql.query("desc super_table") - tdSql.checkCols(5) - tdSql.checkData(0, 4, "") - tdSql.execute("drop database comment_test_db") def alter_table_with_col_comment(self): From c2af41d0d0971e80ea0a9a8642724ffe269de2c9 Mon Sep 17 00:00:00 2001 From: wangjiaming0909 <604227650@qq.com> Date: Thu, 24 Aug 2023 13:42:51 +0800 Subject: [PATCH 40/46] Revert "feat: support alter table add column with comment" This reverts commit cb027cc5c53ad481d9b401f0b742e5542770b5d9. --- include/common/tmsg.h | 3 - include/libs/nodes/cmdnodes.h | 1 - source/libs/parser/inc/parAst.h | 3 +- source/libs/parser/inc/sql.y | 8 +- source/libs/parser/src/parAstCreater.c | 12 +- source/libs/parser/src/parTranslater.c | 18 - source/libs/parser/src/sql.c | 1704 ++++++++++++------------ tests/system-test/0-others/show.py | 42 +- 8 files changed, 848 insertions(+), 943 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 21cad322bb..20a39a5fb3 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2633,9 +2633,6 @@ typedef struct { int8_t type; int8_t flags; int32_t bytes; - bool hasColComment; - char* colComment; - int32_t colCommentLen; // TSDB_ALTER_TABLE_DROP_COLUMN // TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES int8_t colModType; diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 78b7f1babf..b6c4e89a33 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -214,7 +214,6 @@ typedef struct SAlterTableStmt { char newColName[TSDB_COL_NAME_LEN]; STableOptions* pOptions; SDataType dataType; - char colComment[TSDB_COL_COMMENT_LEN]; SValueNode* pVal; } SAlterTableStmt; diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index d24bb1db4f..4a6dee4fe3 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -173,7 +173,8 @@ SNode* createDropTableClause(SAstCreateContext* pCxt, bool ignoreNotExists, SNod SNode* createDropTableStmt(SAstCreateContext* pCxt, SNodeList* pTables); SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable); SNode* createAlterTableModifyOptions(SAstCreateContext* pCxt, SNode* pRealTable, SNode* pOptions); -SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, SNode* pColDefNode); +SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, SToken* pColName, + SDataType dataType); SNode* createAlterTableDropCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, SToken* pColName); SNode* createAlterTableRenameCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, SToken* pOldColName, SToken* pNewColName); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 2501ae8504..a86666ec98 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -312,17 +312,17 @@ cmd ::= ALTER STABLE alter_table_clause(A). alter_table_clause(A) ::= full_table_name(B) alter_table_options(C). { A = createAlterTableModifyOptions(pCxt, B, C); } alter_table_clause(A) ::= - full_table_name(B) ADD COLUMN column_def(C). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, C); } + full_table_name(B) ADD COLUMN column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C, D); } alter_table_clause(A) ::= full_table_name(B) DROP COLUMN column_name(C). { A = createAlterTableDropCol(pCxt, B, TSDB_ALTER_TABLE_DROP_COLUMN, &C); } alter_table_clause(A) ::= - full_table_name(B) MODIFY COLUMN column_def(C). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, C); } + full_table_name(B) MODIFY COLUMN column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &C, D); } alter_table_clause(A) ::= full_table_name(B) RENAME COLUMN column_name(C) column_name(D). { A = createAlterTableRenameCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &C, &D); } alter_table_clause(A) ::= - full_table_name(B) ADD TAG column_def(C). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_TAG, C); } + full_table_name(B) ADD TAG column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_TAG, &C, D); } alter_table_clause(A) ::= full_table_name(B) DROP TAG column_name(C). { A = createAlterTableDropCol(pCxt, B, TSDB_ALTER_TABLE_DROP_TAG, &C); } alter_table_clause(A) ::= - full_table_name(B) MODIFY TAG column_def(C). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, C); } + full_table_name(B) MODIFY TAG column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &C, D); } alter_table_clause(A) ::= full_table_name(B) RENAME TAG column_name(C) column_name(D). { A = createAlterTableRenameCol(pCxt, B, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &C, &D); } alter_table_clause(A) ::= diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index c51b442166..342c0f390e 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -1457,15 +1457,17 @@ SNode* createAlterTableModifyOptions(SAstCreateContext* pCxt, SNode* pRealTable, return createAlterTableStmtFinalize(pRealTable, pStmt); } -SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, SNode* pColDefNode) { +SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, SToken* pColName, + SDataType dataType) { CHECK_PARSER_STATUS(pCxt); - SColumnDefNode* pCol = (SColumnDefNode*)pColDefNode; + if (!checkColumnName(pCxt, pColName)) { + return NULL; + } SAlterTableStmt* pStmt = (SAlterTableStmt*)nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->alterType = alterType; - strcpy(pStmt->colName, pCol->colName); - strcpy(pStmt->colComment, pCol->comments); - pStmt->dataType = pCol->dataType; + COPY_STRING_FORM_ID_TOKEN(pStmt->colName, pColName); + pStmt->dataType = dataType; return createAlterTableStmtFinalize(pRealTable, pStmt); } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 3288538af3..70bd25dd2b 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -8879,15 +8879,6 @@ static int32_t buildAddColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt, S pReq->type = pStmt->dataType.type; pReq->flags = COL_SMA_ON; pReq->bytes = calcTypeBytes(pStmt->dataType); - if (pStmt->colComment[0]) { - pReq->colComment = taosStrdup(pStmt->colComment); - if (pReq->colComment == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; - } - pReq->colCommentLen = strlen(pReq->colComment); - } else { - pReq->colCommentLen = -1; - } return TSDB_CODE_SUCCESS; } @@ -8938,15 +8929,6 @@ static int32_t buildUpdateColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt return TSDB_CODE_OUT_OF_MEMORY; } pReq->colId = pSchema->colId; - if (pStmt->colComment[0]) { - pReq->colComment = taosStrdup(pStmt->colComment); - if (pReq->colComment == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; - } - pReq->colCommentLen = strlen(pReq->colComment); - } else { - pReq->colCommentLen = -1; - } return TSDB_CODE_SUCCESS; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index a19b986732..bdc72592cc 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,10 +24,7 @@ ** The following is the concatenation of all %include directives from the ** input grammar file: */ -#include -#include /************ Begin %include sections from the grammar ************************/ - #include #include #include @@ -42,11 +41,6 @@ #define YYSTACKDEPTH 0 /**************** 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 ***************************/ /* The next sections is a series of control #defines. ** various aspects of the generated parser. @@ -140,18 +134,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 801 +#define YYNSTATE 805 #define YYNRULE 605 #define YYNRULE_WITH_ACTION 605 #define YYNTOKEN 339 -#define YY_MAX_SHIFT 800 -#define YY_MIN_SHIFTREDUCE 1183 -#define YY_MAX_SHIFTREDUCE 1787 -#define YY_ERROR_ACTION 1788 -#define YY_ACCEPT_ACTION 1789 -#define YY_NO_ACTION 1790 -#define YY_MIN_REDUCE 1791 -#define YY_MAX_REDUCE 2395 +#define YY_MAX_SHIFT 804 +#define YY_MIN_SHIFTREDUCE 1187 +#define YY_MAX_SHIFTREDUCE 1791 +#define YY_ERROR_ACTION 1792 +#define YY_ACCEPT_ACTION 1793 +#define YY_NO_ACTION 1794 +#define YY_MIN_REDUCE 1795 +#define YY_MAX_REDUCE 2399 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -218,602 +212,586 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2957) +#define YY_ACTTAB_COUNT (2797) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 736, 2202, 2180, 2091, 738, 689, 1968, 2013, 1216, 38, - /* 10 */ 304, 669, 48, 46, 1714, 392, 2188, 1946, 2088, 676, - /* 20 */ 399, 255, 1559, 41, 40, 135, 2184, 47, 45, 44, - /* 30 */ 43, 42, 573, 1640, 2022, 1557, 689, 1968, 41, 40, - /* 40 */ 2220, 2163, 47, 45, 44, 43, 42, 1218, 2021, 1221, - /* 50 */ 1222, 2170, 1241, 705, 1240, 1584, 135, 2180, 2180, 666, - /* 60 */ 144, 149, 1635, 578, 2186, 396, 533, 140, 19, 534, - /* 70 */ 1827, 1959, 2189, 451, 699, 1565, 541, 666, 144, 534, - /* 80 */ 1827, 2184, 2184, 359, 2022, 1242, 688, 2201, 629, 2237, - /* 90 */ 380, 2366, 112, 2203, 709, 2205, 2206, 704, 2020, 699, - /* 100 */ 797, 689, 1968, 15, 185, 2135, 2290, 2091, 2372, 188, - /* 110 */ 395, 2286, 2153, 2367, 655, 181, 48, 46, 346, 2186, - /* 120 */ 2186, 193, 2089, 676, 399, 190, 1559, 1669, 1375, 699, - /* 130 */ 699, 1584, 221, 2320, 367, 2074, 536, 1640, 1834, 1557, - /* 140 */ 1642, 1643, 456, 2070, 1366, 734, 733, 732, 1370, 731, - /* 150 */ 1372, 1373, 730, 727, 250, 1381, 724, 1383, 1384, 721, - /* 160 */ 718, 715, 668, 186, 2298, 2299, 1635, 142, 2303, 51, - /* 170 */ 1615, 1625, 19, 169, 223, 1803, 1641, 1644, 536, 1565, - /* 180 */ 1834, 282, 2298, 665, 1670, 136, 664, 1585, 2366, 202, - /* 190 */ 688, 1560, 125, 1558, 62, 124, 123, 122, 121, 120, - /* 200 */ 119, 118, 117, 116, 797, 653, 188, 15, 2202, 530, - /* 210 */ 2367, 655, 52, 1784, 62, 666, 144, 528, 706, 674, - /* 220 */ 524, 520, 249, 1563, 1564, 1792, 1614, 1617, 1618, 1619, - /* 230 */ 1620, 1621, 1622, 1623, 1624, 701, 697, 1633, 1634, 1636, - /* 240 */ 1637, 1638, 1639, 2, 1642, 1643, 125, 2220, 550, 124, - /* 250 */ 123, 122, 121, 120, 119, 118, 117, 116, 2170, 1791, - /* 260 */ 705, 66, 37, 397, 1664, 1665, 1666, 1667, 1668, 1672, - /* 270 */ 1673, 1674, 1675, 404, 1615, 1625, 2015, 2017, 689, 1968, - /* 280 */ 1641, 1644, 649, 134, 133, 132, 131, 130, 129, 128, - /* 290 */ 127, 126, 1530, 1531, 2201, 1560, 2237, 1558, 56, 112, - /* 300 */ 2203, 709, 2205, 2206, 704, 644, 699, 1410, 1411, 147, - /* 310 */ 1586, 155, 2261, 2290, 746, 2202, 1783, 395, 2286, 187, - /* 320 */ 2298, 2299, 1584, 142, 2303, 669, 286, 1563, 1564, 428, - /* 330 */ 1614, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 701, - /* 340 */ 697, 1633, 1634, 1636, 1637, 1638, 1639, 2, 12, 48, - /* 350 */ 46, 286, 2371, 402, 2220, 2366, 168, 399, 372, 1559, - /* 360 */ 62, 1970, 163, 184, 1909, 2170, 1814, 705, 381, 286, - /* 370 */ 1640, 286, 1557, 2370, 675, 2009, 2020, 2367, 2369, 41, - /* 380 */ 40, 496, 614, 47, 45, 44, 43, 42, 462, 2070, - /* 390 */ 1565, 1587, 666, 144, 2202, 12, 650, 645, 638, 1635, - /* 400 */ 688, 2201, 737, 2237, 703, 19, 112, 2203, 709, 2205, - /* 410 */ 2206, 704, 1565, 699, 689, 1968, 2170, 1813, 185, 756, - /* 420 */ 2290, 689, 1968, 596, 395, 2286, 548, 373, 2084, 371, - /* 430 */ 370, 2305, 575, 2220, 449, 205, 577, 797, 606, 109, - /* 440 */ 15, 450, 212, 211, 2170, 2022, 705, 2321, 1870, 689, - /* 450 */ 1968, 389, 246, 48, 46, 1645, 145, 2302, 576, 2020, - /* 460 */ 2202, 399, 284, 1559, 1960, 495, 648, 2170, 599, 464, - /* 470 */ 706, 1318, 1468, 1469, 1640, 593, 1557, 1642, 1643, 1812, - /* 480 */ 2201, 245, 2237, 51, 1811, 340, 2203, 709, 2205, 2206, - /* 490 */ 704, 702, 699, 690, 2255, 2220, 189, 2298, 2299, 2220, - /* 500 */ 142, 2303, 181, 1635, 12, 433, 10, 1615, 1625, 538, - /* 510 */ 2170, 1320, 705, 1641, 1644, 535, 1565, 286, 591, 590, - /* 520 */ 589, 70, 2075, 2371, 69, 581, 141, 585, 1560, 2170, - /* 530 */ 1558, 584, 435, 431, 2170, 675, 583, 588, 375, 374, - /* 540 */ 1586, 797, 582, 262, 49, 1810, 2201, 2202, 2237, 647, - /* 550 */ 2053, 170, 2203, 709, 2205, 2206, 704, 706, 699, 1836, - /* 560 */ 1563, 1564, 90, 1614, 1617, 1618, 1619, 1620, 1621, 1622, - /* 570 */ 1623, 1624, 701, 697, 1633, 1634, 1636, 1637, 1638, 1639, - /* 580 */ 2, 1642, 1643, 591, 590, 589, 2220, 673, 1964, 2084, - /* 590 */ 581, 141, 585, 630, 2331, 2170, 584, 2170, 691, 705, - /* 600 */ 2262, 583, 588, 375, 374, 654, 700, 582, 2366, 689, - /* 610 */ 1968, 1615, 1625, 2022, 408, 407, 628, 1641, 1644, 365, - /* 620 */ 2016, 2017, 2022, 1789, 1777, 653, 188, 2020, 394, 479, - /* 630 */ 2367, 655, 1560, 2201, 1558, 2237, 2020, 1566, 112, 2203, - /* 640 */ 709, 2205, 2206, 704, 2370, 699, 689, 1968, 295, 296, - /* 650 */ 2386, 675, 2290, 294, 41, 40, 395, 2286, 47, 45, - /* 660 */ 44, 43, 42, 258, 1563, 1564, 480, 1614, 1617, 1618, - /* 670 */ 1619, 1620, 1621, 1622, 1623, 1624, 701, 697, 1633, 1634, - /* 680 */ 1636, 1637, 1638, 1639, 2, 48, 46, 689, 1968, 2202, - /* 690 */ 30, 654, 284, 399, 2366, 1559, 414, 1585, 1944, 706, - /* 700 */ 693, 413, 2262, 684, 1742, 2084, 1640, 549, 1557, 474, - /* 710 */ 2202, 653, 188, 103, 489, 2070, 2367, 655, 473, 90, - /* 720 */ 706, 1945, 62, 2022, 689, 1968, 41, 40, 2220, 403, - /* 730 */ 47, 45, 44, 43, 42, 1635, 369, 2020, 1961, 2170, - /* 740 */ 60, 705, 1809, 629, 1965, 1963, 2366, 626, 1565, 2220, - /* 750 */ 1754, 207, 641, 640, 1740, 1741, 1743, 1744, 1745, 605, - /* 760 */ 2170, 210, 705, 2372, 188, 746, 689, 1968, 2367, 655, - /* 770 */ 393, 577, 603, 797, 601, 2201, 49, 2237, 1970, 166, - /* 780 */ 171, 2203, 709, 2205, 2206, 704, 251, 699, 1808, 48, - /* 790 */ 46, 86, 2170, 576, 85, 1569, 2201, 399, 2237, 1559, - /* 800 */ 1910, 113, 2203, 709, 2205, 2206, 704, 1804, 699, 443, - /* 810 */ 1640, 442, 1557, 1642, 1643, 2290, 2305, 1485, 1486, 2289, - /* 820 */ 2286, 445, 1753, 41, 40, 2305, 444, 47, 45, 44, - /* 830 */ 43, 42, 2334, 656, 2387, 2202, 744, 1943, 2170, 1635, - /* 840 */ 1224, 441, 2301, 1615, 1625, 706, 1583, 689, 1968, 1641, - /* 850 */ 1644, 2300, 1565, 1484, 1487, 160, 159, 741, 740, 739, - /* 860 */ 157, 402, 689, 1968, 1560, 279, 1558, 672, 629, 1970, - /* 870 */ 166, 2366, 689, 1968, 2220, 689, 1968, 797, 146, 286, - /* 880 */ 15, 2261, 259, 742, 1718, 2170, 2013, 705, 2372, 188, - /* 890 */ 1584, 642, 299, 2367, 655, 686, 1563, 1564, 2063, 1614, - /* 900 */ 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 701, 697, - /* 910 */ 1633, 1634, 1636, 1637, 1638, 1639, 2, 1642, 1643, 1730, - /* 920 */ 139, 2201, 657, 2237, 587, 586, 113, 2203, 709, 2205, - /* 930 */ 2206, 704, 743, 699, 405, 2013, 744, 454, 14, 13, - /* 940 */ 2290, 2371, 1970, 166, 2366, 2287, 1807, 1615, 1625, 689, - /* 950 */ 1968, 1329, 744, 1641, 1644, 160, 159, 741, 740, 739, - /* 960 */ 157, 1711, 2370, 237, 1328, 2191, 2367, 2368, 1560, 687, - /* 970 */ 1558, 160, 159, 741, 740, 739, 157, 689, 1968, 173, - /* 980 */ 47, 45, 44, 43, 42, 1650, 1806, 567, 563, 559, - /* 990 */ 555, 1584, 236, 1241, 273, 1240, 2170, 305, 1244, 1245, - /* 1000 */ 1563, 1564, 1867, 1614, 1617, 1618, 1619, 1620, 1621, 1622, - /* 1010 */ 1623, 1624, 701, 697, 1633, 1634, 1636, 1637, 1638, 1639, - /* 1020 */ 2, 2193, 350, 167, 1582, 382, 1242, 1805, 325, 505, - /* 1030 */ 318, 487, 91, 1999, 503, 234, 2170, 502, 34, 1587, - /* 1040 */ 1616, 1683, 322, 73, 41, 40, 72, 9, 47, 45, - /* 1050 */ 44, 43, 42, 470, 54, 504, 3, 347, 41, 40, - /* 1060 */ 472, 1908, 47, 45, 44, 43, 42, 2164, 219, 515, - /* 1070 */ 513, 510, 774, 773, 772, 771, 411, 2170, 770, 769, - /* 1080 */ 148, 764, 763, 762, 761, 760, 759, 758, 162, 754, - /* 1090 */ 753, 752, 410, 409, 749, 748, 747, 176, 175, 44, - /* 1100 */ 43, 42, 757, 233, 227, 1930, 368, 1587, 62, 36, - /* 1110 */ 232, 546, 689, 1968, 629, 41, 40, 2366, 458, 47, - /* 1120 */ 45, 44, 43, 42, 1671, 1802, 569, 568, 83, 225, - /* 1130 */ 137, 1559, 406, 1333, 2372, 188, 1584, 1801, 658, 2367, - /* 1140 */ 655, 1616, 571, 570, 1557, 1800, 1332, 111, 500, 1799, - /* 1150 */ 661, 494, 493, 492, 491, 486, 485, 484, 483, 482, - /* 1160 */ 478, 477, 476, 475, 349, 467, 466, 465, 612, 460, - /* 1170 */ 459, 366, 41, 40, 579, 2170, 47, 45, 44, 43, - /* 1180 */ 42, 248, 2202, 74, 1565, 247, 1568, 2170, 81, 80, - /* 1190 */ 448, 203, 706, 200, 2328, 2170, 1316, 1798, 1797, 2170, - /* 1200 */ 1796, 1795, 35, 768, 766, 242, 440, 438, 240, 797, - /* 1210 */ 1794, 507, 1676, 1221, 1222, 629, 670, 348, 2366, 1710, - /* 1220 */ 429, 2220, 165, 427, 423, 419, 416, 441, 1957, 166, - /* 1230 */ 1953, 166, 2170, 84, 705, 2372, 188, 1955, 166, 158, - /* 1240 */ 2367, 655, 580, 2202, 1951, 166, 93, 2170, 2170, 354, - /* 1250 */ 2170, 2170, 379, 706, 607, 2341, 1971, 166, 2156, 261, - /* 1260 */ 2170, 2310, 1703, 629, 1314, 286, 2366, 1703, 2201, 2221, - /* 1270 */ 2237, 260, 696, 112, 2203, 709, 2205, 2206, 704, 609, - /* 1280 */ 699, 608, 2220, 2372, 188, 2386, 1616, 2290, 2367, 655, - /* 1290 */ 1854, 395, 2286, 2170, 1845, 705, 1843, 158, 151, 55, - /* 1300 */ 1560, 150, 1558, 244, 158, 153, 243, 421, 152, 50, - /* 1310 */ 50, 2202, 592, 266, 94, 158, 594, 1567, 597, 1786, - /* 1320 */ 1787, 706, 50, 636, 1907, 292, 1275, 71, 156, 2201, - /* 1330 */ 158, 2237, 1563, 1564, 112, 2203, 709, 2205, 2206, 704, - /* 1340 */ 412, 699, 2079, 1828, 1571, 1837, 2386, 1833, 2290, 2010, - /* 1350 */ 2220, 64, 395, 2286, 14, 13, 2324, 1525, 50, 50, - /* 1360 */ 667, 2170, 281, 705, 1528, 713, 1276, 750, 156, 1739, - /* 1370 */ 1738, 108, 158, 268, 2202, 671, 138, 659, 156, 751, - /* 1380 */ 278, 105, 1482, 5, 706, 297, 2359, 681, 301, 1294, - /* 1390 */ 1359, 662, 415, 1, 363, 792, 420, 2201, 1590, 2237, - /* 1400 */ 2202, 1292, 112, 2203, 709, 2205, 2206, 704, 437, 699, - /* 1410 */ 706, 1677, 2309, 2220, 2386, 195, 2290, 436, 1626, 317, - /* 1420 */ 395, 2286, 196, 439, 2170, 1388, 705, 1661, 1392, 1506, - /* 1430 */ 198, 312, 1399, 455, 1583, 2202, 1397, 209, 161, 2220, - /* 1440 */ 457, 1587, 2080, 461, 463, 706, 498, 1582, 468, 488, - /* 1450 */ 2170, 481, 705, 2072, 490, 506, 497, 499, 508, 509, - /* 1460 */ 2201, 214, 2237, 511, 213, 112, 2203, 709, 2205, 2206, - /* 1470 */ 704, 1588, 699, 216, 2220, 1570, 512, 2386, 514, 2290, - /* 1480 */ 516, 531, 4, 395, 2286, 2170, 2201, 705, 2237, 532, - /* 1490 */ 539, 112, 2203, 709, 2205, 2206, 704, 540, 699, 542, - /* 1500 */ 224, 408, 407, 2386, 2202, 2290, 1585, 543, 226, 395, - /* 1510 */ 2286, 1573, 1589, 544, 706, 1591, 229, 545, 547, 231, - /* 1520 */ 551, 2201, 1640, 2237, 1566, 572, 112, 2203, 709, 2205, - /* 1530 */ 2206, 704, 2202, 699, 88, 89, 235, 114, 2265, 574, - /* 1540 */ 2290, 353, 706, 2220, 395, 2286, 2144, 1958, 239, 2141, - /* 1550 */ 611, 1635, 1954, 241, 2170, 2140, 705, 613, 1956, 1952, - /* 1560 */ 92, 313, 154, 252, 1565, 617, 618, 2202, 616, 1513, - /* 1570 */ 254, 2220, 256, 624, 621, 2325, 633, 706, 643, 679, - /* 1580 */ 639, 385, 2170, 623, 705, 2335, 646, 2340, 2339, 695, - /* 1590 */ 2201, 8, 2237, 652, 264, 112, 2203, 709, 2205, 2206, - /* 1600 */ 704, 622, 699, 2312, 272, 174, 2220, 2263, 267, 2290, - /* 1610 */ 634, 274, 632, 395, 2286, 275, 631, 2170, 2201, 705, - /* 1620 */ 2237, 277, 276, 112, 2203, 709, 2205, 2206, 704, 1703, - /* 1630 */ 699, 386, 2389, 663, 280, 692, 2365, 2290, 1586, 143, - /* 1640 */ 660, 395, 2286, 1708, 2306, 1706, 178, 287, 1592, 191, - /* 1650 */ 98, 2085, 314, 2201, 2202, 2237, 285, 315, 113, 2203, - /* 1660 */ 709, 2205, 2206, 704, 706, 699, 677, 678, 2099, 100, - /* 1670 */ 682, 2098, 2290, 61, 683, 316, 694, 2286, 102, 1969, - /* 1680 */ 1574, 2271, 1569, 104, 2202, 711, 1931, 2097, 319, 391, - /* 1690 */ 2014, 793, 796, 2220, 706, 794, 308, 328, 321, 342, - /* 1700 */ 332, 53, 323, 343, 2170, 2162, 705, 2161, 355, 2160, - /* 1710 */ 356, 78, 1577, 1579, 2157, 417, 418, 1550, 1551, 194, - /* 1720 */ 422, 2155, 424, 2220, 425, 697, 1633, 1634, 1636, 1637, - /* 1730 */ 1638, 1639, 426, 2154, 2170, 364, 705, 2152, 430, 2151, - /* 1740 */ 707, 432, 2237, 434, 1541, 113, 2203, 709, 2205, 2206, - /* 1750 */ 704, 2150, 699, 2131, 197, 2202, 2130, 199, 1509, 2290, - /* 1760 */ 79, 2112, 1508, 358, 2286, 706, 2111, 2110, 446, 447, - /* 1770 */ 2201, 2109, 2237, 2108, 1459, 170, 2203, 709, 2205, 2206, - /* 1780 */ 704, 2062, 699, 452, 453, 2059, 2058, 201, 82, 2057, - /* 1790 */ 2056, 2061, 204, 2060, 2220, 2055, 2054, 2052, 383, 2051, - /* 1800 */ 2050, 206, 2049, 469, 471, 2170, 2065, 705, 2048, 2047, - /* 1810 */ 2046, 2045, 2044, 2202, 2043, 2042, 2041, 2040, 2332, 2039, - /* 1820 */ 2038, 2037, 2036, 706, 2035, 2034, 208, 2202, 2033, 87, - /* 1830 */ 2032, 2031, 2030, 2064, 2029, 2028, 2027, 706, 2026, 2025, - /* 1840 */ 1461, 2201, 501, 2237, 2202, 2024, 341, 2203, 709, 2205, - /* 1850 */ 2206, 704, 2220, 699, 706, 2023, 384, 230, 2106, 1330, - /* 1860 */ 1873, 351, 1334, 2170, 1326, 705, 2220, 215, 1872, 217, - /* 1870 */ 1871, 352, 1869, 1866, 1865, 1858, 517, 2170, 1847, 705, - /* 1880 */ 1823, 1223, 521, 2220, 525, 519, 1822, 523, 218, 527, - /* 1890 */ 2129, 529, 518, 522, 2170, 220, 705, 2119, 182, 2201, - /* 1900 */ 526, 2237, 76, 77, 341, 2203, 709, 2205, 2206, 704, - /* 1910 */ 2107, 699, 2190, 2201, 2202, 2237, 183, 222, 334, 2203, - /* 1920 */ 709, 2205, 2206, 704, 706, 699, 537, 228, 2083, 1947, - /* 1930 */ 2201, 1268, 2237, 2202, 1868, 171, 2203, 709, 2205, 2206, - /* 1940 */ 704, 1864, 699, 703, 552, 553, 554, 1862, 556, 2202, - /* 1950 */ 557, 558, 1860, 2220, 560, 561, 562, 390, 1857, 706, - /* 1960 */ 564, 1842, 566, 651, 2170, 565, 705, 1840, 1841, 1839, - /* 1970 */ 1819, 1949, 2220, 63, 1404, 1403, 238, 1948, 1317, 1315, - /* 1980 */ 1313, 1312, 765, 2170, 1311, 705, 1310, 1304, 2220, 2388, - /* 1990 */ 1309, 1306, 398, 1855, 767, 1305, 376, 1303, 1846, 2170, - /* 2000 */ 2201, 705, 2237, 377, 1844, 341, 2203, 709, 2205, 2206, - /* 2010 */ 704, 378, 699, 598, 595, 1818, 1817, 600, 602, 2201, - /* 2020 */ 2202, 2237, 1816, 604, 340, 2203, 709, 2205, 2206, 704, - /* 2030 */ 706, 699, 615, 2256, 115, 2201, 1539, 2237, 1535, 29, - /* 2040 */ 341, 2203, 709, 2205, 2206, 704, 1537, 699, 1534, 2128, - /* 2050 */ 800, 67, 1515, 57, 1517, 2202, 2118, 1519, 619, 2220, - /* 2060 */ 2105, 620, 2104, 400, 311, 706, 257, 1494, 2371, 625, - /* 2070 */ 2170, 1493, 705, 20, 6, 31, 164, 635, 627, 1756, - /* 2080 */ 180, 21, 263, 7, 637, 2202, 22, 172, 790, 786, - /* 2090 */ 782, 778, 17, 309, 2220, 706, 265, 270, 1737, 269, - /* 2100 */ 32, 271, 2191, 1729, 1776, 2170, 2201, 705, 2237, 95, - /* 2110 */ 33, 341, 2203, 709, 2205, 2206, 704, 23, 699, 65, - /* 2120 */ 24, 1771, 2202, 1777, 2220, 1770, 387, 1775, 1774, 388, - /* 2130 */ 283, 1700, 706, 110, 1699, 2170, 302, 705, 2103, 59, - /* 2140 */ 2082, 610, 58, 2237, 177, 290, 336, 2203, 709, 2205, - /* 2150 */ 2206, 704, 18, 699, 96, 25, 97, 2081, 99, 300, - /* 2160 */ 293, 2220, 291, 1735, 298, 680, 68, 101, 303, 685, - /* 2170 */ 26, 2201, 2170, 2237, 705, 1652, 326, 2203, 709, 2205, - /* 2180 */ 2206, 704, 105, 699, 2202, 11, 1651, 13, 1575, 1662, - /* 2190 */ 2240, 179, 1630, 1628, 706, 192, 710, 1607, 712, 2202, - /* 2200 */ 1627, 1380, 698, 39, 289, 16, 27, 28, 2201, 706, - /* 2210 */ 2237, 288, 1599, 324, 2203, 709, 2205, 2206, 704, 1389, - /* 2220 */ 699, 401, 1386, 2220, 716, 714, 719, 708, 717, 722, - /* 2230 */ 253, 1385, 720, 723, 2170, 1382, 705, 1376, 2220, 725, - /* 2240 */ 1374, 728, 726, 1365, 729, 306, 1379, 1398, 106, 2170, - /* 2250 */ 2202, 705, 107, 75, 1378, 1394, 1266, 735, 1377, 1298, - /* 2260 */ 706, 745, 1297, 1296, 2202, 1295, 1293, 1291, 755, 1290, - /* 2270 */ 2201, 1289, 2237, 1324, 706, 327, 2203, 709, 2205, 2206, - /* 2280 */ 704, 307, 699, 1287, 1286, 2201, 1285, 2237, 1284, 2220, - /* 2290 */ 333, 2203, 709, 2205, 2206, 704, 1863, 699, 1283, 1282, - /* 2300 */ 2170, 1321, 705, 2220, 1281, 1319, 1278, 1277, 1274, 1273, - /* 2310 */ 1272, 1271, 775, 1861, 2170, 2202, 705, 776, 777, 779, - /* 2320 */ 781, 1859, 783, 1856, 785, 706, 787, 780, 789, 784, - /* 2330 */ 1838, 788, 791, 1213, 1815, 795, 2201, 310, 2237, 1561, - /* 2340 */ 320, 337, 2203, 709, 2205, 2206, 704, 798, 699, 799, - /* 2350 */ 2201, 1790, 2237, 1790, 2220, 329, 2203, 709, 2205, 2206, - /* 2360 */ 704, 1790, 699, 1790, 1790, 2170, 1790, 705, 1790, 1790, - /* 2370 */ 1790, 1790, 1790, 1790, 1790, 2202, 1790, 1790, 1790, 1790, - /* 2380 */ 1790, 1790, 1790, 1790, 1790, 706, 1790, 1790, 1790, 1790, - /* 2390 */ 2202, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2400 */ 706, 2201, 1790, 2237, 1790, 1790, 338, 2203, 709, 2205, - /* 2410 */ 2206, 704, 1790, 699, 2220, 1790, 1790, 1790, 1790, 1790, - /* 2420 */ 1790, 1790, 1790, 1790, 1790, 2170, 1790, 705, 1790, 2220, - /* 2430 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2440 */ 2170, 1790, 705, 1790, 1790, 1790, 1790, 1790, 2202, 1790, - /* 2450 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 706, 1790, - /* 2460 */ 1790, 2201, 1790, 2237, 1790, 2202, 330, 2203, 709, 2205, - /* 2470 */ 2206, 704, 1790, 699, 1790, 706, 2201, 1790, 2237, 2202, - /* 2480 */ 1790, 339, 2203, 709, 2205, 2206, 704, 2220, 699, 706, - /* 2490 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 2170, 1790, - /* 2500 */ 705, 1790, 1790, 1790, 2220, 1790, 1790, 1790, 1790, 1790, - /* 2510 */ 1790, 1790, 1790, 1790, 1790, 2170, 2202, 705, 2220, 1790, - /* 2520 */ 1790, 1790, 1790, 1790, 1790, 1790, 706, 1790, 1790, 2170, - /* 2530 */ 1790, 705, 1790, 1790, 2201, 1790, 2237, 2202, 1790, 331, - /* 2540 */ 2203, 709, 2205, 2206, 704, 1790, 699, 706, 1790, 1790, - /* 2550 */ 1790, 2201, 1790, 2237, 1790, 2220, 344, 2203, 709, 2205, - /* 2560 */ 2206, 704, 1790, 699, 1790, 2201, 2170, 2237, 705, 1790, - /* 2570 */ 345, 2203, 709, 2205, 2206, 704, 2220, 699, 1790, 1790, - /* 2580 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 2170, 1790, 705, - /* 2590 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2600 */ 1790, 1790, 2201, 2202, 2237, 1790, 1790, 2214, 2203, 709, - /* 2610 */ 2205, 2206, 704, 706, 699, 1790, 1790, 2202, 1790, 1790, - /* 2620 */ 1790, 1790, 1790, 2201, 1790, 2237, 1790, 706, 2213, 2203, - /* 2630 */ 709, 2205, 2206, 704, 2202, 699, 1790, 1790, 1790, 1790, - /* 2640 */ 1790, 1790, 2220, 1790, 706, 1790, 1790, 1790, 1790, 1790, - /* 2650 */ 1790, 1790, 1790, 2170, 1790, 705, 2220, 1790, 1790, 1790, - /* 2660 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 2170, 1790, 705, - /* 2670 */ 1790, 1790, 1790, 2220, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2680 */ 1790, 1790, 1790, 1790, 2170, 1790, 705, 1790, 1790, 2201, - /* 2690 */ 1790, 2237, 1790, 1790, 2212, 2203, 709, 2205, 2206, 704, - /* 2700 */ 1790, 699, 1790, 2201, 1790, 2237, 1790, 1790, 360, 2203, - /* 2710 */ 709, 2205, 2206, 704, 1790, 699, 1790, 1790, 1790, 1790, - /* 2720 */ 2201, 1790, 2237, 1790, 1790, 361, 2203, 709, 2205, 2206, - /* 2730 */ 704, 1790, 699, 2202, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2740 */ 1790, 1790, 1790, 706, 1790, 1790, 1790, 1790, 1790, 2202, - /* 2750 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 706, - /* 2760 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 2202, 1790, - /* 2770 */ 1790, 1790, 2220, 1790, 1790, 1790, 1790, 1790, 706, 1790, - /* 2780 */ 1790, 1790, 1790, 2170, 1790, 705, 1790, 1790, 2220, 1790, - /* 2790 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 2170, - /* 2800 */ 1790, 705, 1790, 1790, 1790, 1790, 1790, 2220, 1790, 1790, - /* 2810 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 2170, 2201, - /* 2820 */ 705, 2237, 1790, 1790, 357, 2203, 709, 2205, 2206, 704, - /* 2830 */ 1790, 699, 1790, 1790, 1790, 2201, 1790, 2237, 1790, 1790, - /* 2840 */ 362, 2203, 709, 2205, 2206, 704, 1790, 699, 1790, 1790, - /* 2850 */ 1790, 1790, 1790, 1790, 707, 1790, 2237, 1790, 2202, 336, - /* 2860 */ 2203, 709, 2205, 2206, 704, 1790, 699, 1790, 706, 1790, - /* 2870 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2880 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2890 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 2220, 1790, 1790, - /* 2900 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 2170, 1790, - /* 2910 */ 705, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2920 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2930 */ 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, 1790, - /* 2940 */ 1790, 1790, 1790, 1790, 2201, 1790, 2237, 1790, 1790, 335, - /* 2950 */ 2203, 709, 2205, 2206, 704, 1790, 699, + /* 0 */ 455, 2206, 2184, 2095, 537, 693, 1972, 538, 1831, 14, + /* 10 */ 13, 673, 48, 46, 1718, 396, 2192, 1961, 2092, 680, + /* 20 */ 403, 1588, 1563, 41, 40, 135, 2188, 47, 45, 44, + /* 30 */ 43, 42, 577, 1644, 221, 1561, 693, 1972, 540, 2224, + /* 40 */ 1838, 2167, 41, 40, 1588, 350, 47, 45, 44, 43, + /* 50 */ 42, 2174, 1245, 709, 1244, 692, 135, 2184, 2184, 670, + /* 60 */ 144, 1957, 1639, 582, 2190, 400, 545, 140, 19, 538, + /* 70 */ 1831, 1963, 2193, 109, 703, 1569, 408, 670, 144, 2019, + /* 80 */ 2021, 2188, 2188, 363, 1818, 1246, 2095, 2205, 633, 2241, + /* 90 */ 145, 2370, 112, 2207, 713, 2209, 2210, 708, 1964, 703, + /* 100 */ 801, 2093, 680, 15, 185, 169, 2294, 1807, 2376, 188, + /* 110 */ 399, 2290, 1687, 2371, 659, 181, 48, 46, 692, 2190, + /* 120 */ 2190, 1590, 693, 1972, 403, 190, 1563, 1673, 1379, 703, + /* 130 */ 703, 38, 308, 2324, 2174, 371, 2078, 1644, 51, 1561, + /* 140 */ 1646, 1647, 193, 2309, 1370, 738, 737, 736, 1374, 735, + /* 150 */ 1376, 1377, 734, 731, 181, 1385, 728, 1387, 1388, 725, + /* 160 */ 722, 719, 672, 186, 2302, 2303, 1639, 142, 2307, 2306, + /* 170 */ 1619, 1629, 19, 1588, 223, 2079, 1645, 1648, 540, 1569, + /* 180 */ 1838, 286, 2302, 669, 1674, 136, 668, 1589, 2370, 693, + /* 190 */ 1972, 1564, 125, 1562, 1620, 124, 123, 122, 121, 120, + /* 200 */ 119, 118, 117, 116, 801, 657, 188, 15, 2206, 56, + /* 210 */ 2371, 659, 47, 45, 44, 43, 42, 1788, 710, 2020, + /* 220 */ 2021, 1591, 692, 1567, 1568, 1795, 1618, 1621, 1622, 1623, + /* 230 */ 1624, 1625, 1626, 1627, 1628, 705, 701, 1637, 1638, 1640, + /* 240 */ 1641, 1642, 1643, 2, 1646, 1647, 2224, 184, 678, 134, + /* 250 */ 133, 132, 131, 130, 129, 128, 127, 126, 2174, 2013, + /* 260 */ 709, 1796, 37, 401, 1668, 1669, 1670, 1671, 1672, 1676, + /* 270 */ 1677, 1678, 1679, 288, 1619, 1629, 168, 1588, 693, 1972, + /* 280 */ 1645, 1648, 125, 554, 1913, 124, 123, 122, 121, 120, + /* 290 */ 119, 118, 117, 116, 2205, 1564, 2241, 1562, 453, 112, + /* 300 */ 2207, 713, 2209, 2210, 708, 51, 703, 1414, 1415, 147, + /* 310 */ 679, 151, 2265, 2294, 2026, 2206, 1322, 399, 2290, 1793, + /* 320 */ 1787, 384, 252, 1472, 1473, 673, 251, 1567, 1568, 2024, + /* 330 */ 1618, 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 705, + /* 340 */ 701, 1637, 1638, 1640, 1641, 1642, 1643, 2, 12, 48, + /* 350 */ 46, 2026, 2067, 2224, 693, 1972, 1324, 403, 393, 1563, + /* 360 */ 62, 1715, 552, 406, 2088, 2174, 2024, 709, 460, 2074, + /* 370 */ 1644, 163, 1561, 203, 454, 1220, 41, 40, 385, 1974, + /* 380 */ 47, 45, 44, 43, 42, 653, 2024, 93, 1591, 679, + /* 390 */ 358, 458, 418, 383, 2206, 611, 542, 417, 1245, 1639, + /* 400 */ 1244, 2205, 539, 2241, 707, 19, 112, 2207, 713, 2209, + /* 410 */ 2210, 708, 1569, 703, 1222, 202, 1225, 1226, 185, 1746, + /* 420 */ 2294, 2026, 41, 40, 399, 2290, 47, 45, 44, 43, + /* 430 */ 42, 1246, 2224, 2375, 466, 2074, 2025, 801, 652, 633, + /* 440 */ 15, 677, 2370, 2088, 2174, 1675, 709, 2325, 1817, 66, + /* 450 */ 1590, 2374, 449, 48, 46, 1649, 1572, 448, 30, 2376, + /* 460 */ 188, 403, 290, 1563, 2371, 659, 2224, 645, 644, 1744, + /* 470 */ 1745, 1747, 1748, 1749, 1644, 166, 1561, 1646, 1647, 62, + /* 480 */ 2205, 205, 2241, 1975, 376, 344, 2207, 713, 2209, 2210, + /* 490 */ 708, 706, 703, 694, 2259, 1722, 493, 2074, 2174, 633, + /* 500 */ 2206, 1588, 2370, 1639, 1248, 1249, 658, 1619, 1629, 2370, + /* 510 */ 710, 573, 572, 1645, 1648, 648, 1569, 290, 1758, 2376, + /* 520 */ 188, 651, 2026, 35, 2371, 659, 657, 188, 1564, 369, + /* 530 */ 1562, 2371, 659, 1680, 1781, 679, 1654, 2024, 2224, 2026, + /* 540 */ 266, 801, 1588, 210, 49, 750, 398, 2206, 62, 12, + /* 550 */ 2174, 10, 709, 377, 2024, 375, 374, 710, 579, 1840, + /* 560 */ 1567, 1568, 581, 1618, 1621, 1622, 1623, 1624, 1625, 1626, + /* 570 */ 1627, 1628, 705, 701, 1637, 1638, 1640, 1641, 1642, 1643, + /* 580 */ 2, 1646, 1647, 2057, 580, 2224, 2205, 688, 2241, 2088, + /* 590 */ 618, 113, 2207, 713, 2209, 2210, 708, 2174, 703, 709, + /* 600 */ 609, 658, 288, 90, 2370, 2294, 654, 649, 642, 2293, + /* 610 */ 2290, 1619, 1629, 607, 1575, 605, 632, 1645, 1648, 1714, + /* 620 */ 373, 657, 188, 207, 693, 1972, 2371, 659, 154, 1967, + /* 630 */ 412, 411, 1564, 2205, 1562, 2241, 290, 12, 112, 2207, + /* 640 */ 713, 2209, 2210, 708, 468, 703, 146, 1589, 34, 2265, + /* 650 */ 2390, 1620, 2294, 1570, 41, 40, 399, 2290, 47, 45, + /* 660 */ 44, 43, 42, 86, 1567, 1568, 85, 1618, 1621, 1622, + /* 670 */ 1623, 1624, 1625, 1626, 1627, 1628, 705, 701, 1637, 1638, + /* 680 */ 1640, 1641, 1642, 1643, 2, 48, 46, 2168, 55, 2206, + /* 690 */ 1949, 1563, 1620, 403, 1333, 1563, 693, 1972, 1569, 710, + /* 700 */ 2206, 397, 693, 1972, 1561, 290, 1644, 1332, 1561, 166, + /* 710 */ 710, 2026, 595, 594, 593, 741, 483, 1974, 407, 585, + /* 720 */ 141, 589, 484, 693, 1972, 588, 2024, 2224, 52, 661, + /* 730 */ 587, 592, 379, 378, 633, 1639, 586, 2370, 2224, 2174, + /* 740 */ 60, 709, 478, 553, 1569, 253, 500, 630, 1569, 1914, + /* 750 */ 2174, 477, 709, 1337, 2376, 188, 760, 41, 40, 2371, + /* 760 */ 659, 47, 45, 44, 43, 42, 1336, 1489, 1490, 801, + /* 770 */ 670, 144, 509, 801, 437, 2205, 49, 2241, 670, 144, + /* 780 */ 170, 2207, 713, 2209, 2210, 708, 2205, 703, 2241, 48, + /* 790 */ 46, 170, 2207, 713, 2209, 2210, 708, 403, 703, 1563, + /* 800 */ 1228, 439, 435, 1488, 1491, 748, 1587, 212, 211, 534, + /* 810 */ 1644, 1573, 1561, 1646, 1647, 1534, 1535, 532, 693, 1972, + /* 820 */ 528, 524, 634, 2335, 156, 155, 745, 744, 743, 153, + /* 830 */ 499, 511, 406, 1959, 2336, 748, 299, 300, 676, 1639, + /* 840 */ 166, 298, 2375, 1619, 1629, 2370, 575, 574, 1974, 1645, + /* 850 */ 1648, 1874, 1569, 1757, 156, 155, 745, 744, 743, 153, + /* 860 */ 1564, 108, 1562, 2374, 1564, 1955, 1562, 2371, 2373, 2375, + /* 870 */ 1816, 105, 2370, 62, 187, 2302, 2303, 801, 142, 2307, + /* 880 */ 15, 2206, 189, 2302, 2303, 290, 142, 2307, 591, 590, + /* 890 */ 2374, 710, 1567, 1568, 2371, 2372, 1567, 1568, 1948, 1618, + /* 900 */ 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 705, 701, + /* 910 */ 1637, 1638, 1640, 1641, 1642, 1643, 2, 1646, 1647, 2224, + /* 920 */ 2174, 595, 594, 593, 693, 1972, 693, 1972, 585, 141, + /* 930 */ 589, 2174, 1815, 709, 588, 600, 44, 43, 42, 587, + /* 940 */ 592, 379, 378, 740, 1969, 586, 255, 1619, 1629, 1814, + /* 950 */ 610, 41, 40, 1645, 1648, 47, 45, 44, 43, 42, + /* 960 */ 447, 695, 446, 2266, 250, 750, 259, 2205, 1564, 2241, + /* 970 */ 1562, 103, 113, 2207, 713, 2209, 2210, 708, 704, 703, + /* 980 */ 603, 409, 2174, 1225, 1226, 1813, 2294, 597, 1947, 166, + /* 990 */ 698, 2290, 445, 249, 616, 2309, 1965, 1974, 1812, 2174, + /* 1000 */ 1567, 1568, 1871, 1618, 1621, 1622, 1623, 1624, 1625, 1626, + /* 1010 */ 1627, 1628, 705, 701, 1637, 1638, 1640, 1641, 1642, 1643, + /* 1020 */ 2, 2305, 354, 167, 1586, 693, 1972, 1811, 329, 742, + /* 1030 */ 290, 491, 2017, 70, 507, 2174, 69, 506, 693, 1972, + /* 1040 */ 2157, 633, 326, 73, 2370, 263, 72, 1734, 2174, 1810, + /* 1050 */ 1809, 1806, 1805, 474, 1804, 508, 9, 351, 303, 1803, + /* 1060 */ 476, 2376, 188, 772, 770, 1802, 2371, 659, 219, 519, + /* 1070 */ 517, 514, 778, 777, 776, 775, 415, 2174, 774, 773, + /* 1080 */ 148, 768, 767, 766, 765, 764, 763, 762, 158, 758, + /* 1090 */ 757, 756, 414, 413, 753, 752, 751, 176, 175, 2174, + /* 1100 */ 2174, 2174, 2174, 748, 2174, 237, 372, 746, 62, 2174, + /* 1110 */ 2017, 662, 2309, 693, 1972, 2174, 1591, 747, 462, 90, + /* 1120 */ 2017, 173, 156, 155, 745, 744, 743, 153, 581, 571, + /* 1130 */ 567, 563, 559, 690, 236, 41, 40, 1801, 2304, 47, + /* 1140 */ 45, 44, 43, 42, 1800, 1968, 322, 111, 504, 2003, + /* 1150 */ 580, 498, 497, 496, 495, 490, 489, 488, 487, 486, + /* 1160 */ 482, 481, 480, 479, 353, 471, 470, 469, 674, 464, + /* 1170 */ 463, 370, 36, 2139, 91, 693, 1972, 234, 41, 40, + /* 1180 */ 693, 1972, 47, 45, 44, 43, 42, 2174, 81, 80, + /* 1190 */ 452, 700, 2206, 200, 2174, 691, 693, 1972, 1799, 697, + /* 1200 */ 309, 2266, 710, 1950, 2332, 761, 444, 442, 1934, 2314, + /* 1210 */ 1707, 583, 584, 1798, 74, 633, 410, 352, 2370, 54, + /* 1220 */ 433, 3, 254, 431, 427, 423, 420, 445, 1858, 83, + /* 1230 */ 2224, 137, 1571, 1320, 1318, 2376, 188, 665, 154, 2206, + /* 1240 */ 2371, 659, 2174, 2160, 709, 233, 227, 149, 2174, 710, + /* 1250 */ 596, 2345, 232, 550, 41, 40, 1808, 432, 47, 45, + /* 1260 */ 44, 43, 42, 2174, 84, 290, 154, 242, 265, 244, + /* 1270 */ 240, 225, 243, 613, 264, 612, 1707, 2224, 2205, 246, + /* 1280 */ 2241, 1849, 245, 112, 2207, 713, 2209, 2210, 708, 2174, + /* 1290 */ 703, 709, 425, 248, 1847, 2390, 247, 2294, 1529, 50, + /* 1300 */ 50, 399, 2290, 598, 270, 1790, 1791, 154, 50, 296, + /* 1310 */ 71, 152, 154, 14, 13, 1841, 601, 94, 64, 754, + /* 1320 */ 50, 1279, 262, 50, 717, 2205, 1532, 2241, 152, 2195, + /* 1330 */ 112, 2207, 713, 2209, 2210, 708, 154, 703, 2338, 138, + /* 1340 */ 152, 1298, 2390, 2206, 2294, 283, 1665, 646, 399, 2290, + /* 1350 */ 663, 139, 277, 710, 755, 640, 412, 411, 1912, 1743, + /* 1360 */ 1742, 1280, 1911, 2206, 272, 796, 1577, 675, 1486, 301, + /* 1370 */ 685, 305, 1363, 710, 386, 2363, 1296, 1644, 1681, 1570, + /* 1380 */ 1630, 2224, 416, 321, 1392, 2197, 2225, 2083, 1396, 1832, + /* 1390 */ 1574, 2014, 285, 2174, 1837, 709, 1403, 2328, 671, 1401, + /* 1400 */ 157, 2224, 282, 5, 1, 419, 1639, 424, 367, 1594, + /* 1410 */ 440, 441, 2206, 2174, 195, 709, 196, 198, 165, 1569, + /* 1420 */ 443, 1510, 710, 316, 2313, 1587, 459, 209, 461, 2205, + /* 1430 */ 1591, 2241, 2206, 2084, 112, 2207, 713, 2209, 2210, 708, + /* 1440 */ 465, 703, 710, 467, 699, 472, 2390, 1586, 2294, 2205, + /* 1450 */ 2224, 2241, 399, 2290, 112, 2207, 713, 2209, 2210, 708, + /* 1460 */ 502, 703, 2174, 485, 709, 492, 2390, 2076, 2294, 512, + /* 1470 */ 2224, 513, 399, 2290, 494, 501, 503, 510, 666, 214, + /* 1480 */ 213, 515, 2174, 516, 709, 216, 518, 520, 1592, 535, + /* 1490 */ 4, 536, 543, 546, 544, 1589, 547, 224, 2205, 226, + /* 1500 */ 2241, 2206, 1593, 112, 2207, 713, 2209, 2210, 708, 548, + /* 1510 */ 703, 710, 1595, 549, 229, 2390, 551, 2294, 2205, 555, + /* 1520 */ 2241, 399, 2290, 171, 2207, 713, 2209, 2210, 708, 231, + /* 1530 */ 703, 88, 576, 89, 235, 1578, 114, 1573, 578, 2224, + /* 1540 */ 357, 1962, 2148, 2145, 239, 2144, 1958, 241, 615, 92, + /* 1550 */ 2206, 2174, 617, 709, 150, 159, 160, 621, 1960, 1956, + /* 1560 */ 710, 161, 162, 317, 256, 622, 620, 1581, 1583, 258, + /* 1570 */ 1517, 260, 628, 647, 625, 637, 660, 2391, 2344, 683, + /* 1580 */ 701, 1637, 1638, 1640, 1641, 1642, 1643, 2205, 2224, 2241, + /* 1590 */ 2343, 2329, 112, 2207, 713, 2209, 2210, 708, 268, 703, + /* 1600 */ 2174, 643, 709, 626, 2269, 627, 2294, 2339, 271, 389, + /* 1610 */ 399, 2290, 650, 8, 638, 2316, 656, 635, 636, 276, + /* 1620 */ 2206, 2393, 174, 281, 278, 279, 667, 390, 664, 143, + /* 1630 */ 710, 1707, 1590, 1712, 2310, 1710, 2205, 1596, 2241, 2089, + /* 1640 */ 2206, 112, 2207, 713, 2209, 2210, 708, 291, 703, 318, + /* 1650 */ 710, 98, 178, 2267, 681, 2294, 319, 280, 2224, 399, + /* 1660 */ 2290, 682, 2103, 2102, 2101, 395, 100, 686, 1973, 102, + /* 1670 */ 2174, 191, 709, 320, 289, 61, 2275, 284, 2224, 687, + /* 1680 */ 104, 323, 2018, 2369, 715, 312, 797, 1935, 798, 800, + /* 1690 */ 2174, 325, 709, 359, 332, 346, 360, 336, 2166, 53, + /* 1700 */ 2165, 327, 2164, 78, 2161, 421, 2205, 422, 2241, 2206, + /* 1710 */ 347, 112, 2207, 713, 2209, 2210, 708, 1554, 703, 710, + /* 1720 */ 1555, 194, 426, 696, 2159, 2294, 711, 428, 2241, 399, + /* 1730 */ 2290, 113, 2207, 713, 2209, 2210, 708, 430, 703, 2158, + /* 1740 */ 429, 368, 2156, 434, 2206, 2294, 2155, 2224, 436, 362, + /* 1750 */ 2290, 2154, 438, 1545, 710, 2135, 197, 2134, 199, 2174, + /* 1760 */ 79, 709, 1513, 2116, 1512, 2115, 2114, 450, 451, 2113, + /* 1770 */ 2112, 2066, 1463, 456, 2206, 2063, 457, 201, 2062, 82, + /* 1780 */ 2061, 2060, 2224, 2065, 710, 2064, 2059, 387, 204, 2058, + /* 1790 */ 2056, 2055, 2054, 206, 2174, 2205, 709, 2241, 2053, 473, + /* 1800 */ 113, 2207, 713, 2209, 2210, 708, 475, 703, 2069, 2052, + /* 1810 */ 2051, 2206, 2224, 2050, 2294, 2049, 2048, 388, 2047, 2291, + /* 1820 */ 2046, 710, 2045, 2044, 2174, 2043, 709, 2042, 2041, 2040, + /* 1830 */ 2205, 2039, 2241, 2038, 208, 345, 2207, 713, 2209, 2210, + /* 1840 */ 708, 2206, 703, 2037, 87, 2036, 2035, 2034, 2068, 2224, + /* 1850 */ 2033, 710, 2032, 2031, 1465, 2030, 2029, 505, 2028, 2027, + /* 1860 */ 2205, 2174, 2241, 709, 1334, 345, 2207, 713, 2209, 2210, + /* 1870 */ 708, 1338, 703, 2206, 355, 1877, 215, 1876, 356, 2224, + /* 1880 */ 1875, 217, 1873, 710, 1870, 522, 1330, 1869, 526, 521, + /* 1890 */ 1862, 2174, 525, 709, 1851, 529, 218, 2205, 1827, 2241, + /* 1900 */ 533, 523, 338, 2207, 713, 2209, 2210, 708, 527, 703, + /* 1910 */ 2206, 2224, 530, 531, 220, 76, 394, 182, 2194, 1227, + /* 1920 */ 707, 1826, 77, 2174, 2133, 709, 183, 2205, 541, 2241, + /* 1930 */ 2123, 222, 171, 2207, 713, 2209, 2210, 708, 2111, 703, + /* 1940 */ 2206, 228, 230, 2110, 2087, 1951, 1872, 655, 2224, 1868, + /* 1950 */ 710, 556, 557, 558, 1272, 1866, 561, 560, 562, 2205, + /* 1960 */ 2174, 2241, 709, 619, 345, 2207, 713, 2209, 2210, 708, + /* 1970 */ 1864, 703, 564, 566, 565, 1861, 569, 568, 2224, 570, + /* 1980 */ 1846, 804, 1844, 402, 1845, 1843, 2392, 2206, 1823, 1953, + /* 1990 */ 2174, 1408, 709, 1407, 1952, 315, 2205, 710, 2241, 238, + /* 2000 */ 63, 344, 2207, 713, 2209, 2210, 708, 1321, 703, 1319, + /* 2010 */ 2260, 180, 1317, 2206, 1316, 1308, 1315, 769, 1314, 794, + /* 2020 */ 790, 786, 782, 710, 313, 2224, 2205, 1313, 2241, 1859, + /* 2030 */ 404, 345, 2207, 713, 2209, 2210, 708, 2174, 703, 709, + /* 2040 */ 771, 1310, 1309, 1307, 380, 1850, 381, 1848, 599, 382, + /* 2050 */ 602, 2224, 1822, 604, 1821, 606, 1820, 608, 115, 2132, + /* 2060 */ 1539, 1541, 1543, 2174, 110, 709, 29, 306, 1538, 57, + /* 2070 */ 67, 1519, 1521, 2205, 2206, 2241, 1523, 2122, 345, 2207, + /* 2080 */ 713, 2209, 2210, 708, 710, 703, 164, 2206, 623, 624, + /* 2090 */ 2109, 2108, 261, 629, 31, 1498, 2375, 710, 1497, 614, + /* 2100 */ 689, 2241, 20, 17, 340, 2207, 713, 2209, 2210, 708, + /* 2110 */ 631, 703, 2224, 1760, 267, 6, 7, 639, 641, 21, + /* 2120 */ 22, 269, 274, 33, 2174, 2224, 709, 1741, 275, 2195, + /* 2130 */ 65, 172, 23, 273, 1775, 293, 1733, 2174, 2206, 709, + /* 2140 */ 32, 24, 292, 95, 1774, 1780, 1781, 391, 710, 1779, + /* 2150 */ 1778, 18, 392, 1704, 2206, 1703, 2107, 287, 58, 2086, + /* 2160 */ 2205, 257, 2241, 59, 710, 330, 2207, 713, 2209, 2210, + /* 2170 */ 708, 177, 703, 2205, 96, 2241, 2224, 97, 328, 2207, + /* 2180 */ 713, 2209, 2210, 708, 294, 703, 25, 297, 2174, 295, + /* 2190 */ 709, 1739, 2224, 2085, 99, 302, 684, 68, 101, 105, + /* 2200 */ 307, 26, 11, 2206, 2174, 1656, 709, 304, 1655, 13, + /* 2210 */ 1579, 2244, 179, 710, 1611, 1634, 702, 192, 1666, 714, + /* 2220 */ 1632, 39, 716, 16, 2205, 1631, 2241, 1603, 27, 331, + /* 2230 */ 2207, 713, 2209, 2210, 708, 712, 703, 28, 405, 1393, + /* 2240 */ 2205, 2224, 2241, 718, 720, 337, 2207, 713, 2209, 2210, + /* 2250 */ 708, 1390, 703, 2174, 2206, 709, 1389, 721, 723, 726, + /* 2260 */ 729, 724, 732, 727, 710, 1386, 1380, 730, 1384, 733, + /* 2270 */ 2206, 1383, 1378, 1369, 1382, 1381, 106, 310, 739, 107, + /* 2280 */ 710, 1402, 75, 2206, 1398, 1270, 749, 1302, 1301, 2205, + /* 2290 */ 1300, 2241, 2224, 710, 341, 2207, 713, 2209, 2210, 708, + /* 2300 */ 1299, 703, 1297, 2206, 2174, 1295, 709, 1294, 2224, 1293, + /* 2310 */ 1328, 759, 311, 710, 1291, 1290, 1325, 1289, 1288, 1287, + /* 2320 */ 2174, 2224, 709, 1286, 1285, 1323, 1282, 1281, 1278, 1276, + /* 2330 */ 1277, 1867, 1275, 2174, 779, 709, 780, 781, 1865, 783, + /* 2340 */ 2205, 2224, 2241, 1863, 787, 333, 2207, 713, 2209, 2210, + /* 2350 */ 708, 784, 703, 2174, 785, 709, 2205, 788, 2241, 789, + /* 2360 */ 1860, 342, 2207, 713, 2209, 2210, 708, 791, 703, 2205, + /* 2370 */ 792, 2241, 793, 2206, 334, 2207, 713, 2209, 2210, 708, + /* 2380 */ 1842, 703, 795, 710, 1217, 1819, 314, 799, 802, 2205, + /* 2390 */ 1565, 2241, 324, 803, 343, 2207, 713, 2209, 2210, 708, + /* 2400 */ 1794, 703, 1794, 1794, 1794, 1794, 2206, 1794, 1794, 1794, + /* 2410 */ 1794, 2224, 1794, 1794, 1794, 1794, 710, 1794, 1794, 1794, + /* 2420 */ 1794, 1794, 2206, 2174, 1794, 709, 1794, 1794, 1794, 1794, + /* 2430 */ 1794, 1794, 710, 1794, 1794, 1794, 1794, 1794, 1794, 1794, + /* 2440 */ 1794, 1794, 1794, 2206, 2224, 1794, 1794, 1794, 1794, 1794, + /* 2450 */ 1794, 1794, 1794, 710, 1794, 1794, 2174, 1794, 709, 2205, + /* 2460 */ 2224, 2241, 1794, 1794, 335, 2207, 713, 2209, 2210, 708, + /* 2470 */ 1794, 703, 2174, 1794, 709, 1794, 1794, 1794, 1794, 1794, + /* 2480 */ 1794, 2224, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, + /* 2490 */ 1794, 1794, 2205, 2174, 2241, 709, 1794, 348, 2207, 713, + /* 2500 */ 2209, 2210, 708, 1794, 703, 1794, 1794, 1794, 2205, 2206, + /* 2510 */ 2241, 1794, 1794, 349, 2207, 713, 2209, 2210, 708, 710, + /* 2520 */ 703, 1794, 2206, 1794, 1794, 1794, 1794, 1794, 1794, 2205, + /* 2530 */ 1794, 2241, 710, 2206, 2218, 2207, 713, 2209, 2210, 708, + /* 2540 */ 1794, 703, 1794, 710, 1794, 1794, 2206, 2224, 1794, 1794, + /* 2550 */ 1794, 1794, 1794, 1794, 1794, 1794, 710, 1794, 1794, 2174, + /* 2560 */ 2224, 709, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, + /* 2570 */ 1794, 2224, 2174, 1794, 709, 1794, 1794, 1794, 1794, 1794, + /* 2580 */ 1794, 1794, 1794, 2174, 2224, 709, 1794, 1794, 1794, 1794, + /* 2590 */ 1794, 1794, 1794, 1794, 1794, 2205, 2174, 2241, 709, 1794, + /* 2600 */ 2217, 2207, 713, 2209, 2210, 708, 1794, 703, 2205, 1794, + /* 2610 */ 2241, 1794, 1794, 2216, 2207, 713, 2209, 2210, 708, 2205, + /* 2620 */ 703, 2241, 1794, 2206, 364, 2207, 713, 2209, 2210, 708, + /* 2630 */ 1794, 703, 2205, 710, 2241, 1794, 2206, 365, 2207, 713, + /* 2640 */ 2209, 2210, 708, 1794, 703, 1794, 710, 2206, 1794, 1794, + /* 2650 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 710, 1794, 1794, + /* 2660 */ 1794, 2224, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, + /* 2670 */ 1794, 1794, 1794, 2174, 2224, 709, 1794, 1794, 1794, 1794, + /* 2680 */ 1794, 1794, 1794, 1794, 1794, 2224, 2174, 1794, 709, 1794, + /* 2690 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 2174, 2206, 709, + /* 2700 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 710, 2205, + /* 2710 */ 1794, 2241, 1794, 1794, 361, 2207, 713, 2209, 2210, 708, + /* 2720 */ 1794, 703, 2205, 1794, 2241, 1794, 1794, 366, 2207, 713, + /* 2730 */ 2209, 2210, 708, 711, 703, 2241, 2224, 1794, 340, 2207, + /* 2740 */ 713, 2209, 2210, 708, 1794, 703, 1794, 1794, 2174, 1794, + /* 2750 */ 709, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, + /* 2760 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, + /* 2770 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, + /* 2780 */ 1794, 1794, 1794, 1794, 2205, 1794, 2241, 1794, 1794, 339, + /* 2790 */ 2207, 713, 2209, 2210, 708, 1794, 703, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 388, 342, 368, 394, 389, 351, 352, 392, 4, 448, - /* 10 */ 449, 352, 12, 13, 14, 406, 382, 0, 409, 410, - /* 20 */ 20, 388, 22, 8, 9, 371, 392, 12, 13, 14, - /* 30 */ 15, 16, 378, 33, 381, 35, 351, 352, 8, 9, - /* 40 */ 381, 412, 12, 13, 14, 15, 16, 43, 395, 45, - /* 50 */ 46, 392, 20, 394, 22, 20, 371, 368, 368, 351, - /* 60 */ 352, 44, 62, 378, 430, 431, 346, 35, 68, 349, - /* 70 */ 350, 382, 382, 351, 440, 75, 346, 351, 352, 349, - /* 80 */ 350, 392, 392, 68, 381, 53, 20, 428, 459, 430, - /* 90 */ 387, 462, 433, 434, 435, 436, 437, 438, 395, 440, - /* 100 */ 100, 351, 352, 103, 445, 376, 447, 394, 479, 480, - /* 110 */ 451, 452, 0, 484, 485, 381, 12, 13, 396, 430, - /* 120 */ 430, 371, 409, 410, 20, 466, 22, 112, 100, 440, - /* 130 */ 440, 20, 347, 474, 400, 401, 351, 33, 353, 35, - /* 140 */ 140, 141, 351, 352, 116, 117, 118, 119, 120, 121, - /* 150 */ 122, 123, 124, 125, 425, 127, 128, 129, 130, 131, - /* 160 */ 132, 133, 454, 455, 456, 457, 62, 459, 460, 103, - /* 170 */ 170, 171, 68, 341, 347, 343, 176, 177, 351, 75, - /* 180 */ 353, 455, 456, 457, 169, 459, 460, 20, 462, 398, - /* 190 */ 20, 191, 21, 193, 103, 24, 25, 26, 27, 28, - /* 200 */ 29, 30, 31, 32, 100, 479, 480, 103, 342, 49, - /* 210 */ 484, 485, 103, 183, 103, 351, 352, 57, 352, 20, - /* 220 */ 60, 61, 134, 223, 224, 0, 226, 227, 228, 229, + /* 0 */ 351, 342, 368, 394, 346, 351, 352, 349, 350, 1, + /* 10 */ 2, 352, 12, 13, 14, 406, 382, 381, 409, 410, + /* 20 */ 20, 20, 22, 8, 9, 371, 392, 12, 13, 14, + /* 30 */ 15, 16, 378, 33, 347, 35, 351, 352, 351, 380, + /* 40 */ 353, 412, 8, 9, 20, 396, 12, 13, 14, 15, + /* 50 */ 16, 392, 20, 394, 22, 20, 371, 368, 368, 351, + /* 60 */ 352, 381, 62, 378, 430, 431, 346, 35, 68, 349, + /* 70 */ 350, 382, 382, 358, 440, 75, 390, 351, 352, 393, + /* 80 */ 394, 392, 392, 68, 342, 53, 394, 428, 459, 430, + /* 90 */ 375, 462, 433, 434, 435, 436, 437, 438, 383, 440, + /* 100 */ 100, 409, 410, 103, 445, 341, 447, 343, 479, 480, + /* 110 */ 451, 452, 104, 484, 485, 380, 12, 13, 20, 430, + /* 120 */ 430, 20, 351, 352, 20, 466, 22, 112, 100, 440, + /* 130 */ 440, 448, 449, 474, 392, 400, 401, 33, 103, 35, + /* 140 */ 140, 141, 371, 432, 116, 117, 118, 119, 120, 121, + /* 150 */ 122, 123, 124, 125, 380, 127, 128, 129, 130, 131, + /* 160 */ 132, 133, 454, 455, 456, 457, 62, 459, 460, 458, + /* 170 */ 170, 171, 68, 20, 347, 401, 176, 177, 351, 75, + /* 180 */ 353, 455, 456, 457, 169, 459, 460, 20, 462, 351, + /* 190 */ 352, 191, 21, 193, 170, 24, 25, 26, 27, 28, + /* 200 */ 29, 30, 31, 32, 100, 479, 480, 103, 342, 371, + /* 210 */ 484, 485, 12, 13, 14, 15, 16, 183, 352, 393, + /* 220 */ 394, 20, 20, 223, 224, 0, 226, 227, 228, 229, /* 230 */ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - /* 240 */ 240, 241, 242, 243, 140, 141, 21, 381, 67, 24, - /* 250 */ 25, 26, 27, 28, 29, 30, 31, 32, 392, 0, - /* 260 */ 394, 4, 247, 248, 249, 250, 251, 252, 253, 254, - /* 270 */ 255, 256, 257, 390, 170, 171, 393, 394, 351, 352, - /* 280 */ 176, 177, 20, 24, 25, 26, 27, 28, 29, 30, - /* 290 */ 31, 32, 204, 205, 428, 191, 430, 193, 371, 433, - /* 300 */ 434, 435, 436, 437, 438, 175, 440, 140, 141, 443, - /* 310 */ 20, 445, 446, 447, 67, 342, 286, 451, 452, 455, - /* 320 */ 456, 457, 20, 459, 460, 352, 260, 223, 224, 217, + /* 240 */ 240, 241, 242, 243, 140, 141, 380, 379, 20, 24, + /* 250 */ 25, 26, 27, 28, 29, 30, 31, 32, 392, 391, + /* 260 */ 394, 0, 247, 248, 249, 250, 251, 252, 253, 254, + /* 270 */ 255, 256, 257, 172, 170, 171, 361, 20, 351, 352, + /* 280 */ 176, 177, 21, 67, 369, 24, 25, 26, 27, 28, + /* 290 */ 29, 30, 31, 32, 428, 191, 430, 193, 371, 433, + /* 300 */ 434, 435, 436, 437, 438, 103, 440, 140, 141, 443, + /* 310 */ 351, 445, 446, 447, 380, 342, 35, 451, 452, 339, + /* 320 */ 286, 387, 135, 170, 171, 352, 139, 223, 224, 395, /* 330 */ 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, /* 340 */ 236, 237, 238, 239, 240, 241, 242, 243, 244, 12, - /* 350 */ 13, 260, 459, 372, 381, 462, 361, 20, 37, 22, - /* 360 */ 103, 380, 381, 379, 369, 392, 342, 394, 387, 260, - /* 370 */ 33, 260, 35, 480, 351, 391, 395, 484, 485, 8, - /* 380 */ 9, 84, 114, 12, 13, 14, 15, 16, 351, 352, - /* 390 */ 75, 20, 351, 352, 342, 244, 266, 267, 268, 62, - /* 400 */ 20, 428, 114, 430, 352, 68, 433, 434, 435, 436, - /* 410 */ 437, 438, 75, 440, 351, 352, 392, 342, 445, 75, - /* 420 */ 447, 351, 352, 4, 451, 452, 403, 106, 405, 108, - /* 430 */ 109, 432, 111, 381, 371, 398, 115, 100, 19, 358, - /* 440 */ 103, 371, 145, 146, 392, 381, 394, 474, 0, 351, - /* 450 */ 352, 387, 33, 12, 13, 14, 375, 458, 137, 395, - /* 460 */ 342, 20, 172, 22, 383, 168, 352, 392, 49, 371, - /* 470 */ 352, 35, 170, 171, 33, 56, 35, 140, 141, 342, - /* 480 */ 428, 62, 430, 103, 342, 433, 434, 435, 436, 437, - /* 490 */ 438, 439, 440, 441, 442, 381, 455, 456, 457, 381, - /* 500 */ 459, 460, 381, 62, 244, 186, 246, 170, 171, 14, - /* 510 */ 392, 75, 394, 176, 177, 20, 75, 260, 70, 71, - /* 520 */ 72, 102, 401, 3, 105, 77, 78, 79, 191, 392, - /* 530 */ 193, 83, 213, 214, 392, 351, 88, 89, 90, 91, - /* 540 */ 20, 100, 94, 172, 103, 342, 428, 342, 430, 435, - /* 550 */ 0, 433, 434, 435, 436, 437, 438, 352, 440, 354, - /* 560 */ 223, 224, 360, 226, 227, 228, 229, 230, 231, 232, + /* 350 */ 13, 380, 0, 380, 351, 352, 75, 20, 387, 22, + /* 360 */ 103, 4, 403, 372, 405, 392, 395, 394, 351, 352, + /* 370 */ 33, 380, 35, 172, 371, 4, 8, 9, 387, 388, + /* 380 */ 12, 13, 14, 15, 16, 20, 395, 200, 20, 351, + /* 390 */ 203, 39, 412, 206, 342, 208, 14, 417, 20, 62, + /* 400 */ 22, 428, 20, 430, 352, 68, 433, 434, 435, 436, + /* 410 */ 437, 438, 75, 440, 43, 398, 45, 46, 445, 223, + /* 420 */ 447, 380, 8, 9, 451, 452, 12, 13, 14, 15, + /* 430 */ 16, 53, 380, 3, 351, 352, 395, 100, 352, 459, + /* 440 */ 103, 403, 462, 405, 392, 169, 394, 474, 342, 4, + /* 450 */ 20, 3, 412, 12, 13, 14, 35, 417, 44, 479, + /* 460 */ 480, 20, 260, 22, 484, 485, 380, 271, 272, 273, + /* 470 */ 274, 275, 276, 277, 33, 380, 35, 140, 141, 103, + /* 480 */ 428, 398, 430, 388, 37, 433, 434, 435, 436, 437, + /* 490 */ 438, 439, 440, 441, 442, 14, 351, 352, 392, 459, + /* 500 */ 342, 20, 462, 62, 54, 55, 459, 170, 171, 462, + /* 510 */ 352, 356, 357, 176, 177, 175, 75, 260, 104, 479, + /* 520 */ 480, 435, 380, 247, 484, 485, 479, 480, 191, 387, + /* 530 */ 193, 484, 485, 257, 104, 351, 14, 395, 380, 380, + /* 540 */ 172, 100, 20, 398, 103, 67, 387, 342, 103, 244, + /* 550 */ 392, 246, 394, 106, 395, 108, 109, 352, 111, 354, + /* 560 */ 223, 224, 115, 226, 227, 228, 229, 230, 231, 232, /* 570 */ 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - /* 580 */ 243, 140, 141, 70, 71, 72, 381, 403, 386, 405, - /* 590 */ 77, 78, 79, 475, 476, 392, 83, 392, 444, 394, - /* 600 */ 446, 88, 89, 90, 91, 459, 388, 94, 462, 351, - /* 610 */ 352, 170, 171, 381, 12, 13, 48, 176, 177, 387, - /* 620 */ 393, 394, 381, 339, 104, 479, 480, 395, 387, 371, - /* 630 */ 484, 485, 191, 428, 193, 430, 395, 35, 433, 434, - /* 640 */ 435, 436, 437, 438, 3, 440, 351, 352, 134, 135, - /* 650 */ 445, 351, 447, 139, 8, 9, 451, 452, 12, 13, - /* 660 */ 14, 15, 16, 418, 223, 224, 371, 226, 227, 228, + /* 580 */ 243, 140, 141, 0, 137, 380, 428, 403, 430, 405, + /* 590 */ 114, 433, 434, 435, 436, 437, 438, 392, 440, 394, + /* 600 */ 21, 459, 172, 360, 462, 447, 266, 267, 268, 451, + /* 610 */ 452, 170, 171, 34, 193, 36, 48, 176, 177, 262, + /* 620 */ 377, 479, 480, 62, 351, 352, 484, 485, 44, 386, + /* 630 */ 12, 13, 191, 428, 193, 430, 260, 244, 433, 434, + /* 640 */ 435, 436, 437, 438, 371, 440, 443, 20, 2, 446, + /* 650 */ 445, 170, 447, 35, 8, 9, 451, 452, 12, 13, + /* 660 */ 14, 15, 16, 102, 223, 224, 105, 226, 227, 228, /* 670 */ 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - /* 680 */ 239, 240, 241, 242, 243, 12, 13, 351, 352, 342, - /* 690 */ 44, 459, 172, 20, 462, 22, 412, 20, 0, 352, - /* 700 */ 444, 417, 446, 403, 223, 405, 33, 371, 35, 159, - /* 710 */ 342, 479, 480, 358, 351, 352, 484, 485, 168, 360, - /* 720 */ 352, 0, 103, 381, 351, 352, 8, 9, 381, 387, - /* 730 */ 12, 13, 14, 15, 16, 62, 377, 395, 383, 392, - /* 740 */ 172, 394, 342, 459, 371, 386, 462, 179, 75, 381, - /* 750 */ 104, 62, 271, 272, 273, 274, 275, 276, 277, 21, - /* 760 */ 392, 398, 394, 479, 480, 67, 351, 352, 484, 485, - /* 770 */ 372, 115, 34, 100, 36, 428, 103, 430, 380, 381, - /* 780 */ 433, 434, 435, 436, 437, 438, 371, 440, 342, 12, - /* 790 */ 13, 102, 392, 137, 105, 193, 428, 20, 430, 22, - /* 800 */ 369, 433, 434, 435, 436, 437, 438, 343, 440, 190, - /* 810 */ 33, 192, 35, 140, 141, 447, 432, 140, 141, 451, - /* 820 */ 452, 412, 104, 8, 9, 432, 417, 12, 13, 14, - /* 830 */ 15, 16, 402, 486, 487, 342, 115, 0, 392, 62, - /* 840 */ 14, 222, 458, 170, 171, 352, 20, 351, 352, 176, - /* 850 */ 177, 458, 75, 176, 177, 134, 135, 136, 137, 138, - /* 860 */ 139, 372, 351, 352, 191, 488, 193, 371, 459, 380, - /* 870 */ 381, 462, 351, 352, 381, 351, 352, 100, 443, 260, - /* 880 */ 103, 446, 371, 389, 14, 392, 392, 394, 479, 480, - /* 890 */ 20, 477, 371, 484, 485, 371, 223, 224, 0, 226, + /* 680 */ 239, 240, 241, 242, 243, 12, 13, 412, 104, 342, + /* 690 */ 0, 22, 170, 20, 22, 22, 351, 352, 75, 352, + /* 700 */ 342, 372, 351, 352, 35, 260, 33, 35, 35, 380, + /* 710 */ 352, 380, 70, 71, 72, 114, 371, 388, 387, 77, + /* 720 */ 78, 79, 371, 351, 352, 83, 395, 380, 103, 281, + /* 730 */ 88, 89, 90, 91, 459, 62, 94, 462, 380, 392, + /* 740 */ 172, 394, 159, 371, 75, 134, 84, 179, 75, 369, + /* 750 */ 392, 168, 394, 22, 479, 480, 75, 8, 9, 484, + /* 760 */ 485, 12, 13, 14, 15, 16, 35, 140, 141, 100, + /* 770 */ 351, 352, 100, 100, 186, 428, 103, 430, 351, 352, + /* 780 */ 433, 434, 435, 436, 437, 438, 428, 440, 430, 12, + /* 790 */ 13, 433, 434, 435, 436, 437, 438, 20, 440, 22, + /* 800 */ 14, 213, 214, 176, 177, 115, 20, 145, 146, 49, + /* 810 */ 33, 193, 35, 140, 141, 204, 205, 57, 351, 352, + /* 820 */ 60, 61, 475, 476, 134, 135, 136, 137, 138, 139, + /* 830 */ 168, 100, 372, 381, 476, 115, 134, 135, 371, 62, + /* 840 */ 380, 139, 459, 170, 171, 462, 356, 357, 388, 176, + /* 850 */ 177, 0, 75, 104, 134, 135, 136, 137, 138, 139, + /* 860 */ 191, 103, 193, 480, 191, 381, 193, 484, 485, 459, + /* 870 */ 342, 113, 462, 103, 455, 456, 457, 100, 459, 460, + /* 880 */ 103, 342, 455, 456, 457, 260, 459, 460, 365, 366, + /* 890 */ 480, 352, 223, 224, 484, 485, 223, 224, 0, 226, /* 900 */ 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - /* 910 */ 237, 238, 239, 240, 241, 242, 243, 140, 141, 104, - /* 920 */ 355, 428, 281, 430, 365, 366, 433, 434, 435, 436, - /* 930 */ 437, 438, 389, 440, 372, 392, 115, 39, 1, 2, - /* 940 */ 447, 459, 380, 381, 462, 452, 342, 170, 171, 351, - /* 950 */ 352, 22, 115, 176, 177, 134, 135, 136, 137, 138, - /* 960 */ 139, 4, 480, 33, 35, 47, 484, 485, 191, 371, - /* 970 */ 193, 134, 135, 136, 137, 138, 139, 351, 352, 49, - /* 980 */ 12, 13, 14, 15, 16, 14, 342, 57, 58, 59, - /* 990 */ 60, 20, 62, 20, 471, 22, 392, 371, 54, 55, + /* 910 */ 237, 238, 239, 240, 241, 242, 243, 140, 141, 380, + /* 920 */ 392, 70, 71, 72, 351, 352, 351, 352, 77, 78, + /* 930 */ 79, 392, 342, 394, 83, 4, 14, 15, 16, 88, + /* 940 */ 89, 90, 91, 381, 371, 94, 371, 170, 171, 342, + /* 950 */ 19, 8, 9, 176, 177, 12, 13, 14, 15, 16, + /* 960 */ 190, 444, 192, 446, 33, 67, 381, 428, 191, 430, + /* 970 */ 193, 358, 433, 434, 435, 436, 437, 438, 381, 440, + /* 980 */ 49, 372, 392, 45, 46, 342, 447, 56, 0, 380, + /* 990 */ 451, 452, 222, 62, 412, 432, 383, 388, 342, 392, /* 1000 */ 223, 224, 0, 226, 227, 228, 229, 230, 231, 232, /* 1010 */ 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - /* 1020 */ 243, 103, 18, 18, 20, 411, 53, 342, 23, 100, - /* 1030 */ 373, 27, 102, 376, 30, 105, 392, 33, 2, 20, - /* 1040 */ 170, 104, 37, 38, 8, 9, 41, 39, 12, 13, - /* 1050 */ 14, 15, 16, 49, 42, 51, 44, 52, 8, 9, - /* 1060 */ 56, 368, 12, 13, 14, 15, 16, 412, 63, 64, + /* 1020 */ 243, 458, 18, 18, 20, 351, 352, 342, 23, 389, + /* 1030 */ 260, 27, 392, 102, 30, 392, 105, 33, 351, 352, + /* 1040 */ 0, 459, 37, 38, 462, 371, 41, 104, 392, 342, + /* 1050 */ 342, 342, 342, 49, 342, 51, 39, 52, 371, 342, + /* 1060 */ 56, 479, 480, 365, 366, 342, 484, 485, 63, 64, /* 1070 */ 65, 66, 70, 71, 72, 73, 74, 392, 76, 77, /* 1080 */ 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - /* 1090 */ 88, 89, 90, 91, 92, 93, 94, 95, 96, 14, - /* 1100 */ 15, 16, 367, 173, 174, 370, 102, 20, 103, 2, - /* 1110 */ 180, 181, 351, 352, 459, 8, 9, 462, 114, 12, - /* 1120 */ 13, 14, 15, 16, 169, 342, 356, 357, 42, 199, - /* 1130 */ 44, 22, 371, 22, 479, 480, 20, 342, 44, 484, - /* 1140 */ 485, 170, 356, 357, 35, 342, 35, 142, 144, 342, - /* 1150 */ 44, 147, 148, 149, 150, 151, 152, 153, 154, 155, + /* 1090 */ 88, 89, 90, 91, 92, 93, 94, 95, 96, 392, + /* 1100 */ 392, 392, 392, 115, 392, 33, 102, 389, 103, 392, + /* 1110 */ 392, 44, 432, 351, 352, 392, 20, 389, 114, 360, + /* 1120 */ 392, 49, 134, 135, 136, 137, 138, 139, 115, 57, + /* 1130 */ 58, 59, 60, 371, 62, 8, 9, 342, 458, 12, + /* 1140 */ 13, 14, 15, 16, 342, 386, 373, 142, 144, 376, + /* 1150 */ 137, 147, 148, 149, 150, 151, 152, 153, 154, 155, /* 1160 */ 156, 157, 158, 159, 160, 161, 162, 163, 412, 165, - /* 1170 */ 166, 167, 8, 9, 13, 392, 12, 13, 14, 15, - /* 1180 */ 16, 135, 342, 114, 75, 139, 35, 392, 183, 184, - /* 1190 */ 185, 172, 352, 188, 354, 392, 35, 342, 342, 392, - /* 1200 */ 342, 342, 247, 365, 366, 107, 201, 202, 110, 100, - /* 1210 */ 342, 100, 257, 45, 46, 459, 412, 212, 462, 262, - /* 1220 */ 215, 381, 172, 218, 219, 220, 221, 222, 380, 381, - /* 1230 */ 380, 381, 392, 164, 394, 479, 480, 380, 381, 44, - /* 1240 */ 484, 485, 13, 342, 380, 381, 200, 392, 392, 203, - /* 1250 */ 392, 392, 206, 352, 208, 354, 380, 381, 0, 172, - /* 1260 */ 392, 258, 259, 459, 35, 260, 462, 259, 428, 381, - /* 1270 */ 430, 62, 68, 433, 434, 435, 436, 437, 438, 207, - /* 1280 */ 440, 209, 381, 479, 480, 445, 170, 447, 484, 485, - /* 1290 */ 0, 451, 452, 392, 0, 394, 0, 44, 107, 104, - /* 1300 */ 191, 110, 193, 107, 44, 107, 110, 49, 110, 44, - /* 1310 */ 44, 342, 22, 44, 105, 44, 22, 35, 22, 140, - /* 1320 */ 141, 352, 44, 354, 368, 44, 35, 44, 44, 428, - /* 1330 */ 44, 430, 223, 224, 433, 434, 435, 436, 437, 438, - /* 1340 */ 355, 440, 402, 350, 193, 0, 445, 352, 447, 391, - /* 1350 */ 381, 44, 451, 452, 1, 2, 402, 104, 44, 44, - /* 1360 */ 461, 392, 481, 394, 104, 44, 75, 13, 44, 104, - /* 1370 */ 104, 103, 44, 104, 342, 104, 44, 283, 44, 13, - /* 1380 */ 453, 113, 104, 263, 352, 104, 354, 104, 104, 35, - /* 1390 */ 104, 285, 413, 465, 429, 50, 49, 428, 20, 430, - /* 1400 */ 342, 35, 433, 434, 435, 436, 437, 438, 422, 440, - /* 1410 */ 352, 104, 354, 381, 445, 427, 447, 206, 104, 104, - /* 1420 */ 451, 452, 360, 422, 392, 104, 394, 223, 104, 189, - /* 1430 */ 360, 415, 104, 352, 20, 342, 104, 42, 104, 381, - /* 1440 */ 399, 20, 402, 352, 399, 352, 169, 20, 397, 352, - /* 1450 */ 392, 351, 394, 351, 399, 99, 397, 397, 101, 364, - /* 1460 */ 428, 351, 430, 98, 363, 433, 434, 435, 436, 437, - /* 1470 */ 438, 20, 440, 351, 381, 193, 362, 445, 351, 447, - /* 1480 */ 351, 344, 48, 451, 452, 392, 428, 394, 430, 348, - /* 1490 */ 344, 433, 434, 435, 436, 437, 438, 348, 440, 422, - /* 1500 */ 360, 12, 13, 445, 342, 447, 20, 394, 360, 451, - /* 1510 */ 452, 22, 20, 353, 352, 20, 360, 414, 353, 360, - /* 1520 */ 351, 428, 33, 430, 35, 344, 433, 434, 435, 436, - /* 1530 */ 437, 438, 342, 440, 360, 360, 360, 351, 445, 381, - /* 1540 */ 447, 344, 352, 381, 451, 452, 392, 381, 381, 392, - /* 1550 */ 210, 62, 381, 381, 392, 392, 394, 426, 381, 381, - /* 1560 */ 103, 422, 424, 358, 75, 197, 421, 342, 196, 195, - /* 1570 */ 420, 381, 358, 351, 394, 402, 392, 352, 270, 269, - /* 1580 */ 392, 392, 392, 413, 394, 402, 392, 470, 470, 100, - /* 1590 */ 428, 278, 430, 182, 407, 433, 434, 435, 436, 437, - /* 1600 */ 438, 419, 440, 473, 472, 470, 381, 445, 407, 447, - /* 1610 */ 280, 469, 279, 451, 452, 468, 264, 392, 428, 394, - /* 1620 */ 430, 413, 467, 433, 434, 435, 436, 437, 438, 259, - /* 1630 */ 440, 287, 489, 284, 482, 445, 483, 447, 20, 352, - /* 1640 */ 282, 451, 452, 114, 432, 261, 353, 358, 20, 464, - /* 1650 */ 358, 405, 407, 428, 342, 430, 463, 407, 433, 434, - /* 1660 */ 435, 436, 437, 438, 352, 440, 392, 392, 392, 358, - /* 1670 */ 174, 392, 447, 103, 404, 376, 451, 452, 358, 352, - /* 1680 */ 191, 450, 193, 103, 342, 384, 370, 392, 351, 392, - /* 1690 */ 392, 36, 344, 381, 352, 345, 358, 374, 359, 374, - /* 1700 */ 374, 416, 340, 423, 392, 0, 394, 0, 408, 0, - /* 1710 */ 408, 42, 223, 224, 0, 35, 216, 35, 35, 35, - /* 1720 */ 216, 0, 35, 381, 35, 236, 237, 238, 239, 240, - /* 1730 */ 241, 242, 216, 0, 392, 216, 394, 0, 35, 0, - /* 1740 */ 428, 22, 430, 35, 211, 433, 434, 435, 436, 437, - /* 1750 */ 438, 0, 440, 0, 199, 342, 0, 199, 193, 447, - /* 1760 */ 200, 0, 191, 451, 452, 352, 0, 0, 187, 186, - /* 1770 */ 428, 0, 430, 0, 47, 433, 434, 435, 436, 437, - /* 1780 */ 438, 0, 440, 35, 49, 0, 0, 47, 42, 0, - /* 1790 */ 0, 0, 47, 0, 381, 0, 0, 0, 385, 0, - /* 1800 */ 0, 159, 0, 35, 159, 392, 0, 394, 0, 0, - /* 1810 */ 0, 0, 0, 342, 0, 0, 0, 0, 476, 0, - /* 1820 */ 0, 0, 0, 352, 0, 0, 47, 342, 0, 42, - /* 1830 */ 0, 0, 0, 0, 0, 0, 0, 352, 0, 0, - /* 1840 */ 22, 428, 143, 430, 342, 0, 433, 434, 435, 436, - /* 1850 */ 437, 438, 381, 440, 352, 0, 385, 182, 0, 22, - /* 1860 */ 0, 48, 22, 392, 35, 394, 381, 62, 0, 62, - /* 1870 */ 0, 48, 0, 0, 0, 0, 35, 392, 0, 394, - /* 1880 */ 0, 14, 35, 381, 35, 39, 0, 39, 62, 39, - /* 1890 */ 0, 35, 49, 49, 392, 42, 394, 0, 44, 428, - /* 1900 */ 49, 430, 39, 39, 433, 434, 435, 436, 437, 438, - /* 1910 */ 0, 440, 47, 428, 342, 430, 47, 40, 433, 434, - /* 1920 */ 435, 436, 437, 438, 352, 440, 47, 39, 0, 0, - /* 1930 */ 428, 69, 430, 342, 0, 433, 434, 435, 436, 437, - /* 1940 */ 438, 0, 440, 352, 35, 49, 39, 0, 35, 342, - /* 1950 */ 49, 39, 0, 381, 35, 49, 39, 385, 0, 352, - /* 1960 */ 35, 0, 39, 478, 392, 49, 394, 0, 0, 0, - /* 1970 */ 0, 0, 381, 112, 35, 22, 110, 0, 35, 35, - /* 1980 */ 35, 35, 44, 392, 35, 394, 35, 22, 381, 487, - /* 1990 */ 35, 35, 385, 0, 44, 35, 22, 35, 0, 392, - /* 2000 */ 428, 394, 430, 22, 0, 433, 434, 435, 436, 437, - /* 2010 */ 438, 22, 440, 35, 51, 0, 0, 35, 35, 428, - /* 2020 */ 342, 430, 0, 22, 433, 434, 435, 436, 437, 438, - /* 2030 */ 352, 440, 1, 442, 20, 428, 104, 430, 35, 103, - /* 2040 */ 433, 434, 435, 436, 437, 438, 35, 440, 35, 0, - /* 2050 */ 19, 103, 35, 172, 22, 342, 0, 198, 22, 381, - /* 2060 */ 0, 172, 0, 385, 33, 352, 174, 172, 3, 178, - /* 2070 */ 392, 172, 394, 44, 48, 103, 194, 101, 178, 104, - /* 2080 */ 49, 44, 103, 48, 99, 342, 44, 103, 57, 58, - /* 2090 */ 59, 60, 265, 62, 381, 352, 104, 44, 104, 103, - /* 2100 */ 103, 47, 47, 104, 104, 392, 428, 394, 430, 103, - /* 2110 */ 44, 433, 434, 435, 436, 437, 438, 265, 440, 3, - /* 2120 */ 44, 35, 342, 104, 381, 35, 35, 35, 35, 35, - /* 2130 */ 47, 104, 352, 102, 104, 392, 105, 394, 0, 44, - /* 2140 */ 0, 428, 258, 430, 47, 47, 433, 434, 435, 436, - /* 2150 */ 437, 438, 265, 440, 103, 103, 39, 0, 39, 173, - /* 2160 */ 103, 381, 104, 104, 103, 175, 103, 103, 47, 138, - /* 2170 */ 44, 428, 392, 430, 394, 101, 433, 434, 435, 436, - /* 2180 */ 437, 438, 113, 440, 342, 245, 101, 2, 22, 223, - /* 2190 */ 103, 47, 104, 104, 352, 47, 114, 22, 35, 342, - /* 2200 */ 104, 126, 103, 103, 173, 103, 103, 103, 428, 352, - /* 2210 */ 430, 180, 104, 433, 434, 435, 436, 437, 438, 104, - /* 2220 */ 440, 35, 104, 381, 35, 103, 35, 225, 103, 35, - /* 2230 */ 199, 104, 103, 103, 392, 104, 394, 104, 381, 35, - /* 2240 */ 104, 35, 103, 22, 103, 44, 126, 35, 103, 392, - /* 2250 */ 342, 394, 103, 103, 126, 22, 69, 115, 126, 35, - /* 2260 */ 352, 68, 35, 35, 342, 35, 35, 35, 97, 35, - /* 2270 */ 428, 35, 430, 75, 352, 433, 434, 435, 436, 437, - /* 2280 */ 438, 44, 440, 35, 35, 428, 35, 430, 22, 381, - /* 2290 */ 433, 434, 435, 436, 437, 438, 0, 440, 35, 35, - /* 2300 */ 392, 75, 394, 381, 35, 35, 35, 35, 35, 35, - /* 2310 */ 22, 35, 35, 0, 392, 342, 394, 49, 39, 35, - /* 2320 */ 39, 0, 35, 0, 39, 352, 35, 49, 39, 49, - /* 2330 */ 0, 49, 35, 35, 0, 21, 428, 22, 430, 22, - /* 2340 */ 22, 433, 434, 435, 436, 437, 438, 21, 440, 20, - /* 2350 */ 428, 490, 430, 490, 381, 433, 434, 435, 436, 437, - /* 2360 */ 438, 490, 440, 490, 490, 392, 490, 394, 490, 490, - /* 2370 */ 490, 490, 490, 490, 490, 342, 490, 490, 490, 490, - /* 2380 */ 490, 490, 490, 490, 490, 352, 490, 490, 490, 490, - /* 2390 */ 342, 490, 490, 490, 490, 490, 490, 490, 490, 490, - /* 2400 */ 352, 428, 490, 430, 490, 490, 433, 434, 435, 436, - /* 2410 */ 437, 438, 490, 440, 381, 490, 490, 490, 490, 490, - /* 2420 */ 490, 490, 490, 490, 490, 392, 490, 394, 490, 381, - /* 2430 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, - /* 2440 */ 392, 490, 394, 490, 490, 490, 490, 490, 342, 490, - /* 2450 */ 490, 490, 490, 490, 490, 490, 490, 490, 352, 490, - /* 2460 */ 490, 428, 490, 430, 490, 342, 433, 434, 435, 436, - /* 2470 */ 437, 438, 490, 440, 490, 352, 428, 490, 430, 342, - /* 2480 */ 490, 433, 434, 435, 436, 437, 438, 381, 440, 352, - /* 2490 */ 490, 490, 490, 490, 490, 490, 490, 490, 392, 490, - /* 2500 */ 394, 490, 490, 490, 381, 490, 490, 490, 490, 490, - /* 2510 */ 490, 490, 490, 490, 490, 392, 342, 394, 381, 490, - /* 2520 */ 490, 490, 490, 490, 490, 490, 352, 490, 490, 392, - /* 2530 */ 490, 394, 490, 490, 428, 490, 430, 342, 490, 433, - /* 2540 */ 434, 435, 436, 437, 438, 490, 440, 352, 490, 490, - /* 2550 */ 490, 428, 490, 430, 490, 381, 433, 434, 435, 436, - /* 2560 */ 437, 438, 490, 440, 490, 428, 392, 430, 394, 490, - /* 2570 */ 433, 434, 435, 436, 437, 438, 381, 440, 490, 490, - /* 2580 */ 490, 490, 490, 490, 490, 490, 490, 392, 490, 394, - /* 2590 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, - /* 2600 */ 490, 490, 428, 342, 430, 490, 490, 433, 434, 435, - /* 2610 */ 436, 437, 438, 352, 440, 490, 490, 342, 490, 490, - /* 2620 */ 490, 490, 490, 428, 490, 430, 490, 352, 433, 434, - /* 2630 */ 435, 436, 437, 438, 342, 440, 490, 490, 490, 490, - /* 2640 */ 490, 490, 381, 490, 352, 490, 490, 490, 490, 490, - /* 2650 */ 490, 490, 490, 392, 490, 394, 381, 490, 490, 490, - /* 2660 */ 490, 490, 490, 490, 490, 490, 490, 392, 490, 394, - /* 2670 */ 490, 490, 490, 381, 490, 490, 490, 490, 490, 490, - /* 2680 */ 490, 490, 490, 490, 392, 490, 394, 490, 490, 428, - /* 2690 */ 490, 430, 490, 490, 433, 434, 435, 436, 437, 438, - /* 2700 */ 490, 440, 490, 428, 490, 430, 490, 490, 433, 434, - /* 2710 */ 435, 436, 437, 438, 490, 440, 490, 490, 490, 490, - /* 2720 */ 428, 490, 430, 490, 490, 433, 434, 435, 436, 437, - /* 2730 */ 438, 490, 440, 342, 490, 490, 490, 490, 490, 490, - /* 2740 */ 490, 490, 490, 352, 490, 490, 490, 490, 490, 342, - /* 2750 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 352, - /* 2760 */ 490, 490, 490, 490, 490, 490, 490, 490, 342, 490, - /* 2770 */ 490, 490, 381, 490, 490, 490, 490, 490, 352, 490, - /* 2780 */ 490, 490, 490, 392, 490, 394, 490, 490, 381, 490, - /* 2790 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 392, - /* 2800 */ 490, 394, 490, 490, 490, 490, 490, 381, 490, 490, - /* 2810 */ 490, 490, 490, 490, 490, 490, 490, 490, 392, 428, - /* 2820 */ 394, 430, 490, 490, 433, 434, 435, 436, 437, 438, - /* 2830 */ 490, 440, 490, 490, 490, 428, 490, 430, 490, 490, - /* 2840 */ 433, 434, 435, 436, 437, 438, 490, 440, 490, 490, - /* 2850 */ 490, 490, 490, 490, 428, 490, 430, 490, 342, 433, - /* 2860 */ 434, 435, 436, 437, 438, 490, 440, 490, 352, 490, - /* 2870 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, - /* 2880 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, - /* 2890 */ 490, 490, 490, 490, 490, 490, 490, 381, 490, 490, - /* 2900 */ 490, 490, 490, 490, 490, 490, 490, 490, 392, 490, - /* 2910 */ 394, 490, 490, 490, 490, 490, 490, 490, 490, 490, - /* 2920 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, - /* 2930 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, - /* 2940 */ 490, 490, 490, 490, 428, 490, 430, 490, 490, 433, - /* 2950 */ 434, 435, 436, 437, 438, 490, 440, 339, 339, 339, + /* 1170 */ 166, 167, 2, 376, 102, 351, 352, 105, 8, 9, + /* 1180 */ 351, 352, 12, 13, 14, 15, 16, 392, 183, 184, + /* 1190 */ 185, 68, 342, 188, 392, 371, 351, 352, 342, 444, + /* 1200 */ 371, 446, 352, 0, 354, 367, 201, 202, 370, 258, + /* 1210 */ 259, 13, 13, 342, 114, 459, 371, 212, 462, 42, + /* 1220 */ 215, 44, 425, 218, 219, 220, 221, 222, 0, 42, + /* 1230 */ 380, 44, 35, 35, 35, 479, 480, 44, 44, 342, + /* 1240 */ 484, 485, 392, 0, 394, 173, 174, 44, 392, 352, + /* 1250 */ 22, 354, 180, 181, 8, 9, 343, 217, 12, 13, + /* 1260 */ 14, 15, 16, 392, 164, 260, 44, 107, 172, 107, + /* 1270 */ 110, 199, 110, 207, 62, 209, 259, 380, 428, 107, + /* 1280 */ 430, 0, 110, 433, 434, 435, 436, 437, 438, 392, + /* 1290 */ 440, 394, 49, 107, 0, 445, 110, 447, 104, 44, + /* 1300 */ 44, 451, 452, 22, 44, 140, 141, 44, 44, 44, + /* 1310 */ 44, 44, 44, 1, 2, 0, 22, 105, 44, 13, + /* 1320 */ 44, 35, 418, 44, 44, 428, 104, 430, 44, 47, + /* 1330 */ 433, 434, 435, 436, 437, 438, 44, 440, 402, 44, + /* 1340 */ 44, 35, 445, 342, 447, 488, 223, 477, 451, 452, + /* 1350 */ 283, 355, 471, 352, 13, 354, 12, 13, 368, 104, + /* 1360 */ 104, 75, 368, 342, 104, 50, 22, 104, 104, 104, + /* 1370 */ 104, 104, 104, 352, 411, 354, 35, 33, 104, 35, + /* 1380 */ 104, 380, 355, 104, 104, 103, 380, 402, 104, 350, + /* 1390 */ 193, 391, 481, 392, 352, 394, 104, 402, 461, 104, + /* 1400 */ 104, 380, 453, 263, 465, 413, 62, 49, 429, 20, + /* 1410 */ 206, 422, 342, 392, 427, 394, 360, 360, 172, 75, + /* 1420 */ 422, 189, 352, 415, 354, 20, 352, 42, 399, 428, + /* 1430 */ 20, 430, 342, 402, 433, 434, 435, 436, 437, 438, + /* 1440 */ 352, 440, 352, 399, 100, 397, 445, 20, 447, 428, + /* 1450 */ 380, 430, 451, 452, 433, 434, 435, 436, 437, 438, + /* 1460 */ 169, 440, 392, 351, 394, 352, 445, 351, 447, 101, + /* 1470 */ 380, 364, 451, 452, 399, 397, 397, 99, 285, 351, + /* 1480 */ 363, 98, 392, 362, 394, 351, 351, 351, 20, 344, + /* 1490 */ 48, 348, 344, 422, 348, 20, 394, 360, 428, 360, + /* 1500 */ 430, 342, 20, 433, 434, 435, 436, 437, 438, 353, + /* 1510 */ 440, 352, 20, 414, 360, 445, 353, 447, 428, 351, + /* 1520 */ 430, 451, 452, 433, 434, 435, 436, 437, 438, 360, + /* 1530 */ 440, 360, 344, 360, 360, 191, 351, 193, 380, 380, + /* 1540 */ 344, 380, 392, 392, 380, 392, 380, 380, 210, 103, + /* 1550 */ 342, 392, 426, 394, 424, 380, 380, 197, 380, 380, + /* 1560 */ 352, 380, 380, 422, 358, 421, 196, 223, 224, 420, + /* 1570 */ 195, 358, 351, 270, 394, 392, 486, 487, 470, 269, + /* 1580 */ 236, 237, 238, 239, 240, 241, 242, 428, 380, 430, + /* 1590 */ 470, 402, 433, 434, 435, 436, 437, 438, 407, 440, + /* 1600 */ 392, 392, 394, 419, 445, 413, 447, 402, 407, 392, + /* 1610 */ 451, 452, 392, 278, 280, 473, 182, 264, 279, 472, + /* 1620 */ 342, 489, 470, 413, 469, 468, 284, 287, 282, 352, + /* 1630 */ 352, 259, 20, 114, 432, 261, 428, 20, 430, 405, + /* 1640 */ 342, 433, 434, 435, 436, 437, 438, 358, 440, 407, + /* 1650 */ 352, 358, 353, 445, 392, 447, 407, 467, 380, 451, + /* 1660 */ 452, 392, 392, 392, 392, 392, 358, 174, 352, 358, + /* 1670 */ 392, 464, 394, 376, 463, 103, 450, 482, 380, 404, + /* 1680 */ 103, 351, 392, 483, 384, 358, 36, 370, 345, 344, + /* 1690 */ 392, 359, 394, 408, 374, 374, 408, 374, 0, 416, + /* 1700 */ 0, 340, 0, 42, 0, 35, 428, 216, 430, 342, + /* 1710 */ 423, 433, 434, 435, 436, 437, 438, 35, 440, 352, + /* 1720 */ 35, 35, 216, 445, 0, 447, 428, 35, 430, 451, + /* 1730 */ 452, 433, 434, 435, 436, 437, 438, 216, 440, 0, + /* 1740 */ 35, 216, 0, 35, 342, 447, 0, 380, 22, 451, + /* 1750 */ 452, 0, 35, 211, 352, 0, 199, 0, 199, 392, + /* 1760 */ 200, 394, 193, 0, 191, 0, 0, 187, 186, 0, + /* 1770 */ 0, 0, 47, 35, 342, 0, 49, 47, 0, 42, + /* 1780 */ 0, 0, 380, 0, 352, 0, 0, 385, 47, 0, + /* 1790 */ 0, 0, 0, 159, 392, 428, 394, 430, 0, 35, + /* 1800 */ 433, 434, 435, 436, 437, 438, 159, 440, 0, 0, + /* 1810 */ 0, 342, 380, 0, 447, 0, 0, 385, 0, 452, + /* 1820 */ 0, 352, 0, 0, 392, 0, 394, 0, 0, 0, + /* 1830 */ 428, 0, 430, 0, 47, 433, 434, 435, 436, 437, + /* 1840 */ 438, 342, 440, 0, 42, 0, 0, 0, 0, 380, + /* 1850 */ 0, 352, 0, 0, 22, 0, 0, 143, 0, 0, + /* 1860 */ 428, 392, 430, 394, 22, 433, 434, 435, 436, 437, + /* 1870 */ 438, 22, 440, 342, 48, 0, 62, 0, 48, 380, + /* 1880 */ 0, 62, 0, 352, 0, 49, 35, 0, 49, 35, + /* 1890 */ 0, 392, 35, 394, 0, 35, 62, 428, 0, 430, + /* 1900 */ 35, 39, 433, 434, 435, 436, 437, 438, 39, 440, + /* 1910 */ 342, 380, 49, 39, 42, 39, 385, 44, 47, 14, + /* 1920 */ 352, 0, 39, 392, 0, 394, 47, 428, 47, 430, + /* 1930 */ 0, 40, 433, 434, 435, 436, 437, 438, 0, 440, + /* 1940 */ 342, 39, 182, 0, 0, 0, 0, 478, 380, 0, + /* 1950 */ 352, 35, 49, 39, 69, 0, 49, 35, 39, 428, + /* 1960 */ 392, 430, 394, 1, 433, 434, 435, 436, 437, 438, + /* 1970 */ 0, 440, 35, 39, 49, 0, 49, 35, 380, 39, + /* 1980 */ 0, 19, 0, 385, 0, 0, 487, 342, 0, 0, + /* 1990 */ 392, 35, 394, 22, 0, 33, 428, 352, 430, 110, + /* 2000 */ 112, 433, 434, 435, 436, 437, 438, 35, 440, 35, + /* 2010 */ 442, 49, 35, 342, 35, 22, 35, 44, 35, 57, + /* 2020 */ 58, 59, 60, 352, 62, 380, 428, 35, 430, 0, + /* 2030 */ 385, 433, 434, 435, 436, 437, 438, 392, 440, 394, + /* 2040 */ 44, 35, 35, 35, 22, 0, 22, 0, 51, 22, + /* 2050 */ 35, 380, 0, 35, 0, 35, 0, 22, 20, 0, + /* 2060 */ 35, 35, 104, 392, 102, 394, 103, 105, 35, 172, + /* 2070 */ 103, 35, 22, 428, 342, 430, 198, 0, 433, 434, + /* 2080 */ 435, 436, 437, 438, 352, 440, 194, 342, 22, 172, + /* 2090 */ 0, 0, 174, 178, 103, 172, 3, 352, 172, 428, + /* 2100 */ 138, 430, 44, 265, 433, 434, 435, 436, 437, 438, + /* 2110 */ 178, 440, 380, 104, 103, 48, 48, 101, 99, 44, + /* 2120 */ 44, 104, 44, 44, 392, 380, 394, 104, 47, 47, + /* 2130 */ 3, 103, 265, 103, 35, 173, 104, 392, 342, 394, + /* 2140 */ 103, 44, 180, 103, 35, 104, 104, 35, 352, 35, + /* 2150 */ 35, 265, 35, 104, 342, 104, 0, 47, 258, 0, + /* 2160 */ 428, 199, 430, 44, 352, 433, 434, 435, 436, 437, + /* 2170 */ 438, 47, 440, 428, 103, 430, 380, 39, 433, 434, + /* 2180 */ 435, 436, 437, 438, 47, 440, 103, 103, 392, 104, + /* 2190 */ 394, 104, 380, 0, 39, 103, 175, 103, 103, 113, + /* 2200 */ 47, 44, 245, 342, 392, 101, 394, 173, 101, 2, + /* 2210 */ 22, 103, 47, 352, 22, 104, 103, 47, 223, 114, + /* 2220 */ 104, 103, 35, 103, 428, 104, 430, 104, 103, 433, + /* 2230 */ 434, 435, 436, 437, 438, 225, 440, 103, 35, 104, + /* 2240 */ 428, 380, 430, 103, 35, 433, 434, 435, 436, 437, + /* 2250 */ 438, 104, 440, 392, 342, 394, 104, 103, 35, 35, + /* 2260 */ 35, 103, 35, 103, 352, 104, 104, 103, 126, 103, + /* 2270 */ 342, 126, 104, 22, 126, 126, 103, 44, 115, 103, + /* 2280 */ 352, 35, 103, 342, 22, 69, 68, 35, 35, 428, + /* 2290 */ 35, 430, 380, 352, 433, 434, 435, 436, 437, 438, + /* 2300 */ 35, 440, 35, 342, 392, 35, 394, 35, 380, 35, + /* 2310 */ 75, 97, 44, 352, 35, 35, 75, 35, 22, 35, + /* 2320 */ 392, 380, 394, 35, 35, 35, 35, 35, 35, 22, + /* 2330 */ 35, 0, 35, 392, 35, 394, 49, 39, 0, 35, + /* 2340 */ 428, 380, 430, 0, 35, 433, 434, 435, 436, 437, + /* 2350 */ 438, 49, 440, 392, 39, 394, 428, 49, 430, 39, + /* 2360 */ 0, 433, 434, 435, 436, 437, 438, 35, 440, 428, + /* 2370 */ 49, 430, 39, 342, 433, 434, 435, 436, 437, 438, + /* 2380 */ 0, 440, 35, 352, 35, 0, 22, 21, 21, 428, + /* 2390 */ 22, 430, 22, 20, 433, 434, 435, 436, 437, 438, + /* 2400 */ 490, 440, 490, 490, 490, 490, 342, 490, 490, 490, + /* 2410 */ 490, 380, 490, 490, 490, 490, 352, 490, 490, 490, + /* 2420 */ 490, 490, 342, 392, 490, 394, 490, 490, 490, 490, + /* 2430 */ 490, 490, 352, 490, 490, 490, 490, 490, 490, 490, + /* 2440 */ 490, 490, 490, 342, 380, 490, 490, 490, 490, 490, + /* 2450 */ 490, 490, 490, 352, 490, 490, 392, 490, 394, 428, + /* 2460 */ 380, 430, 490, 490, 433, 434, 435, 436, 437, 438, + /* 2470 */ 490, 440, 392, 490, 394, 490, 490, 490, 490, 490, + /* 2480 */ 490, 380, 490, 490, 490, 490, 490, 490, 490, 490, + /* 2490 */ 490, 490, 428, 392, 430, 394, 490, 433, 434, 435, + /* 2500 */ 436, 437, 438, 490, 440, 490, 490, 490, 428, 342, + /* 2510 */ 430, 490, 490, 433, 434, 435, 436, 437, 438, 352, + /* 2520 */ 440, 490, 342, 490, 490, 490, 490, 490, 490, 428, + /* 2530 */ 490, 430, 352, 342, 433, 434, 435, 436, 437, 438, + /* 2540 */ 490, 440, 490, 352, 490, 490, 342, 380, 490, 490, + /* 2550 */ 490, 490, 490, 490, 490, 490, 352, 490, 490, 392, + /* 2560 */ 380, 394, 490, 490, 490, 490, 490, 490, 490, 490, + /* 2570 */ 490, 380, 392, 490, 394, 490, 490, 490, 490, 490, + /* 2580 */ 490, 490, 490, 392, 380, 394, 490, 490, 490, 490, + /* 2590 */ 490, 490, 490, 490, 490, 428, 392, 430, 394, 490, + /* 2600 */ 433, 434, 435, 436, 437, 438, 490, 440, 428, 490, + /* 2610 */ 430, 490, 490, 433, 434, 435, 436, 437, 438, 428, + /* 2620 */ 440, 430, 490, 342, 433, 434, 435, 436, 437, 438, + /* 2630 */ 490, 440, 428, 352, 430, 490, 342, 433, 434, 435, + /* 2640 */ 436, 437, 438, 490, 440, 490, 352, 342, 490, 490, + /* 2650 */ 490, 490, 490, 490, 490, 490, 490, 352, 490, 490, + /* 2660 */ 490, 380, 490, 490, 490, 490, 490, 490, 490, 490, + /* 2670 */ 490, 490, 490, 392, 380, 394, 490, 490, 490, 490, + /* 2680 */ 490, 490, 490, 490, 490, 380, 392, 490, 394, 490, + /* 2690 */ 490, 490, 490, 490, 490, 490, 490, 392, 342, 394, + /* 2700 */ 490, 490, 490, 490, 490, 490, 490, 490, 352, 428, + /* 2710 */ 490, 430, 490, 490, 433, 434, 435, 436, 437, 438, + /* 2720 */ 490, 440, 428, 490, 430, 490, 490, 433, 434, 435, + /* 2730 */ 436, 437, 438, 428, 440, 430, 380, 490, 433, 434, + /* 2740 */ 435, 436, 437, 438, 490, 440, 490, 490, 392, 490, + /* 2750 */ 394, 490, 490, 490, 490, 490, 490, 490, 490, 490, + /* 2760 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, + /* 2770 */ 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, + /* 2780 */ 490, 490, 490, 490, 428, 490, 430, 490, 490, 433, + /* 2790 */ 434, 435, 436, 437, 438, 490, 440, 339, 339, 339, + /* 2800 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2810 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2820 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2830 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2840 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2850 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2860 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2870 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2880 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2890 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2900 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2910 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2920 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2930 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2940 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + /* 2950 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, /* 2960 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, /* 2970 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, /* 2980 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, @@ -831,230 +809,214 @@ static const YYCODETYPE yy_lookahead[] = { /* 3100 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, /* 3110 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, /* 3120 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3130 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3140 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3150 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3160 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3170 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3180 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3190 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3200 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3210 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3220 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3230 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3240 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3250 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3260 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3270 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3280 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, - /* 3290 */ 339, 339, 339, 339, 339, 339, + /* 3130 */ 339, 339, 339, 339, 339, 339, }; -#define YY_SHIFT_COUNT (800) +#define YY_SHIFT_COUNT (804) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2334) +#define YY_SHIFT_MAX (2385) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 1005, 0, 104, 0, 337, 337, 337, 337, 337, 337, /* 10 */ 337, 337, 337, 337, 337, 337, 441, 673, 673, 777, /* 20 */ 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, /* 30 */ 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, /* 40 */ 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, - /* 50 */ 673, 66, 111, 619, 380, 91, 109, 91, 380, 380, - /* 60 */ 91, 1489, 91, 1489, 1489, 257, 91, 35, 677, 170, - /* 70 */ 170, 677, 4, 4, 302, 167, 495, 495, 170, 170, - /* 80 */ 170, 170, 170, 170, 170, 170, 170, 170, 199, 170, - /* 90 */ 170, 181, 35, 170, 170, 262, 35, 170, 199, 170, - /* 100 */ 199, 35, 170, 170, 35, 170, 35, 35, 35, 170, - /* 110 */ 247, 1004, 15, 15, 513, 171, 1109, 1109, 1109, 1109, - /* 120 */ 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, - /* 130 */ 1109, 1109, 1109, 1109, 1109, 321, 520, 302, 167, 944, - /* 140 */ 944, 436, 290, 290, 290, 698, 260, 260, 436, 181, - /* 150 */ 35, 35, 35, 35, 268, 151, 35, 315, 35, 315, - /* 160 */ 315, 288, 344, 28, 28, 28, 28, 2031, 448, 225, - /* 170 */ 371, 30, 481, 32, 130, 602, 602, 870, 568, 971, - /* 180 */ 973, 1019, 1168, 826, 656, 1087, 1003, 1008, 641, 1003, - /* 190 */ 1012, 957, 1116, 1120, 1347, 1378, 1211, 181, 1378, 181, - /* 200 */ 1240, 1414, 1395, 1421, 1414, 1395, 1277, 1427, 1414, 1427, - /* 210 */ 1395, 1277, 1277, 1357, 1356, 1427, 1365, 1427, 1427, 1427, - /* 220 */ 1451, 1434, 1451, 1434, 1378, 181, 1486, 181, 1492, 1495, - /* 230 */ 181, 1492, 181, 181, 181, 1427, 181, 1451, 35, 35, - /* 240 */ 35, 35, 35, 35, 35, 1427, 1451, 315, 315, 315, - /* 250 */ 1340, 1457, 1378, 247, 1368, 1372, 1486, 247, 1374, 1120, - /* 260 */ 1427, 1421, 1421, 315, 1308, 1310, 315, 1308, 1310, 315, - /* 270 */ 315, 35, 1313, 1411, 1308, 1330, 1333, 1352, 1120, 1344, - /* 280 */ 1349, 1358, 1370, 1414, 1618, 1529, 1384, 1492, 247, 247, - /* 290 */ 1628, 1310, 315, 315, 315, 315, 315, 1310, 315, 1496, - /* 300 */ 247, 288, 247, 1414, 1570, 1580, 315, 344, 1427, 247, - /* 310 */ 1655, 1451, 2957, 2957, 2957, 2957, 2957, 2957, 2957, 2957, - /* 320 */ 2957, 1002, 930, 259, 646, 419, 718, 815, 721, 1036, - /* 330 */ 1107, 1050, 837, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - /* 340 */ 1164, 1164, 821, 1046, 968, 968, 297, 160, 319, 550, - /* 350 */ 689, 929, 1111, 738, 88, 514, 514, 1085, 937, 955, - /* 360 */ 1085, 1085, 1085, 1258, 112, 1195, 898, 1086, 1069, 17, - /* 370 */ 1098, 1191, 1196, 1198, 1161, 1229, 1290, 1294, 1296, 1072, - /* 380 */ 1253, 1260, 1209, 1265, 1266, 1269, 1179, 1094, 1106, 1271, - /* 390 */ 1278, 1281, 1283, 1284, 1286, 1353, 1307, 1204, 1314, 918, - /* 400 */ 1315, 1321, 1324, 1328, 1332, 1334, 1268, 1151, 1282, 1354, - /* 410 */ 1366, 1291, 1345, 1705, 1707, 1709, 1669, 1714, 1680, 1500, - /* 420 */ 1682, 1683, 1684, 1504, 1721, 1687, 1689, 1516, 1733, 1519, - /* 430 */ 1737, 1703, 1739, 1719, 1751, 1708, 1533, 1753, 1555, 1756, - /* 440 */ 1558, 1560, 1565, 1571, 1761, 1766, 1767, 1581, 1583, 1771, - /* 450 */ 1773, 1727, 1781, 1748, 1735, 1785, 1740, 1786, 1746, 1789, - /* 460 */ 1790, 1791, 1745, 1793, 1795, 1796, 1797, 1799, 1800, 1642, - /* 470 */ 1768, 1802, 1645, 1806, 1808, 1809, 1810, 1811, 1812, 1814, - /* 480 */ 1815, 1816, 1817, 1819, 1820, 1821, 1822, 1824, 1825, 1779, - /* 490 */ 1828, 1787, 1830, 1831, 1832, 1833, 1834, 1835, 1818, 1836, - /* 500 */ 1838, 1839, 1699, 1845, 1855, 1837, 1813, 1840, 1823, 1860, - /* 510 */ 1805, 1829, 1868, 1807, 1870, 1826, 1872, 1873, 1841, 1843, - /* 520 */ 1846, 1874, 1847, 1844, 1848, 1875, 1849, 1851, 1850, 1878, - /* 530 */ 1856, 1880, 1853, 1863, 1854, 1865, 1869, 1867, 1879, 1886, - /* 540 */ 1877, 1864, 1890, 1897, 1910, 1888, 1675, 1858, 1928, 1929, - /* 550 */ 1862, 1934, 1941, 1909, 1896, 1907, 1947, 1913, 1901, 1912, - /* 560 */ 1952, 1919, 1906, 1917, 1958, 1925, 1916, 1923, 1961, 1967, - /* 570 */ 1968, 1969, 1970, 1971, 1861, 1866, 1939, 1953, 1977, 1943, - /* 580 */ 1944, 1945, 1946, 1949, 1951, 1955, 1938, 1950, 1956, 1960, - /* 590 */ 1965, 1962, 1993, 1974, 1998, 1981, 1963, 2004, 1989, 1978, - /* 600 */ 2015, 1982, 2016, 1983, 2022, 2001, 2014, 2003, 2011, 2013, - /* 610 */ 1932, 1936, 2049, 1881, 1948, 1859, 2017, 2032, 2056, 1882, - /* 620 */ 2036, 1889, 1892, 2060, 2062, 1895, 1891, 1899, 1900, 2065, - /* 630 */ 2029, 1827, 1972, 1975, 1979, 2026, 1976, 2035, 1985, 1992, - /* 640 */ 2037, 2042, 1994, 1984, 1996, 1997, 1999, 2053, 2054, 2055, - /* 650 */ 2006, 2066, 1852, 2000, 2019, 2116, 2076, 1887, 2086, 2090, - /* 660 */ 2091, 2092, 2093, 2094, 2027, 2030, 2083, 1884, 2095, 2097, - /* 670 */ 2138, 2140, 2051, 2117, 1865, 2098, 2052, 2058, 2059, 2057, - /* 680 */ 2061, 1990, 2063, 2157, 2119, 1986, 2064, 2069, 1865, 2121, - /* 690 */ 2126, 2074, 1940, 2085, 2185, 2166, 1966, 2087, 2088, 2099, - /* 700 */ 2089, 2100, 2096, 2144, 2102, 2103, 2148, 2108, 2175, 2002, - /* 710 */ 2104, 2082, 2115, 2163, 2186, 2122, 2118, 2189, 2125, 2127, - /* 720 */ 2191, 2129, 2131, 2194, 2130, 2133, 2204, 2139, 2136, 2206, - /* 730 */ 2141, 2075, 2120, 2128, 2132, 2221, 2142, 2145, 2201, 2149, - /* 740 */ 2212, 2150, 2201, 2201, 2233, 2187, 2193, 2224, 2227, 2228, - /* 750 */ 2230, 2231, 2232, 2234, 2236, 2198, 2171, 2237, 2248, 2249, - /* 760 */ 2251, 2266, 2263, 2264, 2269, 2226, 1938, 2270, 1950, 2271, - /* 770 */ 2272, 2273, 2274, 2288, 2276, 2296, 2277, 2268, 2279, 2313, - /* 780 */ 2284, 2278, 2281, 2321, 2287, 2280, 2285, 2323, 2291, 2282, - /* 790 */ 2289, 2330, 2297, 2298, 2334, 2315, 2314, 2317, 2318, 2326, - /* 800 */ 2329, + /* 50 */ 673, 202, 257, 770, 35, 376, 625, 376, 35, 35, + /* 60 */ 376, 1344, 376, 1344, 1344, 445, 376, 1, 627, 98, + /* 70 */ 98, 627, 371, 371, 153, 167, 382, 382, 98, 98, + /* 80 */ 98, 98, 98, 98, 98, 98, 98, 98, 228, 98, + /* 90 */ 98, 216, 1, 98, 98, 365, 1, 98, 228, 98, + /* 100 */ 228, 1, 98, 98, 1, 98, 1, 1, 1, 98, + /* 110 */ 478, 1004, 15, 15, 642, 171, 669, 669, 669, 669, + /* 120 */ 669, 669, 669, 669, 669, 669, 669, 669, 669, 669, + /* 130 */ 669, 669, 669, 669, 669, 447, 430, 153, 167, 450, + /* 140 */ 450, 281, 101, 101, 101, 898, 305, 305, 281, 216, + /* 150 */ 476, 393, 1, 623, 1, 623, 623, 601, 681, 28, + /* 160 */ 28, 28, 28, 28, 28, 28, 28, 1962, 851, 261, + /* 170 */ 368, 34, 196, 32, 340, 618, 618, 481, 568, 522, + /* 180 */ 378, 201, 938, 786, 1013, 1096, 951, 1017, 448, 951, + /* 190 */ 1177, 357, 24, 1140, 1358, 1389, 1204, 216, 1389, 216, + /* 200 */ 1232, 1405, 1385, 1410, 1405, 1385, 1291, 1427, 1405, 1427, + /* 210 */ 1385, 1291, 1291, 1368, 1378, 1427, 1383, 1427, 1427, 1427, + /* 220 */ 1468, 1442, 1468, 1442, 1389, 216, 1475, 216, 1482, 1492, + /* 230 */ 216, 1482, 216, 216, 216, 1427, 216, 1468, 1, 1, + /* 240 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1427, + /* 250 */ 1468, 623, 623, 623, 1338, 1446, 1389, 478, 1360, 1370, + /* 260 */ 1475, 478, 1375, 1140, 1427, 1410, 1410, 623, 1303, 1310, + /* 270 */ 623, 1303, 1310, 623, 623, 1, 1335, 1434, 1303, 1334, + /* 280 */ 1339, 1353, 1140, 1340, 1342, 1346, 1372, 1405, 1612, 1519, + /* 290 */ 1374, 1482, 478, 478, 1617, 1310, 623, 623, 623, 623, + /* 300 */ 623, 1310, 623, 1493, 478, 601, 478, 1405, 1572, 1577, + /* 310 */ 623, 681, 1427, 478, 1650, 1468, 2797, 2797, 2797, 2797, + /* 320 */ 2797, 2797, 2797, 2797, 2797, 1002, 1072, 225, 414, 931, + /* 330 */ 749, 943, 690, 646, 1170, 1246, 988, 1127, 1127, 1127, + /* 340 */ 1127, 1127, 1127, 1127, 1127, 1127, 720, 187, 200, 200, + /* 350 */ 662, 760, 588, 583, 561, 672, 731, 579, 611, 702, + /* 360 */ 702, 922, 8, 276, 922, 922, 922, 1243, 1040, 584, + /* 370 */ 352, 1187, 1100, 1203, 1160, 1162, 1172, 1186, 1198, 1199, + /* 380 */ 1228, 1281, 1294, 1066, 1194, 1222, 1212, 1255, 1256, 1260, + /* 390 */ 1165, 1067, 1193, 1263, 1264, 1265, 1266, 1267, 1268, 1312, + /* 400 */ 1274, 1123, 1276, 1282, 1279, 1280, 1284, 1292, 1295, 1296, + /* 410 */ 758, 421, 1197, 1306, 1341, 1286, 1315, 1698, 1700, 1702, + /* 420 */ 1661, 1704, 1670, 1491, 1682, 1685, 1686, 1506, 1724, 1692, + /* 430 */ 1705, 1521, 1739, 1525, 1742, 1708, 1746, 1726, 1751, 1717, + /* 440 */ 1542, 1755, 1557, 1757, 1559, 1560, 1569, 1573, 1763, 1765, + /* 450 */ 1766, 1580, 1582, 1769, 1770, 1725, 1771, 1738, 1727, 1775, + /* 460 */ 1730, 1778, 1737, 1780, 1781, 1783, 1741, 1785, 1786, 1789, + /* 470 */ 1790, 1791, 1792, 1634, 1764, 1798, 1647, 1808, 1809, 1810, + /* 480 */ 1813, 1815, 1816, 1818, 1820, 1822, 1823, 1825, 1827, 1828, + /* 490 */ 1829, 1831, 1833, 1787, 1843, 1802, 1845, 1846, 1847, 1848, + /* 500 */ 1850, 1852, 1832, 1853, 1855, 1856, 1714, 1858, 1859, 1842, + /* 510 */ 1826, 1849, 1830, 1875, 1814, 1851, 1877, 1819, 1880, 1834, + /* 520 */ 1882, 1884, 1854, 1836, 1862, 1887, 1857, 1839, 1869, 1890, + /* 530 */ 1860, 1863, 1874, 1894, 1865, 1898, 1872, 1876, 1873, 1871, + /* 540 */ 1879, 1905, 1881, 1921, 1891, 1883, 1924, 1930, 1938, 1902, + /* 550 */ 1760, 1943, 1944, 1945, 1885, 1946, 1949, 1916, 1903, 1914, + /* 560 */ 1955, 1922, 1907, 1919, 1970, 1937, 1925, 1934, 1975, 1942, + /* 570 */ 1927, 1940, 1980, 1982, 1984, 1985, 1988, 1989, 1888, 1889, + /* 580 */ 1956, 1971, 1994, 1972, 1974, 1977, 1979, 1981, 1983, 1992, + /* 590 */ 1973, 1996, 2006, 2007, 1993, 2008, 2029, 2022, 2045, 2024, + /* 600 */ 1997, 2047, 2027, 2015, 2052, 2018, 2054, 2020, 2056, 2035, + /* 610 */ 2038, 2025, 2026, 2033, 1958, 1963, 2059, 1897, 1967, 1878, + /* 620 */ 2036, 2050, 2077, 1892, 2066, 1917, 1918, 2090, 2091, 1923, + /* 630 */ 1915, 1926, 1932, 2093, 2058, 1838, 1991, 2009, 2011, 2067, + /* 640 */ 2016, 2068, 2019, 2017, 2075, 2076, 2023, 2028, 2030, 2037, + /* 650 */ 2032, 2078, 2081, 2082, 2040, 2079, 1867, 2041, 2042, 2127, + /* 660 */ 2097, 1886, 2099, 2109, 2112, 2114, 2115, 2117, 2049, 2051, + /* 670 */ 2110, 1900, 2119, 2124, 2156, 2159, 2071, 2138, 1871, 2137, + /* 680 */ 2083, 2085, 2087, 2084, 2092, 2021, 2094, 2193, 2155, 2034, + /* 690 */ 2095, 2086, 1871, 2153, 2157, 2104, 1957, 2107, 2207, 2188, + /* 700 */ 1995, 2108, 2111, 2113, 2116, 2118, 2121, 2165, 2120, 2125, + /* 710 */ 2170, 2123, 2192, 2010, 2134, 2105, 2135, 2187, 2203, 2140, + /* 720 */ 2147, 2209, 2154, 2152, 2223, 2158, 2161, 2224, 2160, 2162, + /* 730 */ 2225, 2164, 2168, 2227, 2166, 2142, 2145, 2148, 2149, 2251, + /* 740 */ 2163, 2173, 2233, 2176, 2246, 2179, 2233, 2233, 2262, 2216, + /* 750 */ 2218, 2252, 2253, 2255, 2265, 2267, 2270, 2272, 2274, 2235, + /* 760 */ 2214, 2268, 2279, 2280, 2282, 2296, 2284, 2288, 2289, 2241, + /* 770 */ 1973, 2290, 1996, 2291, 2292, 2293, 2295, 2307, 2297, 2331, + /* 780 */ 2299, 2287, 2298, 2338, 2304, 2302, 2315, 2343, 2309, 2308, + /* 790 */ 2320, 2360, 2332, 2321, 2333, 2380, 2347, 2349, 2385, 2364, + /* 800 */ 2366, 2368, 2370, 2367, 2373, }; -#define YY_REDUCE_COUNT (320) -#define YY_REDUCE_MIN (-439) -#define YY_REDUCE_MAX (2516) +#define YY_REDUCE_COUNT (324) +#define YY_REDUCE_MIN (-391) +#define YY_REDUCE_MAX (2356) static const short yy_reduce_ofst[] = { - /* 0 */ 284, -341, -134, -27, 205, 840, 901, 969, 1032, 1058, - /* 10 */ 1093, 1162, 1190, 368, 1225, 1312, 52, 118, 347, 493, - /* 20 */ 1342, 1413, 1471, 1485, 1502, 1572, 1591, 1607, 1678, 1713, - /* 30 */ 1743, 1780, 1842, 1857, 1908, 1922, 1973, 2033, 2048, 2106, - /* 40 */ 2123, 2137, 2174, 2195, 2261, 2275, 2292, 2391, 2407, 2426, - /* 50 */ 2516, -274, 232, 409, -292, -371, 655, 756, -136, 41, - /* 60 */ 804, -366, 146, -311, -310, -107, 482, -19, -391, -346, - /* 70 */ -315, -287, -280, -270, -266, -117, -215, -173, -250, -73, - /* 80 */ 63, 70, -209, 37, 98, 258, 295, 363, 23, 336, - /* 90 */ 373, 359, -297, 415, 511, 114, 64, 496, 184, 521, - /* 100 */ 300, 398, 524, 598, 241, 626, 489, 342, 562, 761, - /* 110 */ 81, -278, -439, -439, -5, -168, 24, 75, 137, 142, - /* 120 */ 203, 400, 446, 604, 644, 685, 783, 795, 803, 807, - /* 130 */ 855, 856, 858, 859, 868, -16, -1, 121, 227, 770, - /* 140 */ 786, 559, -1, 384, 393, 355, 154, 256, 838, 202, - /* 150 */ 848, 850, 857, 864, -271, 435, 876, -385, -347, 494, - /* 160 */ 543, 657, 735, -388, -367, 218, -388, 245, 431, 464, - /* 170 */ 430, 377, 414, 565, 523, 693, 956, 888, 614, 888, - /* 180 */ 985, 940, 993, 995, 958, 954, 899, 899, 881, 899, - /* 190 */ 927, 928, 888, 979, 965, 986, 988, 1062, 1001, 1070, - /* 200 */ 1016, 1081, 1041, 1040, 1091, 1045, 1051, 1100, 1097, 1102, - /* 210 */ 1055, 1059, 1060, 1095, 1101, 1110, 1114, 1122, 1127, 1129, - /* 220 */ 1137, 1141, 1146, 1149, 1077, 1140, 1113, 1148, 1160, 1103, - /* 230 */ 1156, 1165, 1159, 1174, 1175, 1169, 1176, 1181, 1158, 1166, - /* 240 */ 1167, 1171, 1172, 1177, 1178, 1186, 1197, 1154, 1157, 1163, - /* 250 */ 1131, 1138, 1139, 1205, 1145, 1150, 1180, 1214, 1182, 1170, - /* 260 */ 1222, 1173, 1183, 1184, 1117, 1187, 1188, 1118, 1201, 1189, - /* 270 */ 1194, 888, 1130, 1132, 1135, 1142, 1147, 1155, 1208, 1143, - /* 280 */ 1153, 1152, 899, 1287, 1212, 1185, 1193, 1293, 1289, 1292, - /* 290 */ 1246, 1245, 1274, 1275, 1276, 1279, 1295, 1250, 1297, 1270, - /* 300 */ 1311, 1299, 1320, 1327, 1231, 1301, 1298, 1316, 1337, 1338, - /* 310 */ 1350, 1348, 1285, 1280, 1300, 1302, 1323, 1325, 1326, 1339, - /* 320 */ 1362, + /* 0 */ -20, -341, -134, -27, 205, 850, 897, 1001, 1021, 1070, + /* 10 */ 1159, 1208, 1278, 158, 539, 1298, 52, 347, 1090, 1367, + /* 20 */ 358, 1402, 1432, 1469, 1499, 1531, 1568, 1598, 1645, 1671, + /* 30 */ 1732, 1745, 1796, 1812, 1861, 1912, 1928, 1941, 1961, 2031, + /* 40 */ 2064, 2080, 2101, 2167, 2180, 2191, 2204, 2281, 2294, 2305, + /* 50 */ 2356, -274, 142, 40, -292, -371, 275, 582, 419, 427, + /* 60 */ 756, -366, 47, -311, -310, 383, 410, -9, -391, -346, + /* 70 */ -315, -308, -342, -280, -265, -314, -313, -173, -229, -162, + /* 80 */ -73, 3, 17, 83, 273, 345, 351, 145, -41, 372, + /* 90 */ 573, 243, -66, 575, 674, 86, -29, 467, 38, 687, + /* 100 */ 184, 329, 762, 824, 159, 829, 460, 331, 609, 845, + /* 110 */ -285, -351, -317, -317, -85, -236, -258, 106, 528, 590, + /* 120 */ 607, 643, 656, 685, 707, 708, 709, 710, 712, 717, + /* 130 */ 723, 795, 802, 856, 871, -132, -289, -226, -174, 155, + /* 140 */ 490, 523, -289, 563, 680, 613, 517, 755, 698, 759, + /* 150 */ 797, 203, 95, 640, 41, 718, 728, 773, 838, -364, + /* 160 */ -320, 452, 484, 562, 585, 597, 562, 904, 380, 913, + /* 170 */ 936, 857, 870, 996, 881, 990, 994, 1006, 963, 1006, + /* 180 */ 1027, 985, 1039, 1042, 1000, 995, 937, 937, 911, 937, + /* 190 */ 949, 939, 1006, 992, 979, 989, 987, 1056, 998, 1057, + /* 200 */ 1008, 1074, 1029, 1031, 1088, 1044, 1048, 1112, 1113, 1116, + /* 210 */ 1075, 1078, 1079, 1107, 1117, 1128, 1121, 1134, 1135, 1136, + /* 220 */ 1145, 1143, 1148, 1146, 1071, 1137, 1102, 1139, 1156, 1099, + /* 230 */ 1154, 1163, 1169, 1171, 1173, 1168, 1174, 1188, 1158, 1161, + /* 240 */ 1164, 1166, 1167, 1175, 1176, 1178, 1179, 1181, 1182, 1185, + /* 250 */ 1196, 1150, 1151, 1153, 1126, 1130, 1141, 1206, 1144, 1149, + /* 260 */ 1180, 1213, 1184, 1192, 1221, 1189, 1205, 1183, 1108, 1191, + /* 270 */ 1209, 1120, 1201, 1217, 1220, 1006, 1142, 1147, 1152, 1155, + /* 280 */ 1157, 1190, 1210, 1132, 1200, 1195, 937, 1277, 1202, 1207, + /* 290 */ 1211, 1299, 1289, 1293, 1234, 1242, 1262, 1269, 1270, 1271, + /* 300 */ 1272, 1249, 1273, 1275, 1308, 1297, 1311, 1316, 1226, 1300, + /* 310 */ 1290, 1317, 1330, 1327, 1343, 1345, 1283, 1287, 1285, 1288, + /* 320 */ 1320, 1321, 1323, 1332, 1361, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 10 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 20 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 30 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 40 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 50 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 60 */ 2100, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 70 */ 1788, 1788, 1788, 1788, 2073, 1788, 1788, 1788, 1788, 1788, - /* 80 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 90 */ 1788, 1877, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 100 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 110 */ 1875, 2066, 2292, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 120 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 130 */ 1788, 1788, 1788, 1788, 1788, 1788, 2304, 1788, 1788, 1851, - /* 140 */ 1851, 1788, 2304, 2304, 2304, 1875, 2264, 2264, 1788, 1877, - /* 150 */ 1788, 1788, 1788, 1788, 2134, 1788, 1788, 1788, 1788, 1788, - /* 160 */ 1788, 1998, 1788, 2022, 1788, 1788, 1788, 2126, 1788, 1788, - /* 170 */ 2333, 2390, 1788, 1788, 2336, 1788, 1788, 1788, 1788, 1788, - /* 180 */ 1788, 2078, 1788, 1788, 1950, 2323, 2296, 2310, 2374, 2297, - /* 190 */ 2294, 2317, 1788, 2327, 1788, 1788, 2148, 1877, 1788, 1877, - /* 200 */ 2113, 1788, 2071, 1788, 1788, 2071, 2068, 1788, 1788, 1788, - /* 210 */ 2071, 2068, 2068, 1939, 1935, 1788, 1933, 1788, 1788, 1788, - /* 220 */ 1788, 1835, 1788, 1835, 1788, 1877, 1788, 1877, 1788, 1788, - /* 230 */ 1877, 1788, 1877, 1877, 1877, 1788, 1877, 1788, 1788, 1788, - /* 240 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 250 */ 2146, 2132, 1788, 1875, 2124, 2122, 1788, 1875, 2120, 2327, - /* 260 */ 1788, 1788, 1788, 1788, 2344, 2342, 1788, 2344, 2342, 1788, - /* 270 */ 1788, 1788, 2358, 2354, 2344, 2363, 2360, 2329, 2327, 2393, - /* 280 */ 2380, 2376, 2310, 1788, 1788, 2315, 2313, 1788, 1875, 1875, - /* 290 */ 1788, 2342, 1788, 1788, 1788, 1788, 1788, 2342, 1788, 1788, - /* 300 */ 1875, 1788, 1875, 1788, 1788, 1966, 1788, 1788, 1788, 1875, - /* 310 */ 1820, 1788, 2115, 2137, 2096, 2096, 2001, 2001, 2001, 1878, - /* 320 */ 1793, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 330 */ 1788, 1788, 1788, 2357, 2356, 2219, 1788, 2268, 2267, 2266, - /* 340 */ 2257, 2218, 1962, 1788, 2217, 2216, 1788, 1788, 1788, 1788, - /* 350 */ 1788, 1788, 1788, 1788, 1788, 2087, 2086, 2210, 1788, 1788, - /* 360 */ 2211, 2209, 2208, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 370 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 380 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 2377, 2381, 1788, - /* 390 */ 1788, 1788, 1788, 1788, 1788, 2293, 1788, 1788, 1788, 2192, - /* 400 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 410 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 420 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 430 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 440 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 450 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 460 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 470 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 480 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 490 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 500 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 510 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 520 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 530 */ 1788, 1788, 1788, 1788, 1825, 2197, 1788, 1788, 1788, 1788, - /* 540 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 550 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 560 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 570 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 580 */ 1788, 1788, 1788, 1788, 1788, 1788, 1916, 1915, 1788, 1788, - /* 590 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 600 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 610 */ 2201, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 620 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 2373, - /* 630 */ 2330, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 640 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 2192, - /* 650 */ 1788, 2355, 1788, 1788, 2371, 1788, 2375, 1788, 1788, 1788, - /* 660 */ 1788, 1788, 1788, 1788, 2303, 2299, 1788, 1788, 2295, 1788, - /* 670 */ 1788, 1788, 1788, 1788, 2200, 1788, 1788, 1788, 1788, 1788, - /* 680 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 2191, 1788, - /* 690 */ 2254, 1788, 1788, 1788, 2288, 1788, 1788, 2239, 1788, 1788, - /* 700 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 2201, 1788, 2204, - /* 710 */ 1788, 1788, 1788, 1788, 1788, 1995, 1788, 1788, 1788, 1788, - /* 720 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 730 */ 1788, 1979, 1977, 1976, 1975, 1788, 1972, 1788, 2008, 1788, - /* 740 */ 1788, 1788, 2004, 2003, 1788, 1788, 1788, 1788, 1788, 1788, - /* 750 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1896, 1788, 1788, - /* 760 */ 1788, 1788, 1788, 1788, 1788, 1788, 1888, 1788, 1887, 1788, - /* 770 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 780 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 790 */ 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, 1788, - /* 800 */ 1788, + /* 0 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 10 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 20 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 30 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 40 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 50 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 60 */ 2104, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 70 */ 1792, 1792, 1792, 1792, 2077, 1792, 1792, 1792, 1792, 1792, + /* 80 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 90 */ 1792, 1881, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 100 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 110 */ 1879, 2070, 2296, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 120 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 130 */ 1792, 1792, 1792, 1792, 1792, 1792, 2308, 1792, 1792, 1855, + /* 140 */ 1855, 1792, 2308, 2308, 2308, 1879, 2268, 2268, 1792, 1881, + /* 150 */ 2138, 1792, 1792, 1792, 1792, 1792, 1792, 2002, 1792, 1792, + /* 160 */ 1792, 1792, 1792, 2026, 1792, 1792, 1792, 2130, 1792, 1792, + /* 170 */ 2337, 2394, 1792, 1792, 2340, 1792, 1792, 1792, 1792, 1792, + /* 180 */ 1792, 2082, 1792, 1792, 1954, 2327, 2300, 2314, 2378, 2301, + /* 190 */ 2298, 2321, 1792, 2331, 1792, 1792, 2152, 1881, 1792, 1881, + /* 200 */ 2117, 1792, 2075, 1792, 1792, 2075, 2072, 1792, 1792, 1792, + /* 210 */ 2075, 2072, 2072, 1943, 1939, 1792, 1937, 1792, 1792, 1792, + /* 220 */ 1792, 1839, 1792, 1839, 1792, 1881, 1792, 1881, 1792, 1792, + /* 230 */ 1881, 1792, 1881, 1881, 1881, 1792, 1881, 1792, 1792, 1792, + /* 240 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 250 */ 1792, 1792, 1792, 1792, 2150, 2136, 1792, 1879, 2128, 2126, + /* 260 */ 1792, 1879, 2124, 2331, 1792, 1792, 1792, 1792, 2348, 2346, + /* 270 */ 1792, 2348, 2346, 1792, 1792, 1792, 2362, 2358, 2348, 2367, + /* 280 */ 2364, 2333, 2331, 2397, 2384, 2380, 2314, 1792, 1792, 2319, + /* 290 */ 2317, 1792, 1879, 1879, 1792, 2346, 1792, 1792, 1792, 1792, + /* 300 */ 1792, 2346, 1792, 1792, 1879, 1792, 1879, 1792, 1792, 1970, + /* 310 */ 1792, 1792, 1792, 1879, 1824, 1792, 2119, 2141, 2100, 2100, + /* 320 */ 2005, 2005, 2005, 1882, 1797, 1792, 1792, 1792, 1792, 1792, + /* 330 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 2361, 2360, 2223, + /* 340 */ 1792, 2272, 2271, 2270, 2261, 2222, 1966, 1792, 2221, 2220, + /* 350 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 2091, + /* 360 */ 2090, 2214, 1792, 1792, 2215, 2213, 2212, 1792, 1792, 1792, + /* 370 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 380 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 390 */ 1792, 2381, 2385, 1792, 1792, 1792, 1792, 1792, 1792, 2297, + /* 400 */ 1792, 1792, 1792, 2196, 1792, 1792, 1792, 1792, 1792, 1792, + /* 410 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 420 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 430 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 440 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 450 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 460 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 470 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 480 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 490 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 500 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 510 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 520 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 530 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1829, 2201, + /* 540 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 550 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 560 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 570 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 580 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 590 */ 1920, 1919, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 600 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 610 */ 1792, 1792, 1792, 1792, 2205, 1792, 1792, 1792, 1792, 1792, + /* 620 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 630 */ 1792, 1792, 1792, 2377, 2334, 1792, 1792, 1792, 1792, 1792, + /* 640 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 650 */ 1792, 1792, 1792, 2196, 1792, 2359, 1792, 1792, 2375, 1792, + /* 660 */ 2379, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 2307, 2303, + /* 670 */ 1792, 1792, 2299, 1792, 1792, 1792, 1792, 1792, 2204, 1792, + /* 680 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 690 */ 1792, 1792, 2195, 1792, 2258, 1792, 1792, 1792, 2292, 1792, + /* 700 */ 1792, 2243, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 710 */ 1792, 2205, 1792, 2208, 1792, 1792, 1792, 1792, 1792, 1999, + /* 720 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 730 */ 1792, 1792, 1792, 1792, 1792, 1983, 1981, 1980, 1979, 1792, + /* 740 */ 1976, 1792, 2012, 1792, 1792, 1792, 2008, 2007, 1792, 1792, + /* 750 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 760 */ 1792, 1900, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 770 */ 1892, 1792, 1891, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 780 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 790 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, + /* 800 */ 1792, 1792, 1792, 1792, 1792, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1466,6 +1428,7 @@ typedef struct yyParser yyParser; #ifndef NDEBUG #include +#include static FILE *yyTraceFILE = 0; static char *yyTracePrompt = 0; #endif /* NDEBUG */ @@ -1880,15 +1843,15 @@ static const char *const yyTokenName[] = { /* 377 */ "multi_drop_clause", /* 378 */ "alter_table_clause", /* 379 */ "alter_table_options", - /* 380 */ "column_def", - /* 381 */ "column_name", + /* 380 */ "column_name", + /* 381 */ "type_name", /* 382 */ "signed_literal", /* 383 */ "create_subtable_clause", /* 384 */ "specific_cols_opt", /* 385 */ "expression_list", /* 386 */ "drop_table_clause", /* 387 */ "col_name_list", - /* 388 */ "type_name", + /* 388 */ "column_def", /* 389 */ "duration_list", /* 390 */ "rollup_func_list", /* 391 */ "alter_table_option", @@ -2157,13 +2120,13 @@ static const char *const yyRuleName[] = { /* 157 */ "cmd ::= ALTER TABLE alter_table_clause", /* 158 */ "cmd ::= ALTER STABLE alter_table_clause", /* 159 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 160 */ "alter_table_clause ::= full_table_name ADD COLUMN column_def", + /* 160 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", /* 161 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 162 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_def", + /* 162 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", /* 163 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 164 */ "alter_table_clause ::= full_table_name ADD TAG column_def", + /* 164 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", /* 165 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 166 */ "alter_table_clause ::= full_table_name MODIFY TAG column_def", + /* 166 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", /* 167 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", /* 168 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", /* 169 */ "multi_create_clause ::= create_subtable_clause", @@ -2742,10 +2705,10 @@ static void yy_destructor( case 374: /* table_options */ case 378: /* alter_table_clause */ case 379: /* alter_table_options */ - case 380: /* column_def */ case 382: /* signed_literal */ case 383: /* create_subtable_clause */ case 386: /* drop_table_clause */ + case 388: /* column_def */ case 392: /* duration_literal */ case 393: /* rollup_func_name */ case 395: /* col_name */ @@ -2821,7 +2784,7 @@ static void yy_destructor( case 352: /* table_name */ case 353: /* topic_name */ case 355: /* dnode_endpoint */ - case 381: /* column_name */ + case 380: /* column_name */ case 394: /* function_name */ case 402: /* column_alias */ case 405: /* index_name */ @@ -2908,7 +2871,7 @@ static void yy_destructor( } break; - case 388: /* type_name */ + case 381: /* type_name */ { } @@ -3103,7 +3066,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); @@ -3385,13 +3348,13 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 339, /* (157) cmd ::= ALTER TABLE alter_table_clause */ 339, /* (158) cmd ::= ALTER STABLE alter_table_clause */ 378, /* (159) alter_table_clause ::= full_table_name alter_table_options */ - 378, /* (160) alter_table_clause ::= full_table_name ADD COLUMN column_def */ + 378, /* (160) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ 378, /* (161) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 378, /* (162) alter_table_clause ::= full_table_name MODIFY COLUMN column_def */ + 378, /* (162) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ 378, /* (163) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 378, /* (164) alter_table_clause ::= full_table_name ADD TAG column_def */ + 378, /* (164) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ 378, /* (165) alter_table_clause ::= full_table_name DROP TAG column_name */ - 378, /* (166) alter_table_clause ::= full_table_name MODIFY TAG column_def */ + 378, /* (166) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ 378, /* (167) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ 378, /* (168) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ 375, /* (169) multi_create_clause ::= create_subtable_clause */ @@ -3406,32 +3369,32 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 371, /* (178) full_table_name ::= db_name NK_DOT table_name */ 372, /* (179) column_def_list ::= column_def */ 372, /* (180) column_def_list ::= column_def_list NK_COMMA column_def */ - 380, /* (181) column_def ::= column_name type_name */ - 380, /* (182) column_def ::= column_name type_name COMMENT NK_STRING */ - 388, /* (183) type_name ::= BOOL */ - 388, /* (184) type_name ::= TINYINT */ - 388, /* (185) type_name ::= SMALLINT */ - 388, /* (186) type_name ::= INT */ - 388, /* (187) type_name ::= INTEGER */ - 388, /* (188) type_name ::= BIGINT */ - 388, /* (189) type_name ::= FLOAT */ - 388, /* (190) type_name ::= DOUBLE */ - 388, /* (191) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 388, /* (192) type_name ::= TIMESTAMP */ - 388, /* (193) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 388, /* (194) type_name ::= TINYINT UNSIGNED */ - 388, /* (195) type_name ::= SMALLINT UNSIGNED */ - 388, /* (196) type_name ::= INT UNSIGNED */ - 388, /* (197) type_name ::= BIGINT UNSIGNED */ - 388, /* (198) type_name ::= JSON */ - 388, /* (199) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 388, /* (200) type_name ::= MEDIUMBLOB */ - 388, /* (201) type_name ::= BLOB */ - 388, /* (202) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 388, /* (203) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 388, /* (204) type_name ::= DECIMAL */ - 388, /* (205) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 388, /* (206) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 388, /* (181) column_def ::= column_name type_name */ + 388, /* (182) column_def ::= column_name type_name COMMENT NK_STRING */ + 381, /* (183) type_name ::= BOOL */ + 381, /* (184) type_name ::= TINYINT */ + 381, /* (185) type_name ::= SMALLINT */ + 381, /* (186) type_name ::= INT */ + 381, /* (187) type_name ::= INTEGER */ + 381, /* (188) type_name ::= BIGINT */ + 381, /* (189) type_name ::= FLOAT */ + 381, /* (190) type_name ::= DOUBLE */ + 381, /* (191) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 381, /* (192) type_name ::= TIMESTAMP */ + 381, /* (193) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 381, /* (194) type_name ::= TINYINT UNSIGNED */ + 381, /* (195) type_name ::= SMALLINT UNSIGNED */ + 381, /* (196) type_name ::= INT UNSIGNED */ + 381, /* (197) type_name ::= BIGINT UNSIGNED */ + 381, /* (198) type_name ::= JSON */ + 381, /* (199) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 381, /* (200) type_name ::= MEDIUMBLOB */ + 381, /* (201) type_name ::= BLOB */ + 381, /* (202) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 381, /* (203) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 381, /* (204) type_name ::= DECIMAL */ + 381, /* (205) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 381, /* (206) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ 373, /* (207) tags_def_opt ::= */ 373, /* (208) tags_def_opt ::= tags_def */ 376, /* (209) tags_def ::= TAGS NK_LP column_def_list NK_RP */ @@ -3626,7 +3589,7 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 431, /* (398) literal_list ::= literal_list NK_COMMA signed_literal */ 351, /* (399) db_name ::= NK_ID */ 352, /* (400) table_name ::= NK_ID */ - 381, /* (401) column_name ::= NK_ID */ + 380, /* (401) column_name ::= NK_ID */ 394, /* (402) function_name ::= NK_ID */ 432, /* (403) table_alias ::= NK_ID */ 402, /* (404) column_alias ::= NK_ID */ @@ -3995,13 +3958,13 @@ static const signed char yyRuleInfoNRhs[] = { -3, /* (157) cmd ::= ALTER TABLE alter_table_clause */ -3, /* (158) cmd ::= ALTER STABLE alter_table_clause */ -2, /* (159) alter_table_clause ::= full_table_name alter_table_options */ - -4, /* (160) alter_table_clause ::= full_table_name ADD COLUMN column_def */ + -5, /* (160) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -4, /* (161) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - -4, /* (162) alter_table_clause ::= full_table_name MODIFY COLUMN column_def */ + -5, /* (162) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -5, /* (163) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - -4, /* (164) alter_table_clause ::= full_table_name ADD TAG column_def */ + -5, /* (164) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -4, /* (165) alter_table_clause ::= full_table_name DROP TAG column_name */ - -4, /* (166) alter_table_clause ::= full_table_name MODIFY TAG column_def */ + -5, /* (166) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -5, /* (167) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -6, /* (168) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -1, /* (169) multi_create_clause ::= create_subtable_clause */ @@ -4469,8 +4432,9 @@ static YYACTIONTYPE yy_reduce( (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; + assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ); #ifndef NDEBUG - if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ + if( yyTraceFILE ){ yysize = yyRuleInfoNRhs[yyruleno]; if( yysize ){ fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", @@ -5102,33 +5066,33 @@ static YYACTIONTYPE yy_reduce( { yylhsminor.yy952 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 160: /* alter_table_clause ::= full_table_name ADD COLUMN column_def */ -{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-3].minor.yy952, TSDB_ALTER_TABLE_ADD_COLUMN, yymsp[0].minor.yy952); } - yymsp[-3].minor.yy952 = yylhsminor.yy952; + case 160: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ +{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84); } + yymsp[-4].minor.yy952 = yylhsminor.yy952; break; case 161: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ { yylhsminor.yy952 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy952, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy169); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 162: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_def */ -{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-3].minor.yy952, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, yymsp[0].minor.yy952); } - yymsp[-3].minor.yy952 = yylhsminor.yy952; + case 162: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ +{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84); } + yymsp[-4].minor.yy952 = yylhsminor.yy952; break; case 163: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ { yylhsminor.yy952 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy169, &yymsp[0].minor.yy169); } yymsp[-4].minor.yy952 = yylhsminor.yy952; break; - case 164: /* alter_table_clause ::= full_table_name ADD TAG column_def */ -{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-3].minor.yy952, TSDB_ALTER_TABLE_ADD_TAG, yymsp[0].minor.yy952); } - yymsp[-3].minor.yy952 = yylhsminor.yy952; + case 164: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ +{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84); } + yymsp[-4].minor.yy952 = yylhsminor.yy952; break; case 165: /* alter_table_clause ::= full_table_name DROP TAG column_name */ { yylhsminor.yy952 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy952, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy169); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 166: /* alter_table_clause ::= full_table_name MODIFY TAG column_def */ -{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-3].minor.yy952, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, yymsp[0].minor.yy952); } - yymsp[-3].minor.yy952 = yylhsminor.yy952; + case 166: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ +{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84); } + yymsp[-4].minor.yy952 = yylhsminor.yy952; break; case 167: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ { yylhsminor.yy952 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy169, &yymsp[0].minor.yy169); } diff --git a/tests/system-test/0-others/show.py b/tests/system-test/0-others/show.py index 864c3e8a31..0482a76bdd 100644 --- a/tests/system-test/0-others/show.py +++ b/tests/system-test/0-others/show.py @@ -215,51 +215,12 @@ class TDTestCase: tdSql.execute("use comment_test_db") tdSql.execute("create table normal_table(ts timestamp, c2 int comment 'c2 comment')") tdSql.execute("create stable super_table(ts timestamp comment 'ts', c2 int comment 'c2 comment') tags(tg int comment 'tg comment')") - - create_sql = "create table `normal_table` (`ts` timestamp, `c2` int)" tdSql.query('show create table normal_table') + create_sql = "create table `normal_table` (`ts` timestamp, `c2` int)" tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) tdSql.query('show create table super_table') create_sql = "create stable `super_table` (`ts` timestamp, `c2` int) tags (`tg` int)" tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - tdSql.execute("drop database comment_test_db") - - def alter_table_with_col_comment(self): - tdSql.execute("create database comment_test_db") - tdSql.execute("use comment_test_db") - tdSql.execute("create table normal_table(ts timestamp, c2 int comment 'c2 comment')") - tdSql.execute("create stable super_table(ts timestamp comment 'ts', c2 int comment 'c2 comment') tags(tg int comment 'tg comment')") - - create_sql = "create table `normal_table` (`ts` timestamp, `c2` int, `c3` int)" - tdSql.execute("alter table normal_table add column c3 int comment 'c3 comment'", queryTimes=1) - tdSql.query("show create table normal_table") - tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - - create_sql = "create table `normal_table` (`ts` timestamp, `c2` int, `c3` int, `c4` varchar(255))" - tdSql.execute("alter table normal_table add column c4 varchar(255) comment 'c4 comment'", queryTimes=1) - tdSql.query("show create table normal_table") - tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - - create_sql = "create table `normal_table` (`ts` timestamp, `c2` int, `c3` int, `c4` varchar(255), `c5` varchar(255))" - tdSql.execute("alter table normal_table add column c5 varchar(255)", queryTimes=1) - tdSql.query("show create table normal_table") - tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - - create_sql = "create stable `super_table` (`ts` timestamp, `c2` int, `c3` int) tags (`tg` int) sma(`ts`,`c2`)" - tdSql.execute("alter table super_table add column c3 int comment 'c3 comment'", queryTimes=1) - tdSql.query("show create table super_table") - tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - - create_sql = "create stable `super_table` (`ts` timestamp, `c2` int, `c3` int, `c4` varchar(255)) tags (`tg` int) sma(`ts`,`c2`)" - tdSql.execute("alter table super_table add column c4 varchar(255) comment 'c4 comment'", queryTimes=1) - tdSql.query("show create table super_table") - tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - - create_sql = "create stable `super_table` (`ts` timestamp, `c2` int, `c3` int, `c4` varchar(256)) tags (`tg` int) sma(`ts`,`c2`)" - tdSql.execute("alter table super_table modify column c4 varchar(256) comment 'c4 256 comment'", queryTimes=1) - tdSql.query("show create table super_table") - tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - tdSql.execute("drop database comment_test_db") def run(self): self.check_gitinfo() @@ -270,7 +231,6 @@ class TDTestCase: self.show_create_sysdb_sql() self.show_create_systb_sql() self.show_create_table_with_col_comment() - self.alter_table_with_col_comment() def stop(self): tdSql.close() From 366a9cc0090588b715cba5c40373827da5d6fb0c Mon Sep 17 00:00:00 2001 From: wangjiaming0909 <604227650@qq.com> Date: Thu, 24 Aug 2023 13:54:27 +0800 Subject: [PATCH 41/46] Revert "feat: support column comment" This reverts commit dcbef83deae7b18e2a9b3e0c38af81d306c9ea58. --- include/common/tmsg.h | 2 - include/common/ttokendef.h | 38 +- include/libs/nodes/cmdnodes.h | 2 +- include/util/tdef.h | 5 +- source/common/src/tmsg.c | 4 - source/dnode/mnode/impl/src/mndStb.c | 2 - source/libs/parser/inc/sql.y | 2 +- source/libs/parser/src/parTranslater.c | 2 - source/libs/parser/src/sql.c | 4635 ++++++++++++------------ tests/system-test/0-others/show.py | 13 - 10 files changed, 2337 insertions(+), 2368 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 20a39a5fb3..b6684cdd0e 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -441,7 +441,6 @@ typedef struct SField { uint8_t type; int8_t flags; int32_t bytes; - char comment[TSDB_COL_COMMENT_LEN]; } SField; typedef struct SRetention { @@ -520,7 +519,6 @@ struct SSchema { col_id_t colId; int32_t bytes; char name[TSDB_COL_NAME_LEN]; - char comment[TSDB_COL_COMMENT_LEN]; }; struct SSchema2 { diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 42b9bc8939..163c3a3d3f 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -130,25 +130,25 @@ #define TK_NK_EQ 112 #define TK_USING 113 #define TK_TAGS 114 -#define TK_COMMENT 115 -#define TK_BOOL 116 -#define TK_TINYINT 117 -#define TK_SMALLINT 118 -#define TK_INT 119 -#define TK_INTEGER 120 -#define TK_BIGINT 121 -#define TK_FLOAT 122 -#define TK_DOUBLE 123 -#define TK_BINARY 124 -#define TK_NCHAR 125 -#define TK_UNSIGNED 126 -#define TK_JSON 127 -#define TK_VARCHAR 128 -#define TK_MEDIUMBLOB 129 -#define TK_BLOB 130 -#define TK_VARBINARY 131 -#define TK_GEOMETRY 132 -#define TK_DECIMAL 133 +#define TK_BOOL 115 +#define TK_TINYINT 116 +#define TK_SMALLINT 117 +#define TK_INT 118 +#define TK_INTEGER 119 +#define TK_BIGINT 120 +#define TK_FLOAT 121 +#define TK_DOUBLE 122 +#define TK_BINARY 123 +#define TK_NCHAR 124 +#define TK_UNSIGNED 125 +#define TK_JSON 126 +#define TK_VARCHAR 127 +#define TK_MEDIUMBLOB 128 +#define TK_BLOB 129 +#define TK_VARBINARY 130 +#define TK_GEOMETRY 131 +#define TK_DECIMAL 132 +#define TK_COMMENT 133 #define TK_MAX_DELAY 134 #define TK_WATERMARK 135 #define TK_ROLLUP 136 diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index b6c4e89a33..f0a715e651 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -155,7 +155,7 @@ typedef struct SColumnDefNode { ENodeType type; char colName[TSDB_COL_NAME_LEN]; SDataType dataType; - char comments[TSDB_COL_COMMENT_LEN]; + char comments[TSDB_TB_COMMENT_LEN]; bool sma; } SColumnDefNode; diff --git a/include/util/tdef.h b/include/util/tdef.h index e9ed47465a..68a21ea4cf 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -228,9 +228,8 @@ typedef enum ELogicConditionType { #define TSDB_MAX_SQL_SHOW_LEN 1024 #define TSDB_MAX_ALLOWED_SQL_LEN (1 * 1024 * 1024u) // sql length should be less than 1mb -#define TSDB_APP_NAME_LEN TSDB_UNI_LEN -#define TSDB_TB_COMMENT_LEN 1025 -#define TSDB_COL_COMMENT_LEN 1025 +#define TSDB_APP_NAME_LEN TSDB_UNI_LEN +#define TSDB_TB_COMMENT_LEN 1025 #define TSDB_QUERY_ID_LEN 26 #define TSDB_TRANS_OPER_LEN 16 diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 6131b15e53..1431cd049a 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -534,7 +534,6 @@ int32_t tSerializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pReq if (tEncodeI8(&encoder, pField->flags) < 0) return -1; if (tEncodeI32(&encoder, pField->bytes) < 0) return -1; if (tEncodeCStr(&encoder, pField->name) < 0) return -1; - if (tEncodeCStr(&encoder, pField->comment) < 0) return -1; } for (int32_t i = 0; i < pReq->numOfTags; ++i) { @@ -543,7 +542,6 @@ int32_t tSerializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pReq if (tEncodeI8(&encoder, pField->flags) < 0) return -1; if (tEncodeI32(&encoder, pField->bytes) < 0) return -1; if (tEncodeCStr(&encoder, pField->name) < 0) return -1; - if (tEncodeCStr(&encoder, pField->comment) < 0) return -1; } for (int32_t i = 0; i < pReq->numOfFuncs; ++i) { @@ -610,7 +608,6 @@ int32_t tDeserializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pR if (tDecodeI8(&decoder, &field.flags) < 0) return -1; if (tDecodeI32(&decoder, &field.bytes) < 0) return -1; if (tDecodeCStrTo(&decoder, field.name) < 0) return -1; - if (tDecodeCStrTo(&decoder, field.comment) < 0) return -1; if (taosArrayPush(pReq->pColumns, &field) == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; @@ -623,7 +620,6 @@ int32_t tDeserializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pR if (tDecodeI8(&decoder, &field.flags) < 0) return -1; if (tDecodeI32(&decoder, &field.bytes) < 0) return -1; if (tDecodeCStrTo(&decoder, field.name) < 0) return -1; - if (tDecodeCStrTo(&decoder, field.comment) < 0) return -1; if (taosArrayPush(pReq->pTags, &field) == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 0d41650394..f52ce6582b 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -839,7 +839,6 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat pSchema->bytes = pField->bytes; pSchema->flags = pField->flags; memcpy(pSchema->name, pField->name, TSDB_COL_NAME_LEN); - memcpy(pSchema->comment, pField->comment, TSDB_COL_COMMENT_LEN); pSchema->colId = pDst->nextColId; pDst->nextColId++; } @@ -853,7 +852,6 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat SSCHMEA_SET_IDX_ON(pSchema); } memcpy(pSchema->name, pField->name, TSDB_COL_NAME_LEN); - memcpy(pSchema->comment, pField->comment, TSDB_COL_COMMENT_LEN); pSchema->colId = pDst->nextColId; pDst->nextColId++; } diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index a86666ec98..0661cc5963 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -358,7 +358,7 @@ column_def_list(A) ::= column_def(B). column_def_list(A) ::= column_def_list(B) NK_COMMA column_def(C). { A = addNodeToList(pCxt, B, C); } column_def(A) ::= column_name(B) type_name(C). { A = createColumnDefNode(pCxt, &B, C, NULL); } -column_def(A) ::= column_name(B) type_name(C) COMMENT NK_STRING(D). { A = createColumnDefNode(pCxt, &B, C, &D); } +//column_def(A) ::= column_name(B) type_name(C) COMMENT NK_STRING(D). { A = createColumnDefNode(pCxt, &B, C, &D); } %type type_name { SDataType } %destructor type_name { } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 70bd25dd2b..d593295827 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -4702,7 +4702,6 @@ static int32_t columnDefNodeToField(SNodeList* pList, SArray** pArray) { SColumnDefNode* pCol = (SColumnDefNode*)pNode; SField field = {.type = pCol->dataType.type, .bytes = calcTypeBytes(pCol->dataType)}; strcpy(field.name, pCol->colName); - strcpy(field.comment, pCol->comments); if (pCol->sma) { field.flags |= COL_SMA_ON; } @@ -5050,7 +5049,6 @@ static void toSchema(const SColumnDefNode* pCol, col_id_t colId, SSchema* pSchem pSchema->bytes = calcTypeBytes(pCol->dataType); pSchema->flags = flags; strcpy(pSchema->name, pCol->colName); - strcpy(pSchema->comment, pCol->comments); } typedef struct SSampleAstInfo { diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index bdc72592cc..05cdf10bd2 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -134,18 +134,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 805 -#define YYNRULE 605 -#define YYNRULE_WITH_ACTION 605 +#define YYNSTATE 803 +#define YYNRULE 604 +#define YYNRULE_WITH_ACTION 604 #define YYNTOKEN 339 -#define YY_MAX_SHIFT 804 -#define YY_MIN_SHIFTREDUCE 1187 -#define YY_MAX_SHIFTREDUCE 1791 -#define YY_ERROR_ACTION 1792 -#define YY_ACCEPT_ACTION 1793 -#define YY_NO_ACTION 1794 -#define YY_MIN_REDUCE 1795 -#define YY_MAX_REDUCE 2399 +#define YY_MAX_SHIFT 802 +#define YY_MIN_SHIFTREDUCE 1185 +#define YY_MAX_SHIFTREDUCE 1788 +#define YY_ERROR_ACTION 1789 +#define YY_ACCEPT_ACTION 1790 +#define YY_NO_ACTION 1791 +#define YY_MIN_REDUCE 1792 +#define YY_MAX_REDUCE 2395 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -214,286 +214,286 @@ typedef union { *********** Begin parsing tables **********************************************/ #define YY_ACTTAB_COUNT (2797) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 455, 2206, 2184, 2095, 537, 693, 1972, 538, 1831, 14, - /* 10 */ 13, 673, 48, 46, 1718, 396, 2192, 1961, 2092, 680, - /* 20 */ 403, 1588, 1563, 41, 40, 135, 2188, 47, 45, 44, - /* 30 */ 43, 42, 577, 1644, 221, 1561, 693, 1972, 540, 2224, - /* 40 */ 1838, 2167, 41, 40, 1588, 350, 47, 45, 44, 43, - /* 50 */ 42, 2174, 1245, 709, 1244, 692, 135, 2184, 2184, 670, - /* 60 */ 144, 1957, 1639, 582, 2190, 400, 545, 140, 19, 538, - /* 70 */ 1831, 1963, 2193, 109, 703, 1569, 408, 670, 144, 2019, - /* 80 */ 2021, 2188, 2188, 363, 1818, 1246, 2095, 2205, 633, 2241, - /* 90 */ 145, 2370, 112, 2207, 713, 2209, 2210, 708, 1964, 703, - /* 100 */ 801, 2093, 680, 15, 185, 169, 2294, 1807, 2376, 188, - /* 110 */ 399, 2290, 1687, 2371, 659, 181, 48, 46, 692, 2190, - /* 120 */ 2190, 1590, 693, 1972, 403, 190, 1563, 1673, 1379, 703, - /* 130 */ 703, 38, 308, 2324, 2174, 371, 2078, 1644, 51, 1561, - /* 140 */ 1646, 1647, 193, 2309, 1370, 738, 737, 736, 1374, 735, - /* 150 */ 1376, 1377, 734, 731, 181, 1385, 728, 1387, 1388, 725, - /* 160 */ 722, 719, 672, 186, 2302, 2303, 1639, 142, 2307, 2306, - /* 170 */ 1619, 1629, 19, 1588, 223, 2079, 1645, 1648, 540, 1569, - /* 180 */ 1838, 286, 2302, 669, 1674, 136, 668, 1589, 2370, 693, - /* 190 */ 1972, 1564, 125, 1562, 1620, 124, 123, 122, 121, 120, - /* 200 */ 119, 118, 117, 116, 801, 657, 188, 15, 2206, 56, - /* 210 */ 2371, 659, 47, 45, 44, 43, 42, 1788, 710, 2020, - /* 220 */ 2021, 1591, 692, 1567, 1568, 1795, 1618, 1621, 1622, 1623, - /* 230 */ 1624, 1625, 1626, 1627, 1628, 705, 701, 1637, 1638, 1640, - /* 240 */ 1641, 1642, 1643, 2, 1646, 1647, 2224, 184, 678, 134, - /* 250 */ 133, 132, 131, 130, 129, 128, 127, 126, 2174, 2013, - /* 260 */ 709, 1796, 37, 401, 1668, 1669, 1670, 1671, 1672, 1676, - /* 270 */ 1677, 1678, 1679, 288, 1619, 1629, 168, 1588, 693, 1972, - /* 280 */ 1645, 1648, 125, 554, 1913, 124, 123, 122, 121, 120, - /* 290 */ 119, 118, 117, 116, 2205, 1564, 2241, 1562, 453, 112, - /* 300 */ 2207, 713, 2209, 2210, 708, 51, 703, 1414, 1415, 147, - /* 310 */ 679, 151, 2265, 2294, 2026, 2206, 1322, 399, 2290, 1793, - /* 320 */ 1787, 384, 252, 1472, 1473, 673, 251, 1567, 1568, 2024, - /* 330 */ 1618, 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 705, - /* 340 */ 701, 1637, 1638, 1640, 1641, 1642, 1643, 2, 12, 48, - /* 350 */ 46, 2026, 2067, 2224, 693, 1972, 1324, 403, 393, 1563, - /* 360 */ 62, 1715, 552, 406, 2088, 2174, 2024, 709, 460, 2074, - /* 370 */ 1644, 163, 1561, 203, 454, 1220, 41, 40, 385, 1974, - /* 380 */ 47, 45, 44, 43, 42, 653, 2024, 93, 1591, 679, - /* 390 */ 358, 458, 418, 383, 2206, 611, 542, 417, 1245, 1639, - /* 400 */ 1244, 2205, 539, 2241, 707, 19, 112, 2207, 713, 2209, - /* 410 */ 2210, 708, 1569, 703, 1222, 202, 1225, 1226, 185, 1746, - /* 420 */ 2294, 2026, 41, 40, 399, 2290, 47, 45, 44, 43, - /* 430 */ 42, 1246, 2224, 2375, 466, 2074, 2025, 801, 652, 633, - /* 440 */ 15, 677, 2370, 2088, 2174, 1675, 709, 2325, 1817, 66, - /* 450 */ 1590, 2374, 449, 48, 46, 1649, 1572, 448, 30, 2376, - /* 460 */ 188, 403, 290, 1563, 2371, 659, 2224, 645, 644, 1744, - /* 470 */ 1745, 1747, 1748, 1749, 1644, 166, 1561, 1646, 1647, 62, - /* 480 */ 2205, 205, 2241, 1975, 376, 344, 2207, 713, 2209, 2210, - /* 490 */ 708, 706, 703, 694, 2259, 1722, 493, 2074, 2174, 633, - /* 500 */ 2206, 1588, 2370, 1639, 1248, 1249, 658, 1619, 1629, 2370, - /* 510 */ 710, 573, 572, 1645, 1648, 648, 1569, 290, 1758, 2376, - /* 520 */ 188, 651, 2026, 35, 2371, 659, 657, 188, 1564, 369, - /* 530 */ 1562, 2371, 659, 1680, 1781, 679, 1654, 2024, 2224, 2026, - /* 540 */ 266, 801, 1588, 210, 49, 750, 398, 2206, 62, 12, - /* 550 */ 2174, 10, 709, 377, 2024, 375, 374, 710, 579, 1840, - /* 560 */ 1567, 1568, 581, 1618, 1621, 1622, 1623, 1624, 1625, 1626, - /* 570 */ 1627, 1628, 705, 701, 1637, 1638, 1640, 1641, 1642, 1643, - /* 580 */ 2, 1646, 1647, 2057, 580, 2224, 2205, 688, 2241, 2088, - /* 590 */ 618, 113, 2207, 713, 2209, 2210, 708, 2174, 703, 709, - /* 600 */ 609, 658, 288, 90, 2370, 2294, 654, 649, 642, 2293, - /* 610 */ 2290, 1619, 1629, 607, 1575, 605, 632, 1645, 1648, 1714, - /* 620 */ 373, 657, 188, 207, 693, 1972, 2371, 659, 154, 1967, - /* 630 */ 412, 411, 1564, 2205, 1562, 2241, 290, 12, 112, 2207, - /* 640 */ 713, 2209, 2210, 708, 468, 703, 146, 1589, 34, 2265, - /* 650 */ 2390, 1620, 2294, 1570, 41, 40, 399, 2290, 47, 45, - /* 660 */ 44, 43, 42, 86, 1567, 1568, 85, 1618, 1621, 1622, - /* 670 */ 1623, 1624, 1625, 1626, 1627, 1628, 705, 701, 1637, 1638, - /* 680 */ 1640, 1641, 1642, 1643, 2, 48, 46, 2168, 55, 2206, - /* 690 */ 1949, 1563, 1620, 403, 1333, 1563, 693, 1972, 1569, 710, - /* 700 */ 2206, 397, 693, 1972, 1561, 290, 1644, 1332, 1561, 166, - /* 710 */ 710, 2026, 595, 594, 593, 741, 483, 1974, 407, 585, - /* 720 */ 141, 589, 484, 693, 1972, 588, 2024, 2224, 52, 661, - /* 730 */ 587, 592, 379, 378, 633, 1639, 586, 2370, 2224, 2174, - /* 740 */ 60, 709, 478, 553, 1569, 253, 500, 630, 1569, 1914, - /* 750 */ 2174, 477, 709, 1337, 2376, 188, 760, 41, 40, 2371, - /* 760 */ 659, 47, 45, 44, 43, 42, 1336, 1489, 1490, 801, - /* 770 */ 670, 144, 509, 801, 437, 2205, 49, 2241, 670, 144, - /* 780 */ 170, 2207, 713, 2209, 2210, 708, 2205, 703, 2241, 48, - /* 790 */ 46, 170, 2207, 713, 2209, 2210, 708, 403, 703, 1563, - /* 800 */ 1228, 439, 435, 1488, 1491, 748, 1587, 212, 211, 534, - /* 810 */ 1644, 1573, 1561, 1646, 1647, 1534, 1535, 532, 693, 1972, - /* 820 */ 528, 524, 634, 2335, 156, 155, 745, 744, 743, 153, - /* 830 */ 499, 511, 406, 1959, 2336, 748, 299, 300, 676, 1639, - /* 840 */ 166, 298, 2375, 1619, 1629, 2370, 575, 574, 1974, 1645, - /* 850 */ 1648, 1874, 1569, 1757, 156, 155, 745, 744, 743, 153, - /* 860 */ 1564, 108, 1562, 2374, 1564, 1955, 1562, 2371, 2373, 2375, - /* 870 */ 1816, 105, 2370, 62, 187, 2302, 2303, 801, 142, 2307, - /* 880 */ 15, 2206, 189, 2302, 2303, 290, 142, 2307, 591, 590, - /* 890 */ 2374, 710, 1567, 1568, 2371, 2372, 1567, 1568, 1948, 1618, - /* 900 */ 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 705, 701, - /* 910 */ 1637, 1638, 1640, 1641, 1642, 1643, 2, 1646, 1647, 2224, - /* 920 */ 2174, 595, 594, 593, 693, 1972, 693, 1972, 585, 141, - /* 930 */ 589, 2174, 1815, 709, 588, 600, 44, 43, 42, 587, - /* 940 */ 592, 379, 378, 740, 1969, 586, 255, 1619, 1629, 1814, - /* 950 */ 610, 41, 40, 1645, 1648, 47, 45, 44, 43, 42, - /* 960 */ 447, 695, 446, 2266, 250, 750, 259, 2205, 1564, 2241, - /* 970 */ 1562, 103, 113, 2207, 713, 2209, 2210, 708, 704, 703, - /* 980 */ 603, 409, 2174, 1225, 1226, 1813, 2294, 597, 1947, 166, - /* 990 */ 698, 2290, 445, 249, 616, 2309, 1965, 1974, 1812, 2174, - /* 1000 */ 1567, 1568, 1871, 1618, 1621, 1622, 1623, 1624, 1625, 1626, - /* 1010 */ 1627, 1628, 705, 701, 1637, 1638, 1640, 1641, 1642, 1643, - /* 1020 */ 2, 2305, 354, 167, 1586, 693, 1972, 1811, 329, 742, - /* 1030 */ 290, 491, 2017, 70, 507, 2174, 69, 506, 693, 1972, - /* 1040 */ 2157, 633, 326, 73, 2370, 263, 72, 1734, 2174, 1810, - /* 1050 */ 1809, 1806, 1805, 474, 1804, 508, 9, 351, 303, 1803, - /* 1060 */ 476, 2376, 188, 772, 770, 1802, 2371, 659, 219, 519, - /* 1070 */ 517, 514, 778, 777, 776, 775, 415, 2174, 774, 773, - /* 1080 */ 148, 768, 767, 766, 765, 764, 763, 762, 158, 758, - /* 1090 */ 757, 756, 414, 413, 753, 752, 751, 176, 175, 2174, - /* 1100 */ 2174, 2174, 2174, 748, 2174, 237, 372, 746, 62, 2174, - /* 1110 */ 2017, 662, 2309, 693, 1972, 2174, 1591, 747, 462, 90, - /* 1120 */ 2017, 173, 156, 155, 745, 744, 743, 153, 581, 571, - /* 1130 */ 567, 563, 559, 690, 236, 41, 40, 1801, 2304, 47, - /* 1140 */ 45, 44, 43, 42, 1800, 1968, 322, 111, 504, 2003, - /* 1150 */ 580, 498, 497, 496, 495, 490, 489, 488, 487, 486, - /* 1160 */ 482, 481, 480, 479, 353, 471, 470, 469, 674, 464, - /* 1170 */ 463, 370, 36, 2139, 91, 693, 1972, 234, 41, 40, - /* 1180 */ 693, 1972, 47, 45, 44, 43, 42, 2174, 81, 80, - /* 1190 */ 452, 700, 2206, 200, 2174, 691, 693, 1972, 1799, 697, - /* 1200 */ 309, 2266, 710, 1950, 2332, 761, 444, 442, 1934, 2314, - /* 1210 */ 1707, 583, 584, 1798, 74, 633, 410, 352, 2370, 54, - /* 1220 */ 433, 3, 254, 431, 427, 423, 420, 445, 1858, 83, - /* 1230 */ 2224, 137, 1571, 1320, 1318, 2376, 188, 665, 154, 2206, - /* 1240 */ 2371, 659, 2174, 2160, 709, 233, 227, 149, 2174, 710, - /* 1250 */ 596, 2345, 232, 550, 41, 40, 1808, 432, 47, 45, - /* 1260 */ 44, 43, 42, 2174, 84, 290, 154, 242, 265, 244, - /* 1270 */ 240, 225, 243, 613, 264, 612, 1707, 2224, 2205, 246, - /* 1280 */ 2241, 1849, 245, 112, 2207, 713, 2209, 2210, 708, 2174, - /* 1290 */ 703, 709, 425, 248, 1847, 2390, 247, 2294, 1529, 50, - /* 1300 */ 50, 399, 2290, 598, 270, 1790, 1791, 154, 50, 296, - /* 1310 */ 71, 152, 154, 14, 13, 1841, 601, 94, 64, 754, - /* 1320 */ 50, 1279, 262, 50, 717, 2205, 1532, 2241, 152, 2195, - /* 1330 */ 112, 2207, 713, 2209, 2210, 708, 154, 703, 2338, 138, - /* 1340 */ 152, 1298, 2390, 2206, 2294, 283, 1665, 646, 399, 2290, - /* 1350 */ 663, 139, 277, 710, 755, 640, 412, 411, 1912, 1743, - /* 1360 */ 1742, 1280, 1911, 2206, 272, 796, 1577, 675, 1486, 301, - /* 1370 */ 685, 305, 1363, 710, 386, 2363, 1296, 1644, 1681, 1570, - /* 1380 */ 1630, 2224, 416, 321, 1392, 2197, 2225, 2083, 1396, 1832, - /* 1390 */ 1574, 2014, 285, 2174, 1837, 709, 1403, 2328, 671, 1401, - /* 1400 */ 157, 2224, 282, 5, 1, 419, 1639, 424, 367, 1594, - /* 1410 */ 440, 441, 2206, 2174, 195, 709, 196, 198, 165, 1569, - /* 1420 */ 443, 1510, 710, 316, 2313, 1587, 459, 209, 461, 2205, - /* 1430 */ 1591, 2241, 2206, 2084, 112, 2207, 713, 2209, 2210, 708, - /* 1440 */ 465, 703, 710, 467, 699, 472, 2390, 1586, 2294, 2205, - /* 1450 */ 2224, 2241, 399, 2290, 112, 2207, 713, 2209, 2210, 708, - /* 1460 */ 502, 703, 2174, 485, 709, 492, 2390, 2076, 2294, 512, - /* 1470 */ 2224, 513, 399, 2290, 494, 501, 503, 510, 666, 214, - /* 1480 */ 213, 515, 2174, 516, 709, 216, 518, 520, 1592, 535, - /* 1490 */ 4, 536, 543, 546, 544, 1589, 547, 224, 2205, 226, - /* 1500 */ 2241, 2206, 1593, 112, 2207, 713, 2209, 2210, 708, 548, - /* 1510 */ 703, 710, 1595, 549, 229, 2390, 551, 2294, 2205, 555, - /* 1520 */ 2241, 399, 2290, 171, 2207, 713, 2209, 2210, 708, 231, - /* 1530 */ 703, 88, 576, 89, 235, 1578, 114, 1573, 578, 2224, - /* 1540 */ 357, 1962, 2148, 2145, 239, 2144, 1958, 241, 615, 92, - /* 1550 */ 2206, 2174, 617, 709, 150, 159, 160, 621, 1960, 1956, - /* 1560 */ 710, 161, 162, 317, 256, 622, 620, 1581, 1583, 258, - /* 1570 */ 1517, 260, 628, 647, 625, 637, 660, 2391, 2344, 683, - /* 1580 */ 701, 1637, 1638, 1640, 1641, 1642, 1643, 2205, 2224, 2241, - /* 1590 */ 2343, 2329, 112, 2207, 713, 2209, 2210, 708, 268, 703, - /* 1600 */ 2174, 643, 709, 626, 2269, 627, 2294, 2339, 271, 389, - /* 1610 */ 399, 2290, 650, 8, 638, 2316, 656, 635, 636, 276, - /* 1620 */ 2206, 2393, 174, 281, 278, 279, 667, 390, 664, 143, - /* 1630 */ 710, 1707, 1590, 1712, 2310, 1710, 2205, 1596, 2241, 2089, - /* 1640 */ 2206, 112, 2207, 713, 2209, 2210, 708, 291, 703, 318, - /* 1650 */ 710, 98, 178, 2267, 681, 2294, 319, 280, 2224, 399, - /* 1660 */ 2290, 682, 2103, 2102, 2101, 395, 100, 686, 1973, 102, - /* 1670 */ 2174, 191, 709, 320, 289, 61, 2275, 284, 2224, 687, - /* 1680 */ 104, 323, 2018, 2369, 715, 312, 797, 1935, 798, 800, - /* 1690 */ 2174, 325, 709, 359, 332, 346, 360, 336, 2166, 53, - /* 1700 */ 2165, 327, 2164, 78, 2161, 421, 2205, 422, 2241, 2206, - /* 1710 */ 347, 112, 2207, 713, 2209, 2210, 708, 1554, 703, 710, - /* 1720 */ 1555, 194, 426, 696, 2159, 2294, 711, 428, 2241, 399, - /* 1730 */ 2290, 113, 2207, 713, 2209, 2210, 708, 430, 703, 2158, - /* 1740 */ 429, 368, 2156, 434, 2206, 2294, 2155, 2224, 436, 362, - /* 1750 */ 2290, 2154, 438, 1545, 710, 2135, 197, 2134, 199, 2174, - /* 1760 */ 79, 709, 1513, 2116, 1512, 2115, 2114, 450, 451, 2113, - /* 1770 */ 2112, 2066, 1463, 456, 2206, 2063, 457, 201, 2062, 82, - /* 1780 */ 2061, 2060, 2224, 2065, 710, 2064, 2059, 387, 204, 2058, - /* 1790 */ 2056, 2055, 2054, 206, 2174, 2205, 709, 2241, 2053, 473, - /* 1800 */ 113, 2207, 713, 2209, 2210, 708, 475, 703, 2069, 2052, - /* 1810 */ 2051, 2206, 2224, 2050, 2294, 2049, 2048, 388, 2047, 2291, - /* 1820 */ 2046, 710, 2045, 2044, 2174, 2043, 709, 2042, 2041, 2040, - /* 1830 */ 2205, 2039, 2241, 2038, 208, 345, 2207, 713, 2209, 2210, - /* 1840 */ 708, 2206, 703, 2037, 87, 2036, 2035, 2034, 2068, 2224, - /* 1850 */ 2033, 710, 2032, 2031, 1465, 2030, 2029, 505, 2028, 2027, - /* 1860 */ 2205, 2174, 2241, 709, 1334, 345, 2207, 713, 2209, 2210, - /* 1870 */ 708, 1338, 703, 2206, 355, 1877, 215, 1876, 356, 2224, - /* 1880 */ 1875, 217, 1873, 710, 1870, 522, 1330, 1869, 526, 521, - /* 1890 */ 1862, 2174, 525, 709, 1851, 529, 218, 2205, 1827, 2241, - /* 1900 */ 533, 523, 338, 2207, 713, 2209, 2210, 708, 527, 703, - /* 1910 */ 2206, 2224, 530, 531, 220, 76, 394, 182, 2194, 1227, - /* 1920 */ 707, 1826, 77, 2174, 2133, 709, 183, 2205, 541, 2241, - /* 1930 */ 2123, 222, 171, 2207, 713, 2209, 2210, 708, 2111, 703, - /* 1940 */ 2206, 228, 230, 2110, 2087, 1951, 1872, 655, 2224, 1868, - /* 1950 */ 710, 556, 557, 558, 1272, 1866, 561, 560, 562, 2205, - /* 1960 */ 2174, 2241, 709, 619, 345, 2207, 713, 2209, 2210, 708, - /* 1970 */ 1864, 703, 564, 566, 565, 1861, 569, 568, 2224, 570, - /* 1980 */ 1846, 804, 1844, 402, 1845, 1843, 2392, 2206, 1823, 1953, - /* 1990 */ 2174, 1408, 709, 1407, 1952, 315, 2205, 710, 2241, 238, - /* 2000 */ 63, 344, 2207, 713, 2209, 2210, 708, 1321, 703, 1319, - /* 2010 */ 2260, 180, 1317, 2206, 1316, 1308, 1315, 769, 1314, 794, - /* 2020 */ 790, 786, 782, 710, 313, 2224, 2205, 1313, 2241, 1859, - /* 2030 */ 404, 345, 2207, 713, 2209, 2210, 708, 2174, 703, 709, - /* 2040 */ 771, 1310, 1309, 1307, 380, 1850, 381, 1848, 599, 382, - /* 2050 */ 602, 2224, 1822, 604, 1821, 606, 1820, 608, 115, 2132, - /* 2060 */ 1539, 1541, 1543, 2174, 110, 709, 29, 306, 1538, 57, - /* 2070 */ 67, 1519, 1521, 2205, 2206, 2241, 1523, 2122, 345, 2207, - /* 2080 */ 713, 2209, 2210, 708, 710, 703, 164, 2206, 623, 624, - /* 2090 */ 2109, 2108, 261, 629, 31, 1498, 2375, 710, 1497, 614, - /* 2100 */ 689, 2241, 20, 17, 340, 2207, 713, 2209, 2210, 708, - /* 2110 */ 631, 703, 2224, 1760, 267, 6, 7, 639, 641, 21, - /* 2120 */ 22, 269, 274, 33, 2174, 2224, 709, 1741, 275, 2195, - /* 2130 */ 65, 172, 23, 273, 1775, 293, 1733, 2174, 2206, 709, - /* 2140 */ 32, 24, 292, 95, 1774, 1780, 1781, 391, 710, 1779, - /* 2150 */ 1778, 18, 392, 1704, 2206, 1703, 2107, 287, 58, 2086, - /* 2160 */ 2205, 257, 2241, 59, 710, 330, 2207, 713, 2209, 2210, - /* 2170 */ 708, 177, 703, 2205, 96, 2241, 2224, 97, 328, 2207, - /* 2180 */ 713, 2209, 2210, 708, 294, 703, 25, 297, 2174, 295, - /* 2190 */ 709, 1739, 2224, 2085, 99, 302, 684, 68, 101, 105, - /* 2200 */ 307, 26, 11, 2206, 2174, 1656, 709, 304, 1655, 13, - /* 2210 */ 1579, 2244, 179, 710, 1611, 1634, 702, 192, 1666, 714, - /* 2220 */ 1632, 39, 716, 16, 2205, 1631, 2241, 1603, 27, 331, - /* 2230 */ 2207, 713, 2209, 2210, 708, 712, 703, 28, 405, 1393, - /* 2240 */ 2205, 2224, 2241, 718, 720, 337, 2207, 713, 2209, 2210, - /* 2250 */ 708, 1390, 703, 2174, 2206, 709, 1389, 721, 723, 726, - /* 2260 */ 729, 724, 732, 727, 710, 1386, 1380, 730, 1384, 733, - /* 2270 */ 2206, 1383, 1378, 1369, 1382, 1381, 106, 310, 739, 107, - /* 2280 */ 710, 1402, 75, 2206, 1398, 1270, 749, 1302, 1301, 2205, - /* 2290 */ 1300, 2241, 2224, 710, 341, 2207, 713, 2209, 2210, 708, - /* 2300 */ 1299, 703, 1297, 2206, 2174, 1295, 709, 1294, 2224, 1293, - /* 2310 */ 1328, 759, 311, 710, 1291, 1290, 1325, 1289, 1288, 1287, - /* 2320 */ 2174, 2224, 709, 1286, 1285, 1323, 1282, 1281, 1278, 1276, - /* 2330 */ 1277, 1867, 1275, 2174, 779, 709, 780, 781, 1865, 783, - /* 2340 */ 2205, 2224, 2241, 1863, 787, 333, 2207, 713, 2209, 2210, - /* 2350 */ 708, 784, 703, 2174, 785, 709, 2205, 788, 2241, 789, - /* 2360 */ 1860, 342, 2207, 713, 2209, 2210, 708, 791, 703, 2205, - /* 2370 */ 792, 2241, 793, 2206, 334, 2207, 713, 2209, 2210, 708, - /* 2380 */ 1842, 703, 795, 710, 1217, 1819, 314, 799, 802, 2205, - /* 2390 */ 1565, 2241, 324, 803, 343, 2207, 713, 2209, 2210, 708, - /* 2400 */ 1794, 703, 1794, 1794, 1794, 1794, 2206, 1794, 1794, 1794, - /* 2410 */ 1794, 2224, 1794, 1794, 1794, 1794, 710, 1794, 1794, 1794, - /* 2420 */ 1794, 1794, 2206, 2174, 1794, 709, 1794, 1794, 1794, 1794, - /* 2430 */ 1794, 1794, 710, 1794, 1794, 1794, 1794, 1794, 1794, 1794, - /* 2440 */ 1794, 1794, 1794, 2206, 2224, 1794, 1794, 1794, 1794, 1794, - /* 2450 */ 1794, 1794, 1794, 710, 1794, 1794, 2174, 1794, 709, 2205, - /* 2460 */ 2224, 2241, 1794, 1794, 335, 2207, 713, 2209, 2210, 708, - /* 2470 */ 1794, 703, 2174, 1794, 709, 1794, 1794, 1794, 1794, 1794, - /* 2480 */ 1794, 2224, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, - /* 2490 */ 1794, 1794, 2205, 2174, 2241, 709, 1794, 348, 2207, 713, - /* 2500 */ 2209, 2210, 708, 1794, 703, 1794, 1794, 1794, 2205, 2206, - /* 2510 */ 2241, 1794, 1794, 349, 2207, 713, 2209, 2210, 708, 710, - /* 2520 */ 703, 1794, 2206, 1794, 1794, 1794, 1794, 1794, 1794, 2205, - /* 2530 */ 1794, 2241, 710, 2206, 2218, 2207, 713, 2209, 2210, 708, - /* 2540 */ 1794, 703, 1794, 710, 1794, 1794, 2206, 2224, 1794, 1794, - /* 2550 */ 1794, 1794, 1794, 1794, 1794, 1794, 710, 1794, 1794, 2174, - /* 2560 */ 2224, 709, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, - /* 2570 */ 1794, 2224, 2174, 1794, 709, 1794, 1794, 1794, 1794, 1794, - /* 2580 */ 1794, 1794, 1794, 2174, 2224, 709, 1794, 1794, 1794, 1794, - /* 2590 */ 1794, 1794, 1794, 1794, 1794, 2205, 2174, 2241, 709, 1794, - /* 2600 */ 2217, 2207, 713, 2209, 2210, 708, 1794, 703, 2205, 1794, - /* 2610 */ 2241, 1794, 1794, 2216, 2207, 713, 2209, 2210, 708, 2205, - /* 2620 */ 703, 2241, 1794, 2206, 364, 2207, 713, 2209, 2210, 708, - /* 2630 */ 1794, 703, 2205, 710, 2241, 1794, 2206, 365, 2207, 713, - /* 2640 */ 2209, 2210, 708, 1794, 703, 1794, 710, 2206, 1794, 1794, - /* 2650 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 710, 1794, 1794, - /* 2660 */ 1794, 2224, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, - /* 2670 */ 1794, 1794, 1794, 2174, 2224, 709, 1794, 1794, 1794, 1794, - /* 2680 */ 1794, 1794, 1794, 1794, 1794, 2224, 2174, 1794, 709, 1794, - /* 2690 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 2174, 2206, 709, - /* 2700 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 710, 2205, - /* 2710 */ 1794, 2241, 1794, 1794, 361, 2207, 713, 2209, 2210, 708, - /* 2720 */ 1794, 703, 2205, 1794, 2241, 1794, 1794, 366, 2207, 713, - /* 2730 */ 2209, 2210, 708, 711, 703, 2241, 2224, 1794, 340, 2207, - /* 2740 */ 713, 2209, 2210, 708, 1794, 703, 1794, 1794, 2174, 1794, - /* 2750 */ 709, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, - /* 2760 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, - /* 2770 */ 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, - /* 2780 */ 1794, 1794, 1794, 1794, 2205, 1794, 2241, 1794, 1794, 339, - /* 2790 */ 2207, 713, 2209, 2210, 708, 1794, 703, + /* 0 */ 455, 2202, 2180, 2091, 537, 693, 1969, 538, 1828, 14, + /* 10 */ 13, 673, 48, 46, 1715, 396, 2188, 1958, 2088, 680, + /* 20 */ 403, 1585, 1560, 41, 40, 135, 2184, 47, 45, 44, + /* 30 */ 43, 42, 577, 1641, 221, 1558, 693, 1969, 540, 2220, + /* 40 */ 1835, 2163, 41, 40, 692, 350, 47, 45, 44, 43, + /* 50 */ 42, 2170, 2371, 709, 1954, 542, 135, 2180, 2180, 670, + /* 60 */ 144, 539, 1636, 582, 2186, 400, 38, 308, 19, 1587, + /* 70 */ 2091, 1960, 2189, 109, 703, 1566, 545, 670, 144, 538, + /* 80 */ 1828, 2184, 2184, 363, 181, 2089, 680, 2201, 633, 2237, + /* 90 */ 145, 2366, 112, 2203, 713, 2205, 2206, 708, 1961, 703, + /* 100 */ 799, 181, 1320, 15, 185, 2075, 2290, 397, 2372, 188, + /* 110 */ 399, 2286, 1684, 2367, 659, 166, 48, 46, 678, 2186, + /* 120 */ 2186, 371, 2074, 1971, 403, 190, 1560, 1670, 1376, 703, + /* 130 */ 703, 408, 223, 2320, 2015, 2017, 540, 1641, 1835, 1558, + /* 140 */ 1643, 1644, 1322, 1367, 738, 737, 736, 1371, 735, 1373, + /* 150 */ 1374, 734, 731, 1778, 1382, 728, 1384, 1385, 725, 722, + /* 160 */ 719, 168, 672, 186, 2298, 2299, 1636, 142, 2303, 1910, + /* 170 */ 1616, 1626, 19, 1585, 693, 1969, 1642, 1645, 169, 1566, + /* 180 */ 1804, 286, 2298, 669, 1671, 136, 668, 1586, 2366, 693, + /* 190 */ 1969, 1561, 125, 1559, 193, 124, 123, 122, 121, 120, + /* 200 */ 119, 118, 117, 116, 799, 657, 188, 15, 2202, 56, + /* 210 */ 2367, 659, 47, 45, 44, 43, 42, 1785, 710, 2016, + /* 220 */ 2017, 288, 692, 1564, 1565, 1792, 1615, 1618, 1619, 1620, + /* 230 */ 1621, 1622, 1623, 1624, 1625, 705, 701, 1634, 1635, 1637, + /* 240 */ 1638, 1639, 1640, 2, 1643, 1644, 2220, 184, 103, 134, + /* 250 */ 133, 132, 131, 130, 129, 128, 127, 126, 2170, 2009, + /* 260 */ 709, 1793, 37, 401, 1665, 1666, 1667, 1668, 1669, 1673, + /* 270 */ 1674, 1675, 1676, 1962, 1616, 1626, 1672, 554, 693, 1969, + /* 280 */ 1642, 1645, 125, 1246, 1247, 124, 123, 122, 121, 120, + /* 290 */ 119, 118, 117, 116, 2201, 1561, 2237, 1559, 453, 112, + /* 300 */ 2203, 713, 2205, 2206, 708, 51, 703, 1411, 1412, 147, + /* 310 */ 1719, 151, 2261, 2290, 2022, 2202, 1585, 399, 2286, 1790, + /* 320 */ 1784, 384, 252, 1469, 1470, 673, 251, 1564, 1565, 2020, + /* 330 */ 1615, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 705, + /* 340 */ 701, 1634, 1635, 1637, 1638, 1639, 1640, 2, 12, 48, + /* 350 */ 46, 412, 411, 2220, 35, 460, 2070, 403, 1243, 1560, + /* 360 */ 1242, 154, 692, 406, 1677, 2170, 653, 709, 466, 2070, + /* 370 */ 1641, 163, 1558, 140, 1567, 1218, 41, 40, 385, 1971, + /* 380 */ 47, 45, 44, 43, 42, 581, 2020, 93, 1588, 580, + /* 390 */ 358, 1244, 418, 383, 2202, 611, 1585, 417, 1243, 1636, + /* 400 */ 1242, 2201, 202, 2237, 707, 19, 112, 2203, 713, 2205, + /* 410 */ 2206, 708, 1566, 703, 1220, 205, 1223, 1224, 185, 1743, + /* 420 */ 2290, 55, 41, 40, 399, 2286, 47, 45, 44, 43, + /* 430 */ 42, 1244, 2220, 1586, 493, 2070, 12, 799, 10, 633, + /* 440 */ 15, 2022, 2366, 500, 2170, 51, 709, 2321, 393, 66, + /* 450 */ 748, 1815, 449, 48, 46, 1646, 2020, 448, 30, 2372, + /* 460 */ 188, 403, 376, 1560, 2367, 659, 1617, 645, 644, 1741, + /* 470 */ 1742, 1744, 1745, 1746, 1641, 253, 1558, 1643, 1644, 62, + /* 480 */ 2201, 210, 2237, 573, 572, 344, 2203, 713, 2205, 2206, + /* 490 */ 708, 706, 703, 694, 2255, 90, 609, 693, 1969, 633, + /* 500 */ 2202, 2170, 2366, 1636, 212, 211, 632, 1616, 1626, 607, + /* 510 */ 710, 605, 373, 1642, 1645, 618, 1566, 454, 1755, 2372, + /* 520 */ 188, 1964, 2022, 648, 2367, 659, 665, 499, 1561, 369, + /* 530 */ 1559, 377, 1570, 375, 374, 406, 579, 2020, 2220, 108, + /* 540 */ 266, 799, 1331, 166, 49, 1531, 1532, 2202, 62, 105, + /* 550 */ 2170, 1971, 709, 1486, 1487, 1330, 2164, 710, 581, 1837, + /* 560 */ 1564, 1565, 580, 1615, 1618, 1619, 1620, 1621, 1622, 1623, + /* 570 */ 1624, 1625, 705, 701, 1634, 1635, 1637, 1638, 1639, 1640, + /* 580 */ 2, 1643, 1644, 2053, 12, 2220, 2201, 2305, 2237, 1485, + /* 590 */ 1488, 113, 2203, 713, 2205, 2206, 708, 2170, 703, 709, + /* 600 */ 2135, 658, 290, 633, 2366, 2290, 2366, 575, 574, 2289, + /* 610 */ 2286, 1616, 1626, 2302, 654, 649, 642, 1642, 1645, 1566, + /* 620 */ 509, 657, 188, 2372, 188, 2305, 2367, 659, 2367, 659, + /* 630 */ 60, 583, 1561, 2201, 1559, 2237, 290, 630, 112, 2203, + /* 640 */ 713, 2205, 2206, 708, 1814, 703, 693, 1969, 34, 254, + /* 650 */ 2386, 2301, 2290, 1318, 41, 40, 399, 2286, 47, 45, + /* 660 */ 44, 43, 42, 679, 1564, 1565, 468, 1615, 1618, 1619, + /* 670 */ 1620, 1621, 1622, 1623, 1624, 1625, 705, 701, 1634, 1635, + /* 680 */ 1637, 1638, 1639, 1640, 2, 48, 46, 693, 1969, 2202, + /* 690 */ 534, 1560, 1946, 403, 2170, 1560, 693, 1969, 532, 710, + /* 700 */ 2202, 528, 524, 1651, 1558, 290, 1641, 483, 1558, 1585, + /* 710 */ 710, 2022, 595, 594, 593, 552, 484, 2084, 398, 585, + /* 720 */ 141, 589, 739, 693, 1969, 588, 2020, 2220, 62, 409, + /* 730 */ 587, 592, 379, 378, 1944, 1636, 586, 166, 2220, 2170, + /* 740 */ 1585, 709, 478, 553, 1566, 1971, 693, 1969, 1566, 1911, + /* 750 */ 2170, 477, 709, 2022, 693, 1969, 146, 41, 40, 2261, + /* 760 */ 407, 47, 45, 44, 43, 42, 1966, 666, 2020, 799, + /* 770 */ 670, 144, 652, 799, 255, 2201, 49, 2237, 670, 144, + /* 780 */ 170, 2203, 713, 2205, 2206, 708, 2201, 703, 2237, 48, + /* 790 */ 46, 170, 2203, 713, 2205, 2206, 708, 403, 703, 1560, + /* 800 */ 2220, 41, 40, 52, 679, 47, 45, 44, 43, 42, + /* 810 */ 1641, 1335, 1558, 1643, 1644, 746, 156, 155, 743, 742, + /* 820 */ 741, 153, 634, 2331, 1334, 746, 156, 155, 743, 742, + /* 830 */ 741, 153, 591, 590, 2332, 299, 300, 693, 1969, 1636, + /* 840 */ 298, 693, 1969, 1616, 1626, 693, 1969, 758, 1813, 1642, + /* 850 */ 1645, 1871, 1566, 1754, 1956, 651, 677, 263, 2084, 1617, + /* 860 */ 1561, 676, 1559, 2334, 1561, 303, 1559, 746, 156, 155, + /* 870 */ 743, 742, 741, 153, 187, 2298, 2299, 799, 142, 2303, + /* 880 */ 15, 2202, 189, 2298, 2299, 290, 142, 2303, 1587, 511, + /* 890 */ 1617, 710, 1564, 1565, 2305, 1952, 1564, 1565, 2170, 1615, + /* 900 */ 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 705, 701, + /* 910 */ 1634, 1635, 1637, 1638, 1639, 1640, 2, 1643, 1644, 2220, + /* 920 */ 2300, 595, 594, 593, 693, 1969, 693, 1969, 585, 141, + /* 930 */ 589, 2170, 1812, 709, 588, 600, 44, 43, 42, 587, + /* 940 */ 592, 379, 378, 679, 690, 586, 691, 1616, 1626, 1973, + /* 950 */ 610, 41, 40, 1642, 1645, 47, 45, 44, 43, 42, + /* 960 */ 290, 693, 1969, 658, 250, 165, 2366, 2201, 1561, 2237, + /* 970 */ 1559, 437, 113, 2203, 713, 2205, 2206, 708, 2370, 703, + /* 980 */ 603, 309, 2170, 657, 188, 1712, 2290, 597, 2367, 659, + /* 990 */ 698, 2286, 207, 249, 616, 688, 259, 2084, 439, 435, + /* 1000 */ 1564, 1565, 1868, 1615, 1618, 1619, 1620, 1621, 1622, 1623, + /* 1010 */ 1624, 1625, 705, 701, 1634, 1635, 1637, 1638, 1639, 1640, + /* 1020 */ 2, 9, 354, 167, 1583, 693, 1969, 1811, 329, 770, + /* 1030 */ 768, 491, 86, 70, 507, 85, 69, 506, 704, 90, + /* 1040 */ 288, 633, 326, 73, 2366, 410, 72, 1731, 1945, 1588, + /* 1050 */ 1810, 1809, 674, 474, 1808, 508, 695, 351, 2262, 2153, + /* 1060 */ 476, 2372, 188, 1807, 1806, 1965, 2367, 659, 219, 519, + /* 1070 */ 517, 514, 776, 775, 774, 773, 415, 2170, 772, 771, + /* 1080 */ 148, 766, 765, 764, 763, 762, 761, 760, 158, 756, + /* 1090 */ 755, 754, 414, 413, 751, 750, 749, 176, 175, 633, + /* 1100 */ 2170, 2170, 2366, 1805, 2170, 237, 372, 2022, 62, 62, + /* 1110 */ 697, 1588, 2262, 2170, 2170, 748, 1223, 1224, 462, 2372, + /* 1120 */ 188, 173, 2021, 1803, 2367, 659, 1802, 166, 662, 571, + /* 1130 */ 567, 563, 559, 740, 236, 1972, 2013, 1801, 41, 40, + /* 1140 */ 283, 1800, 47, 45, 44, 43, 42, 111, 504, 1799, + /* 1150 */ 1798, 498, 497, 496, 495, 490, 489, 488, 487, 486, + /* 1160 */ 482, 481, 480, 479, 353, 471, 470, 469, 1797, 464, + /* 1170 */ 463, 370, 36, 2170, 91, 1226, 2170, 234, 41, 40, + /* 1180 */ 1569, 1584, 47, 45, 44, 43, 42, 2170, 81, 80, + /* 1190 */ 452, 2170, 2202, 200, 744, 2063, 447, 2013, 446, 2170, + /* 1200 */ 2170, 203, 710, 1568, 2328, 1796, 444, 442, 1795, 262, + /* 1210 */ 2371, 745, 2371, 2366, 2013, 2366, 322, 352, 2170, 1999, + /* 1220 */ 433, 2310, 1704, 431, 427, 423, 420, 445, 445, 759, + /* 1230 */ 2220, 2370, 1931, 2370, 458, 2367, 2369, 2367, 2368, 2202, + /* 1240 */ 584, 1704, 2170, 1711, 709, 233, 227, 2156, 54, 710, + /* 1250 */ 3, 2341, 232, 550, 74, 2170, 661, 83, 2170, 137, + /* 1260 */ 154, 154, 1316, 265, 1947, 290, 290, 242, 50, 244, + /* 1270 */ 240, 225, 243, 613, 264, 612, 432, 2220, 2201, 246, + /* 1280 */ 2237, 50, 245, 112, 2203, 713, 2205, 2206, 708, 2170, + /* 1290 */ 703, 709, 1855, 1846, 1844, 2386, 425, 2290, 270, 154, + /* 1300 */ 248, 399, 2286, 247, 84, 1787, 1788, 646, 149, 50, + /* 1310 */ 296, 71, 152, 139, 596, 598, 601, 94, 154, 700, + /* 1320 */ 1526, 1529, 14, 13, 64, 2201, 50, 2237, 1740, 50, + /* 1330 */ 112, 2203, 713, 2205, 2206, 708, 2191, 703, 1572, 717, + /* 1340 */ 152, 1739, 2386, 2202, 2290, 154, 752, 138, 399, 2286, + /* 1350 */ 152, 1277, 753, 710, 1838, 640, 412, 411, 272, 675, + /* 1360 */ 277, 1571, 1909, 2202, 1908, 2221, 1574, 663, 1296, 1483, + /* 1370 */ 301, 685, 305, 710, 1294, 2359, 386, 1641, 1361, 1567, + /* 1380 */ 416, 2220, 2079, 1829, 1678, 2324, 1627, 1834, 2010, 321, + /* 1390 */ 671, 1278, 2193, 2170, 285, 709, 5, 282, 1, 1389, + /* 1400 */ 1393, 2220, 419, 367, 794, 1400, 1636, 1398, 424, 1591, + /* 1410 */ 157, 440, 2202, 2170, 441, 709, 196, 195, 198, 1566, + /* 1420 */ 443, 1507, 710, 316, 2309, 1584, 459, 209, 1588, 2201, + /* 1430 */ 461, 2237, 2202, 465, 112, 2203, 713, 2205, 2206, 708, + /* 1440 */ 2080, 703, 710, 467, 699, 502, 2386, 472, 2290, 2201, + /* 1450 */ 2220, 2237, 399, 2286, 112, 2203, 713, 2205, 2206, 708, + /* 1460 */ 1583, 703, 2170, 485, 709, 492, 2386, 2072, 2290, 512, + /* 1470 */ 2220, 513, 399, 2286, 1662, 494, 501, 503, 510, 214, + /* 1480 */ 213, 515, 2170, 516, 709, 216, 518, 520, 1589, 4, + /* 1490 */ 535, 536, 543, 1586, 547, 544, 1590, 546, 2201, 224, + /* 1500 */ 2237, 2202, 226, 112, 2203, 713, 2205, 2206, 708, 548, + /* 1510 */ 703, 710, 1592, 549, 229, 2386, 551, 2290, 2201, 576, + /* 1520 */ 2237, 399, 2286, 171, 2203, 713, 2205, 2206, 708, 231, + /* 1530 */ 703, 88, 555, 89, 235, 1575, 114, 1570, 578, 2220, + /* 1540 */ 357, 2144, 2141, 2140, 1959, 615, 239, 1955, 617, 92, + /* 1550 */ 2202, 2170, 256, 709, 317, 150, 241, 159, 160, 1957, + /* 1560 */ 710, 621, 1953, 161, 162, 622, 620, 1578, 1580, 260, + /* 1570 */ 1514, 628, 258, 2340, 625, 647, 660, 2387, 683, 637, + /* 1580 */ 701, 1634, 1635, 1637, 1638, 1639, 1640, 2201, 2220, 2237, + /* 1590 */ 643, 2325, 112, 2203, 713, 2205, 2206, 708, 268, 703, + /* 1600 */ 2170, 627, 709, 2335, 2265, 626, 2290, 2339, 8, 271, + /* 1610 */ 399, 2286, 656, 389, 650, 635, 638, 636, 390, 1704, + /* 1620 */ 2202, 667, 281, 664, 2365, 279, 2312, 276, 1587, 143, + /* 1630 */ 710, 1709, 1707, 291, 178, 2306, 2201, 98, 2237, 1593, + /* 1640 */ 2202, 112, 2203, 713, 2205, 2206, 708, 2085, 703, 681, + /* 1650 */ 710, 318, 682, 2263, 2099, 2290, 319, 280, 2220, 399, + /* 1660 */ 2286, 2098, 174, 2097, 395, 686, 278, 687, 191, 100, + /* 1670 */ 2170, 102, 709, 289, 1970, 320, 61, 104, 2220, 2271, + /* 1680 */ 2014, 715, 284, 323, 1932, 312, 795, 796, 2389, 798, + /* 1690 */ 2170, 332, 709, 347, 359, 360, 327, 346, 336, 53, + /* 1700 */ 2162, 2161, 325, 2160, 78, 2157, 2201, 421, 2237, 2202, + /* 1710 */ 422, 112, 2203, 713, 2205, 2206, 708, 1551, 703, 710, + /* 1720 */ 1552, 194, 426, 696, 2155, 2290, 711, 428, 2237, 399, + /* 1730 */ 2286, 113, 2203, 713, 2205, 2206, 708, 429, 703, 430, + /* 1740 */ 2154, 368, 2152, 434, 2202, 2290, 2151, 2220, 436, 362, + /* 1750 */ 2286, 2150, 438, 1542, 710, 2131, 197, 2130, 199, 2170, + /* 1760 */ 79, 709, 1510, 1509, 2112, 2111, 2110, 450, 451, 2109, + /* 1770 */ 2108, 2062, 1460, 456, 2202, 2059, 457, 201, 2058, 82, + /* 1780 */ 2057, 2056, 2220, 2061, 710, 2060, 204, 387, 2055, 2054, + /* 1790 */ 2052, 2051, 2050, 206, 2170, 2201, 709, 2237, 473, 2049, + /* 1800 */ 113, 2203, 713, 2205, 2206, 708, 475, 703, 2065, 2048, + /* 1810 */ 2047, 2202, 2220, 2046, 2290, 2045, 2044, 388, 2043, 2287, + /* 1820 */ 2042, 710, 2041, 2040, 2170, 2039, 709, 2038, 2037, 2036, + /* 1830 */ 2201, 2035, 2237, 2034, 208, 345, 2203, 713, 2205, 2206, + /* 1840 */ 708, 2202, 703, 2033, 87, 2032, 2031, 2030, 2064, 2220, + /* 1850 */ 2029, 710, 2028, 2027, 1462, 2026, 2025, 505, 2024, 2023, + /* 1860 */ 2201, 2170, 2237, 709, 1332, 345, 2203, 713, 2205, 2206, + /* 1870 */ 708, 1336, 703, 2202, 355, 1874, 215, 1873, 356, 2220, + /* 1880 */ 1872, 217, 1870, 710, 1867, 522, 1328, 1866, 526, 521, + /* 1890 */ 1859, 2170, 525, 709, 1848, 529, 218, 2201, 1824, 2237, + /* 1900 */ 533, 523, 338, 2203, 713, 2205, 2206, 708, 527, 703, + /* 1910 */ 2202, 2220, 530, 531, 220, 76, 394, 182, 2190, 1225, + /* 1920 */ 707, 1823, 77, 2170, 2129, 709, 183, 2201, 541, 2237, + /* 1930 */ 2119, 222, 171, 2203, 713, 2205, 2206, 708, 2107, 703, + /* 1940 */ 2202, 228, 230, 2106, 2083, 1948, 1869, 655, 2220, 1865, + /* 1950 */ 710, 556, 557, 558, 1270, 1863, 561, 560, 562, 2201, + /* 1960 */ 2170, 2237, 709, 619, 345, 2203, 713, 2205, 2206, 708, + /* 1970 */ 1861, 703, 564, 566, 565, 1858, 569, 568, 2220, 570, + /* 1980 */ 1843, 802, 1841, 402, 1842, 1840, 2388, 2202, 1820, 1950, + /* 1990 */ 2170, 1405, 709, 1404, 1949, 315, 2201, 710, 2237, 238, + /* 2000 */ 63, 344, 2203, 713, 2205, 2206, 708, 1319, 703, 1317, + /* 2010 */ 2256, 180, 1315, 2202, 1314, 1306, 1313, 767, 1312, 792, + /* 2020 */ 788, 784, 780, 710, 313, 2220, 2201, 1311, 2237, 1856, + /* 2030 */ 404, 345, 2203, 713, 2205, 2206, 708, 2170, 703, 709, + /* 2040 */ 769, 1308, 1307, 1305, 380, 1847, 381, 1845, 599, 382, + /* 2050 */ 602, 2220, 1819, 604, 1818, 606, 1817, 608, 115, 2128, + /* 2060 */ 1536, 1538, 1540, 2170, 110, 709, 29, 306, 1535, 57, + /* 2070 */ 67, 1516, 1518, 2201, 2202, 2237, 1520, 2118, 345, 2203, + /* 2080 */ 713, 2205, 2206, 708, 710, 703, 164, 2202, 623, 624, + /* 2090 */ 2105, 2104, 261, 629, 31, 1495, 2371, 710, 1494, 614, + /* 2100 */ 689, 2237, 20, 17, 340, 2203, 713, 2205, 2206, 708, + /* 2110 */ 631, 703, 2220, 1757, 267, 6, 7, 639, 641, 21, + /* 2120 */ 22, 269, 274, 33, 2170, 2220, 709, 1738, 275, 2191, + /* 2130 */ 65, 172, 23, 273, 1772, 293, 1730, 2170, 2202, 709, + /* 2140 */ 32, 24, 292, 95, 1771, 1777, 1778, 391, 710, 1776, + /* 2150 */ 1775, 18, 392, 1701, 2202, 1700, 2103, 287, 58, 2082, + /* 2160 */ 2201, 257, 2237, 59, 710, 330, 2203, 713, 2205, 2206, + /* 2170 */ 708, 177, 703, 2201, 96, 2237, 2220, 97, 328, 2203, + /* 2180 */ 713, 2205, 2206, 708, 294, 703, 25, 297, 2170, 295, + /* 2190 */ 709, 1736, 2220, 2081, 99, 302, 684, 68, 101, 105, + /* 2200 */ 307, 26, 11, 2202, 2170, 1653, 709, 304, 1652, 13, + /* 2210 */ 1576, 2240, 179, 710, 1608, 1631, 702, 192, 1663, 714, + /* 2220 */ 1629, 39, 716, 16, 2201, 1628, 2237, 1600, 27, 331, + /* 2230 */ 2203, 713, 2205, 2206, 708, 712, 703, 28, 405, 1390, + /* 2240 */ 2201, 2220, 2237, 718, 720, 337, 2203, 713, 2205, 2206, + /* 2250 */ 708, 1387, 703, 2170, 2202, 709, 1386, 721, 723, 726, + /* 2260 */ 729, 724, 732, 727, 710, 1383, 1377, 730, 1381, 733, + /* 2270 */ 2202, 1380, 1375, 1379, 1378, 106, 310, 107, 1399, 75, + /* 2280 */ 710, 1395, 1268, 2202, 747, 1300, 1299, 1298, 1297, 2201, + /* 2290 */ 1295, 2237, 2220, 710, 341, 2203, 713, 2205, 2206, 708, + /* 2300 */ 1293, 703, 1292, 2202, 2170, 1291, 709, 757, 2220, 1326, + /* 2310 */ 311, 1289, 1288, 710, 1287, 1286, 1323, 1285, 1284, 1283, + /* 2320 */ 2170, 2220, 709, 1321, 1280, 1279, 1276, 1275, 1274, 1864, + /* 2330 */ 1273, 777, 1862, 2170, 778, 709, 779, 781, 783, 1860, + /* 2340 */ 2201, 2220, 2237, 787, 785, 333, 2203, 713, 2205, 2206, + /* 2350 */ 708, 1857, 703, 2170, 789, 709, 2201, 782, 2237, 786, + /* 2360 */ 790, 342, 2203, 713, 2205, 2206, 708, 791, 703, 2201, + /* 2370 */ 1839, 2237, 793, 2202, 334, 2203, 713, 2205, 2206, 708, + /* 2380 */ 1215, 703, 1816, 710, 314, 797, 1791, 1562, 324, 2201, + /* 2390 */ 800, 2237, 801, 1791, 343, 2203, 713, 2205, 2206, 708, + /* 2400 */ 1791, 703, 1791, 1791, 1791, 1791, 2202, 1791, 1791, 1791, + /* 2410 */ 1791, 2220, 1791, 1791, 1791, 1791, 710, 1791, 1791, 1791, + /* 2420 */ 1791, 1791, 2202, 2170, 1791, 709, 1791, 1791, 1791, 1791, + /* 2430 */ 1791, 1791, 710, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + /* 2440 */ 1791, 1791, 1791, 2202, 2220, 1791, 1791, 1791, 1791, 1791, + /* 2450 */ 1791, 1791, 1791, 710, 1791, 1791, 2170, 1791, 709, 2201, + /* 2460 */ 2220, 2237, 1791, 1791, 335, 2203, 713, 2205, 2206, 708, + /* 2470 */ 1791, 703, 2170, 1791, 709, 1791, 1791, 1791, 1791, 1791, + /* 2480 */ 1791, 2220, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + /* 2490 */ 1791, 1791, 2201, 2170, 2237, 709, 1791, 348, 2203, 713, + /* 2500 */ 2205, 2206, 708, 1791, 703, 1791, 1791, 1791, 2201, 2202, + /* 2510 */ 2237, 1791, 1791, 349, 2203, 713, 2205, 2206, 708, 710, + /* 2520 */ 703, 1791, 2202, 1791, 1791, 1791, 1791, 1791, 1791, 2201, + /* 2530 */ 1791, 2237, 710, 2202, 2214, 2203, 713, 2205, 2206, 708, + /* 2540 */ 1791, 703, 1791, 710, 1791, 1791, 2202, 2220, 1791, 1791, + /* 2550 */ 1791, 1791, 1791, 1791, 1791, 1791, 710, 1791, 1791, 2170, + /* 2560 */ 2220, 709, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + /* 2570 */ 1791, 2220, 2170, 1791, 709, 1791, 1791, 1791, 1791, 1791, + /* 2580 */ 1791, 1791, 1791, 2170, 2220, 709, 1791, 1791, 1791, 1791, + /* 2590 */ 1791, 1791, 1791, 1791, 1791, 2201, 2170, 2237, 709, 1791, + /* 2600 */ 2213, 2203, 713, 2205, 2206, 708, 1791, 703, 2201, 1791, + /* 2610 */ 2237, 1791, 1791, 2212, 2203, 713, 2205, 2206, 708, 2201, + /* 2620 */ 703, 2237, 1791, 2202, 364, 2203, 713, 2205, 2206, 708, + /* 2630 */ 1791, 703, 2201, 710, 2237, 1791, 2202, 365, 2203, 713, + /* 2640 */ 2205, 2206, 708, 1791, 703, 1791, 710, 2202, 1791, 1791, + /* 2650 */ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 710, 1791, 1791, + /* 2660 */ 1791, 2220, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + /* 2670 */ 1791, 1791, 1791, 2170, 2220, 709, 1791, 1791, 1791, 1791, + /* 2680 */ 1791, 1791, 1791, 1791, 1791, 2220, 2170, 1791, 709, 1791, + /* 2690 */ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 2170, 2202, 709, + /* 2700 */ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 710, 2201, + /* 2710 */ 1791, 2237, 1791, 1791, 361, 2203, 713, 2205, 2206, 708, + /* 2720 */ 1791, 703, 2201, 1791, 2237, 1791, 1791, 366, 2203, 713, + /* 2730 */ 2205, 2206, 708, 711, 703, 2237, 2220, 1791, 340, 2203, + /* 2740 */ 713, 2205, 2206, 708, 1791, 703, 1791, 1791, 2170, 1791, + /* 2750 */ 709, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + /* 2760 */ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + /* 2770 */ 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + /* 2780 */ 1791, 1791, 1791, 1791, 2201, 1791, 2237, 1791, 1791, 339, + /* 2790 */ 2203, 713, 2205, 2206, 708, 1791, 703, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 351, 342, 368, 394, 346, 351, 352, 349, 350, 1, @@ -501,181 +501,181 @@ static const YYCODETYPE yy_lookahead[] = { /* 20 */ 20, 20, 22, 8, 9, 371, 392, 12, 13, 14, /* 30 */ 15, 16, 378, 33, 347, 35, 351, 352, 351, 380, /* 40 */ 353, 412, 8, 9, 20, 396, 12, 13, 14, 15, - /* 50 */ 16, 392, 20, 394, 22, 20, 371, 368, 368, 351, - /* 60 */ 352, 381, 62, 378, 430, 431, 346, 35, 68, 349, - /* 70 */ 350, 382, 382, 358, 440, 75, 390, 351, 352, 393, - /* 80 */ 394, 392, 392, 68, 342, 53, 394, 428, 459, 430, + /* 50 */ 16, 392, 3, 394, 381, 14, 371, 368, 368, 351, + /* 60 */ 352, 20, 62, 378, 430, 431, 448, 449, 68, 20, + /* 70 */ 394, 382, 382, 358, 440, 75, 346, 351, 352, 349, + /* 80 */ 350, 392, 392, 68, 380, 409, 410, 428, 459, 430, /* 90 */ 375, 462, 433, 434, 435, 436, 437, 438, 383, 440, - /* 100 */ 100, 409, 410, 103, 445, 341, 447, 343, 479, 480, + /* 100 */ 100, 380, 35, 103, 445, 401, 447, 372, 479, 480, /* 110 */ 451, 452, 104, 484, 485, 380, 12, 13, 20, 430, - /* 120 */ 430, 20, 351, 352, 20, 466, 22, 112, 100, 440, - /* 130 */ 440, 448, 449, 474, 392, 400, 401, 33, 103, 35, - /* 140 */ 140, 141, 371, 432, 116, 117, 118, 119, 120, 121, - /* 150 */ 122, 123, 124, 125, 380, 127, 128, 129, 130, 131, - /* 160 */ 132, 133, 454, 455, 456, 457, 62, 459, 460, 458, - /* 170 */ 170, 171, 68, 20, 347, 401, 176, 177, 351, 75, - /* 180 */ 353, 455, 456, 457, 169, 459, 460, 20, 462, 351, - /* 190 */ 352, 191, 21, 193, 170, 24, 25, 26, 27, 28, + /* 120 */ 430, 400, 401, 388, 20, 466, 22, 112, 100, 440, + /* 130 */ 440, 390, 347, 474, 393, 394, 351, 33, 353, 35, + /* 140 */ 140, 141, 75, 115, 116, 117, 118, 119, 120, 121, + /* 150 */ 122, 123, 124, 104, 126, 127, 128, 129, 130, 131, + /* 160 */ 132, 361, 454, 455, 456, 457, 62, 459, 460, 369, + /* 170 */ 170, 171, 68, 20, 351, 352, 176, 177, 341, 75, + /* 180 */ 343, 455, 456, 457, 169, 459, 460, 20, 462, 351, + /* 190 */ 352, 191, 21, 193, 371, 24, 25, 26, 27, 28, /* 200 */ 29, 30, 31, 32, 100, 479, 480, 103, 342, 371, /* 210 */ 484, 485, 12, 13, 14, 15, 16, 183, 352, 393, - /* 220 */ 394, 20, 20, 223, 224, 0, 226, 227, 228, 229, + /* 220 */ 394, 172, 20, 223, 224, 0, 226, 227, 228, 229, /* 230 */ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - /* 240 */ 240, 241, 242, 243, 140, 141, 380, 379, 20, 24, + /* 240 */ 240, 241, 242, 243, 140, 141, 380, 379, 358, 24, /* 250 */ 25, 26, 27, 28, 29, 30, 31, 32, 392, 391, /* 260 */ 394, 0, 247, 248, 249, 250, 251, 252, 253, 254, - /* 270 */ 255, 256, 257, 172, 170, 171, 361, 20, 351, 352, - /* 280 */ 176, 177, 21, 67, 369, 24, 25, 26, 27, 28, + /* 270 */ 255, 256, 257, 383, 170, 171, 169, 67, 351, 352, + /* 280 */ 176, 177, 21, 54, 55, 24, 25, 26, 27, 28, /* 290 */ 29, 30, 31, 32, 428, 191, 430, 193, 371, 433, /* 300 */ 434, 435, 436, 437, 438, 103, 440, 140, 141, 443, - /* 310 */ 351, 445, 446, 447, 380, 342, 35, 451, 452, 339, + /* 310 */ 14, 445, 446, 447, 380, 342, 20, 451, 452, 339, /* 320 */ 286, 387, 135, 170, 171, 352, 139, 223, 224, 395, /* 330 */ 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, /* 340 */ 236, 237, 238, 239, 240, 241, 242, 243, 244, 12, - /* 350 */ 13, 380, 0, 380, 351, 352, 75, 20, 387, 22, - /* 360 */ 103, 4, 403, 372, 405, 392, 395, 394, 351, 352, - /* 370 */ 33, 380, 35, 172, 371, 4, 8, 9, 387, 388, - /* 380 */ 12, 13, 14, 15, 16, 20, 395, 200, 20, 351, - /* 390 */ 203, 39, 412, 206, 342, 208, 14, 417, 20, 62, - /* 400 */ 22, 428, 20, 430, 352, 68, 433, 434, 435, 436, + /* 350 */ 13, 12, 13, 380, 247, 351, 352, 20, 20, 22, + /* 360 */ 22, 44, 20, 372, 257, 392, 20, 394, 351, 352, + /* 370 */ 33, 380, 35, 35, 35, 4, 8, 9, 387, 388, + /* 380 */ 12, 13, 14, 15, 16, 133, 395, 200, 20, 137, + /* 390 */ 203, 53, 412, 206, 342, 208, 20, 417, 20, 62, + /* 400 */ 22, 428, 398, 430, 352, 68, 433, 434, 435, 436, /* 410 */ 437, 438, 75, 440, 43, 398, 45, 46, 445, 223, - /* 420 */ 447, 380, 8, 9, 451, 452, 12, 13, 14, 15, - /* 430 */ 16, 53, 380, 3, 351, 352, 395, 100, 352, 459, - /* 440 */ 103, 403, 462, 405, 392, 169, 394, 474, 342, 4, - /* 450 */ 20, 3, 412, 12, 13, 14, 35, 417, 44, 479, - /* 460 */ 480, 20, 260, 22, 484, 485, 380, 271, 272, 273, - /* 470 */ 274, 275, 276, 277, 33, 380, 35, 140, 141, 103, - /* 480 */ 428, 398, 430, 388, 37, 433, 434, 435, 436, 437, - /* 490 */ 438, 439, 440, 441, 442, 14, 351, 352, 392, 459, - /* 500 */ 342, 20, 462, 62, 54, 55, 459, 170, 171, 462, - /* 510 */ 352, 356, 357, 176, 177, 175, 75, 260, 104, 479, - /* 520 */ 480, 435, 380, 247, 484, 485, 479, 480, 191, 387, - /* 530 */ 193, 484, 485, 257, 104, 351, 14, 395, 380, 380, - /* 540 */ 172, 100, 20, 398, 103, 67, 387, 342, 103, 244, - /* 550 */ 392, 246, 394, 106, 395, 108, 109, 352, 111, 354, - /* 560 */ 223, 224, 115, 226, 227, 228, 229, 230, 231, 232, + /* 420 */ 447, 104, 8, 9, 451, 452, 12, 13, 14, 15, + /* 430 */ 16, 53, 380, 20, 351, 352, 244, 100, 246, 459, + /* 440 */ 103, 380, 462, 84, 392, 103, 394, 474, 387, 4, + /* 450 */ 67, 342, 412, 12, 13, 14, 395, 417, 44, 479, + /* 460 */ 480, 20, 37, 22, 484, 485, 170, 271, 272, 273, + /* 470 */ 274, 275, 276, 277, 33, 134, 35, 140, 141, 103, + /* 480 */ 428, 398, 430, 356, 357, 433, 434, 435, 436, 437, + /* 490 */ 438, 439, 440, 441, 442, 360, 21, 351, 352, 459, + /* 500 */ 342, 392, 462, 62, 145, 146, 48, 170, 171, 34, + /* 510 */ 352, 36, 377, 176, 177, 114, 75, 371, 104, 479, + /* 520 */ 480, 386, 380, 175, 484, 485, 44, 168, 191, 387, + /* 530 */ 193, 106, 193, 108, 109, 372, 111, 395, 380, 103, + /* 540 */ 172, 100, 22, 380, 103, 204, 205, 342, 103, 113, + /* 550 */ 392, 388, 394, 140, 141, 35, 412, 352, 133, 354, + /* 560 */ 223, 224, 137, 226, 227, 228, 229, 230, 231, 232, /* 570 */ 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - /* 580 */ 243, 140, 141, 0, 137, 380, 428, 403, 430, 405, - /* 590 */ 114, 433, 434, 435, 436, 437, 438, 392, 440, 394, - /* 600 */ 21, 459, 172, 360, 462, 447, 266, 267, 268, 451, - /* 610 */ 452, 170, 171, 34, 193, 36, 48, 176, 177, 262, - /* 620 */ 377, 479, 480, 62, 351, 352, 484, 485, 44, 386, - /* 630 */ 12, 13, 191, 428, 193, 430, 260, 244, 433, 434, - /* 640 */ 435, 436, 437, 438, 371, 440, 443, 20, 2, 446, - /* 650 */ 445, 170, 447, 35, 8, 9, 451, 452, 12, 13, - /* 660 */ 14, 15, 16, 102, 223, 224, 105, 226, 227, 228, + /* 580 */ 243, 140, 141, 0, 244, 380, 428, 432, 430, 176, + /* 590 */ 177, 433, 434, 435, 436, 437, 438, 392, 440, 394, + /* 600 */ 376, 459, 260, 459, 462, 447, 462, 356, 357, 451, + /* 610 */ 452, 170, 171, 458, 266, 267, 268, 176, 177, 75, + /* 620 */ 100, 479, 480, 479, 480, 432, 484, 485, 484, 485, + /* 630 */ 172, 13, 191, 428, 193, 430, 260, 179, 433, 434, + /* 640 */ 435, 436, 437, 438, 342, 440, 351, 352, 2, 425, + /* 650 */ 445, 458, 447, 35, 8, 9, 451, 452, 12, 13, + /* 660 */ 14, 15, 16, 351, 223, 224, 371, 226, 227, 228, /* 670 */ 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - /* 680 */ 239, 240, 241, 242, 243, 12, 13, 412, 104, 342, - /* 690 */ 0, 22, 170, 20, 22, 22, 351, 352, 75, 352, - /* 700 */ 342, 372, 351, 352, 35, 260, 33, 35, 35, 380, - /* 710 */ 352, 380, 70, 71, 72, 114, 371, 388, 387, 77, - /* 720 */ 78, 79, 371, 351, 352, 83, 395, 380, 103, 281, - /* 730 */ 88, 89, 90, 91, 459, 62, 94, 462, 380, 392, - /* 740 */ 172, 394, 159, 371, 75, 134, 84, 179, 75, 369, - /* 750 */ 392, 168, 394, 22, 479, 480, 75, 8, 9, 484, - /* 760 */ 485, 12, 13, 14, 15, 16, 35, 140, 141, 100, - /* 770 */ 351, 352, 100, 100, 186, 428, 103, 430, 351, 352, + /* 680 */ 239, 240, 241, 242, 243, 12, 13, 351, 352, 342, + /* 690 */ 49, 22, 0, 20, 392, 22, 351, 352, 57, 352, + /* 700 */ 342, 60, 61, 14, 35, 260, 33, 371, 35, 20, + /* 710 */ 352, 380, 70, 71, 72, 403, 371, 405, 387, 77, + /* 720 */ 78, 79, 114, 351, 352, 83, 395, 380, 103, 372, + /* 730 */ 88, 89, 90, 91, 0, 62, 94, 380, 380, 392, + /* 740 */ 20, 394, 159, 371, 75, 388, 351, 352, 75, 369, + /* 750 */ 392, 168, 394, 380, 351, 352, 443, 8, 9, 446, + /* 760 */ 387, 12, 13, 14, 15, 16, 371, 285, 395, 100, + /* 770 */ 351, 352, 352, 100, 371, 428, 103, 430, 351, 352, /* 780 */ 433, 434, 435, 436, 437, 438, 428, 440, 430, 12, /* 790 */ 13, 433, 434, 435, 436, 437, 438, 20, 440, 22, - /* 800 */ 14, 213, 214, 176, 177, 115, 20, 145, 146, 49, - /* 810 */ 33, 193, 35, 140, 141, 204, 205, 57, 351, 352, - /* 820 */ 60, 61, 475, 476, 134, 135, 136, 137, 138, 139, - /* 830 */ 168, 100, 372, 381, 476, 115, 134, 135, 371, 62, - /* 840 */ 380, 139, 459, 170, 171, 462, 356, 357, 388, 176, - /* 850 */ 177, 0, 75, 104, 134, 135, 136, 137, 138, 139, - /* 860 */ 191, 103, 193, 480, 191, 381, 193, 484, 485, 459, - /* 870 */ 342, 113, 462, 103, 455, 456, 457, 100, 459, 460, - /* 880 */ 103, 342, 455, 456, 457, 260, 459, 460, 365, 366, - /* 890 */ 480, 352, 223, 224, 484, 485, 223, 224, 0, 226, + /* 800 */ 380, 8, 9, 103, 351, 12, 13, 14, 15, 16, + /* 810 */ 33, 22, 35, 140, 141, 133, 134, 135, 136, 137, + /* 820 */ 138, 139, 475, 476, 35, 133, 134, 135, 136, 137, + /* 830 */ 138, 139, 365, 366, 476, 134, 135, 351, 352, 62, + /* 840 */ 139, 351, 352, 170, 171, 351, 352, 75, 342, 176, + /* 850 */ 177, 0, 75, 104, 381, 435, 403, 371, 405, 170, + /* 860 */ 191, 371, 193, 402, 191, 371, 193, 133, 134, 135, + /* 870 */ 136, 137, 138, 139, 455, 456, 457, 100, 459, 460, + /* 880 */ 103, 342, 455, 456, 457, 260, 459, 460, 20, 100, + /* 890 */ 170, 352, 223, 224, 432, 381, 223, 224, 392, 226, /* 900 */ 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, /* 910 */ 237, 238, 239, 240, 241, 242, 243, 140, 141, 380, - /* 920 */ 392, 70, 71, 72, 351, 352, 351, 352, 77, 78, + /* 920 */ 458, 70, 71, 72, 351, 352, 351, 352, 77, 78, /* 930 */ 79, 392, 342, 394, 83, 4, 14, 15, 16, 88, - /* 940 */ 89, 90, 91, 381, 371, 94, 371, 170, 171, 342, + /* 940 */ 89, 90, 91, 351, 371, 94, 371, 170, 171, 381, /* 950 */ 19, 8, 9, 176, 177, 12, 13, 14, 15, 16, - /* 960 */ 190, 444, 192, 446, 33, 67, 381, 428, 191, 430, - /* 970 */ 193, 358, 433, 434, 435, 436, 437, 438, 381, 440, - /* 980 */ 49, 372, 392, 45, 46, 342, 447, 56, 0, 380, - /* 990 */ 451, 452, 222, 62, 412, 432, 383, 388, 342, 392, + /* 960 */ 260, 351, 352, 459, 33, 172, 462, 428, 191, 430, + /* 970 */ 193, 186, 433, 434, 435, 436, 437, 438, 3, 440, + /* 980 */ 49, 371, 392, 479, 480, 4, 447, 56, 484, 485, + /* 990 */ 451, 452, 62, 62, 412, 403, 381, 405, 213, 214, /* 1000 */ 223, 224, 0, 226, 227, 228, 229, 230, 231, 232, /* 1010 */ 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - /* 1020 */ 243, 458, 18, 18, 20, 351, 352, 342, 23, 389, - /* 1030 */ 260, 27, 392, 102, 30, 392, 105, 33, 351, 352, - /* 1040 */ 0, 459, 37, 38, 462, 371, 41, 104, 392, 342, - /* 1050 */ 342, 342, 342, 49, 342, 51, 39, 52, 371, 342, - /* 1060 */ 56, 479, 480, 365, 366, 342, 484, 485, 63, 64, + /* 1020 */ 243, 39, 18, 18, 20, 351, 352, 342, 23, 365, + /* 1030 */ 366, 27, 102, 102, 30, 105, 105, 33, 381, 360, + /* 1040 */ 172, 459, 37, 38, 462, 371, 41, 104, 0, 20, + /* 1050 */ 342, 342, 412, 49, 342, 51, 444, 52, 446, 0, + /* 1060 */ 56, 479, 480, 342, 342, 386, 484, 485, 63, 64, /* 1070 */ 65, 66, 70, 71, 72, 73, 74, 392, 76, 77, /* 1080 */ 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - /* 1090 */ 88, 89, 90, 91, 92, 93, 94, 95, 96, 392, - /* 1100 */ 392, 392, 392, 115, 392, 33, 102, 389, 103, 392, - /* 1110 */ 392, 44, 432, 351, 352, 392, 20, 389, 114, 360, - /* 1120 */ 392, 49, 134, 135, 136, 137, 138, 139, 115, 57, - /* 1130 */ 58, 59, 60, 371, 62, 8, 9, 342, 458, 12, - /* 1140 */ 13, 14, 15, 16, 342, 386, 373, 142, 144, 376, - /* 1150 */ 137, 147, 148, 149, 150, 151, 152, 153, 154, 155, - /* 1160 */ 156, 157, 158, 159, 160, 161, 162, 163, 412, 165, - /* 1170 */ 166, 167, 2, 376, 102, 351, 352, 105, 8, 9, - /* 1180 */ 351, 352, 12, 13, 14, 15, 16, 392, 183, 184, - /* 1190 */ 185, 68, 342, 188, 392, 371, 351, 352, 342, 444, - /* 1200 */ 371, 446, 352, 0, 354, 367, 201, 202, 370, 258, - /* 1210 */ 259, 13, 13, 342, 114, 459, 371, 212, 462, 42, - /* 1220 */ 215, 44, 425, 218, 219, 220, 221, 222, 0, 42, - /* 1230 */ 380, 44, 35, 35, 35, 479, 480, 44, 44, 342, - /* 1240 */ 484, 485, 392, 0, 394, 173, 174, 44, 392, 352, - /* 1250 */ 22, 354, 180, 181, 8, 9, 343, 217, 12, 13, - /* 1260 */ 14, 15, 16, 392, 164, 260, 44, 107, 172, 107, - /* 1270 */ 110, 199, 110, 207, 62, 209, 259, 380, 428, 107, - /* 1280 */ 430, 0, 110, 433, 434, 435, 436, 437, 438, 392, - /* 1290 */ 440, 394, 49, 107, 0, 445, 110, 447, 104, 44, - /* 1300 */ 44, 451, 452, 22, 44, 140, 141, 44, 44, 44, - /* 1310 */ 44, 44, 44, 1, 2, 0, 22, 105, 44, 13, - /* 1320 */ 44, 35, 418, 44, 44, 428, 104, 430, 44, 47, - /* 1330 */ 433, 434, 435, 436, 437, 438, 44, 440, 402, 44, - /* 1340 */ 44, 35, 445, 342, 447, 488, 223, 477, 451, 452, - /* 1350 */ 283, 355, 471, 352, 13, 354, 12, 13, 368, 104, - /* 1360 */ 104, 75, 368, 342, 104, 50, 22, 104, 104, 104, - /* 1370 */ 104, 104, 104, 352, 411, 354, 35, 33, 104, 35, - /* 1380 */ 104, 380, 355, 104, 104, 103, 380, 402, 104, 350, - /* 1390 */ 193, 391, 481, 392, 352, 394, 104, 402, 461, 104, - /* 1400 */ 104, 380, 453, 263, 465, 413, 62, 49, 429, 20, - /* 1410 */ 206, 422, 342, 392, 427, 394, 360, 360, 172, 75, - /* 1420 */ 422, 189, 352, 415, 354, 20, 352, 42, 399, 428, - /* 1430 */ 20, 430, 342, 402, 433, 434, 435, 436, 437, 438, - /* 1440 */ 352, 440, 352, 399, 100, 397, 445, 20, 447, 428, + /* 1090 */ 88, 89, 90, 91, 92, 93, 94, 95, 96, 459, + /* 1100 */ 392, 392, 462, 343, 392, 33, 102, 380, 103, 103, + /* 1110 */ 444, 20, 446, 392, 392, 67, 45, 46, 114, 479, + /* 1120 */ 480, 49, 395, 342, 484, 485, 342, 380, 44, 57, + /* 1130 */ 58, 59, 60, 389, 62, 388, 392, 342, 8, 9, + /* 1140 */ 488, 342, 12, 13, 14, 15, 16, 142, 144, 342, + /* 1150 */ 342, 147, 148, 149, 150, 151, 152, 153, 154, 155, + /* 1160 */ 156, 157, 158, 159, 160, 161, 162, 163, 342, 165, + /* 1170 */ 166, 167, 2, 392, 102, 14, 392, 105, 8, 9, + /* 1180 */ 35, 20, 12, 13, 14, 15, 16, 392, 183, 184, + /* 1190 */ 185, 392, 342, 188, 389, 0, 190, 392, 192, 392, + /* 1200 */ 392, 172, 352, 35, 354, 342, 201, 202, 342, 418, + /* 1210 */ 459, 389, 459, 462, 392, 462, 373, 212, 392, 376, + /* 1220 */ 215, 258, 259, 218, 219, 220, 221, 222, 222, 367, + /* 1230 */ 380, 480, 370, 480, 39, 484, 485, 484, 485, 342, + /* 1240 */ 13, 259, 392, 262, 394, 173, 174, 0, 42, 352, + /* 1250 */ 44, 354, 180, 181, 114, 392, 281, 42, 392, 44, + /* 1260 */ 44, 44, 35, 172, 0, 260, 260, 107, 44, 107, + /* 1270 */ 110, 199, 110, 207, 62, 209, 217, 380, 428, 107, + /* 1280 */ 430, 44, 110, 433, 434, 435, 436, 437, 438, 392, + /* 1290 */ 440, 394, 0, 0, 0, 445, 49, 447, 44, 44, + /* 1300 */ 107, 451, 452, 110, 164, 140, 141, 477, 44, 44, + /* 1310 */ 44, 44, 44, 355, 22, 22, 22, 105, 44, 68, + /* 1320 */ 104, 104, 1, 2, 44, 428, 44, 430, 104, 44, + /* 1330 */ 433, 434, 435, 436, 437, 438, 47, 440, 193, 44, + /* 1340 */ 44, 104, 445, 342, 447, 44, 13, 44, 451, 452, + /* 1350 */ 44, 35, 13, 352, 0, 354, 12, 13, 104, 104, + /* 1360 */ 471, 193, 368, 342, 368, 380, 22, 283, 35, 104, + /* 1370 */ 104, 104, 104, 352, 35, 354, 411, 33, 104, 35, + /* 1380 */ 355, 380, 402, 350, 104, 402, 104, 352, 391, 104, + /* 1390 */ 461, 75, 103, 392, 481, 394, 263, 453, 465, 104, + /* 1400 */ 104, 380, 413, 429, 50, 104, 62, 104, 49, 20, + /* 1410 */ 104, 206, 342, 392, 422, 394, 360, 427, 360, 75, + /* 1420 */ 422, 189, 352, 415, 354, 20, 352, 42, 20, 428, + /* 1430 */ 399, 430, 342, 352, 433, 434, 435, 436, 437, 438, + /* 1440 */ 402, 440, 352, 399, 100, 169, 445, 397, 447, 428, /* 1450 */ 380, 430, 451, 452, 433, 434, 435, 436, 437, 438, - /* 1460 */ 169, 440, 392, 351, 394, 352, 445, 351, 447, 101, - /* 1470 */ 380, 364, 451, 452, 399, 397, 397, 99, 285, 351, - /* 1480 */ 363, 98, 392, 362, 394, 351, 351, 351, 20, 344, - /* 1490 */ 48, 348, 344, 422, 348, 20, 394, 360, 428, 360, - /* 1500 */ 430, 342, 20, 433, 434, 435, 436, 437, 438, 353, - /* 1510 */ 440, 352, 20, 414, 360, 445, 353, 447, 428, 351, + /* 1460 */ 20, 440, 392, 351, 394, 352, 445, 351, 447, 101, + /* 1470 */ 380, 364, 451, 452, 223, 399, 397, 397, 99, 351, + /* 1480 */ 363, 98, 392, 362, 394, 351, 351, 351, 20, 48, + /* 1490 */ 344, 348, 344, 20, 394, 348, 20, 422, 428, 360, + /* 1500 */ 430, 342, 360, 433, 434, 435, 436, 437, 438, 353, + /* 1510 */ 440, 352, 20, 414, 360, 445, 353, 447, 428, 344, /* 1520 */ 430, 451, 452, 433, 434, 435, 436, 437, 438, 360, - /* 1530 */ 440, 360, 344, 360, 360, 191, 351, 193, 380, 380, - /* 1540 */ 344, 380, 392, 392, 380, 392, 380, 380, 210, 103, - /* 1550 */ 342, 392, 426, 394, 424, 380, 380, 197, 380, 380, - /* 1560 */ 352, 380, 380, 422, 358, 421, 196, 223, 224, 420, - /* 1570 */ 195, 358, 351, 270, 394, 392, 486, 487, 470, 269, + /* 1530 */ 440, 360, 351, 360, 360, 191, 351, 193, 380, 380, + /* 1540 */ 344, 392, 392, 392, 380, 210, 380, 380, 426, 103, + /* 1550 */ 342, 392, 358, 394, 422, 424, 380, 380, 380, 380, + /* 1560 */ 352, 197, 380, 380, 380, 421, 196, 223, 224, 358, + /* 1570 */ 195, 351, 420, 470, 394, 270, 486, 487, 269, 392, /* 1580 */ 236, 237, 238, 239, 240, 241, 242, 428, 380, 430, - /* 1590 */ 470, 402, 433, 434, 435, 436, 437, 438, 407, 440, - /* 1600 */ 392, 392, 394, 419, 445, 413, 447, 402, 407, 392, - /* 1610 */ 451, 452, 392, 278, 280, 473, 182, 264, 279, 472, - /* 1620 */ 342, 489, 470, 413, 469, 468, 284, 287, 282, 352, - /* 1630 */ 352, 259, 20, 114, 432, 261, 428, 20, 430, 405, - /* 1640 */ 342, 433, 434, 435, 436, 437, 438, 358, 440, 407, - /* 1650 */ 352, 358, 353, 445, 392, 447, 407, 467, 380, 451, - /* 1660 */ 452, 392, 392, 392, 392, 392, 358, 174, 352, 358, - /* 1670 */ 392, 464, 394, 376, 463, 103, 450, 482, 380, 404, - /* 1680 */ 103, 351, 392, 483, 384, 358, 36, 370, 345, 344, - /* 1690 */ 392, 359, 394, 408, 374, 374, 408, 374, 0, 416, - /* 1700 */ 0, 340, 0, 42, 0, 35, 428, 216, 430, 342, - /* 1710 */ 423, 433, 434, 435, 436, 437, 438, 35, 440, 352, + /* 1590 */ 392, 402, 433, 434, 435, 436, 437, 438, 407, 440, + /* 1600 */ 392, 413, 394, 402, 445, 419, 447, 470, 278, 407, + /* 1610 */ 451, 452, 182, 392, 392, 264, 280, 279, 287, 259, + /* 1620 */ 342, 284, 413, 282, 483, 468, 473, 472, 20, 352, + /* 1630 */ 352, 114, 261, 358, 353, 432, 428, 358, 430, 20, + /* 1640 */ 342, 433, 434, 435, 436, 437, 438, 405, 440, 392, + /* 1650 */ 352, 407, 392, 445, 392, 447, 407, 467, 380, 451, + /* 1660 */ 452, 392, 470, 392, 392, 174, 469, 404, 464, 358, + /* 1670 */ 392, 358, 394, 463, 352, 376, 103, 103, 380, 450, + /* 1680 */ 392, 384, 482, 351, 370, 358, 36, 345, 489, 344, + /* 1690 */ 392, 374, 394, 423, 408, 408, 340, 374, 374, 416, + /* 1700 */ 0, 0, 359, 0, 42, 0, 428, 35, 430, 342, + /* 1710 */ 216, 433, 434, 435, 436, 437, 438, 35, 440, 352, /* 1720 */ 35, 35, 216, 445, 0, 447, 428, 35, 430, 451, - /* 1730 */ 452, 433, 434, 435, 436, 437, 438, 216, 440, 0, - /* 1740 */ 35, 216, 0, 35, 342, 447, 0, 380, 22, 451, + /* 1730 */ 452, 433, 434, 435, 436, 437, 438, 35, 440, 216, + /* 1740 */ 0, 216, 0, 35, 342, 447, 0, 380, 22, 451, /* 1750 */ 452, 0, 35, 211, 352, 0, 199, 0, 199, 392, - /* 1760 */ 200, 394, 193, 0, 191, 0, 0, 187, 186, 0, + /* 1760 */ 200, 394, 193, 191, 0, 0, 0, 187, 186, 0, /* 1770 */ 0, 0, 47, 35, 342, 0, 49, 47, 0, 42, - /* 1780 */ 0, 0, 380, 0, 352, 0, 0, 385, 47, 0, - /* 1790 */ 0, 0, 0, 159, 392, 428, 394, 430, 0, 35, + /* 1780 */ 0, 0, 380, 0, 352, 0, 47, 385, 0, 0, + /* 1790 */ 0, 0, 0, 159, 392, 428, 394, 430, 35, 0, /* 1800 */ 433, 434, 435, 436, 437, 438, 159, 440, 0, 0, /* 1810 */ 0, 342, 380, 0, 447, 0, 0, 385, 0, 452, /* 1820 */ 0, 352, 0, 0, 392, 0, 394, 0, 0, 0, @@ -722,20 +722,20 @@ static const YYCODETYPE yy_lookahead[] = { /* 2230 */ 434, 435, 436, 437, 438, 225, 440, 103, 35, 104, /* 2240 */ 428, 380, 430, 103, 35, 433, 434, 435, 436, 437, /* 2250 */ 438, 104, 440, 392, 342, 394, 104, 103, 35, 35, - /* 2260 */ 35, 103, 35, 103, 352, 104, 104, 103, 126, 103, - /* 2270 */ 342, 126, 104, 22, 126, 126, 103, 44, 115, 103, - /* 2280 */ 352, 35, 103, 342, 22, 69, 68, 35, 35, 428, + /* 2260 */ 35, 103, 35, 103, 352, 104, 104, 103, 125, 103, + /* 2270 */ 342, 125, 104, 125, 125, 103, 44, 103, 35, 103, + /* 2280 */ 352, 22, 69, 342, 68, 35, 35, 35, 35, 428, /* 2290 */ 35, 430, 380, 352, 433, 434, 435, 436, 437, 438, - /* 2300 */ 35, 440, 35, 342, 392, 35, 394, 35, 380, 35, - /* 2310 */ 75, 97, 44, 352, 35, 35, 75, 35, 22, 35, - /* 2320 */ 392, 380, 394, 35, 35, 35, 35, 35, 35, 22, - /* 2330 */ 35, 0, 35, 392, 35, 394, 49, 39, 0, 35, - /* 2340 */ 428, 380, 430, 0, 35, 433, 434, 435, 436, 437, - /* 2350 */ 438, 49, 440, 392, 39, 394, 428, 49, 430, 39, - /* 2360 */ 0, 433, 434, 435, 436, 437, 438, 35, 440, 428, - /* 2370 */ 49, 430, 39, 342, 433, 434, 435, 436, 437, 438, - /* 2380 */ 0, 440, 35, 352, 35, 0, 22, 21, 21, 428, - /* 2390 */ 22, 430, 22, 20, 433, 434, 435, 436, 437, 438, + /* 2300 */ 35, 440, 35, 342, 392, 35, 394, 97, 380, 75, + /* 2310 */ 44, 35, 35, 352, 35, 22, 75, 35, 35, 35, + /* 2320 */ 392, 380, 394, 35, 35, 35, 35, 35, 22, 0, + /* 2330 */ 35, 35, 0, 392, 49, 394, 39, 35, 39, 0, + /* 2340 */ 428, 380, 430, 39, 35, 433, 434, 435, 436, 437, + /* 2350 */ 438, 0, 440, 392, 35, 394, 428, 49, 430, 49, + /* 2360 */ 49, 433, 434, 435, 436, 437, 438, 39, 440, 428, + /* 2370 */ 0, 430, 35, 342, 433, 434, 435, 436, 437, 438, + /* 2380 */ 35, 440, 0, 352, 22, 21, 490, 22, 22, 428, + /* 2390 */ 21, 430, 20, 490, 433, 434, 435, 436, 437, 438, /* 2400 */ 490, 440, 490, 490, 490, 490, 342, 490, 490, 490, /* 2410 */ 490, 380, 490, 490, 490, 490, 352, 490, 490, 490, /* 2420 */ 490, 490, 342, 392, 490, 394, 490, 490, 490, 490, @@ -811,58 +811,58 @@ static const YYCODETYPE yy_lookahead[] = { /* 3120 */ 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, /* 3130 */ 339, 339, 339, 339, 339, 339, }; -#define YY_SHIFT_COUNT (804) +#define YY_SHIFT_COUNT (802) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2385) +#define YY_SHIFT_MAX (2382) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 1005, 0, 104, 0, 337, 337, 337, 337, 337, 337, /* 10 */ 337, 337, 337, 337, 337, 337, 441, 673, 673, 777, /* 20 */ 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, /* 30 */ 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, /* 40 */ 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, - /* 50 */ 673, 202, 257, 770, 35, 376, 625, 376, 35, 35, - /* 60 */ 376, 1344, 376, 1344, 1344, 445, 376, 1, 627, 98, - /* 70 */ 98, 627, 371, 371, 153, 167, 382, 382, 98, 98, - /* 80 */ 98, 98, 98, 98, 98, 98, 98, 98, 228, 98, - /* 90 */ 98, 216, 1, 98, 98, 365, 1, 98, 228, 98, - /* 100 */ 228, 1, 98, 98, 1, 98, 1, 1, 1, 98, - /* 110 */ 478, 1004, 15, 15, 642, 171, 669, 669, 669, 669, + /* 50 */ 673, 342, 376, 1006, 202, 625, 700, 625, 202, 202, + /* 60 */ 625, 1344, 625, 1344, 1344, 445, 625, 1, 413, 24, + /* 70 */ 24, 413, 371, 371, 153, 167, 41, 41, 24, 24, + /* 80 */ 24, 24, 24, 24, 24, 24, 24, 24, 98, 24, + /* 90 */ 24, 210, 1, 24, 24, 346, 1, 24, 98, 24, + /* 100 */ 98, 1, 24, 24, 1, 24, 1, 1, 1, 24, + /* 110 */ 383, 1004, 15, 15, 642, 171, 669, 669, 669, 669, /* 120 */ 669, 669, 669, 669, 669, 669, 669, 669, 669, 669, - /* 130 */ 669, 669, 669, 669, 669, 447, 430, 153, 167, 450, - /* 140 */ 450, 281, 101, 101, 101, 898, 305, 305, 281, 216, - /* 150 */ 476, 393, 1, 623, 1, 623, 623, 601, 681, 28, + /* 130 */ 669, 669, 669, 669, 669, 425, 49, 153, 167, 229, + /* 140 */ 229, 67, 868, 868, 868, 1048, 192, 192, 67, 210, + /* 150 */ 401, 340, 1, 544, 1, 544, 544, 608, 772, 28, /* 160 */ 28, 28, 28, 28, 28, 28, 28, 1962, 851, 261, - /* 170 */ 368, 34, 196, 32, 340, 618, 618, 481, 568, 522, - /* 180 */ 378, 201, 938, 786, 1013, 1096, 951, 1017, 448, 951, - /* 190 */ 1177, 357, 24, 1140, 1358, 1389, 1204, 216, 1389, 216, - /* 200 */ 1232, 1405, 1385, 1410, 1405, 1385, 1291, 1427, 1405, 1427, - /* 210 */ 1385, 1291, 1291, 1368, 1378, 1427, 1383, 1427, 1427, 1427, - /* 220 */ 1468, 1442, 1468, 1442, 1389, 216, 1475, 216, 1482, 1492, - /* 230 */ 216, 1482, 216, 216, 216, 1427, 216, 1468, 1, 1, - /* 240 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1427, - /* 250 */ 1468, 623, 623, 623, 1338, 1446, 1389, 478, 1360, 1370, - /* 260 */ 1475, 478, 1375, 1140, 1427, 1410, 1410, 623, 1303, 1310, - /* 270 */ 623, 1303, 1310, 623, 623, 1, 1335, 1434, 1303, 1334, - /* 280 */ 1339, 1353, 1140, 1340, 1342, 1346, 1372, 1405, 1612, 1519, - /* 290 */ 1374, 1482, 478, 478, 1617, 1310, 623, 623, 623, 623, - /* 300 */ 623, 1310, 623, 1493, 478, 601, 478, 1405, 1572, 1577, - /* 310 */ 623, 681, 1427, 478, 1650, 1468, 2797, 2797, 2797, 2797, + /* 170 */ 368, 34, 196, 338, 348, 339, 339, 296, 458, 689, + /* 180 */ 378, 1029, 1071, 1161, 252, 1091, 963, 982, 975, 963, + /* 190 */ 1206, 981, 720, 1133, 1359, 1389, 1205, 210, 1389, 210, + /* 200 */ 1232, 1405, 1385, 1408, 1405, 1385, 1276, 1440, 1405, 1440, + /* 210 */ 1385, 1276, 1276, 1368, 1379, 1440, 1383, 1440, 1440, 1440, + /* 220 */ 1468, 1441, 1468, 1441, 1389, 210, 1473, 210, 1476, 1492, + /* 230 */ 210, 1476, 210, 210, 210, 1440, 210, 1468, 1, 1, + /* 240 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1440, + /* 250 */ 1468, 544, 544, 544, 1335, 1446, 1389, 383, 1364, 1370, + /* 260 */ 1473, 383, 1375, 1133, 1440, 1408, 1408, 544, 1305, 1309, + /* 270 */ 544, 1305, 1309, 544, 544, 1, 1330, 1430, 1305, 1336, + /* 280 */ 1338, 1351, 1133, 1331, 1337, 1341, 1360, 1405, 1608, 1517, + /* 290 */ 1371, 1476, 383, 383, 1619, 1309, 544, 544, 544, 544, + /* 300 */ 544, 1309, 544, 1491, 383, 608, 383, 1405, 1573, 1574, + /* 310 */ 544, 772, 1440, 383, 1650, 1468, 2797, 2797, 2797, 2797, /* 320 */ 2797, 2797, 2797, 2797, 2797, 1002, 1072, 225, 414, 931, - /* 330 */ 749, 943, 690, 646, 1170, 1246, 988, 1127, 1127, 1127, - /* 340 */ 1127, 1127, 1127, 1127, 1127, 1127, 720, 187, 200, 200, - /* 350 */ 662, 760, 588, 583, 561, 672, 731, 579, 611, 702, - /* 360 */ 702, 922, 8, 276, 922, 922, 922, 1243, 1040, 584, - /* 370 */ 352, 1187, 1100, 1203, 1160, 1162, 1172, 1186, 1198, 1199, - /* 380 */ 1228, 1281, 1294, 1066, 1194, 1222, 1212, 1255, 1256, 1260, - /* 390 */ 1165, 1067, 1193, 1263, 1264, 1265, 1266, 1267, 1268, 1312, - /* 400 */ 1274, 1123, 1276, 1282, 1279, 1280, 1284, 1292, 1295, 1296, - /* 410 */ 758, 421, 1197, 1306, 1341, 1286, 1315, 1698, 1700, 1702, - /* 420 */ 1661, 1704, 1670, 1491, 1682, 1685, 1686, 1506, 1724, 1692, - /* 430 */ 1705, 1521, 1739, 1525, 1742, 1708, 1746, 1726, 1751, 1717, - /* 440 */ 1542, 1755, 1557, 1757, 1559, 1560, 1569, 1573, 1763, 1765, + /* 330 */ 749, 943, 692, 646, 1170, 793, 734, 1130, 1130, 1130, + /* 340 */ 1130, 1130, 1130, 1130, 1130, 1130, 682, 187, 200, 200, + /* 350 */ 359, 641, 785, 583, 930, 520, 789, 475, 341, 701, + /* 360 */ 701, 922, 8, 107, 922, 922, 922, 1247, 1059, 317, + /* 370 */ 1195, 1215, 1140, 1264, 1160, 1162, 1172, 1193, 618, 1227, + /* 380 */ 1292, 1293, 1294, 1066, 1216, 1217, 1212, 1224, 1237, 1254, + /* 390 */ 1165, 1084, 482, 1255, 1265, 1266, 1267, 1268, 1274, 1321, + /* 400 */ 1280, 1251, 1282, 1289, 1285, 1295, 1296, 1301, 1303, 1306, + /* 410 */ 436, 1145, 1168, 1333, 1339, 1316, 1354, 1700, 1701, 1703, + /* 420 */ 1662, 1705, 1672, 1494, 1682, 1685, 1686, 1506, 1724, 1692, + /* 430 */ 1702, 1523, 1740, 1525, 1742, 1708, 1746, 1726, 1751, 1717, + /* 440 */ 1542, 1755, 1557, 1757, 1559, 1560, 1569, 1572, 1764, 1765, /* 450 */ 1766, 1580, 1582, 1769, 1770, 1725, 1771, 1738, 1727, 1775, - /* 460 */ 1730, 1778, 1737, 1780, 1781, 1783, 1741, 1785, 1786, 1789, - /* 470 */ 1790, 1791, 1792, 1634, 1764, 1798, 1647, 1808, 1809, 1810, + /* 460 */ 1730, 1778, 1737, 1780, 1781, 1783, 1739, 1785, 1788, 1789, + /* 470 */ 1790, 1791, 1792, 1634, 1763, 1799, 1647, 1808, 1809, 1810, /* 480 */ 1813, 1815, 1816, 1818, 1820, 1822, 1823, 1825, 1827, 1828, /* 490 */ 1829, 1831, 1833, 1787, 1843, 1802, 1845, 1846, 1847, 1848, /* 500 */ 1850, 1852, 1832, 1853, 1855, 1856, 1714, 1858, 1859, 1842, @@ -888,14 +888,14 @@ static const unsigned short int yy_shift_ofst[] = { /* 700 */ 1995, 2108, 2111, 2113, 2116, 2118, 2121, 2165, 2120, 2125, /* 710 */ 2170, 2123, 2192, 2010, 2134, 2105, 2135, 2187, 2203, 2140, /* 720 */ 2147, 2209, 2154, 2152, 2223, 2158, 2161, 2224, 2160, 2162, - /* 730 */ 2225, 2164, 2168, 2227, 2166, 2142, 2145, 2148, 2149, 2251, - /* 740 */ 2163, 2173, 2233, 2176, 2246, 2179, 2233, 2233, 2262, 2216, - /* 750 */ 2218, 2252, 2253, 2255, 2265, 2267, 2270, 2272, 2274, 2235, - /* 760 */ 2214, 2268, 2279, 2280, 2282, 2296, 2284, 2288, 2289, 2241, - /* 770 */ 1973, 2290, 1996, 2291, 2292, 2293, 2295, 2307, 2297, 2331, - /* 780 */ 2299, 2287, 2298, 2338, 2304, 2302, 2315, 2343, 2309, 2308, - /* 790 */ 2320, 2360, 2332, 2321, 2333, 2380, 2347, 2349, 2385, 2364, - /* 800 */ 2366, 2368, 2370, 2367, 2373, + /* 730 */ 2225, 2164, 2168, 2227, 2166, 2143, 2146, 2148, 2149, 2172, + /* 740 */ 2232, 2174, 2243, 2176, 2232, 2232, 2259, 2213, 2216, 2250, + /* 750 */ 2251, 2252, 2253, 2255, 2265, 2267, 2270, 2234, 2210, 2266, + /* 760 */ 2276, 2277, 2279, 2293, 2282, 2283, 2284, 2241, 1973, 2288, + /* 770 */ 1996, 2289, 2290, 2291, 2292, 2306, 2295, 2329, 2296, 2285, + /* 780 */ 2297, 2332, 2302, 2308, 2299, 2339, 2309, 2310, 2304, 2351, + /* 790 */ 2319, 2311, 2328, 2370, 2337, 2345, 2382, 2362, 2364, 2365, + /* 800 */ 2366, 2369, 2372, }; #define YY_REDUCE_COUNT (324) #define YY_REDUCE_MIN (-391) @@ -906,117 +906,117 @@ static const short yy_reduce_ofst[] = { /* 20 */ 358, 1402, 1432, 1469, 1499, 1531, 1568, 1598, 1645, 1671, /* 30 */ 1732, 1745, 1796, 1812, 1861, 1912, 1928, 1941, 1961, 2031, /* 40 */ 2064, 2080, 2101, 2167, 2180, 2191, 2204, 2281, 2294, 2305, - /* 50 */ 2356, -274, 142, 40, -292, -371, 275, 582, 419, 427, - /* 60 */ 756, -366, 47, -311, -310, 383, 410, -9, -391, -346, - /* 70 */ -315, -308, -342, -280, -265, -314, -313, -173, -229, -162, - /* 80 */ -73, 3, 17, 83, 273, 345, 351, 145, -41, 372, - /* 90 */ 573, 243, -66, 575, 674, 86, -29, 467, 38, 687, - /* 100 */ 184, 329, 762, 824, 159, 829, 460, 331, 609, 845, - /* 110 */ -285, -351, -317, -317, -85, -236, -258, 106, 528, 590, - /* 120 */ 607, 643, 656, 685, 707, 708, 709, 710, 712, 717, - /* 130 */ 723, 795, 802, 856, 871, -132, -289, -226, -174, 155, - /* 140 */ 490, 523, -289, 563, 680, 613, 517, 755, 698, 759, - /* 150 */ 797, 203, 95, 640, 41, 718, 728, 773, 838, -364, - /* 160 */ -320, 452, 484, 562, 585, 597, 562, 904, 380, 913, - /* 170 */ 936, 857, 870, 996, 881, 990, 994, 1006, 963, 1006, - /* 180 */ 1027, 985, 1039, 1042, 1000, 995, 937, 937, 911, 937, - /* 190 */ 949, 939, 1006, 992, 979, 989, 987, 1056, 998, 1057, - /* 200 */ 1008, 1074, 1029, 1031, 1088, 1044, 1048, 1112, 1113, 1116, - /* 210 */ 1075, 1078, 1079, 1107, 1117, 1128, 1121, 1134, 1135, 1136, - /* 220 */ 1145, 1143, 1148, 1146, 1071, 1137, 1102, 1139, 1156, 1099, - /* 230 */ 1154, 1163, 1169, 1171, 1173, 1168, 1174, 1188, 1158, 1161, - /* 240 */ 1164, 1166, 1167, 1175, 1176, 1178, 1179, 1181, 1182, 1185, - /* 250 */ 1196, 1150, 1151, 1153, 1126, 1130, 1141, 1206, 1144, 1149, - /* 260 */ 1180, 1213, 1184, 1192, 1221, 1189, 1205, 1183, 1108, 1191, - /* 270 */ 1209, 1120, 1201, 1217, 1220, 1006, 1142, 1147, 1152, 1155, - /* 280 */ 1157, 1190, 1210, 1132, 1200, 1195, 937, 1277, 1202, 1207, - /* 290 */ 1211, 1299, 1289, 1293, 1234, 1242, 1262, 1269, 1270, 1271, - /* 300 */ 1272, 1249, 1273, 1275, 1308, 1297, 1311, 1316, 1226, 1300, - /* 310 */ 1290, 1317, 1330, 1327, 1343, 1345, 1283, 1287, 1285, 1288, - /* 320 */ 1320, 1321, 1323, 1332, 1361, + /* 50 */ 2356, -274, 142, 40, -292, -371, 144, 582, 419, 427, + /* 60 */ 640, -366, 504, -311, -310, 751, 753, -9, -391, -346, + /* 70 */ -315, -324, -342, -270, -279, -259, -313, -215, -177, -162, + /* 80 */ -73, 146, 4, 17, 295, 336, 345, 83, 312, 372, + /* 90 */ 395, 135, -66, 403, 486, 420, 61, 490, 453, 494, + /* 100 */ 592, -265, 573, 575, 331, 610, 163, 373, 357, 674, + /* 110 */ -285, -351, -382, -382, -200, -163, 109, 302, 506, 590, + /* 120 */ 685, 708, 709, 712, 721, 722, 781, 784, 795, 799, + /* 130 */ 807, 808, 826, 863, 866, -132, 155, -296, -174, 127, + /* 140 */ 251, 467, 155, 193, 462, -110, 612, 666, 664, 679, + /* 150 */ 224, 313, 747, 744, 727, 805, 822, 843, 862, -364, + /* 160 */ -327, 473, 514, 568, 615, 657, 568, 791, 380, 760, + /* 170 */ 461, 652, 830, 958, 889, 994, 996, 985, 965, 985, + /* 180 */ 1025, 980, 1033, 1035, 997, 983, 929, 929, 913, 929, + /* 190 */ 944, 933, 985, 989, 974, 992, 990, 1056, 998, 1058, + /* 200 */ 1008, 1074, 1031, 1038, 1081, 1044, 1050, 1112, 1113, 1116, + /* 210 */ 1076, 1079, 1080, 1107, 1117, 1128, 1121, 1134, 1135, 1136, + /* 220 */ 1146, 1143, 1148, 1147, 1075, 1139, 1100, 1142, 1156, 1099, + /* 230 */ 1154, 1163, 1169, 1171, 1173, 1181, 1174, 1175, 1158, 1164, + /* 240 */ 1166, 1167, 1176, 1177, 1178, 1179, 1182, 1183, 1184, 1185, + /* 250 */ 1196, 1149, 1150, 1151, 1122, 1131, 1132, 1194, 1144, 1152, + /* 260 */ 1180, 1211, 1186, 1188, 1220, 1189, 1201, 1187, 1103, 1191, + /* 270 */ 1198, 1137, 1202, 1221, 1222, 985, 1153, 1155, 1192, 1197, + /* 280 */ 1157, 1190, 1209, 1199, 1141, 1200, 929, 1277, 1203, 1204, + /* 290 */ 1210, 1281, 1275, 1279, 1242, 1244, 1257, 1260, 1262, 1269, + /* 300 */ 1271, 1249, 1272, 1263, 1311, 1299, 1313, 1322, 1229, 1297, + /* 310 */ 1288, 1314, 1332, 1327, 1342, 1345, 1283, 1270, 1286, 1287, + /* 320 */ 1317, 1323, 1324, 1343, 1356, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 10 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 20 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 30 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 40 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 50 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 60 */ 2104, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 70 */ 1792, 1792, 1792, 1792, 2077, 1792, 1792, 1792, 1792, 1792, - /* 80 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 90 */ 1792, 1881, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 100 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 110 */ 1879, 2070, 2296, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 120 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 130 */ 1792, 1792, 1792, 1792, 1792, 1792, 2308, 1792, 1792, 1855, - /* 140 */ 1855, 1792, 2308, 2308, 2308, 1879, 2268, 2268, 1792, 1881, - /* 150 */ 2138, 1792, 1792, 1792, 1792, 1792, 1792, 2002, 1792, 1792, - /* 160 */ 1792, 1792, 1792, 2026, 1792, 1792, 1792, 2130, 1792, 1792, - /* 170 */ 2337, 2394, 1792, 1792, 2340, 1792, 1792, 1792, 1792, 1792, - /* 180 */ 1792, 2082, 1792, 1792, 1954, 2327, 2300, 2314, 2378, 2301, - /* 190 */ 2298, 2321, 1792, 2331, 1792, 1792, 2152, 1881, 1792, 1881, - /* 200 */ 2117, 1792, 2075, 1792, 1792, 2075, 2072, 1792, 1792, 1792, - /* 210 */ 2075, 2072, 2072, 1943, 1939, 1792, 1937, 1792, 1792, 1792, - /* 220 */ 1792, 1839, 1792, 1839, 1792, 1881, 1792, 1881, 1792, 1792, - /* 230 */ 1881, 1792, 1881, 1881, 1881, 1792, 1881, 1792, 1792, 1792, - /* 240 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 250 */ 1792, 1792, 1792, 1792, 2150, 2136, 1792, 1879, 2128, 2126, - /* 260 */ 1792, 1879, 2124, 2331, 1792, 1792, 1792, 1792, 2348, 2346, - /* 270 */ 1792, 2348, 2346, 1792, 1792, 1792, 2362, 2358, 2348, 2367, - /* 280 */ 2364, 2333, 2331, 2397, 2384, 2380, 2314, 1792, 1792, 2319, - /* 290 */ 2317, 1792, 1879, 1879, 1792, 2346, 1792, 1792, 1792, 1792, - /* 300 */ 1792, 2346, 1792, 1792, 1879, 1792, 1879, 1792, 1792, 1970, - /* 310 */ 1792, 1792, 1792, 1879, 1824, 1792, 2119, 2141, 2100, 2100, - /* 320 */ 2005, 2005, 2005, 1882, 1797, 1792, 1792, 1792, 1792, 1792, - /* 330 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 2361, 2360, 2223, - /* 340 */ 1792, 2272, 2271, 2270, 2261, 2222, 1966, 1792, 2221, 2220, - /* 350 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 2091, - /* 360 */ 2090, 2214, 1792, 1792, 2215, 2213, 2212, 1792, 1792, 1792, - /* 370 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 380 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 390 */ 1792, 2381, 2385, 1792, 1792, 1792, 1792, 1792, 1792, 2297, - /* 400 */ 1792, 1792, 1792, 2196, 1792, 1792, 1792, 1792, 1792, 1792, - /* 410 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 420 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 430 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 440 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 450 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 460 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 470 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 480 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 490 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 500 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 510 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 520 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 530 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1829, 2201, - /* 540 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 550 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 560 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 570 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 580 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 590 */ 1920, 1919, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 600 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 610 */ 1792, 1792, 1792, 1792, 2205, 1792, 1792, 1792, 1792, 1792, - /* 620 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 630 */ 1792, 1792, 1792, 2377, 2334, 1792, 1792, 1792, 1792, 1792, - /* 640 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 650 */ 1792, 1792, 1792, 2196, 1792, 2359, 1792, 1792, 2375, 1792, - /* 660 */ 2379, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 2307, 2303, - /* 670 */ 1792, 1792, 2299, 1792, 1792, 1792, 1792, 1792, 2204, 1792, - /* 680 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 690 */ 1792, 1792, 2195, 1792, 2258, 1792, 1792, 1792, 2292, 1792, - /* 700 */ 1792, 2243, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 710 */ 1792, 2205, 1792, 2208, 1792, 1792, 1792, 1792, 1792, 1999, - /* 720 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 730 */ 1792, 1792, 1792, 1792, 1792, 1983, 1981, 1980, 1979, 1792, - /* 740 */ 1976, 1792, 2012, 1792, 1792, 1792, 2008, 2007, 1792, 1792, - /* 750 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 760 */ 1792, 1900, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 770 */ 1892, 1792, 1891, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 780 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 790 */ 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792, - /* 800 */ 1792, 1792, 1792, 1792, 1792, + /* 0 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 10 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 20 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 30 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 40 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 50 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 60 */ 2100, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 70 */ 1789, 1789, 1789, 1789, 2073, 1789, 1789, 1789, 1789, 1789, + /* 80 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 90 */ 1789, 1878, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 100 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 110 */ 1876, 2066, 2292, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 120 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 130 */ 1789, 1789, 1789, 1789, 1789, 1789, 2304, 1789, 1789, 1852, + /* 140 */ 1852, 1789, 2304, 2304, 2304, 1876, 2264, 2264, 1789, 1878, + /* 150 */ 2134, 1789, 1789, 1789, 1789, 1789, 1789, 1998, 1789, 1789, + /* 160 */ 1789, 1789, 1789, 2022, 1789, 1789, 1789, 2126, 1789, 1789, + /* 170 */ 2333, 2390, 1789, 1789, 2336, 1789, 1789, 1789, 1789, 1789, + /* 180 */ 1789, 2078, 1789, 1789, 1951, 2323, 2296, 2310, 2374, 2297, + /* 190 */ 2294, 2317, 1789, 2327, 1789, 1789, 2148, 1878, 1789, 1878, + /* 200 */ 2113, 1789, 2071, 1789, 1789, 2071, 2068, 1789, 1789, 1789, + /* 210 */ 2071, 2068, 2068, 1940, 1936, 1789, 1934, 1789, 1789, 1789, + /* 220 */ 1789, 1836, 1789, 1836, 1789, 1878, 1789, 1878, 1789, 1789, + /* 230 */ 1878, 1789, 1878, 1878, 1878, 1789, 1878, 1789, 1789, 1789, + /* 240 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 250 */ 1789, 1789, 1789, 1789, 2146, 2132, 1789, 1876, 2124, 2122, + /* 260 */ 1789, 1876, 2120, 2327, 1789, 1789, 1789, 1789, 2344, 2342, + /* 270 */ 1789, 2344, 2342, 1789, 1789, 1789, 2358, 2354, 2344, 2363, + /* 280 */ 2360, 2329, 2327, 2393, 2380, 2376, 2310, 1789, 1789, 2315, + /* 290 */ 2313, 1789, 1876, 1876, 1789, 2342, 1789, 1789, 1789, 1789, + /* 300 */ 1789, 2342, 1789, 1789, 1876, 1789, 1876, 1789, 1789, 1967, + /* 310 */ 1789, 1789, 1789, 1876, 1821, 1789, 2115, 2137, 2096, 2096, + /* 320 */ 2001, 2001, 2001, 1879, 1794, 1789, 1789, 1789, 1789, 1789, + /* 330 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 2357, 2356, 2219, + /* 340 */ 1789, 2268, 2267, 2266, 2257, 2218, 1963, 1789, 2217, 2216, + /* 350 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 2087, + /* 360 */ 2086, 2210, 1789, 1789, 2211, 2209, 2208, 1789, 1789, 1789, + /* 370 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 380 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 390 */ 1789, 2377, 2381, 1789, 1789, 1789, 1789, 1789, 1789, 2293, + /* 400 */ 1789, 1789, 1789, 2192, 1789, 1789, 1789, 1789, 1789, 1789, + /* 410 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 420 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 430 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 440 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 450 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 460 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 470 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 480 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 490 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 500 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 510 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 520 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 530 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1826, 2197, + /* 540 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 550 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 560 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 570 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 580 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 590 */ 1917, 1916, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 600 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 610 */ 1789, 1789, 1789, 1789, 2201, 1789, 1789, 1789, 1789, 1789, + /* 620 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 630 */ 1789, 1789, 1789, 2373, 2330, 1789, 1789, 1789, 1789, 1789, + /* 640 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 650 */ 1789, 1789, 1789, 2192, 1789, 2355, 1789, 1789, 2371, 1789, + /* 660 */ 2375, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 2303, 2299, + /* 670 */ 1789, 1789, 2295, 1789, 1789, 1789, 1789, 1789, 2200, 1789, + /* 680 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 690 */ 1789, 1789, 2191, 1789, 2254, 1789, 1789, 1789, 2288, 1789, + /* 700 */ 1789, 2239, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 710 */ 1789, 2201, 1789, 2204, 1789, 1789, 1789, 1789, 1789, 1995, + /* 720 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 730 */ 1789, 1789, 1789, 1789, 1789, 1979, 1977, 1976, 1975, 1789, + /* 740 */ 2008, 1789, 1789, 1789, 2004, 2003, 1789, 1789, 1789, 1789, + /* 750 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1897, + /* 760 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1889, 1789, + /* 770 */ 1888, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 780 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 790 */ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, + /* 800 */ 1789, 1789, 1789, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1151,7 +1151,6 @@ static const YYCODETYPE yyFallback[] = { 0, /* NK_EQ => nothing */ 0, /* USING => nothing */ 0, /* TAGS => nothing */ - 0, /* COMMENT => nothing */ 0, /* BOOL => nothing */ 0, /* TINYINT => nothing */ 0, /* SMALLINT => nothing */ @@ -1170,6 +1169,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* VARBINARY => nothing */ 0, /* GEOMETRY => nothing */ 0, /* DECIMAL => nothing */ + 0, /* COMMENT => nothing */ 0, /* MAX_DELAY => nothing */ 0, /* WATERMARK => nothing */ 0, /* ROLLUP => nothing */ @@ -1578,25 +1578,25 @@ static const char *const yyTokenName[] = { /* 112 */ "NK_EQ", /* 113 */ "USING", /* 114 */ "TAGS", - /* 115 */ "COMMENT", - /* 116 */ "BOOL", - /* 117 */ "TINYINT", - /* 118 */ "SMALLINT", - /* 119 */ "INT", - /* 120 */ "INTEGER", - /* 121 */ "BIGINT", - /* 122 */ "FLOAT", - /* 123 */ "DOUBLE", - /* 124 */ "BINARY", - /* 125 */ "NCHAR", - /* 126 */ "UNSIGNED", - /* 127 */ "JSON", - /* 128 */ "VARCHAR", - /* 129 */ "MEDIUMBLOB", - /* 130 */ "BLOB", - /* 131 */ "VARBINARY", - /* 132 */ "GEOMETRY", - /* 133 */ "DECIMAL", + /* 115 */ "BOOL", + /* 116 */ "TINYINT", + /* 117 */ "SMALLINT", + /* 118 */ "INT", + /* 119 */ "INTEGER", + /* 120 */ "BIGINT", + /* 121 */ "FLOAT", + /* 122 */ "DOUBLE", + /* 123 */ "BINARY", + /* 124 */ "NCHAR", + /* 125 */ "UNSIGNED", + /* 126 */ "JSON", + /* 127 */ "VARCHAR", + /* 128 */ "MEDIUMBLOB", + /* 129 */ "BLOB", + /* 130 */ "VARBINARY", + /* 131 */ "GEOMETRY", + /* 132 */ "DECIMAL", + /* 133 */ "COMMENT", /* 134 */ "MAX_DELAY", /* 135 */ "WATERMARK", /* 136 */ "ROLLUP", @@ -2142,429 +2142,428 @@ static const char *const yyRuleName[] = { /* 179 */ "column_def_list ::= column_def", /* 180 */ "column_def_list ::= column_def_list NK_COMMA column_def", /* 181 */ "column_def ::= column_name type_name", - /* 182 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 183 */ "type_name ::= BOOL", - /* 184 */ "type_name ::= TINYINT", - /* 185 */ "type_name ::= SMALLINT", - /* 186 */ "type_name ::= INT", - /* 187 */ "type_name ::= INTEGER", - /* 188 */ "type_name ::= BIGINT", - /* 189 */ "type_name ::= FLOAT", - /* 190 */ "type_name ::= DOUBLE", - /* 191 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 192 */ "type_name ::= TIMESTAMP", - /* 193 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 194 */ "type_name ::= TINYINT UNSIGNED", - /* 195 */ "type_name ::= SMALLINT UNSIGNED", - /* 196 */ "type_name ::= INT UNSIGNED", - /* 197 */ "type_name ::= BIGINT UNSIGNED", - /* 198 */ "type_name ::= JSON", - /* 199 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 200 */ "type_name ::= MEDIUMBLOB", - /* 201 */ "type_name ::= BLOB", - /* 202 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 203 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", - /* 204 */ "type_name ::= DECIMAL", - /* 205 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 206 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 207 */ "tags_def_opt ::=", - /* 208 */ "tags_def_opt ::= tags_def", - /* 209 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 210 */ "table_options ::=", - /* 211 */ "table_options ::= table_options COMMENT NK_STRING", - /* 212 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 213 */ "table_options ::= table_options WATERMARK duration_list", - /* 214 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 215 */ "table_options ::= table_options TTL NK_INTEGER", - /* 216 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 217 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 218 */ "alter_table_options ::= alter_table_option", - /* 219 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 220 */ "alter_table_option ::= COMMENT NK_STRING", - /* 221 */ "alter_table_option ::= TTL NK_INTEGER", - /* 222 */ "duration_list ::= duration_literal", - /* 223 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 224 */ "rollup_func_list ::= rollup_func_name", - /* 225 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 226 */ "rollup_func_name ::= function_name", - /* 227 */ "rollup_func_name ::= FIRST", - /* 228 */ "rollup_func_name ::= LAST", - /* 229 */ "col_name_list ::= col_name", - /* 230 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 231 */ "col_name ::= column_name", - /* 232 */ "cmd ::= SHOW DNODES", - /* 233 */ "cmd ::= SHOW USERS", - /* 234 */ "cmd ::= SHOW USER PRIVILEGES", - /* 235 */ "cmd ::= SHOW DATABASES", - /* 236 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 237 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 238 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 239 */ "cmd ::= SHOW MNODES", - /* 240 */ "cmd ::= SHOW QNODES", - /* 241 */ "cmd ::= SHOW FUNCTIONS", - /* 242 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 243 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", - /* 244 */ "cmd ::= SHOW STREAMS", - /* 245 */ "cmd ::= SHOW ACCOUNTS", - /* 246 */ "cmd ::= SHOW APPS", - /* 247 */ "cmd ::= SHOW CONNECTIONS", - /* 248 */ "cmd ::= SHOW LICENCES", - /* 249 */ "cmd ::= SHOW GRANTS", - /* 250 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 251 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 252 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 253 */ "cmd ::= SHOW QUERIES", - /* 254 */ "cmd ::= SHOW SCORES", - /* 255 */ "cmd ::= SHOW TOPICS", - /* 256 */ "cmd ::= SHOW VARIABLES", - /* 257 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 258 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 259 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 260 */ "cmd ::= SHOW BNODES", - /* 261 */ "cmd ::= SHOW SNODES", - /* 262 */ "cmd ::= SHOW CLUSTER", - /* 263 */ "cmd ::= SHOW TRANSACTIONS", - /* 264 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 265 */ "cmd ::= SHOW CONSUMERS", - /* 266 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 267 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 268 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", - /* 269 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 270 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", - /* 271 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", - /* 272 */ "cmd ::= SHOW VNODES", - /* 273 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 274 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 275 */ "db_name_cond_opt ::=", - /* 276 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 277 */ "like_pattern_opt ::=", - /* 278 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 279 */ "table_name_cond ::= table_name", - /* 280 */ "from_db_opt ::=", - /* 281 */ "from_db_opt ::= FROM db_name", - /* 282 */ "tag_list_opt ::=", - /* 283 */ "tag_list_opt ::= tag_item", - /* 284 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 285 */ "tag_item ::= TBNAME", - /* 286 */ "tag_item ::= QTAGS", - /* 287 */ "tag_item ::= column_name", - /* 288 */ "tag_item ::= column_name column_alias", - /* 289 */ "tag_item ::= column_name AS column_alias", - /* 290 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options", - /* 291 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP", - /* 292 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 293 */ "full_index_name ::= index_name", - /* 294 */ "full_index_name ::= db_name NK_DOT index_name", - /* 295 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 296 */ "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", - /* 297 */ "func_list ::= func", - /* 298 */ "func_list ::= func_list NK_COMMA func", - /* 299 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 300 */ "sma_func_name ::= function_name", - /* 301 */ "sma_func_name ::= COUNT", - /* 302 */ "sma_func_name ::= FIRST", - /* 303 */ "sma_func_name ::= LAST", - /* 304 */ "sma_func_name ::= LAST_ROW", - /* 305 */ "sma_stream_opt ::=", - /* 306 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 307 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 308 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 309 */ "with_meta ::= AS", - /* 310 */ "with_meta ::= WITH META AS", - /* 311 */ "with_meta ::= ONLY META AS", - /* 312 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 313 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", - /* 314 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", - /* 315 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 316 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 317 */ "cmd ::= DESC full_table_name", - /* 318 */ "cmd ::= DESCRIBE full_table_name", - /* 319 */ "cmd ::= RESET QUERY CACHE", - /* 320 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 321 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 322 */ "analyze_opt ::=", - /* 323 */ "analyze_opt ::= ANALYZE", - /* 324 */ "explain_options ::=", - /* 325 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 326 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 327 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 328 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 329 */ "agg_func_opt ::=", - /* 330 */ "agg_func_opt ::= AGGREGATE", - /* 331 */ "bufsize_opt ::=", - /* 332 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 333 */ "language_opt ::=", - /* 334 */ "language_opt ::= LANGUAGE NK_STRING", - /* 335 */ "or_replace_opt ::=", - /* 336 */ "or_replace_opt ::= OR REPLACE", - /* 337 */ "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", - /* 338 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 339 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 340 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 341 */ "col_list_opt ::=", - /* 342 */ "col_list_opt ::= NK_LP col_name_list NK_RP", - /* 343 */ "tag_def_or_ref_opt ::=", - /* 344 */ "tag_def_or_ref_opt ::= tags_def", - /* 345 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", - /* 346 */ "stream_options ::=", - /* 347 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 348 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 349 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 350 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 351 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 352 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 353 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 354 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 355 */ "subtable_opt ::=", - /* 356 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 357 */ "ignore_opt ::=", - /* 358 */ "ignore_opt ::= IGNORE UNTREATED", - /* 359 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 360 */ "cmd ::= KILL QUERY NK_STRING", - /* 361 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 362 */ "cmd ::= BALANCE VGROUP", - /* 363 */ "cmd ::= BALANCE VGROUP LEADER", - /* 364 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 365 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 366 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 367 */ "dnode_list ::= DNODE NK_INTEGER", - /* 368 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 369 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 370 */ "cmd ::= query_or_subquery", - /* 371 */ "cmd ::= insert_query", - /* 372 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 373 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 374 */ "literal ::= NK_INTEGER", - /* 375 */ "literal ::= NK_FLOAT", - /* 376 */ "literal ::= NK_STRING", - /* 377 */ "literal ::= NK_BOOL", - /* 378 */ "literal ::= TIMESTAMP NK_STRING", - /* 379 */ "literal ::= duration_literal", - /* 380 */ "literal ::= NULL", - /* 381 */ "literal ::= NK_QUESTION", - /* 382 */ "duration_literal ::= NK_VARIABLE", - /* 383 */ "signed ::= NK_INTEGER", - /* 384 */ "signed ::= NK_PLUS NK_INTEGER", - /* 385 */ "signed ::= NK_MINUS NK_INTEGER", - /* 386 */ "signed ::= NK_FLOAT", - /* 387 */ "signed ::= NK_PLUS NK_FLOAT", - /* 388 */ "signed ::= NK_MINUS NK_FLOAT", - /* 389 */ "signed_literal ::= signed", - /* 390 */ "signed_literal ::= NK_STRING", - /* 391 */ "signed_literal ::= NK_BOOL", - /* 392 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 393 */ "signed_literal ::= duration_literal", - /* 394 */ "signed_literal ::= NULL", - /* 395 */ "signed_literal ::= literal_func", - /* 396 */ "signed_literal ::= NK_QUESTION", - /* 397 */ "literal_list ::= signed_literal", - /* 398 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 399 */ "db_name ::= NK_ID", - /* 400 */ "table_name ::= NK_ID", - /* 401 */ "column_name ::= NK_ID", - /* 402 */ "function_name ::= NK_ID", - /* 403 */ "table_alias ::= NK_ID", - /* 404 */ "column_alias ::= NK_ID", - /* 405 */ "user_name ::= NK_ID", - /* 406 */ "topic_name ::= NK_ID", - /* 407 */ "stream_name ::= NK_ID", - /* 408 */ "cgroup_name ::= NK_ID", - /* 409 */ "index_name ::= NK_ID", - /* 410 */ "expr_or_subquery ::= expression", - /* 411 */ "expression ::= literal", - /* 412 */ "expression ::= pseudo_column", - /* 413 */ "expression ::= column_reference", - /* 414 */ "expression ::= function_expression", - /* 415 */ "expression ::= case_when_expression", - /* 416 */ "expression ::= NK_LP expression NK_RP", - /* 417 */ "expression ::= NK_PLUS expr_or_subquery", - /* 418 */ "expression ::= NK_MINUS expr_or_subquery", - /* 419 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 420 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 421 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 422 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 423 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 424 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 425 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 426 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 427 */ "expression_list ::= expr_or_subquery", - /* 428 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 429 */ "column_reference ::= column_name", - /* 430 */ "column_reference ::= table_name NK_DOT column_name", - /* 431 */ "pseudo_column ::= ROWTS", - /* 432 */ "pseudo_column ::= TBNAME", - /* 433 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 434 */ "pseudo_column ::= QSTART", - /* 435 */ "pseudo_column ::= QEND", - /* 436 */ "pseudo_column ::= QDURATION", - /* 437 */ "pseudo_column ::= WSTART", - /* 438 */ "pseudo_column ::= WEND", - /* 439 */ "pseudo_column ::= WDURATION", - /* 440 */ "pseudo_column ::= IROWTS", - /* 441 */ "pseudo_column ::= ISFILLED", - /* 442 */ "pseudo_column ::= QTAGS", - /* 443 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 444 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 445 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 446 */ "function_expression ::= literal_func", - /* 447 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 448 */ "literal_func ::= NOW", - /* 449 */ "noarg_func ::= NOW", - /* 450 */ "noarg_func ::= TODAY", - /* 451 */ "noarg_func ::= TIMEZONE", - /* 452 */ "noarg_func ::= DATABASE", - /* 453 */ "noarg_func ::= CLIENT_VERSION", - /* 454 */ "noarg_func ::= SERVER_VERSION", - /* 455 */ "noarg_func ::= SERVER_STATUS", - /* 456 */ "noarg_func ::= CURRENT_USER", - /* 457 */ "noarg_func ::= USER", - /* 458 */ "star_func ::= COUNT", - /* 459 */ "star_func ::= FIRST", - /* 460 */ "star_func ::= LAST", - /* 461 */ "star_func ::= LAST_ROW", - /* 462 */ "star_func_para_list ::= NK_STAR", - /* 463 */ "star_func_para_list ::= other_para_list", - /* 464 */ "other_para_list ::= star_func_para", - /* 465 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 466 */ "star_func_para ::= expr_or_subquery", - /* 467 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 468 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 469 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 470 */ "when_then_list ::= when_then_expr", - /* 471 */ "when_then_list ::= when_then_list when_then_expr", - /* 472 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 473 */ "case_when_else_opt ::=", - /* 474 */ "case_when_else_opt ::= ELSE common_expression", - /* 475 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 476 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 477 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 478 */ "predicate ::= expr_or_subquery IS NULL", - /* 479 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 480 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 481 */ "compare_op ::= NK_LT", - /* 482 */ "compare_op ::= NK_GT", - /* 483 */ "compare_op ::= NK_LE", - /* 484 */ "compare_op ::= NK_GE", - /* 485 */ "compare_op ::= NK_NE", - /* 486 */ "compare_op ::= NK_EQ", - /* 487 */ "compare_op ::= LIKE", - /* 488 */ "compare_op ::= NOT LIKE", - /* 489 */ "compare_op ::= MATCH", - /* 490 */ "compare_op ::= NMATCH", - /* 491 */ "compare_op ::= CONTAINS", - /* 492 */ "in_op ::= IN", - /* 493 */ "in_op ::= NOT IN", - /* 494 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 495 */ "boolean_value_expression ::= boolean_primary", - /* 496 */ "boolean_value_expression ::= NOT boolean_primary", - /* 497 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 498 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 499 */ "boolean_primary ::= predicate", - /* 500 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 501 */ "common_expression ::= expr_or_subquery", - /* 502 */ "common_expression ::= boolean_value_expression", - /* 503 */ "from_clause_opt ::=", - /* 504 */ "from_clause_opt ::= FROM table_reference_list", - /* 505 */ "table_reference_list ::= table_reference", - /* 506 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 507 */ "table_reference ::= table_primary", - /* 508 */ "table_reference ::= joined_table", - /* 509 */ "table_primary ::= table_name alias_opt", - /* 510 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 511 */ "table_primary ::= subquery alias_opt", - /* 512 */ "table_primary ::= parenthesized_joined_table", - /* 513 */ "alias_opt ::=", - /* 514 */ "alias_opt ::= table_alias", - /* 515 */ "alias_opt ::= AS table_alias", - /* 516 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 517 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 518 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 519 */ "join_type ::=", - /* 520 */ "join_type ::= INNER", - /* 521 */ "query_specification ::= SELECT hint_list tag_mode_opt set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 522 */ "hint_list ::=", - /* 523 */ "hint_list ::= NK_HINT", - /* 524 */ "tag_mode_opt ::=", - /* 525 */ "tag_mode_opt ::= TAGS", - /* 526 */ "set_quantifier_opt ::=", - /* 527 */ "set_quantifier_opt ::= DISTINCT", - /* 528 */ "set_quantifier_opt ::= ALL", - /* 529 */ "select_list ::= select_item", - /* 530 */ "select_list ::= select_list NK_COMMA select_item", - /* 531 */ "select_item ::= NK_STAR", - /* 532 */ "select_item ::= common_expression", - /* 533 */ "select_item ::= common_expression column_alias", - /* 534 */ "select_item ::= common_expression AS column_alias", - /* 535 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 536 */ "where_clause_opt ::=", - /* 537 */ "where_clause_opt ::= WHERE search_condition", - /* 538 */ "partition_by_clause_opt ::=", - /* 539 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 540 */ "partition_list ::= partition_item", - /* 541 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 542 */ "partition_item ::= expr_or_subquery", - /* 543 */ "partition_item ::= expr_or_subquery column_alias", - /* 544 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 545 */ "twindow_clause_opt ::=", - /* 546 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 547 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 548 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 549 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 550 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 551 */ "sliding_opt ::=", - /* 552 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 553 */ "fill_opt ::=", - /* 554 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 555 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 556 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 557 */ "fill_mode ::= NONE", - /* 558 */ "fill_mode ::= PREV", - /* 559 */ "fill_mode ::= NULL", - /* 560 */ "fill_mode ::= NULL_F", - /* 561 */ "fill_mode ::= LINEAR", - /* 562 */ "fill_mode ::= NEXT", - /* 563 */ "group_by_clause_opt ::=", - /* 564 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 565 */ "group_by_list ::= expr_or_subquery", - /* 566 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 567 */ "having_clause_opt ::=", - /* 568 */ "having_clause_opt ::= HAVING search_condition", - /* 569 */ "range_opt ::=", - /* 570 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 571 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 572 */ "every_opt ::=", - /* 573 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 574 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 575 */ "query_simple ::= query_specification", - /* 576 */ "query_simple ::= union_query_expression", - /* 577 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 578 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 579 */ "query_simple_or_subquery ::= query_simple", - /* 580 */ "query_simple_or_subquery ::= subquery", - /* 581 */ "query_or_subquery ::= query_expression", - /* 582 */ "query_or_subquery ::= subquery", - /* 583 */ "order_by_clause_opt ::=", - /* 584 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 585 */ "slimit_clause_opt ::=", - /* 586 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 587 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 588 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 589 */ "limit_clause_opt ::=", - /* 590 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 591 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 592 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 593 */ "subquery ::= NK_LP query_expression NK_RP", - /* 594 */ "subquery ::= NK_LP subquery NK_RP", - /* 595 */ "search_condition ::= common_expression", - /* 596 */ "sort_specification_list ::= sort_specification", - /* 597 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 598 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 599 */ "ordering_specification_opt ::=", - /* 600 */ "ordering_specification_opt ::= ASC", - /* 601 */ "ordering_specification_opt ::= DESC", - /* 602 */ "null_ordering_opt ::=", - /* 603 */ "null_ordering_opt ::= NULLS FIRST", - /* 604 */ "null_ordering_opt ::= NULLS LAST", + /* 182 */ "type_name ::= BOOL", + /* 183 */ "type_name ::= TINYINT", + /* 184 */ "type_name ::= SMALLINT", + /* 185 */ "type_name ::= INT", + /* 186 */ "type_name ::= INTEGER", + /* 187 */ "type_name ::= BIGINT", + /* 188 */ "type_name ::= FLOAT", + /* 189 */ "type_name ::= DOUBLE", + /* 190 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 191 */ "type_name ::= TIMESTAMP", + /* 192 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 193 */ "type_name ::= TINYINT UNSIGNED", + /* 194 */ "type_name ::= SMALLINT UNSIGNED", + /* 195 */ "type_name ::= INT UNSIGNED", + /* 196 */ "type_name ::= BIGINT UNSIGNED", + /* 197 */ "type_name ::= JSON", + /* 198 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 199 */ "type_name ::= MEDIUMBLOB", + /* 200 */ "type_name ::= BLOB", + /* 201 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 202 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", + /* 203 */ "type_name ::= DECIMAL", + /* 204 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 205 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 206 */ "tags_def_opt ::=", + /* 207 */ "tags_def_opt ::= tags_def", + /* 208 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 209 */ "table_options ::=", + /* 210 */ "table_options ::= table_options COMMENT NK_STRING", + /* 211 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 212 */ "table_options ::= table_options WATERMARK duration_list", + /* 213 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 214 */ "table_options ::= table_options TTL NK_INTEGER", + /* 215 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 216 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 217 */ "alter_table_options ::= alter_table_option", + /* 218 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 219 */ "alter_table_option ::= COMMENT NK_STRING", + /* 220 */ "alter_table_option ::= TTL NK_INTEGER", + /* 221 */ "duration_list ::= duration_literal", + /* 222 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 223 */ "rollup_func_list ::= rollup_func_name", + /* 224 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 225 */ "rollup_func_name ::= function_name", + /* 226 */ "rollup_func_name ::= FIRST", + /* 227 */ "rollup_func_name ::= LAST", + /* 228 */ "col_name_list ::= col_name", + /* 229 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 230 */ "col_name ::= column_name", + /* 231 */ "cmd ::= SHOW DNODES", + /* 232 */ "cmd ::= SHOW USERS", + /* 233 */ "cmd ::= SHOW USER PRIVILEGES", + /* 234 */ "cmd ::= SHOW DATABASES", + /* 235 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 236 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 237 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 238 */ "cmd ::= SHOW MNODES", + /* 239 */ "cmd ::= SHOW QNODES", + /* 240 */ "cmd ::= SHOW FUNCTIONS", + /* 241 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 242 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", + /* 243 */ "cmd ::= SHOW STREAMS", + /* 244 */ "cmd ::= SHOW ACCOUNTS", + /* 245 */ "cmd ::= SHOW APPS", + /* 246 */ "cmd ::= SHOW CONNECTIONS", + /* 247 */ "cmd ::= SHOW LICENCES", + /* 248 */ "cmd ::= SHOW GRANTS", + /* 249 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 250 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 251 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 252 */ "cmd ::= SHOW QUERIES", + /* 253 */ "cmd ::= SHOW SCORES", + /* 254 */ "cmd ::= SHOW TOPICS", + /* 255 */ "cmd ::= SHOW VARIABLES", + /* 256 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 257 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 258 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 259 */ "cmd ::= SHOW BNODES", + /* 260 */ "cmd ::= SHOW SNODES", + /* 261 */ "cmd ::= SHOW CLUSTER", + /* 262 */ "cmd ::= SHOW TRANSACTIONS", + /* 263 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 264 */ "cmd ::= SHOW CONSUMERS", + /* 265 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 266 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 267 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", + /* 268 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 269 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", + /* 270 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", + /* 271 */ "cmd ::= SHOW VNODES", + /* 272 */ "cmd ::= SHOW db_name_cond_opt ALIVE", + /* 273 */ "cmd ::= SHOW CLUSTER ALIVE", + /* 274 */ "db_name_cond_opt ::=", + /* 275 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 276 */ "like_pattern_opt ::=", + /* 277 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 278 */ "table_name_cond ::= table_name", + /* 279 */ "from_db_opt ::=", + /* 280 */ "from_db_opt ::= FROM db_name", + /* 281 */ "tag_list_opt ::=", + /* 282 */ "tag_list_opt ::= tag_item", + /* 283 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 284 */ "tag_item ::= TBNAME", + /* 285 */ "tag_item ::= QTAGS", + /* 286 */ "tag_item ::= column_name", + /* 287 */ "tag_item ::= column_name column_alias", + /* 288 */ "tag_item ::= column_name AS column_alias", + /* 289 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options", + /* 290 */ "cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP", + /* 291 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 292 */ "full_index_name ::= index_name", + /* 293 */ "full_index_name ::= db_name NK_DOT index_name", + /* 294 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 295 */ "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", + /* 296 */ "func_list ::= func", + /* 297 */ "func_list ::= func_list NK_COMMA func", + /* 298 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 299 */ "sma_func_name ::= function_name", + /* 300 */ "sma_func_name ::= COUNT", + /* 301 */ "sma_func_name ::= FIRST", + /* 302 */ "sma_func_name ::= LAST", + /* 303 */ "sma_func_name ::= LAST_ROW", + /* 304 */ "sma_stream_opt ::=", + /* 305 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 306 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 307 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 308 */ "with_meta ::= AS", + /* 309 */ "with_meta ::= WITH META AS", + /* 310 */ "with_meta ::= ONLY META AS", + /* 311 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 312 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", + /* 313 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", + /* 314 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 315 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 316 */ "cmd ::= DESC full_table_name", + /* 317 */ "cmd ::= DESCRIBE full_table_name", + /* 318 */ "cmd ::= RESET QUERY CACHE", + /* 319 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 320 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 321 */ "analyze_opt ::=", + /* 322 */ "analyze_opt ::= ANALYZE", + /* 323 */ "explain_options ::=", + /* 324 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 325 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 326 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 327 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 328 */ "agg_func_opt ::=", + /* 329 */ "agg_func_opt ::= AGGREGATE", + /* 330 */ "bufsize_opt ::=", + /* 331 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 332 */ "language_opt ::=", + /* 333 */ "language_opt ::= LANGUAGE NK_STRING", + /* 334 */ "or_replace_opt ::=", + /* 335 */ "or_replace_opt ::= OR REPLACE", + /* 336 */ "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", + /* 337 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 338 */ "cmd ::= PAUSE STREAM exists_opt stream_name", + /* 339 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", + /* 340 */ "col_list_opt ::=", + /* 341 */ "col_list_opt ::= NK_LP col_name_list NK_RP", + /* 342 */ "tag_def_or_ref_opt ::=", + /* 343 */ "tag_def_or_ref_opt ::= tags_def", + /* 344 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", + /* 345 */ "stream_options ::=", + /* 346 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 347 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 348 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 349 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 350 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 351 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 352 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 353 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 354 */ "subtable_opt ::=", + /* 355 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 356 */ "ignore_opt ::=", + /* 357 */ "ignore_opt ::= IGNORE UNTREATED", + /* 358 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 359 */ "cmd ::= KILL QUERY NK_STRING", + /* 360 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 361 */ "cmd ::= BALANCE VGROUP", + /* 362 */ "cmd ::= BALANCE VGROUP LEADER", + /* 363 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 364 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 365 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 366 */ "dnode_list ::= DNODE NK_INTEGER", + /* 367 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 368 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 369 */ "cmd ::= query_or_subquery", + /* 370 */ "cmd ::= insert_query", + /* 371 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 372 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 373 */ "literal ::= NK_INTEGER", + /* 374 */ "literal ::= NK_FLOAT", + /* 375 */ "literal ::= NK_STRING", + /* 376 */ "literal ::= NK_BOOL", + /* 377 */ "literal ::= TIMESTAMP NK_STRING", + /* 378 */ "literal ::= duration_literal", + /* 379 */ "literal ::= NULL", + /* 380 */ "literal ::= NK_QUESTION", + /* 381 */ "duration_literal ::= NK_VARIABLE", + /* 382 */ "signed ::= NK_INTEGER", + /* 383 */ "signed ::= NK_PLUS NK_INTEGER", + /* 384 */ "signed ::= NK_MINUS NK_INTEGER", + /* 385 */ "signed ::= NK_FLOAT", + /* 386 */ "signed ::= NK_PLUS NK_FLOAT", + /* 387 */ "signed ::= NK_MINUS NK_FLOAT", + /* 388 */ "signed_literal ::= signed", + /* 389 */ "signed_literal ::= NK_STRING", + /* 390 */ "signed_literal ::= NK_BOOL", + /* 391 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 392 */ "signed_literal ::= duration_literal", + /* 393 */ "signed_literal ::= NULL", + /* 394 */ "signed_literal ::= literal_func", + /* 395 */ "signed_literal ::= NK_QUESTION", + /* 396 */ "literal_list ::= signed_literal", + /* 397 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 398 */ "db_name ::= NK_ID", + /* 399 */ "table_name ::= NK_ID", + /* 400 */ "column_name ::= NK_ID", + /* 401 */ "function_name ::= NK_ID", + /* 402 */ "table_alias ::= NK_ID", + /* 403 */ "column_alias ::= NK_ID", + /* 404 */ "user_name ::= NK_ID", + /* 405 */ "topic_name ::= NK_ID", + /* 406 */ "stream_name ::= NK_ID", + /* 407 */ "cgroup_name ::= NK_ID", + /* 408 */ "index_name ::= NK_ID", + /* 409 */ "expr_or_subquery ::= expression", + /* 410 */ "expression ::= literal", + /* 411 */ "expression ::= pseudo_column", + /* 412 */ "expression ::= column_reference", + /* 413 */ "expression ::= function_expression", + /* 414 */ "expression ::= case_when_expression", + /* 415 */ "expression ::= NK_LP expression NK_RP", + /* 416 */ "expression ::= NK_PLUS expr_or_subquery", + /* 417 */ "expression ::= NK_MINUS expr_or_subquery", + /* 418 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 419 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 420 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 421 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 422 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 423 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 424 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 425 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 426 */ "expression_list ::= expr_or_subquery", + /* 427 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 428 */ "column_reference ::= column_name", + /* 429 */ "column_reference ::= table_name NK_DOT column_name", + /* 430 */ "pseudo_column ::= ROWTS", + /* 431 */ "pseudo_column ::= TBNAME", + /* 432 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 433 */ "pseudo_column ::= QSTART", + /* 434 */ "pseudo_column ::= QEND", + /* 435 */ "pseudo_column ::= QDURATION", + /* 436 */ "pseudo_column ::= WSTART", + /* 437 */ "pseudo_column ::= WEND", + /* 438 */ "pseudo_column ::= WDURATION", + /* 439 */ "pseudo_column ::= IROWTS", + /* 440 */ "pseudo_column ::= ISFILLED", + /* 441 */ "pseudo_column ::= QTAGS", + /* 442 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 443 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 444 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 445 */ "function_expression ::= literal_func", + /* 446 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 447 */ "literal_func ::= NOW", + /* 448 */ "noarg_func ::= NOW", + /* 449 */ "noarg_func ::= TODAY", + /* 450 */ "noarg_func ::= TIMEZONE", + /* 451 */ "noarg_func ::= DATABASE", + /* 452 */ "noarg_func ::= CLIENT_VERSION", + /* 453 */ "noarg_func ::= SERVER_VERSION", + /* 454 */ "noarg_func ::= SERVER_STATUS", + /* 455 */ "noarg_func ::= CURRENT_USER", + /* 456 */ "noarg_func ::= USER", + /* 457 */ "star_func ::= COUNT", + /* 458 */ "star_func ::= FIRST", + /* 459 */ "star_func ::= LAST", + /* 460 */ "star_func ::= LAST_ROW", + /* 461 */ "star_func_para_list ::= NK_STAR", + /* 462 */ "star_func_para_list ::= other_para_list", + /* 463 */ "other_para_list ::= star_func_para", + /* 464 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 465 */ "star_func_para ::= expr_or_subquery", + /* 466 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 467 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 468 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 469 */ "when_then_list ::= when_then_expr", + /* 470 */ "when_then_list ::= when_then_list when_then_expr", + /* 471 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 472 */ "case_when_else_opt ::=", + /* 473 */ "case_when_else_opt ::= ELSE common_expression", + /* 474 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 475 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 476 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 477 */ "predicate ::= expr_or_subquery IS NULL", + /* 478 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 479 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 480 */ "compare_op ::= NK_LT", + /* 481 */ "compare_op ::= NK_GT", + /* 482 */ "compare_op ::= NK_LE", + /* 483 */ "compare_op ::= NK_GE", + /* 484 */ "compare_op ::= NK_NE", + /* 485 */ "compare_op ::= NK_EQ", + /* 486 */ "compare_op ::= LIKE", + /* 487 */ "compare_op ::= NOT LIKE", + /* 488 */ "compare_op ::= MATCH", + /* 489 */ "compare_op ::= NMATCH", + /* 490 */ "compare_op ::= CONTAINS", + /* 491 */ "in_op ::= IN", + /* 492 */ "in_op ::= NOT IN", + /* 493 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 494 */ "boolean_value_expression ::= boolean_primary", + /* 495 */ "boolean_value_expression ::= NOT boolean_primary", + /* 496 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 497 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 498 */ "boolean_primary ::= predicate", + /* 499 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 500 */ "common_expression ::= expr_or_subquery", + /* 501 */ "common_expression ::= boolean_value_expression", + /* 502 */ "from_clause_opt ::=", + /* 503 */ "from_clause_opt ::= FROM table_reference_list", + /* 504 */ "table_reference_list ::= table_reference", + /* 505 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 506 */ "table_reference ::= table_primary", + /* 507 */ "table_reference ::= joined_table", + /* 508 */ "table_primary ::= table_name alias_opt", + /* 509 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 510 */ "table_primary ::= subquery alias_opt", + /* 511 */ "table_primary ::= parenthesized_joined_table", + /* 512 */ "alias_opt ::=", + /* 513 */ "alias_opt ::= table_alias", + /* 514 */ "alias_opt ::= AS table_alias", + /* 515 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 516 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 517 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 518 */ "join_type ::=", + /* 519 */ "join_type ::= INNER", + /* 520 */ "query_specification ::= SELECT hint_list tag_mode_opt set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 521 */ "hint_list ::=", + /* 522 */ "hint_list ::= NK_HINT", + /* 523 */ "tag_mode_opt ::=", + /* 524 */ "tag_mode_opt ::= TAGS", + /* 525 */ "set_quantifier_opt ::=", + /* 526 */ "set_quantifier_opt ::= DISTINCT", + /* 527 */ "set_quantifier_opt ::= ALL", + /* 528 */ "select_list ::= select_item", + /* 529 */ "select_list ::= select_list NK_COMMA select_item", + /* 530 */ "select_item ::= NK_STAR", + /* 531 */ "select_item ::= common_expression", + /* 532 */ "select_item ::= common_expression column_alias", + /* 533 */ "select_item ::= common_expression AS column_alias", + /* 534 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 535 */ "where_clause_opt ::=", + /* 536 */ "where_clause_opt ::= WHERE search_condition", + /* 537 */ "partition_by_clause_opt ::=", + /* 538 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 539 */ "partition_list ::= partition_item", + /* 540 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 541 */ "partition_item ::= expr_or_subquery", + /* 542 */ "partition_item ::= expr_or_subquery column_alias", + /* 543 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 544 */ "twindow_clause_opt ::=", + /* 545 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 546 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 547 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 548 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 549 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 550 */ "sliding_opt ::=", + /* 551 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 552 */ "fill_opt ::=", + /* 553 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 554 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 555 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 556 */ "fill_mode ::= NONE", + /* 557 */ "fill_mode ::= PREV", + /* 558 */ "fill_mode ::= NULL", + /* 559 */ "fill_mode ::= NULL_F", + /* 560 */ "fill_mode ::= LINEAR", + /* 561 */ "fill_mode ::= NEXT", + /* 562 */ "group_by_clause_opt ::=", + /* 563 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 564 */ "group_by_list ::= expr_or_subquery", + /* 565 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 566 */ "having_clause_opt ::=", + /* 567 */ "having_clause_opt ::= HAVING search_condition", + /* 568 */ "range_opt ::=", + /* 569 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 570 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 571 */ "every_opt ::=", + /* 572 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 573 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 574 */ "query_simple ::= query_specification", + /* 575 */ "query_simple ::= union_query_expression", + /* 576 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 577 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 578 */ "query_simple_or_subquery ::= query_simple", + /* 579 */ "query_simple_or_subquery ::= subquery", + /* 580 */ "query_or_subquery ::= query_expression", + /* 581 */ "query_or_subquery ::= subquery", + /* 582 */ "order_by_clause_opt ::=", + /* 583 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 584 */ "slimit_clause_opt ::=", + /* 585 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 586 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 587 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 588 */ "limit_clause_opt ::=", + /* 589 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 590 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 591 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 592 */ "subquery ::= NK_LP query_expression NK_RP", + /* 593 */ "subquery ::= NK_LP subquery NK_RP", + /* 594 */ "search_condition ::= common_expression", + /* 595 */ "sort_specification_list ::= sort_specification", + /* 596 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 597 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 598 */ "ordering_specification_opt ::=", + /* 599 */ "ordering_specification_opt ::= ASC", + /* 600 */ "ordering_specification_opt ::= DESC", + /* 601 */ "null_ordering_opt ::=", + /* 602 */ "null_ordering_opt ::= NULLS FIRST", + /* 603 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -3370,429 +3369,428 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 372, /* (179) column_def_list ::= column_def */ 372, /* (180) column_def_list ::= column_def_list NK_COMMA column_def */ 388, /* (181) column_def ::= column_name type_name */ - 388, /* (182) column_def ::= column_name type_name COMMENT NK_STRING */ - 381, /* (183) type_name ::= BOOL */ - 381, /* (184) type_name ::= TINYINT */ - 381, /* (185) type_name ::= SMALLINT */ - 381, /* (186) type_name ::= INT */ - 381, /* (187) type_name ::= INTEGER */ - 381, /* (188) type_name ::= BIGINT */ - 381, /* (189) type_name ::= FLOAT */ - 381, /* (190) type_name ::= DOUBLE */ - 381, /* (191) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 381, /* (192) type_name ::= TIMESTAMP */ - 381, /* (193) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 381, /* (194) type_name ::= TINYINT UNSIGNED */ - 381, /* (195) type_name ::= SMALLINT UNSIGNED */ - 381, /* (196) type_name ::= INT UNSIGNED */ - 381, /* (197) type_name ::= BIGINT UNSIGNED */ - 381, /* (198) type_name ::= JSON */ - 381, /* (199) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 381, /* (200) type_name ::= MEDIUMBLOB */ - 381, /* (201) type_name ::= BLOB */ - 381, /* (202) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 381, /* (203) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 381, /* (204) type_name ::= DECIMAL */ - 381, /* (205) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 381, /* (206) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 373, /* (207) tags_def_opt ::= */ - 373, /* (208) tags_def_opt ::= tags_def */ - 376, /* (209) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 374, /* (210) table_options ::= */ - 374, /* (211) table_options ::= table_options COMMENT NK_STRING */ - 374, /* (212) table_options ::= table_options MAX_DELAY duration_list */ - 374, /* (213) table_options ::= table_options WATERMARK duration_list */ - 374, /* (214) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 374, /* (215) table_options ::= table_options TTL NK_INTEGER */ - 374, /* (216) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 374, /* (217) table_options ::= table_options DELETE_MARK duration_list */ - 379, /* (218) alter_table_options ::= alter_table_option */ - 379, /* (219) alter_table_options ::= alter_table_options alter_table_option */ - 391, /* (220) alter_table_option ::= COMMENT NK_STRING */ - 391, /* (221) alter_table_option ::= TTL NK_INTEGER */ - 389, /* (222) duration_list ::= duration_literal */ - 389, /* (223) duration_list ::= duration_list NK_COMMA duration_literal */ - 390, /* (224) rollup_func_list ::= rollup_func_name */ - 390, /* (225) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 393, /* (226) rollup_func_name ::= function_name */ - 393, /* (227) rollup_func_name ::= FIRST */ - 393, /* (228) rollup_func_name ::= LAST */ - 387, /* (229) col_name_list ::= col_name */ - 387, /* (230) col_name_list ::= col_name_list NK_COMMA col_name */ - 395, /* (231) col_name ::= column_name */ - 339, /* (232) cmd ::= SHOW DNODES */ - 339, /* (233) cmd ::= SHOW USERS */ - 339, /* (234) cmd ::= SHOW USER PRIVILEGES */ - 339, /* (235) cmd ::= SHOW DATABASES */ - 339, /* (236) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - 339, /* (237) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 339, /* (238) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 339, /* (239) cmd ::= SHOW MNODES */ - 339, /* (240) cmd ::= SHOW QNODES */ - 339, /* (241) cmd ::= SHOW FUNCTIONS */ - 339, /* (242) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 339, /* (243) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 339, /* (244) cmd ::= SHOW STREAMS */ - 339, /* (245) cmd ::= SHOW ACCOUNTS */ - 339, /* (246) cmd ::= SHOW APPS */ - 339, /* (247) cmd ::= SHOW CONNECTIONS */ - 339, /* (248) cmd ::= SHOW LICENCES */ - 339, /* (249) cmd ::= SHOW GRANTS */ - 339, /* (250) cmd ::= SHOW CREATE DATABASE db_name */ - 339, /* (251) cmd ::= SHOW CREATE TABLE full_table_name */ - 339, /* (252) cmd ::= SHOW CREATE STABLE full_table_name */ - 339, /* (253) cmd ::= SHOW QUERIES */ - 339, /* (254) cmd ::= SHOW SCORES */ - 339, /* (255) cmd ::= SHOW TOPICS */ - 339, /* (256) cmd ::= SHOW VARIABLES */ - 339, /* (257) cmd ::= SHOW CLUSTER VARIABLES */ - 339, /* (258) cmd ::= SHOW LOCAL VARIABLES */ - 339, /* (259) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 339, /* (260) cmd ::= SHOW BNODES */ - 339, /* (261) cmd ::= SHOW SNODES */ - 339, /* (262) cmd ::= SHOW CLUSTER */ - 339, /* (263) cmd ::= SHOW TRANSACTIONS */ - 339, /* (264) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 339, /* (265) cmd ::= SHOW CONSUMERS */ - 339, /* (266) cmd ::= SHOW SUBSCRIPTIONS */ - 339, /* (267) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 339, /* (268) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 339, /* (269) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 339, /* (270) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 339, /* (271) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 339, /* (272) cmd ::= SHOW VNODES */ - 339, /* (273) cmd ::= SHOW db_name_cond_opt ALIVE */ - 339, /* (274) cmd ::= SHOW CLUSTER ALIVE */ - 396, /* (275) db_name_cond_opt ::= */ - 396, /* (276) db_name_cond_opt ::= db_name NK_DOT */ - 397, /* (277) like_pattern_opt ::= */ - 397, /* (278) like_pattern_opt ::= LIKE NK_STRING */ - 398, /* (279) table_name_cond ::= table_name */ - 399, /* (280) from_db_opt ::= */ - 399, /* (281) from_db_opt ::= FROM db_name */ - 400, /* (282) tag_list_opt ::= */ - 400, /* (283) tag_list_opt ::= tag_item */ - 400, /* (284) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 401, /* (285) tag_item ::= TBNAME */ - 401, /* (286) tag_item ::= QTAGS */ - 401, /* (287) tag_item ::= column_name */ - 401, /* (288) tag_item ::= column_name column_alias */ - 401, /* (289) tag_item ::= column_name AS column_alias */ - 339, /* (290) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ - 339, /* (291) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ - 339, /* (292) cmd ::= DROP INDEX exists_opt full_index_name */ - 403, /* (293) full_index_name ::= index_name */ - 403, /* (294) full_index_name ::= db_name NK_DOT index_name */ - 404, /* (295) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 404, /* (296) 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 */ - 406, /* (297) func_list ::= func */ - 406, /* (298) func_list ::= func_list NK_COMMA func */ - 409, /* (299) func ::= sma_func_name NK_LP expression_list NK_RP */ - 410, /* (300) sma_func_name ::= function_name */ - 410, /* (301) sma_func_name ::= COUNT */ - 410, /* (302) sma_func_name ::= FIRST */ - 410, /* (303) sma_func_name ::= LAST */ - 410, /* (304) sma_func_name ::= LAST_ROW */ - 408, /* (305) sma_stream_opt ::= */ - 408, /* (306) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 408, /* (307) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 408, /* (308) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 411, /* (309) with_meta ::= AS */ - 411, /* (310) with_meta ::= WITH META AS */ - 411, /* (311) with_meta ::= ONLY META AS */ - 339, /* (312) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 339, /* (313) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 339, /* (314) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 339, /* (315) cmd ::= DROP TOPIC exists_opt topic_name */ - 339, /* (316) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 339, /* (317) cmd ::= DESC full_table_name */ - 339, /* (318) cmd ::= DESCRIBE full_table_name */ - 339, /* (319) cmd ::= RESET QUERY CACHE */ - 339, /* (320) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 339, /* (321) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 415, /* (322) analyze_opt ::= */ - 415, /* (323) analyze_opt ::= ANALYZE */ - 416, /* (324) explain_options ::= */ - 416, /* (325) explain_options ::= explain_options VERBOSE NK_BOOL */ - 416, /* (326) explain_options ::= explain_options RATIO NK_FLOAT */ - 339, /* (327) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 339, /* (328) cmd ::= DROP FUNCTION exists_opt function_name */ - 419, /* (329) agg_func_opt ::= */ - 419, /* (330) agg_func_opt ::= AGGREGATE */ - 420, /* (331) bufsize_opt ::= */ - 420, /* (332) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 421, /* (333) language_opt ::= */ - 421, /* (334) language_opt ::= LANGUAGE NK_STRING */ - 418, /* (335) or_replace_opt ::= */ - 418, /* (336) or_replace_opt ::= OR REPLACE */ - 339, /* (337) 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 */ - 339, /* (338) cmd ::= DROP STREAM exists_opt stream_name */ - 339, /* (339) cmd ::= PAUSE STREAM exists_opt stream_name */ - 339, /* (340) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 424, /* (341) col_list_opt ::= */ - 424, /* (342) col_list_opt ::= NK_LP col_name_list NK_RP */ - 425, /* (343) tag_def_or_ref_opt ::= */ - 425, /* (344) tag_def_or_ref_opt ::= tags_def */ - 425, /* (345) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 423, /* (346) stream_options ::= */ - 423, /* (347) stream_options ::= stream_options TRIGGER AT_ONCE */ - 423, /* (348) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 423, /* (349) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 423, /* (350) stream_options ::= stream_options WATERMARK duration_literal */ - 423, /* (351) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 423, /* (352) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 423, /* (353) stream_options ::= stream_options DELETE_MARK duration_literal */ - 423, /* (354) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 426, /* (355) subtable_opt ::= */ - 426, /* (356) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 427, /* (357) ignore_opt ::= */ - 427, /* (358) ignore_opt ::= IGNORE UNTREATED */ - 339, /* (359) cmd ::= KILL CONNECTION NK_INTEGER */ - 339, /* (360) cmd ::= KILL QUERY NK_STRING */ - 339, /* (361) cmd ::= KILL TRANSACTION NK_INTEGER */ - 339, /* (362) cmd ::= BALANCE VGROUP */ - 339, /* (363) cmd ::= BALANCE VGROUP LEADER */ - 339, /* (364) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 339, /* (365) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 339, /* (366) cmd ::= SPLIT VGROUP NK_INTEGER */ - 429, /* (367) dnode_list ::= DNODE NK_INTEGER */ - 429, /* (368) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 339, /* (369) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 339, /* (370) cmd ::= query_or_subquery */ - 339, /* (371) cmd ::= insert_query */ - 417, /* (372) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 417, /* (373) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 342, /* (374) literal ::= NK_INTEGER */ - 342, /* (375) literal ::= NK_FLOAT */ - 342, /* (376) literal ::= NK_STRING */ - 342, /* (377) literal ::= NK_BOOL */ - 342, /* (378) literal ::= TIMESTAMP NK_STRING */ - 342, /* (379) literal ::= duration_literal */ - 342, /* (380) literal ::= NULL */ - 342, /* (381) literal ::= NK_QUESTION */ - 392, /* (382) duration_literal ::= NK_VARIABLE */ - 368, /* (383) signed ::= NK_INTEGER */ - 368, /* (384) signed ::= NK_PLUS NK_INTEGER */ - 368, /* (385) signed ::= NK_MINUS NK_INTEGER */ - 368, /* (386) signed ::= NK_FLOAT */ - 368, /* (387) signed ::= NK_PLUS NK_FLOAT */ - 368, /* (388) signed ::= NK_MINUS NK_FLOAT */ - 382, /* (389) signed_literal ::= signed */ - 382, /* (390) signed_literal ::= NK_STRING */ - 382, /* (391) signed_literal ::= NK_BOOL */ - 382, /* (392) signed_literal ::= TIMESTAMP NK_STRING */ - 382, /* (393) signed_literal ::= duration_literal */ - 382, /* (394) signed_literal ::= NULL */ - 382, /* (395) signed_literal ::= literal_func */ - 382, /* (396) signed_literal ::= NK_QUESTION */ - 431, /* (397) literal_list ::= signed_literal */ - 431, /* (398) literal_list ::= literal_list NK_COMMA signed_literal */ - 351, /* (399) db_name ::= NK_ID */ - 352, /* (400) table_name ::= NK_ID */ - 380, /* (401) column_name ::= NK_ID */ - 394, /* (402) function_name ::= NK_ID */ - 432, /* (403) table_alias ::= NK_ID */ - 402, /* (404) column_alias ::= NK_ID */ - 344, /* (405) user_name ::= NK_ID */ - 353, /* (406) topic_name ::= NK_ID */ - 422, /* (407) stream_name ::= NK_ID */ - 414, /* (408) cgroup_name ::= NK_ID */ - 405, /* (409) index_name ::= NK_ID */ - 433, /* (410) expr_or_subquery ::= expression */ - 428, /* (411) expression ::= literal */ - 428, /* (412) expression ::= pseudo_column */ - 428, /* (413) expression ::= column_reference */ - 428, /* (414) expression ::= function_expression */ - 428, /* (415) expression ::= case_when_expression */ - 428, /* (416) expression ::= NK_LP expression NK_RP */ - 428, /* (417) expression ::= NK_PLUS expr_or_subquery */ - 428, /* (418) expression ::= NK_MINUS expr_or_subquery */ - 428, /* (419) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 428, /* (420) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 428, /* (421) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 428, /* (422) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 428, /* (423) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 428, /* (424) expression ::= column_reference NK_ARROW NK_STRING */ - 428, /* (425) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 428, /* (426) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 385, /* (427) expression_list ::= expr_or_subquery */ - 385, /* (428) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 435, /* (429) column_reference ::= column_name */ - 435, /* (430) column_reference ::= table_name NK_DOT column_name */ - 434, /* (431) pseudo_column ::= ROWTS */ - 434, /* (432) pseudo_column ::= TBNAME */ - 434, /* (433) pseudo_column ::= table_name NK_DOT TBNAME */ - 434, /* (434) pseudo_column ::= QSTART */ - 434, /* (435) pseudo_column ::= QEND */ - 434, /* (436) pseudo_column ::= QDURATION */ - 434, /* (437) pseudo_column ::= WSTART */ - 434, /* (438) pseudo_column ::= WEND */ - 434, /* (439) pseudo_column ::= WDURATION */ - 434, /* (440) pseudo_column ::= IROWTS */ - 434, /* (441) pseudo_column ::= ISFILLED */ - 434, /* (442) pseudo_column ::= QTAGS */ - 436, /* (443) function_expression ::= function_name NK_LP expression_list NK_RP */ - 436, /* (444) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 436, /* (445) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 436, /* (446) function_expression ::= literal_func */ - 430, /* (447) literal_func ::= noarg_func NK_LP NK_RP */ - 430, /* (448) literal_func ::= NOW */ - 440, /* (449) noarg_func ::= NOW */ - 440, /* (450) noarg_func ::= TODAY */ - 440, /* (451) noarg_func ::= TIMEZONE */ - 440, /* (452) noarg_func ::= DATABASE */ - 440, /* (453) noarg_func ::= CLIENT_VERSION */ - 440, /* (454) noarg_func ::= SERVER_VERSION */ - 440, /* (455) noarg_func ::= SERVER_STATUS */ - 440, /* (456) noarg_func ::= CURRENT_USER */ - 440, /* (457) noarg_func ::= USER */ - 438, /* (458) star_func ::= COUNT */ - 438, /* (459) star_func ::= FIRST */ - 438, /* (460) star_func ::= LAST */ - 438, /* (461) star_func ::= LAST_ROW */ - 439, /* (462) star_func_para_list ::= NK_STAR */ - 439, /* (463) star_func_para_list ::= other_para_list */ - 441, /* (464) other_para_list ::= star_func_para */ - 441, /* (465) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 442, /* (466) star_func_para ::= expr_or_subquery */ - 442, /* (467) star_func_para ::= table_name NK_DOT NK_STAR */ - 437, /* (468) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 437, /* (469) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 443, /* (470) when_then_list ::= when_then_expr */ - 443, /* (471) when_then_list ::= when_then_list when_then_expr */ - 446, /* (472) when_then_expr ::= WHEN common_expression THEN common_expression */ - 444, /* (473) case_when_else_opt ::= */ - 444, /* (474) case_when_else_opt ::= ELSE common_expression */ - 447, /* (475) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 447, /* (476) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 447, /* (477) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 447, /* (478) predicate ::= expr_or_subquery IS NULL */ - 447, /* (479) predicate ::= expr_or_subquery IS NOT NULL */ - 447, /* (480) predicate ::= expr_or_subquery in_op in_predicate_value */ - 448, /* (481) compare_op ::= NK_LT */ - 448, /* (482) compare_op ::= NK_GT */ - 448, /* (483) compare_op ::= NK_LE */ - 448, /* (484) compare_op ::= NK_GE */ - 448, /* (485) compare_op ::= NK_NE */ - 448, /* (486) compare_op ::= NK_EQ */ - 448, /* (487) compare_op ::= LIKE */ - 448, /* (488) compare_op ::= NOT LIKE */ - 448, /* (489) compare_op ::= MATCH */ - 448, /* (490) compare_op ::= NMATCH */ - 448, /* (491) compare_op ::= CONTAINS */ - 449, /* (492) in_op ::= IN */ - 449, /* (493) in_op ::= NOT IN */ - 450, /* (494) in_predicate_value ::= NK_LP literal_list NK_RP */ - 451, /* (495) boolean_value_expression ::= boolean_primary */ - 451, /* (496) boolean_value_expression ::= NOT boolean_primary */ - 451, /* (497) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 451, /* (498) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 452, /* (499) boolean_primary ::= predicate */ - 452, /* (500) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 445, /* (501) common_expression ::= expr_or_subquery */ - 445, /* (502) common_expression ::= boolean_value_expression */ - 453, /* (503) from_clause_opt ::= */ - 453, /* (504) from_clause_opt ::= FROM table_reference_list */ - 454, /* (505) table_reference_list ::= table_reference */ - 454, /* (506) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 455, /* (507) table_reference ::= table_primary */ - 455, /* (508) table_reference ::= joined_table */ - 456, /* (509) table_primary ::= table_name alias_opt */ - 456, /* (510) table_primary ::= db_name NK_DOT table_name alias_opt */ - 456, /* (511) table_primary ::= subquery alias_opt */ - 456, /* (512) table_primary ::= parenthesized_joined_table */ - 458, /* (513) alias_opt ::= */ - 458, /* (514) alias_opt ::= table_alias */ - 458, /* (515) alias_opt ::= AS table_alias */ - 460, /* (516) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 460, /* (517) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 457, /* (518) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 461, /* (519) join_type ::= */ - 461, /* (520) join_type ::= INNER */ - 462, /* (521) query_specification ::= SELECT hint_list tag_mode_opt set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 463, /* (522) hint_list ::= */ - 463, /* (523) hint_list ::= NK_HINT */ - 464, /* (524) tag_mode_opt ::= */ - 464, /* (525) tag_mode_opt ::= TAGS */ - 465, /* (526) set_quantifier_opt ::= */ - 465, /* (527) set_quantifier_opt ::= DISTINCT */ - 465, /* (528) set_quantifier_opt ::= ALL */ - 466, /* (529) select_list ::= select_item */ - 466, /* (530) select_list ::= select_list NK_COMMA select_item */ - 474, /* (531) select_item ::= NK_STAR */ - 474, /* (532) select_item ::= common_expression */ - 474, /* (533) select_item ::= common_expression column_alias */ - 474, /* (534) select_item ::= common_expression AS column_alias */ - 474, /* (535) select_item ::= table_name NK_DOT NK_STAR */ - 413, /* (536) where_clause_opt ::= */ - 413, /* (537) where_clause_opt ::= WHERE search_condition */ - 467, /* (538) partition_by_clause_opt ::= */ - 467, /* (539) partition_by_clause_opt ::= PARTITION BY partition_list */ - 475, /* (540) partition_list ::= partition_item */ - 475, /* (541) partition_list ::= partition_list NK_COMMA partition_item */ - 476, /* (542) partition_item ::= expr_or_subquery */ - 476, /* (543) partition_item ::= expr_or_subquery column_alias */ - 476, /* (544) partition_item ::= expr_or_subquery AS column_alias */ - 471, /* (545) twindow_clause_opt ::= */ - 471, /* (546) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - 471, /* (547) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 471, /* (548) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - 471, /* (549) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - 471, /* (550) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 407, /* (551) sliding_opt ::= */ - 407, /* (552) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - 470, /* (553) fill_opt ::= */ - 470, /* (554) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 470, /* (555) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 470, /* (556) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 477, /* (557) fill_mode ::= NONE */ - 477, /* (558) fill_mode ::= PREV */ - 477, /* (559) fill_mode ::= NULL */ - 477, /* (560) fill_mode ::= NULL_F */ - 477, /* (561) fill_mode ::= LINEAR */ - 477, /* (562) fill_mode ::= NEXT */ - 472, /* (563) group_by_clause_opt ::= */ - 472, /* (564) group_by_clause_opt ::= GROUP BY group_by_list */ - 478, /* (565) group_by_list ::= expr_or_subquery */ - 478, /* (566) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 473, /* (567) having_clause_opt ::= */ - 473, /* (568) having_clause_opt ::= HAVING search_condition */ - 468, /* (569) range_opt ::= */ - 468, /* (570) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 468, /* (571) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 469, /* (572) every_opt ::= */ - 469, /* (573) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 479, /* (574) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 480, /* (575) query_simple ::= query_specification */ - 480, /* (576) query_simple ::= union_query_expression */ - 484, /* (577) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 484, /* (578) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 485, /* (579) query_simple_or_subquery ::= query_simple */ - 485, /* (580) query_simple_or_subquery ::= subquery */ - 412, /* (581) query_or_subquery ::= query_expression */ - 412, /* (582) query_or_subquery ::= subquery */ - 481, /* (583) order_by_clause_opt ::= */ - 481, /* (584) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 482, /* (585) slimit_clause_opt ::= */ - 482, /* (586) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 482, /* (587) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 482, /* (588) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 483, /* (589) limit_clause_opt ::= */ - 483, /* (590) limit_clause_opt ::= LIMIT NK_INTEGER */ - 483, /* (591) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 483, /* (592) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 459, /* (593) subquery ::= NK_LP query_expression NK_RP */ - 459, /* (594) subquery ::= NK_LP subquery NK_RP */ - 354, /* (595) search_condition ::= common_expression */ - 486, /* (596) sort_specification_list ::= sort_specification */ - 486, /* (597) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 487, /* (598) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 488, /* (599) ordering_specification_opt ::= */ - 488, /* (600) ordering_specification_opt ::= ASC */ - 488, /* (601) ordering_specification_opt ::= DESC */ - 489, /* (602) null_ordering_opt ::= */ - 489, /* (603) null_ordering_opt ::= NULLS FIRST */ - 489, /* (604) null_ordering_opt ::= NULLS LAST */ + 381, /* (182) type_name ::= BOOL */ + 381, /* (183) type_name ::= TINYINT */ + 381, /* (184) type_name ::= SMALLINT */ + 381, /* (185) type_name ::= INT */ + 381, /* (186) type_name ::= INTEGER */ + 381, /* (187) type_name ::= BIGINT */ + 381, /* (188) type_name ::= FLOAT */ + 381, /* (189) type_name ::= DOUBLE */ + 381, /* (190) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 381, /* (191) type_name ::= TIMESTAMP */ + 381, /* (192) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 381, /* (193) type_name ::= TINYINT UNSIGNED */ + 381, /* (194) type_name ::= SMALLINT UNSIGNED */ + 381, /* (195) type_name ::= INT UNSIGNED */ + 381, /* (196) type_name ::= BIGINT UNSIGNED */ + 381, /* (197) type_name ::= JSON */ + 381, /* (198) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 381, /* (199) type_name ::= MEDIUMBLOB */ + 381, /* (200) type_name ::= BLOB */ + 381, /* (201) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 381, /* (202) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 381, /* (203) type_name ::= DECIMAL */ + 381, /* (204) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 381, /* (205) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 373, /* (206) tags_def_opt ::= */ + 373, /* (207) tags_def_opt ::= tags_def */ + 376, /* (208) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 374, /* (209) table_options ::= */ + 374, /* (210) table_options ::= table_options COMMENT NK_STRING */ + 374, /* (211) table_options ::= table_options MAX_DELAY duration_list */ + 374, /* (212) table_options ::= table_options WATERMARK duration_list */ + 374, /* (213) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 374, /* (214) table_options ::= table_options TTL NK_INTEGER */ + 374, /* (215) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 374, /* (216) table_options ::= table_options DELETE_MARK duration_list */ + 379, /* (217) alter_table_options ::= alter_table_option */ + 379, /* (218) alter_table_options ::= alter_table_options alter_table_option */ + 391, /* (219) alter_table_option ::= COMMENT NK_STRING */ + 391, /* (220) alter_table_option ::= TTL NK_INTEGER */ + 389, /* (221) duration_list ::= duration_literal */ + 389, /* (222) duration_list ::= duration_list NK_COMMA duration_literal */ + 390, /* (223) rollup_func_list ::= rollup_func_name */ + 390, /* (224) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 393, /* (225) rollup_func_name ::= function_name */ + 393, /* (226) rollup_func_name ::= FIRST */ + 393, /* (227) rollup_func_name ::= LAST */ + 387, /* (228) col_name_list ::= col_name */ + 387, /* (229) col_name_list ::= col_name_list NK_COMMA col_name */ + 395, /* (230) col_name ::= column_name */ + 339, /* (231) cmd ::= SHOW DNODES */ + 339, /* (232) cmd ::= SHOW USERS */ + 339, /* (233) cmd ::= SHOW USER PRIVILEGES */ + 339, /* (234) cmd ::= SHOW DATABASES */ + 339, /* (235) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + 339, /* (236) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 339, /* (237) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 339, /* (238) cmd ::= SHOW MNODES */ + 339, /* (239) cmd ::= SHOW QNODES */ + 339, /* (240) cmd ::= SHOW FUNCTIONS */ + 339, /* (241) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 339, /* (242) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 339, /* (243) cmd ::= SHOW STREAMS */ + 339, /* (244) cmd ::= SHOW ACCOUNTS */ + 339, /* (245) cmd ::= SHOW APPS */ + 339, /* (246) cmd ::= SHOW CONNECTIONS */ + 339, /* (247) cmd ::= SHOW LICENCES */ + 339, /* (248) cmd ::= SHOW GRANTS */ + 339, /* (249) cmd ::= SHOW CREATE DATABASE db_name */ + 339, /* (250) cmd ::= SHOW CREATE TABLE full_table_name */ + 339, /* (251) cmd ::= SHOW CREATE STABLE full_table_name */ + 339, /* (252) cmd ::= SHOW QUERIES */ + 339, /* (253) cmd ::= SHOW SCORES */ + 339, /* (254) cmd ::= SHOW TOPICS */ + 339, /* (255) cmd ::= SHOW VARIABLES */ + 339, /* (256) cmd ::= SHOW CLUSTER VARIABLES */ + 339, /* (257) cmd ::= SHOW LOCAL VARIABLES */ + 339, /* (258) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 339, /* (259) cmd ::= SHOW BNODES */ + 339, /* (260) cmd ::= SHOW SNODES */ + 339, /* (261) cmd ::= SHOW CLUSTER */ + 339, /* (262) cmd ::= SHOW TRANSACTIONS */ + 339, /* (263) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 339, /* (264) cmd ::= SHOW CONSUMERS */ + 339, /* (265) cmd ::= SHOW SUBSCRIPTIONS */ + 339, /* (266) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 339, /* (267) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 339, /* (268) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 339, /* (269) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 339, /* (270) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 339, /* (271) cmd ::= SHOW VNODES */ + 339, /* (272) cmd ::= SHOW db_name_cond_opt ALIVE */ + 339, /* (273) cmd ::= SHOW CLUSTER ALIVE */ + 396, /* (274) db_name_cond_opt ::= */ + 396, /* (275) db_name_cond_opt ::= db_name NK_DOT */ + 397, /* (276) like_pattern_opt ::= */ + 397, /* (277) like_pattern_opt ::= LIKE NK_STRING */ + 398, /* (278) table_name_cond ::= table_name */ + 399, /* (279) from_db_opt ::= */ + 399, /* (280) from_db_opt ::= FROM db_name */ + 400, /* (281) tag_list_opt ::= */ + 400, /* (282) tag_list_opt ::= tag_item */ + 400, /* (283) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 401, /* (284) tag_item ::= TBNAME */ + 401, /* (285) tag_item ::= QTAGS */ + 401, /* (286) tag_item ::= column_name */ + 401, /* (287) tag_item ::= column_name column_alias */ + 401, /* (288) tag_item ::= column_name AS column_alias */ + 339, /* (289) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ + 339, /* (290) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ + 339, /* (291) cmd ::= DROP INDEX exists_opt full_index_name */ + 403, /* (292) full_index_name ::= index_name */ + 403, /* (293) full_index_name ::= db_name NK_DOT index_name */ + 404, /* (294) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 404, /* (295) 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 */ + 406, /* (296) func_list ::= func */ + 406, /* (297) func_list ::= func_list NK_COMMA func */ + 409, /* (298) func ::= sma_func_name NK_LP expression_list NK_RP */ + 410, /* (299) sma_func_name ::= function_name */ + 410, /* (300) sma_func_name ::= COUNT */ + 410, /* (301) sma_func_name ::= FIRST */ + 410, /* (302) sma_func_name ::= LAST */ + 410, /* (303) sma_func_name ::= LAST_ROW */ + 408, /* (304) sma_stream_opt ::= */ + 408, /* (305) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 408, /* (306) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 408, /* (307) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 411, /* (308) with_meta ::= AS */ + 411, /* (309) with_meta ::= WITH META AS */ + 411, /* (310) with_meta ::= ONLY META AS */ + 339, /* (311) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 339, /* (312) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 339, /* (313) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 339, /* (314) cmd ::= DROP TOPIC exists_opt topic_name */ + 339, /* (315) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 339, /* (316) cmd ::= DESC full_table_name */ + 339, /* (317) cmd ::= DESCRIBE full_table_name */ + 339, /* (318) cmd ::= RESET QUERY CACHE */ + 339, /* (319) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 339, /* (320) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 415, /* (321) analyze_opt ::= */ + 415, /* (322) analyze_opt ::= ANALYZE */ + 416, /* (323) explain_options ::= */ + 416, /* (324) explain_options ::= explain_options VERBOSE NK_BOOL */ + 416, /* (325) explain_options ::= explain_options RATIO NK_FLOAT */ + 339, /* (326) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 339, /* (327) cmd ::= DROP FUNCTION exists_opt function_name */ + 419, /* (328) agg_func_opt ::= */ + 419, /* (329) agg_func_opt ::= AGGREGATE */ + 420, /* (330) bufsize_opt ::= */ + 420, /* (331) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 421, /* (332) language_opt ::= */ + 421, /* (333) language_opt ::= LANGUAGE NK_STRING */ + 418, /* (334) or_replace_opt ::= */ + 418, /* (335) or_replace_opt ::= OR REPLACE */ + 339, /* (336) 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 */ + 339, /* (337) cmd ::= DROP STREAM exists_opt stream_name */ + 339, /* (338) cmd ::= PAUSE STREAM exists_opt stream_name */ + 339, /* (339) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 424, /* (340) col_list_opt ::= */ + 424, /* (341) col_list_opt ::= NK_LP col_name_list NK_RP */ + 425, /* (342) tag_def_or_ref_opt ::= */ + 425, /* (343) tag_def_or_ref_opt ::= tags_def */ + 425, /* (344) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 423, /* (345) stream_options ::= */ + 423, /* (346) stream_options ::= stream_options TRIGGER AT_ONCE */ + 423, /* (347) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 423, /* (348) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 423, /* (349) stream_options ::= stream_options WATERMARK duration_literal */ + 423, /* (350) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 423, /* (351) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 423, /* (352) stream_options ::= stream_options DELETE_MARK duration_literal */ + 423, /* (353) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 426, /* (354) subtable_opt ::= */ + 426, /* (355) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 427, /* (356) ignore_opt ::= */ + 427, /* (357) ignore_opt ::= IGNORE UNTREATED */ + 339, /* (358) cmd ::= KILL CONNECTION NK_INTEGER */ + 339, /* (359) cmd ::= KILL QUERY NK_STRING */ + 339, /* (360) cmd ::= KILL TRANSACTION NK_INTEGER */ + 339, /* (361) cmd ::= BALANCE VGROUP */ + 339, /* (362) cmd ::= BALANCE VGROUP LEADER */ + 339, /* (363) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 339, /* (364) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 339, /* (365) cmd ::= SPLIT VGROUP NK_INTEGER */ + 429, /* (366) dnode_list ::= DNODE NK_INTEGER */ + 429, /* (367) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 339, /* (368) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 339, /* (369) cmd ::= query_or_subquery */ + 339, /* (370) cmd ::= insert_query */ + 417, /* (371) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 417, /* (372) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 342, /* (373) literal ::= NK_INTEGER */ + 342, /* (374) literal ::= NK_FLOAT */ + 342, /* (375) literal ::= NK_STRING */ + 342, /* (376) literal ::= NK_BOOL */ + 342, /* (377) literal ::= TIMESTAMP NK_STRING */ + 342, /* (378) literal ::= duration_literal */ + 342, /* (379) literal ::= NULL */ + 342, /* (380) literal ::= NK_QUESTION */ + 392, /* (381) duration_literal ::= NK_VARIABLE */ + 368, /* (382) signed ::= NK_INTEGER */ + 368, /* (383) signed ::= NK_PLUS NK_INTEGER */ + 368, /* (384) signed ::= NK_MINUS NK_INTEGER */ + 368, /* (385) signed ::= NK_FLOAT */ + 368, /* (386) signed ::= NK_PLUS NK_FLOAT */ + 368, /* (387) signed ::= NK_MINUS NK_FLOAT */ + 382, /* (388) signed_literal ::= signed */ + 382, /* (389) signed_literal ::= NK_STRING */ + 382, /* (390) signed_literal ::= NK_BOOL */ + 382, /* (391) signed_literal ::= TIMESTAMP NK_STRING */ + 382, /* (392) signed_literal ::= duration_literal */ + 382, /* (393) signed_literal ::= NULL */ + 382, /* (394) signed_literal ::= literal_func */ + 382, /* (395) signed_literal ::= NK_QUESTION */ + 431, /* (396) literal_list ::= signed_literal */ + 431, /* (397) literal_list ::= literal_list NK_COMMA signed_literal */ + 351, /* (398) db_name ::= NK_ID */ + 352, /* (399) table_name ::= NK_ID */ + 380, /* (400) column_name ::= NK_ID */ + 394, /* (401) function_name ::= NK_ID */ + 432, /* (402) table_alias ::= NK_ID */ + 402, /* (403) column_alias ::= NK_ID */ + 344, /* (404) user_name ::= NK_ID */ + 353, /* (405) topic_name ::= NK_ID */ + 422, /* (406) stream_name ::= NK_ID */ + 414, /* (407) cgroup_name ::= NK_ID */ + 405, /* (408) index_name ::= NK_ID */ + 433, /* (409) expr_or_subquery ::= expression */ + 428, /* (410) expression ::= literal */ + 428, /* (411) expression ::= pseudo_column */ + 428, /* (412) expression ::= column_reference */ + 428, /* (413) expression ::= function_expression */ + 428, /* (414) expression ::= case_when_expression */ + 428, /* (415) expression ::= NK_LP expression NK_RP */ + 428, /* (416) expression ::= NK_PLUS expr_or_subquery */ + 428, /* (417) expression ::= NK_MINUS expr_or_subquery */ + 428, /* (418) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 428, /* (419) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 428, /* (420) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 428, /* (421) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 428, /* (422) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 428, /* (423) expression ::= column_reference NK_ARROW NK_STRING */ + 428, /* (424) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 428, /* (425) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 385, /* (426) expression_list ::= expr_or_subquery */ + 385, /* (427) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 435, /* (428) column_reference ::= column_name */ + 435, /* (429) column_reference ::= table_name NK_DOT column_name */ + 434, /* (430) pseudo_column ::= ROWTS */ + 434, /* (431) pseudo_column ::= TBNAME */ + 434, /* (432) pseudo_column ::= table_name NK_DOT TBNAME */ + 434, /* (433) pseudo_column ::= QSTART */ + 434, /* (434) pseudo_column ::= QEND */ + 434, /* (435) pseudo_column ::= QDURATION */ + 434, /* (436) pseudo_column ::= WSTART */ + 434, /* (437) pseudo_column ::= WEND */ + 434, /* (438) pseudo_column ::= WDURATION */ + 434, /* (439) pseudo_column ::= IROWTS */ + 434, /* (440) pseudo_column ::= ISFILLED */ + 434, /* (441) pseudo_column ::= QTAGS */ + 436, /* (442) function_expression ::= function_name NK_LP expression_list NK_RP */ + 436, /* (443) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 436, /* (444) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 436, /* (445) function_expression ::= literal_func */ + 430, /* (446) literal_func ::= noarg_func NK_LP NK_RP */ + 430, /* (447) literal_func ::= NOW */ + 440, /* (448) noarg_func ::= NOW */ + 440, /* (449) noarg_func ::= TODAY */ + 440, /* (450) noarg_func ::= TIMEZONE */ + 440, /* (451) noarg_func ::= DATABASE */ + 440, /* (452) noarg_func ::= CLIENT_VERSION */ + 440, /* (453) noarg_func ::= SERVER_VERSION */ + 440, /* (454) noarg_func ::= SERVER_STATUS */ + 440, /* (455) noarg_func ::= CURRENT_USER */ + 440, /* (456) noarg_func ::= USER */ + 438, /* (457) star_func ::= COUNT */ + 438, /* (458) star_func ::= FIRST */ + 438, /* (459) star_func ::= LAST */ + 438, /* (460) star_func ::= LAST_ROW */ + 439, /* (461) star_func_para_list ::= NK_STAR */ + 439, /* (462) star_func_para_list ::= other_para_list */ + 441, /* (463) other_para_list ::= star_func_para */ + 441, /* (464) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 442, /* (465) star_func_para ::= expr_or_subquery */ + 442, /* (466) star_func_para ::= table_name NK_DOT NK_STAR */ + 437, /* (467) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 437, /* (468) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 443, /* (469) when_then_list ::= when_then_expr */ + 443, /* (470) when_then_list ::= when_then_list when_then_expr */ + 446, /* (471) when_then_expr ::= WHEN common_expression THEN common_expression */ + 444, /* (472) case_when_else_opt ::= */ + 444, /* (473) case_when_else_opt ::= ELSE common_expression */ + 447, /* (474) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 447, /* (475) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 447, /* (476) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 447, /* (477) predicate ::= expr_or_subquery IS NULL */ + 447, /* (478) predicate ::= expr_or_subquery IS NOT NULL */ + 447, /* (479) predicate ::= expr_or_subquery in_op in_predicate_value */ + 448, /* (480) compare_op ::= NK_LT */ + 448, /* (481) compare_op ::= NK_GT */ + 448, /* (482) compare_op ::= NK_LE */ + 448, /* (483) compare_op ::= NK_GE */ + 448, /* (484) compare_op ::= NK_NE */ + 448, /* (485) compare_op ::= NK_EQ */ + 448, /* (486) compare_op ::= LIKE */ + 448, /* (487) compare_op ::= NOT LIKE */ + 448, /* (488) compare_op ::= MATCH */ + 448, /* (489) compare_op ::= NMATCH */ + 448, /* (490) compare_op ::= CONTAINS */ + 449, /* (491) in_op ::= IN */ + 449, /* (492) in_op ::= NOT IN */ + 450, /* (493) in_predicate_value ::= NK_LP literal_list NK_RP */ + 451, /* (494) boolean_value_expression ::= boolean_primary */ + 451, /* (495) boolean_value_expression ::= NOT boolean_primary */ + 451, /* (496) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 451, /* (497) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 452, /* (498) boolean_primary ::= predicate */ + 452, /* (499) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 445, /* (500) common_expression ::= expr_or_subquery */ + 445, /* (501) common_expression ::= boolean_value_expression */ + 453, /* (502) from_clause_opt ::= */ + 453, /* (503) from_clause_opt ::= FROM table_reference_list */ + 454, /* (504) table_reference_list ::= table_reference */ + 454, /* (505) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 455, /* (506) table_reference ::= table_primary */ + 455, /* (507) table_reference ::= joined_table */ + 456, /* (508) table_primary ::= table_name alias_opt */ + 456, /* (509) table_primary ::= db_name NK_DOT table_name alias_opt */ + 456, /* (510) table_primary ::= subquery alias_opt */ + 456, /* (511) table_primary ::= parenthesized_joined_table */ + 458, /* (512) alias_opt ::= */ + 458, /* (513) alias_opt ::= table_alias */ + 458, /* (514) alias_opt ::= AS table_alias */ + 460, /* (515) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 460, /* (516) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 457, /* (517) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 461, /* (518) join_type ::= */ + 461, /* (519) join_type ::= INNER */ + 462, /* (520) query_specification ::= SELECT hint_list tag_mode_opt set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 463, /* (521) hint_list ::= */ + 463, /* (522) hint_list ::= NK_HINT */ + 464, /* (523) tag_mode_opt ::= */ + 464, /* (524) tag_mode_opt ::= TAGS */ + 465, /* (525) set_quantifier_opt ::= */ + 465, /* (526) set_quantifier_opt ::= DISTINCT */ + 465, /* (527) set_quantifier_opt ::= ALL */ + 466, /* (528) select_list ::= select_item */ + 466, /* (529) select_list ::= select_list NK_COMMA select_item */ + 474, /* (530) select_item ::= NK_STAR */ + 474, /* (531) select_item ::= common_expression */ + 474, /* (532) select_item ::= common_expression column_alias */ + 474, /* (533) select_item ::= common_expression AS column_alias */ + 474, /* (534) select_item ::= table_name NK_DOT NK_STAR */ + 413, /* (535) where_clause_opt ::= */ + 413, /* (536) where_clause_opt ::= WHERE search_condition */ + 467, /* (537) partition_by_clause_opt ::= */ + 467, /* (538) partition_by_clause_opt ::= PARTITION BY partition_list */ + 475, /* (539) partition_list ::= partition_item */ + 475, /* (540) partition_list ::= partition_list NK_COMMA partition_item */ + 476, /* (541) partition_item ::= expr_or_subquery */ + 476, /* (542) partition_item ::= expr_or_subquery column_alias */ + 476, /* (543) partition_item ::= expr_or_subquery AS column_alias */ + 471, /* (544) twindow_clause_opt ::= */ + 471, /* (545) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + 471, /* (546) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 471, /* (547) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + 471, /* (548) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + 471, /* (549) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 407, /* (550) sliding_opt ::= */ + 407, /* (551) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + 470, /* (552) fill_opt ::= */ + 470, /* (553) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 470, /* (554) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 470, /* (555) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 477, /* (556) fill_mode ::= NONE */ + 477, /* (557) fill_mode ::= PREV */ + 477, /* (558) fill_mode ::= NULL */ + 477, /* (559) fill_mode ::= NULL_F */ + 477, /* (560) fill_mode ::= LINEAR */ + 477, /* (561) fill_mode ::= NEXT */ + 472, /* (562) group_by_clause_opt ::= */ + 472, /* (563) group_by_clause_opt ::= GROUP BY group_by_list */ + 478, /* (564) group_by_list ::= expr_or_subquery */ + 478, /* (565) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 473, /* (566) having_clause_opt ::= */ + 473, /* (567) having_clause_opt ::= HAVING search_condition */ + 468, /* (568) range_opt ::= */ + 468, /* (569) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 468, /* (570) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 469, /* (571) every_opt ::= */ + 469, /* (572) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 479, /* (573) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 480, /* (574) query_simple ::= query_specification */ + 480, /* (575) query_simple ::= union_query_expression */ + 484, /* (576) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 484, /* (577) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 485, /* (578) query_simple_or_subquery ::= query_simple */ + 485, /* (579) query_simple_or_subquery ::= subquery */ + 412, /* (580) query_or_subquery ::= query_expression */ + 412, /* (581) query_or_subquery ::= subquery */ + 481, /* (582) order_by_clause_opt ::= */ + 481, /* (583) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 482, /* (584) slimit_clause_opt ::= */ + 482, /* (585) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 482, /* (586) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 482, /* (587) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 483, /* (588) limit_clause_opt ::= */ + 483, /* (589) limit_clause_opt ::= LIMIT NK_INTEGER */ + 483, /* (590) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 483, /* (591) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 459, /* (592) subquery ::= NK_LP query_expression NK_RP */ + 459, /* (593) subquery ::= NK_LP subquery NK_RP */ + 354, /* (594) search_condition ::= common_expression */ + 486, /* (595) sort_specification_list ::= sort_specification */ + 486, /* (596) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 487, /* (597) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 488, /* (598) ordering_specification_opt ::= */ + 488, /* (599) ordering_specification_opt ::= ASC */ + 488, /* (600) ordering_specification_opt ::= DESC */ + 489, /* (601) null_ordering_opt ::= */ + 489, /* (602) null_ordering_opt ::= NULLS FIRST */ + 489, /* (603) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -3980,429 +3978,428 @@ static const signed char yyRuleInfoNRhs[] = { -1, /* (179) column_def_list ::= column_def */ -3, /* (180) column_def_list ::= column_def_list NK_COMMA column_def */ -2, /* (181) column_def ::= column_name type_name */ - -4, /* (182) column_def ::= column_name type_name COMMENT NK_STRING */ - -1, /* (183) type_name ::= BOOL */ - -1, /* (184) type_name ::= TINYINT */ - -1, /* (185) type_name ::= SMALLINT */ - -1, /* (186) type_name ::= INT */ - -1, /* (187) type_name ::= INTEGER */ - -1, /* (188) type_name ::= BIGINT */ - -1, /* (189) type_name ::= FLOAT */ - -1, /* (190) type_name ::= DOUBLE */ - -4, /* (191) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - -1, /* (192) type_name ::= TIMESTAMP */ - -4, /* (193) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - -2, /* (194) type_name ::= TINYINT UNSIGNED */ - -2, /* (195) type_name ::= SMALLINT UNSIGNED */ - -2, /* (196) type_name ::= INT UNSIGNED */ - -2, /* (197) type_name ::= BIGINT UNSIGNED */ - -1, /* (198) type_name ::= JSON */ - -4, /* (199) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - -1, /* (200) type_name ::= MEDIUMBLOB */ - -1, /* (201) type_name ::= BLOB */ - -4, /* (202) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - -4, /* (203) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - -1, /* (204) type_name ::= DECIMAL */ - -4, /* (205) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - -6, /* (206) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 0, /* (207) tags_def_opt ::= */ - -1, /* (208) tags_def_opt ::= tags_def */ - -4, /* (209) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 0, /* (210) table_options ::= */ - -3, /* (211) table_options ::= table_options COMMENT NK_STRING */ - -3, /* (212) table_options ::= table_options MAX_DELAY duration_list */ - -3, /* (213) table_options ::= table_options WATERMARK duration_list */ - -5, /* (214) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - -3, /* (215) table_options ::= table_options TTL NK_INTEGER */ - -5, /* (216) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - -3, /* (217) table_options ::= table_options DELETE_MARK duration_list */ - -1, /* (218) alter_table_options ::= alter_table_option */ - -2, /* (219) alter_table_options ::= alter_table_options alter_table_option */ - -2, /* (220) alter_table_option ::= COMMENT NK_STRING */ - -2, /* (221) alter_table_option ::= TTL NK_INTEGER */ - -1, /* (222) duration_list ::= duration_literal */ - -3, /* (223) duration_list ::= duration_list NK_COMMA duration_literal */ - -1, /* (224) rollup_func_list ::= rollup_func_name */ - -3, /* (225) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - -1, /* (226) rollup_func_name ::= function_name */ - -1, /* (227) rollup_func_name ::= FIRST */ - -1, /* (228) rollup_func_name ::= LAST */ - -1, /* (229) col_name_list ::= col_name */ - -3, /* (230) col_name_list ::= col_name_list NK_COMMA col_name */ - -1, /* (231) col_name ::= column_name */ - -2, /* (232) cmd ::= SHOW DNODES */ - -2, /* (233) cmd ::= SHOW USERS */ - -3, /* (234) cmd ::= SHOW USER PRIVILEGES */ - -2, /* (235) cmd ::= SHOW DATABASES */ - -4, /* (236) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - -4, /* (237) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - -3, /* (238) cmd ::= SHOW db_name_cond_opt VGROUPS */ - -2, /* (239) cmd ::= SHOW MNODES */ - -2, /* (240) cmd ::= SHOW QNODES */ - -2, /* (241) cmd ::= SHOW FUNCTIONS */ - -5, /* (242) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - -6, /* (243) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - -2, /* (244) cmd ::= SHOW STREAMS */ - -2, /* (245) cmd ::= SHOW ACCOUNTS */ - -2, /* (246) cmd ::= SHOW APPS */ - -2, /* (247) cmd ::= SHOW CONNECTIONS */ - -2, /* (248) cmd ::= SHOW LICENCES */ - -2, /* (249) cmd ::= SHOW GRANTS */ - -4, /* (250) cmd ::= SHOW CREATE DATABASE db_name */ - -4, /* (251) cmd ::= SHOW CREATE TABLE full_table_name */ - -4, /* (252) cmd ::= SHOW CREATE STABLE full_table_name */ - -2, /* (253) cmd ::= SHOW QUERIES */ - -2, /* (254) cmd ::= SHOW SCORES */ - -2, /* (255) cmd ::= SHOW TOPICS */ - -2, /* (256) cmd ::= SHOW VARIABLES */ - -3, /* (257) cmd ::= SHOW CLUSTER VARIABLES */ - -3, /* (258) cmd ::= SHOW LOCAL VARIABLES */ - -5, /* (259) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - -2, /* (260) cmd ::= SHOW BNODES */ - -2, /* (261) cmd ::= SHOW SNODES */ - -2, /* (262) cmd ::= SHOW CLUSTER */ - -2, /* (263) cmd ::= SHOW TRANSACTIONS */ - -4, /* (264) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - -2, /* (265) cmd ::= SHOW CONSUMERS */ - -2, /* (266) cmd ::= SHOW SUBSCRIPTIONS */ - -5, /* (267) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - -6, /* (268) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - -7, /* (269) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - -8, /* (270) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - -5, /* (271) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - -2, /* (272) cmd ::= SHOW VNODES */ - -3, /* (273) cmd ::= SHOW db_name_cond_opt ALIVE */ - -3, /* (274) cmd ::= SHOW CLUSTER ALIVE */ - 0, /* (275) db_name_cond_opt ::= */ - -2, /* (276) db_name_cond_opt ::= db_name NK_DOT */ - 0, /* (277) like_pattern_opt ::= */ - -2, /* (278) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (279) table_name_cond ::= table_name */ - 0, /* (280) from_db_opt ::= */ - -2, /* (281) from_db_opt ::= FROM db_name */ - 0, /* (282) tag_list_opt ::= */ - -1, /* (283) tag_list_opt ::= tag_item */ - -3, /* (284) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (285) tag_item ::= TBNAME */ - -1, /* (286) tag_item ::= QTAGS */ - -1, /* (287) tag_item ::= column_name */ - -2, /* (288) tag_item ::= column_name column_alias */ - -3, /* (289) tag_item ::= column_name AS column_alias */ - -8, /* (290) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ - -9, /* (291) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (292) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (293) full_index_name ::= index_name */ - -3, /* (294) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (295) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (296) 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, /* (297) func_list ::= func */ - -3, /* (298) func_list ::= func_list NK_COMMA func */ - -4, /* (299) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (300) sma_func_name ::= function_name */ - -1, /* (301) sma_func_name ::= COUNT */ - -1, /* (302) sma_func_name ::= FIRST */ - -1, /* (303) sma_func_name ::= LAST */ - -1, /* (304) sma_func_name ::= LAST_ROW */ - 0, /* (305) sma_stream_opt ::= */ - -3, /* (306) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (307) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (308) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -1, /* (309) with_meta ::= AS */ - -3, /* (310) with_meta ::= WITH META AS */ - -3, /* (311) with_meta ::= ONLY META AS */ - -6, /* (312) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (313) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - -8, /* (314) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - -4, /* (315) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (316) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (317) cmd ::= DESC full_table_name */ - -2, /* (318) cmd ::= DESCRIBE full_table_name */ - -3, /* (319) cmd ::= RESET QUERY CACHE */ - -4, /* (320) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (321) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 0, /* (322) analyze_opt ::= */ - -1, /* (323) analyze_opt ::= ANALYZE */ - 0, /* (324) explain_options ::= */ - -3, /* (325) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (326) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (327) 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, /* (328) cmd ::= DROP FUNCTION exists_opt function_name */ - 0, /* (329) agg_func_opt ::= */ - -1, /* (330) agg_func_opt ::= AGGREGATE */ - 0, /* (331) bufsize_opt ::= */ - -2, /* (332) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 0, /* (333) language_opt ::= */ - -2, /* (334) language_opt ::= LANGUAGE NK_STRING */ - 0, /* (335) or_replace_opt ::= */ - -2, /* (336) or_replace_opt ::= OR REPLACE */ - -12, /* (337) 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, /* (338) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (339) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (340) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 0, /* (341) col_list_opt ::= */ - -3, /* (342) col_list_opt ::= NK_LP col_name_list NK_RP */ - 0, /* (343) tag_def_or_ref_opt ::= */ - -1, /* (344) tag_def_or_ref_opt ::= tags_def */ - -4, /* (345) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 0, /* (346) stream_options ::= */ - -3, /* (347) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (348) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -4, /* (349) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (350) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (351) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (352) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (353) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (354) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 0, /* (355) subtable_opt ::= */ - -4, /* (356) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 0, /* (357) ignore_opt ::= */ - -2, /* (358) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (359) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (360) cmd ::= KILL QUERY NK_STRING */ - -3, /* (361) cmd ::= KILL TRANSACTION NK_INTEGER */ - -2, /* (362) cmd ::= BALANCE VGROUP */ - -3, /* (363) cmd ::= BALANCE VGROUP LEADER */ - -4, /* (364) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (365) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (366) cmd ::= SPLIT VGROUP NK_INTEGER */ - -2, /* (367) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (368) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (369) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (370) cmd ::= query_or_subquery */ - -1, /* (371) cmd ::= insert_query */ - -7, /* (372) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (373) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (374) literal ::= NK_INTEGER */ - -1, /* (375) literal ::= NK_FLOAT */ - -1, /* (376) literal ::= NK_STRING */ - -1, /* (377) literal ::= NK_BOOL */ - -2, /* (378) literal ::= TIMESTAMP NK_STRING */ - -1, /* (379) literal ::= duration_literal */ - -1, /* (380) literal ::= NULL */ - -1, /* (381) literal ::= NK_QUESTION */ - -1, /* (382) duration_literal ::= NK_VARIABLE */ - -1, /* (383) signed ::= NK_INTEGER */ - -2, /* (384) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (385) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (386) signed ::= NK_FLOAT */ - -2, /* (387) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (388) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (389) signed_literal ::= signed */ - -1, /* (390) signed_literal ::= NK_STRING */ - -1, /* (391) signed_literal ::= NK_BOOL */ - -2, /* (392) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (393) signed_literal ::= duration_literal */ - -1, /* (394) signed_literal ::= NULL */ - -1, /* (395) signed_literal ::= literal_func */ - -1, /* (396) signed_literal ::= NK_QUESTION */ - -1, /* (397) literal_list ::= signed_literal */ - -3, /* (398) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (399) db_name ::= NK_ID */ - -1, /* (400) table_name ::= NK_ID */ - -1, /* (401) column_name ::= NK_ID */ - -1, /* (402) function_name ::= NK_ID */ - -1, /* (403) table_alias ::= NK_ID */ - -1, /* (404) column_alias ::= NK_ID */ - -1, /* (405) user_name ::= NK_ID */ - -1, /* (406) topic_name ::= NK_ID */ - -1, /* (407) stream_name ::= NK_ID */ - -1, /* (408) cgroup_name ::= NK_ID */ - -1, /* (409) index_name ::= NK_ID */ - -1, /* (410) expr_or_subquery ::= expression */ - -1, /* (411) expression ::= literal */ - -1, /* (412) expression ::= pseudo_column */ - -1, /* (413) expression ::= column_reference */ - -1, /* (414) expression ::= function_expression */ - -1, /* (415) expression ::= case_when_expression */ - -3, /* (416) expression ::= NK_LP expression NK_RP */ - -2, /* (417) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (418) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (419) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (420) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (421) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (422) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (423) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (424) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (425) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (426) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (427) expression_list ::= expr_or_subquery */ - -3, /* (428) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (429) column_reference ::= column_name */ - -3, /* (430) column_reference ::= table_name NK_DOT column_name */ - -1, /* (431) pseudo_column ::= ROWTS */ - -1, /* (432) pseudo_column ::= TBNAME */ - -3, /* (433) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (434) pseudo_column ::= QSTART */ - -1, /* (435) pseudo_column ::= QEND */ - -1, /* (436) pseudo_column ::= QDURATION */ - -1, /* (437) pseudo_column ::= WSTART */ - -1, /* (438) pseudo_column ::= WEND */ - -1, /* (439) pseudo_column ::= WDURATION */ - -1, /* (440) pseudo_column ::= IROWTS */ - -1, /* (441) pseudo_column ::= ISFILLED */ - -1, /* (442) pseudo_column ::= QTAGS */ - -4, /* (443) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (444) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (445) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -1, /* (446) function_expression ::= literal_func */ - -3, /* (447) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (448) literal_func ::= NOW */ - -1, /* (449) noarg_func ::= NOW */ - -1, /* (450) noarg_func ::= TODAY */ - -1, /* (451) noarg_func ::= TIMEZONE */ - -1, /* (452) noarg_func ::= DATABASE */ - -1, /* (453) noarg_func ::= CLIENT_VERSION */ - -1, /* (454) noarg_func ::= SERVER_VERSION */ - -1, /* (455) noarg_func ::= SERVER_STATUS */ - -1, /* (456) noarg_func ::= CURRENT_USER */ - -1, /* (457) noarg_func ::= USER */ - -1, /* (458) star_func ::= COUNT */ - -1, /* (459) star_func ::= FIRST */ - -1, /* (460) star_func ::= LAST */ - -1, /* (461) star_func ::= LAST_ROW */ - -1, /* (462) star_func_para_list ::= NK_STAR */ - -1, /* (463) star_func_para_list ::= other_para_list */ - -1, /* (464) other_para_list ::= star_func_para */ - -3, /* (465) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (466) star_func_para ::= expr_or_subquery */ - -3, /* (467) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (468) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (469) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (470) when_then_list ::= when_then_expr */ - -2, /* (471) when_then_list ::= when_then_list when_then_expr */ - -4, /* (472) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (473) case_when_else_opt ::= */ - -2, /* (474) case_when_else_opt ::= ELSE common_expression */ - -3, /* (475) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (476) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (477) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (478) predicate ::= expr_or_subquery IS NULL */ - -4, /* (479) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (480) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (481) compare_op ::= NK_LT */ - -1, /* (482) compare_op ::= NK_GT */ - -1, /* (483) compare_op ::= NK_LE */ - -1, /* (484) compare_op ::= NK_GE */ - -1, /* (485) compare_op ::= NK_NE */ - -1, /* (486) compare_op ::= NK_EQ */ - -1, /* (487) compare_op ::= LIKE */ - -2, /* (488) compare_op ::= NOT LIKE */ - -1, /* (489) compare_op ::= MATCH */ - -1, /* (490) compare_op ::= NMATCH */ - -1, /* (491) compare_op ::= CONTAINS */ - -1, /* (492) in_op ::= IN */ - -2, /* (493) in_op ::= NOT IN */ - -3, /* (494) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (495) boolean_value_expression ::= boolean_primary */ - -2, /* (496) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (497) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (498) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (499) boolean_primary ::= predicate */ - -3, /* (500) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (501) common_expression ::= expr_or_subquery */ - -1, /* (502) common_expression ::= boolean_value_expression */ - 0, /* (503) from_clause_opt ::= */ - -2, /* (504) from_clause_opt ::= FROM table_reference_list */ - -1, /* (505) table_reference_list ::= table_reference */ - -3, /* (506) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (507) table_reference ::= table_primary */ - -1, /* (508) table_reference ::= joined_table */ - -2, /* (509) table_primary ::= table_name alias_opt */ - -4, /* (510) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (511) table_primary ::= subquery alias_opt */ - -1, /* (512) table_primary ::= parenthesized_joined_table */ - 0, /* (513) alias_opt ::= */ - -1, /* (514) alias_opt ::= table_alias */ - -2, /* (515) alias_opt ::= AS table_alias */ - -3, /* (516) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (517) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -6, /* (518) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 0, /* (519) join_type ::= */ - -1, /* (520) join_type ::= INNER */ - -14, /* (521) query_specification ::= SELECT hint_list tag_mode_opt set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (522) hint_list ::= */ - -1, /* (523) hint_list ::= NK_HINT */ - 0, /* (524) tag_mode_opt ::= */ - -1, /* (525) tag_mode_opt ::= TAGS */ - 0, /* (526) set_quantifier_opt ::= */ - -1, /* (527) set_quantifier_opt ::= DISTINCT */ - -1, /* (528) set_quantifier_opt ::= ALL */ - -1, /* (529) select_list ::= select_item */ - -3, /* (530) select_list ::= select_list NK_COMMA select_item */ - -1, /* (531) select_item ::= NK_STAR */ - -1, /* (532) select_item ::= common_expression */ - -2, /* (533) select_item ::= common_expression column_alias */ - -3, /* (534) select_item ::= common_expression AS column_alias */ - -3, /* (535) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (536) where_clause_opt ::= */ - -2, /* (537) where_clause_opt ::= WHERE search_condition */ - 0, /* (538) partition_by_clause_opt ::= */ - -3, /* (539) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (540) partition_list ::= partition_item */ - -3, /* (541) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (542) partition_item ::= expr_or_subquery */ - -2, /* (543) partition_item ::= expr_or_subquery column_alias */ - -3, /* (544) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (545) twindow_clause_opt ::= */ - -6, /* (546) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - -4, /* (547) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (548) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (549) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (550) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 0, /* (551) sliding_opt ::= */ - -4, /* (552) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - 0, /* (553) fill_opt ::= */ - -4, /* (554) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (555) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (556) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (557) fill_mode ::= NONE */ - -1, /* (558) fill_mode ::= PREV */ - -1, /* (559) fill_mode ::= NULL */ - -1, /* (560) fill_mode ::= NULL_F */ - -1, /* (561) fill_mode ::= LINEAR */ - -1, /* (562) fill_mode ::= NEXT */ - 0, /* (563) group_by_clause_opt ::= */ - -3, /* (564) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (565) group_by_list ::= expr_or_subquery */ - -3, /* (566) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (567) having_clause_opt ::= */ - -2, /* (568) having_clause_opt ::= HAVING search_condition */ - 0, /* (569) range_opt ::= */ - -6, /* (570) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (571) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (572) every_opt ::= */ - -4, /* (573) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (574) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (575) query_simple ::= query_specification */ - -1, /* (576) query_simple ::= union_query_expression */ - -4, /* (577) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (578) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (579) query_simple_or_subquery ::= query_simple */ - -1, /* (580) query_simple_or_subquery ::= subquery */ - -1, /* (581) query_or_subquery ::= query_expression */ - -1, /* (582) query_or_subquery ::= subquery */ - 0, /* (583) order_by_clause_opt ::= */ - -3, /* (584) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (585) slimit_clause_opt ::= */ - -2, /* (586) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (587) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (588) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (589) limit_clause_opt ::= */ - -2, /* (590) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (591) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (592) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (593) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (594) subquery ::= NK_LP subquery NK_RP */ - -1, /* (595) search_condition ::= common_expression */ - -1, /* (596) sort_specification_list ::= sort_specification */ - -3, /* (597) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (598) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (599) ordering_specification_opt ::= */ - -1, /* (600) ordering_specification_opt ::= ASC */ - -1, /* (601) ordering_specification_opt ::= DESC */ - 0, /* (602) null_ordering_opt ::= */ - -2, /* (603) null_ordering_opt ::= NULLS FIRST */ - -2, /* (604) null_ordering_opt ::= NULLS LAST */ + -1, /* (182) type_name ::= BOOL */ + -1, /* (183) type_name ::= TINYINT */ + -1, /* (184) type_name ::= SMALLINT */ + -1, /* (185) type_name ::= INT */ + -1, /* (186) type_name ::= INTEGER */ + -1, /* (187) type_name ::= BIGINT */ + -1, /* (188) type_name ::= FLOAT */ + -1, /* (189) type_name ::= DOUBLE */ + -4, /* (190) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + -1, /* (191) type_name ::= TIMESTAMP */ + -4, /* (192) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + -2, /* (193) type_name ::= TINYINT UNSIGNED */ + -2, /* (194) type_name ::= SMALLINT UNSIGNED */ + -2, /* (195) type_name ::= INT UNSIGNED */ + -2, /* (196) type_name ::= BIGINT UNSIGNED */ + -1, /* (197) type_name ::= JSON */ + -4, /* (198) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + -1, /* (199) type_name ::= MEDIUMBLOB */ + -1, /* (200) type_name ::= BLOB */ + -4, /* (201) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + -4, /* (202) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + -1, /* (203) type_name ::= DECIMAL */ + -4, /* (204) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + -6, /* (205) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (206) tags_def_opt ::= */ + -1, /* (207) tags_def_opt ::= tags_def */ + -4, /* (208) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 0, /* (209) table_options ::= */ + -3, /* (210) table_options ::= table_options COMMENT NK_STRING */ + -3, /* (211) table_options ::= table_options MAX_DELAY duration_list */ + -3, /* (212) table_options ::= table_options WATERMARK duration_list */ + -5, /* (213) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + -3, /* (214) table_options ::= table_options TTL NK_INTEGER */ + -5, /* (215) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + -3, /* (216) table_options ::= table_options DELETE_MARK duration_list */ + -1, /* (217) alter_table_options ::= alter_table_option */ + -2, /* (218) alter_table_options ::= alter_table_options alter_table_option */ + -2, /* (219) alter_table_option ::= COMMENT NK_STRING */ + -2, /* (220) alter_table_option ::= TTL NK_INTEGER */ + -1, /* (221) duration_list ::= duration_literal */ + -3, /* (222) duration_list ::= duration_list NK_COMMA duration_literal */ + -1, /* (223) rollup_func_list ::= rollup_func_name */ + -3, /* (224) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + -1, /* (225) rollup_func_name ::= function_name */ + -1, /* (226) rollup_func_name ::= FIRST */ + -1, /* (227) rollup_func_name ::= LAST */ + -1, /* (228) col_name_list ::= col_name */ + -3, /* (229) col_name_list ::= col_name_list NK_COMMA col_name */ + -1, /* (230) col_name ::= column_name */ + -2, /* (231) cmd ::= SHOW DNODES */ + -2, /* (232) cmd ::= SHOW USERS */ + -3, /* (233) cmd ::= SHOW USER PRIVILEGES */ + -2, /* (234) cmd ::= SHOW DATABASES */ + -4, /* (235) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + -4, /* (236) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + -3, /* (237) cmd ::= SHOW db_name_cond_opt VGROUPS */ + -2, /* (238) cmd ::= SHOW MNODES */ + -2, /* (239) cmd ::= SHOW QNODES */ + -2, /* (240) cmd ::= SHOW FUNCTIONS */ + -5, /* (241) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + -6, /* (242) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + -2, /* (243) cmd ::= SHOW STREAMS */ + -2, /* (244) cmd ::= SHOW ACCOUNTS */ + -2, /* (245) cmd ::= SHOW APPS */ + -2, /* (246) cmd ::= SHOW CONNECTIONS */ + -2, /* (247) cmd ::= SHOW LICENCES */ + -2, /* (248) cmd ::= SHOW GRANTS */ + -4, /* (249) cmd ::= SHOW CREATE DATABASE db_name */ + -4, /* (250) cmd ::= SHOW CREATE TABLE full_table_name */ + -4, /* (251) cmd ::= SHOW CREATE STABLE full_table_name */ + -2, /* (252) cmd ::= SHOW QUERIES */ + -2, /* (253) cmd ::= SHOW SCORES */ + -2, /* (254) cmd ::= SHOW TOPICS */ + -2, /* (255) cmd ::= SHOW VARIABLES */ + -3, /* (256) cmd ::= SHOW CLUSTER VARIABLES */ + -3, /* (257) cmd ::= SHOW LOCAL VARIABLES */ + -5, /* (258) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + -2, /* (259) cmd ::= SHOW BNODES */ + -2, /* (260) cmd ::= SHOW SNODES */ + -2, /* (261) cmd ::= SHOW CLUSTER */ + -2, /* (262) cmd ::= SHOW TRANSACTIONS */ + -4, /* (263) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + -2, /* (264) cmd ::= SHOW CONSUMERS */ + -2, /* (265) cmd ::= SHOW SUBSCRIPTIONS */ + -5, /* (266) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + -6, /* (267) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + -7, /* (268) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + -8, /* (269) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + -5, /* (270) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + -2, /* (271) cmd ::= SHOW VNODES */ + -3, /* (272) cmd ::= SHOW db_name_cond_opt ALIVE */ + -3, /* (273) cmd ::= SHOW CLUSTER ALIVE */ + 0, /* (274) db_name_cond_opt ::= */ + -2, /* (275) db_name_cond_opt ::= db_name NK_DOT */ + 0, /* (276) like_pattern_opt ::= */ + -2, /* (277) like_pattern_opt ::= LIKE NK_STRING */ + -1, /* (278) table_name_cond ::= table_name */ + 0, /* (279) from_db_opt ::= */ + -2, /* (280) from_db_opt ::= FROM db_name */ + 0, /* (281) tag_list_opt ::= */ + -1, /* (282) tag_list_opt ::= tag_item */ + -3, /* (283) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + -1, /* (284) tag_item ::= TBNAME */ + -1, /* (285) tag_item ::= QTAGS */ + -1, /* (286) tag_item ::= column_name */ + -2, /* (287) tag_item ::= column_name column_alias */ + -3, /* (288) tag_item ::= column_name AS column_alias */ + -8, /* (289) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ + -9, /* (290) cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ + -4, /* (291) cmd ::= DROP INDEX exists_opt full_index_name */ + -1, /* (292) full_index_name ::= index_name */ + -3, /* (293) full_index_name ::= db_name NK_DOT index_name */ + -10, /* (294) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + -12, /* (295) 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, /* (296) func_list ::= func */ + -3, /* (297) func_list ::= func_list NK_COMMA func */ + -4, /* (298) func ::= sma_func_name NK_LP expression_list NK_RP */ + -1, /* (299) sma_func_name ::= function_name */ + -1, /* (300) sma_func_name ::= COUNT */ + -1, /* (301) sma_func_name ::= FIRST */ + -1, /* (302) sma_func_name ::= LAST */ + -1, /* (303) sma_func_name ::= LAST_ROW */ + 0, /* (304) sma_stream_opt ::= */ + -3, /* (305) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + -3, /* (306) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + -3, /* (307) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + -1, /* (308) with_meta ::= AS */ + -3, /* (309) with_meta ::= WITH META AS */ + -3, /* (310) with_meta ::= ONLY META AS */ + -6, /* (311) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + -7, /* (312) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + -8, /* (313) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + -4, /* (314) cmd ::= DROP TOPIC exists_opt topic_name */ + -7, /* (315) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + -2, /* (316) cmd ::= DESC full_table_name */ + -2, /* (317) cmd ::= DESCRIBE full_table_name */ + -3, /* (318) cmd ::= RESET QUERY CACHE */ + -4, /* (319) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + -4, /* (320) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 0, /* (321) analyze_opt ::= */ + -1, /* (322) analyze_opt ::= ANALYZE */ + 0, /* (323) explain_options ::= */ + -3, /* (324) explain_options ::= explain_options VERBOSE NK_BOOL */ + -3, /* (325) explain_options ::= explain_options RATIO NK_FLOAT */ + -12, /* (326) 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, /* (327) cmd ::= DROP FUNCTION exists_opt function_name */ + 0, /* (328) agg_func_opt ::= */ + -1, /* (329) agg_func_opt ::= AGGREGATE */ + 0, /* (330) bufsize_opt ::= */ + -2, /* (331) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 0, /* (332) language_opt ::= */ + -2, /* (333) language_opt ::= LANGUAGE NK_STRING */ + 0, /* (334) or_replace_opt ::= */ + -2, /* (335) or_replace_opt ::= OR REPLACE */ + -12, /* (336) 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, /* (337) cmd ::= DROP STREAM exists_opt stream_name */ + -4, /* (338) cmd ::= PAUSE STREAM exists_opt stream_name */ + -5, /* (339) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 0, /* (340) col_list_opt ::= */ + -3, /* (341) col_list_opt ::= NK_LP col_name_list NK_RP */ + 0, /* (342) tag_def_or_ref_opt ::= */ + -1, /* (343) tag_def_or_ref_opt ::= tags_def */ + -4, /* (344) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 0, /* (345) stream_options ::= */ + -3, /* (346) stream_options ::= stream_options TRIGGER AT_ONCE */ + -3, /* (347) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + -4, /* (348) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + -3, /* (349) stream_options ::= stream_options WATERMARK duration_literal */ + -4, /* (350) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + -3, /* (351) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + -3, /* (352) stream_options ::= stream_options DELETE_MARK duration_literal */ + -4, /* (353) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 0, /* (354) subtable_opt ::= */ + -4, /* (355) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 0, /* (356) ignore_opt ::= */ + -2, /* (357) ignore_opt ::= IGNORE UNTREATED */ + -3, /* (358) cmd ::= KILL CONNECTION NK_INTEGER */ + -3, /* (359) cmd ::= KILL QUERY NK_STRING */ + -3, /* (360) cmd ::= KILL TRANSACTION NK_INTEGER */ + -2, /* (361) cmd ::= BALANCE VGROUP */ + -3, /* (362) cmd ::= BALANCE VGROUP LEADER */ + -4, /* (363) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + -4, /* (364) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + -3, /* (365) cmd ::= SPLIT VGROUP NK_INTEGER */ + -2, /* (366) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (367) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (368) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (369) cmd ::= query_or_subquery */ + -1, /* (370) cmd ::= insert_query */ + -7, /* (371) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (372) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (373) literal ::= NK_INTEGER */ + -1, /* (374) literal ::= NK_FLOAT */ + -1, /* (375) literal ::= NK_STRING */ + -1, /* (376) literal ::= NK_BOOL */ + -2, /* (377) literal ::= TIMESTAMP NK_STRING */ + -1, /* (378) literal ::= duration_literal */ + -1, /* (379) literal ::= NULL */ + -1, /* (380) literal ::= NK_QUESTION */ + -1, /* (381) duration_literal ::= NK_VARIABLE */ + -1, /* (382) signed ::= NK_INTEGER */ + -2, /* (383) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (384) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (385) signed ::= NK_FLOAT */ + -2, /* (386) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (387) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (388) signed_literal ::= signed */ + -1, /* (389) signed_literal ::= NK_STRING */ + -1, /* (390) signed_literal ::= NK_BOOL */ + -2, /* (391) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (392) signed_literal ::= duration_literal */ + -1, /* (393) signed_literal ::= NULL */ + -1, /* (394) signed_literal ::= literal_func */ + -1, /* (395) signed_literal ::= NK_QUESTION */ + -1, /* (396) literal_list ::= signed_literal */ + -3, /* (397) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (398) db_name ::= NK_ID */ + -1, /* (399) table_name ::= NK_ID */ + -1, /* (400) column_name ::= NK_ID */ + -1, /* (401) function_name ::= NK_ID */ + -1, /* (402) table_alias ::= NK_ID */ + -1, /* (403) column_alias ::= NK_ID */ + -1, /* (404) user_name ::= NK_ID */ + -1, /* (405) topic_name ::= NK_ID */ + -1, /* (406) stream_name ::= NK_ID */ + -1, /* (407) cgroup_name ::= NK_ID */ + -1, /* (408) index_name ::= NK_ID */ + -1, /* (409) expr_or_subquery ::= expression */ + -1, /* (410) expression ::= literal */ + -1, /* (411) expression ::= pseudo_column */ + -1, /* (412) expression ::= column_reference */ + -1, /* (413) expression ::= function_expression */ + -1, /* (414) expression ::= case_when_expression */ + -3, /* (415) expression ::= NK_LP expression NK_RP */ + -2, /* (416) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (417) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (418) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (419) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (420) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (421) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (422) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (423) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (424) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (425) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (426) expression_list ::= expr_or_subquery */ + -3, /* (427) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (428) column_reference ::= column_name */ + -3, /* (429) column_reference ::= table_name NK_DOT column_name */ + -1, /* (430) pseudo_column ::= ROWTS */ + -1, /* (431) pseudo_column ::= TBNAME */ + -3, /* (432) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (433) pseudo_column ::= QSTART */ + -1, /* (434) pseudo_column ::= QEND */ + -1, /* (435) pseudo_column ::= QDURATION */ + -1, /* (436) pseudo_column ::= WSTART */ + -1, /* (437) pseudo_column ::= WEND */ + -1, /* (438) pseudo_column ::= WDURATION */ + -1, /* (439) pseudo_column ::= IROWTS */ + -1, /* (440) pseudo_column ::= ISFILLED */ + -1, /* (441) pseudo_column ::= QTAGS */ + -4, /* (442) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (443) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (444) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -1, /* (445) function_expression ::= literal_func */ + -3, /* (446) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (447) literal_func ::= NOW */ + -1, /* (448) noarg_func ::= NOW */ + -1, /* (449) noarg_func ::= TODAY */ + -1, /* (450) noarg_func ::= TIMEZONE */ + -1, /* (451) noarg_func ::= DATABASE */ + -1, /* (452) noarg_func ::= CLIENT_VERSION */ + -1, /* (453) noarg_func ::= SERVER_VERSION */ + -1, /* (454) noarg_func ::= SERVER_STATUS */ + -1, /* (455) noarg_func ::= CURRENT_USER */ + -1, /* (456) noarg_func ::= USER */ + -1, /* (457) star_func ::= COUNT */ + -1, /* (458) star_func ::= FIRST */ + -1, /* (459) star_func ::= LAST */ + -1, /* (460) star_func ::= LAST_ROW */ + -1, /* (461) star_func_para_list ::= NK_STAR */ + -1, /* (462) star_func_para_list ::= other_para_list */ + -1, /* (463) other_para_list ::= star_func_para */ + -3, /* (464) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (465) star_func_para ::= expr_or_subquery */ + -3, /* (466) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (467) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (468) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (469) when_then_list ::= when_then_expr */ + -2, /* (470) when_then_list ::= when_then_list when_then_expr */ + -4, /* (471) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (472) case_when_else_opt ::= */ + -2, /* (473) case_when_else_opt ::= ELSE common_expression */ + -3, /* (474) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (475) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (476) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (477) predicate ::= expr_or_subquery IS NULL */ + -4, /* (478) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (479) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (480) compare_op ::= NK_LT */ + -1, /* (481) compare_op ::= NK_GT */ + -1, /* (482) compare_op ::= NK_LE */ + -1, /* (483) compare_op ::= NK_GE */ + -1, /* (484) compare_op ::= NK_NE */ + -1, /* (485) compare_op ::= NK_EQ */ + -1, /* (486) compare_op ::= LIKE */ + -2, /* (487) compare_op ::= NOT LIKE */ + -1, /* (488) compare_op ::= MATCH */ + -1, /* (489) compare_op ::= NMATCH */ + -1, /* (490) compare_op ::= CONTAINS */ + -1, /* (491) in_op ::= IN */ + -2, /* (492) in_op ::= NOT IN */ + -3, /* (493) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (494) boolean_value_expression ::= boolean_primary */ + -2, /* (495) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (496) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (497) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (498) boolean_primary ::= predicate */ + -3, /* (499) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (500) common_expression ::= expr_or_subquery */ + -1, /* (501) common_expression ::= boolean_value_expression */ + 0, /* (502) from_clause_opt ::= */ + -2, /* (503) from_clause_opt ::= FROM table_reference_list */ + -1, /* (504) table_reference_list ::= table_reference */ + -3, /* (505) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (506) table_reference ::= table_primary */ + -1, /* (507) table_reference ::= joined_table */ + -2, /* (508) table_primary ::= table_name alias_opt */ + -4, /* (509) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (510) table_primary ::= subquery alias_opt */ + -1, /* (511) table_primary ::= parenthesized_joined_table */ + 0, /* (512) alias_opt ::= */ + -1, /* (513) alias_opt ::= table_alias */ + -2, /* (514) alias_opt ::= AS table_alias */ + -3, /* (515) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (516) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -6, /* (517) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 0, /* (518) join_type ::= */ + -1, /* (519) join_type ::= INNER */ + -14, /* (520) query_specification ::= SELECT hint_list tag_mode_opt set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 0, /* (521) hint_list ::= */ + -1, /* (522) hint_list ::= NK_HINT */ + 0, /* (523) tag_mode_opt ::= */ + -1, /* (524) tag_mode_opt ::= TAGS */ + 0, /* (525) set_quantifier_opt ::= */ + -1, /* (526) set_quantifier_opt ::= DISTINCT */ + -1, /* (527) set_quantifier_opt ::= ALL */ + -1, /* (528) select_list ::= select_item */ + -3, /* (529) select_list ::= select_list NK_COMMA select_item */ + -1, /* (530) select_item ::= NK_STAR */ + -1, /* (531) select_item ::= common_expression */ + -2, /* (532) select_item ::= common_expression column_alias */ + -3, /* (533) select_item ::= common_expression AS column_alias */ + -3, /* (534) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (535) where_clause_opt ::= */ + -2, /* (536) where_clause_opt ::= WHERE search_condition */ + 0, /* (537) partition_by_clause_opt ::= */ + -3, /* (538) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (539) partition_list ::= partition_item */ + -3, /* (540) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (541) partition_item ::= expr_or_subquery */ + -2, /* (542) partition_item ::= expr_or_subquery column_alias */ + -3, /* (543) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (544) twindow_clause_opt ::= */ + -6, /* (545) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + -4, /* (546) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (547) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (548) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (549) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 0, /* (550) sliding_opt ::= */ + -4, /* (551) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + 0, /* (552) fill_opt ::= */ + -4, /* (553) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (554) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (555) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (556) fill_mode ::= NONE */ + -1, /* (557) fill_mode ::= PREV */ + -1, /* (558) fill_mode ::= NULL */ + -1, /* (559) fill_mode ::= NULL_F */ + -1, /* (560) fill_mode ::= LINEAR */ + -1, /* (561) fill_mode ::= NEXT */ + 0, /* (562) group_by_clause_opt ::= */ + -3, /* (563) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (564) group_by_list ::= expr_or_subquery */ + -3, /* (565) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (566) having_clause_opt ::= */ + -2, /* (567) having_clause_opt ::= HAVING search_condition */ + 0, /* (568) range_opt ::= */ + -6, /* (569) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (570) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (571) every_opt ::= */ + -4, /* (572) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (573) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (574) query_simple ::= query_specification */ + -1, /* (575) query_simple ::= union_query_expression */ + -4, /* (576) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (577) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (578) query_simple_or_subquery ::= query_simple */ + -1, /* (579) query_simple_or_subquery ::= subquery */ + -1, /* (580) query_or_subquery ::= query_expression */ + -1, /* (581) query_or_subquery ::= subquery */ + 0, /* (582) order_by_clause_opt ::= */ + -3, /* (583) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (584) slimit_clause_opt ::= */ + -2, /* (585) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (586) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (587) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (588) limit_clause_opt ::= */ + -2, /* (589) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (590) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (591) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (592) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (593) subquery ::= NK_LP subquery NK_RP */ + -1, /* (594) search_condition ::= common_expression */ + -1, /* (595) sort_specification_list ::= sort_specification */ + -3, /* (596) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (597) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (598) ordering_specification_opt ::= */ + -1, /* (599) ordering_specification_opt ::= ASC */ + -1, /* (600) ordering_specification_opt ::= DESC */ + 0, /* (601) null_ordering_opt ::= */ + -2, /* (602) null_ordering_opt ::= NULLS FIRST */ + -2, /* (603) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -4609,25 +4606,25 @@ static YYACTIONTYPE yy_reduce( case 44: /* with_opt ::= */ case 144: /* start_opt ::= */ yytestcase(yyruleno==144); case 148: /* end_opt ::= */ yytestcase(yyruleno==148); - case 277: /* like_pattern_opt ::= */ yytestcase(yyruleno==277); - case 355: /* subtable_opt ::= */ yytestcase(yyruleno==355); - case 473: /* case_when_else_opt ::= */ yytestcase(yyruleno==473); - case 503: /* from_clause_opt ::= */ yytestcase(yyruleno==503); - case 536: /* where_clause_opt ::= */ yytestcase(yyruleno==536); - case 545: /* twindow_clause_opt ::= */ yytestcase(yyruleno==545); - case 551: /* sliding_opt ::= */ yytestcase(yyruleno==551); - case 553: /* fill_opt ::= */ yytestcase(yyruleno==553); - case 567: /* having_clause_opt ::= */ yytestcase(yyruleno==567); - case 569: /* range_opt ::= */ yytestcase(yyruleno==569); - case 572: /* every_opt ::= */ yytestcase(yyruleno==572); - case 585: /* slimit_clause_opt ::= */ yytestcase(yyruleno==585); - case 589: /* limit_clause_opt ::= */ yytestcase(yyruleno==589); + case 276: /* like_pattern_opt ::= */ yytestcase(yyruleno==276); + case 354: /* subtable_opt ::= */ yytestcase(yyruleno==354); + case 472: /* case_when_else_opt ::= */ yytestcase(yyruleno==472); + case 502: /* from_clause_opt ::= */ yytestcase(yyruleno==502); + case 535: /* where_clause_opt ::= */ yytestcase(yyruleno==535); + case 544: /* twindow_clause_opt ::= */ yytestcase(yyruleno==544); + case 550: /* sliding_opt ::= */ yytestcase(yyruleno==550); + case 552: /* fill_opt ::= */ yytestcase(yyruleno==552); + case 566: /* having_clause_opt ::= */ yytestcase(yyruleno==566); + case 568: /* range_opt ::= */ yytestcase(yyruleno==568); + case 571: /* every_opt ::= */ yytestcase(yyruleno==571); + case 584: /* slimit_clause_opt ::= */ yytestcase(yyruleno==584); + case 588: /* limit_clause_opt ::= */ yytestcase(yyruleno==588); { yymsp[1].minor.yy952 = NULL; } break; case 45: /* with_opt ::= WITH search_condition */ - case 504: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==504); - case 537: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==537); - case 568: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==568); + case 503: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==503); + case 536: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==536); + case 567: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==567); { yymsp[-1].minor.yy952 = yymsp[0].minor.yy952; } break; case 46: /* cmd ::= CREATE DNODE dnode_endpoint */ @@ -4666,54 +4663,54 @@ static YYACTIONTYPE yy_reduce( case 57: /* dnode_endpoint ::= NK_STRING */ case 58: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==58); case 59: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==59); - case 301: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==301); - case 302: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==302); - case 303: /* sma_func_name ::= LAST */ yytestcase(yyruleno==303); - case 304: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==304); - case 399: /* db_name ::= NK_ID */ yytestcase(yyruleno==399); - case 400: /* table_name ::= NK_ID */ yytestcase(yyruleno==400); - case 401: /* column_name ::= NK_ID */ yytestcase(yyruleno==401); - case 402: /* function_name ::= NK_ID */ yytestcase(yyruleno==402); - case 403: /* table_alias ::= NK_ID */ yytestcase(yyruleno==403); - case 404: /* column_alias ::= NK_ID */ yytestcase(yyruleno==404); - case 405: /* user_name ::= NK_ID */ yytestcase(yyruleno==405); - case 406: /* topic_name ::= NK_ID */ yytestcase(yyruleno==406); - case 407: /* stream_name ::= NK_ID */ yytestcase(yyruleno==407); - case 408: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==408); - case 409: /* index_name ::= NK_ID */ yytestcase(yyruleno==409); - case 449: /* noarg_func ::= NOW */ yytestcase(yyruleno==449); - case 450: /* noarg_func ::= TODAY */ yytestcase(yyruleno==450); - case 451: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==451); - case 452: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==452); - case 453: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==453); - case 454: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==454); - case 455: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==455); - case 456: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==456); - case 457: /* noarg_func ::= USER */ yytestcase(yyruleno==457); - case 458: /* star_func ::= COUNT */ yytestcase(yyruleno==458); - case 459: /* star_func ::= FIRST */ yytestcase(yyruleno==459); - case 460: /* star_func ::= LAST */ yytestcase(yyruleno==460); - case 461: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==461); + case 300: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==300); + case 301: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==301); + case 302: /* sma_func_name ::= LAST */ yytestcase(yyruleno==302); + case 303: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==303); + case 398: /* db_name ::= NK_ID */ yytestcase(yyruleno==398); + case 399: /* table_name ::= NK_ID */ yytestcase(yyruleno==399); + case 400: /* column_name ::= NK_ID */ yytestcase(yyruleno==400); + case 401: /* function_name ::= NK_ID */ yytestcase(yyruleno==401); + case 402: /* table_alias ::= NK_ID */ yytestcase(yyruleno==402); + case 403: /* column_alias ::= NK_ID */ yytestcase(yyruleno==403); + case 404: /* user_name ::= NK_ID */ yytestcase(yyruleno==404); + case 405: /* topic_name ::= NK_ID */ yytestcase(yyruleno==405); + case 406: /* stream_name ::= NK_ID */ yytestcase(yyruleno==406); + case 407: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==407); + case 408: /* index_name ::= NK_ID */ yytestcase(yyruleno==408); + case 448: /* noarg_func ::= NOW */ yytestcase(yyruleno==448); + case 449: /* noarg_func ::= TODAY */ yytestcase(yyruleno==449); + case 450: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==450); + case 451: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==451); + case 452: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==452); + case 453: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==453); + case 454: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==454); + case 455: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==455); + case 456: /* noarg_func ::= USER */ yytestcase(yyruleno==456); + case 457: /* star_func ::= COUNT */ yytestcase(yyruleno==457); + case 458: /* star_func ::= FIRST */ yytestcase(yyruleno==458); + case 459: /* star_func ::= LAST */ yytestcase(yyruleno==459); + case 460: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==460); { yylhsminor.yy169 = yymsp[0].minor.yy0; } yymsp[0].minor.yy169 = yylhsminor.yy169; break; case 60: /* force_opt ::= */ case 84: /* not_exists_opt ::= */ yytestcase(yyruleno==84); case 86: /* exists_opt ::= */ yytestcase(yyruleno==86); - case 322: /* analyze_opt ::= */ yytestcase(yyruleno==322); - case 329: /* agg_func_opt ::= */ yytestcase(yyruleno==329); - case 335: /* or_replace_opt ::= */ yytestcase(yyruleno==335); - case 357: /* ignore_opt ::= */ yytestcase(yyruleno==357); - case 524: /* tag_mode_opt ::= */ yytestcase(yyruleno==524); - case 526: /* set_quantifier_opt ::= */ yytestcase(yyruleno==526); + case 321: /* analyze_opt ::= */ yytestcase(yyruleno==321); + case 328: /* agg_func_opt ::= */ yytestcase(yyruleno==328); + case 334: /* or_replace_opt ::= */ yytestcase(yyruleno==334); + case 356: /* ignore_opt ::= */ yytestcase(yyruleno==356); + case 523: /* tag_mode_opt ::= */ yytestcase(yyruleno==523); + case 525: /* set_quantifier_opt ::= */ yytestcase(yyruleno==525); { yymsp[1].minor.yy957 = false; } break; case 61: /* force_opt ::= FORCE */ case 62: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==62); - case 323: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==323); - case 330: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==330); - case 525: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==525); - case 527: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==527); + case 322: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==322); + case 329: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==329); + case 524: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==524); + case 526: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==526); { yymsp[0].minor.yy957 = true; } break; case 63: /* cmd ::= ALTER LOCAL NK_STRING */ @@ -4780,8 +4777,8 @@ static YYACTIONTYPE yy_reduce( { yymsp[-2].minor.yy957 = true; } break; case 85: /* exists_opt ::= IF EXISTS */ - case 336: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==336); - case 358: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==358); + case 335: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==335); + case 357: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==357); { yymsp[-1].minor.yy957 = true; } break; case 87: /* db_options ::= */ @@ -4973,7 +4970,7 @@ static YYACTIONTYPE yy_reduce( yymsp[0].minor.yy824 = yylhsminor.yy824; break; case 136: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 368: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==368); + case 367: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==367); { yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-2].minor.yy824, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy824 = yylhsminor.yy824; break; @@ -4989,31 +4986,31 @@ static YYACTIONTYPE yy_reduce( case 169: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==169); case 172: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==172); case 179: /* column_def_list ::= column_def */ yytestcase(yyruleno==179); - case 224: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==224); - case 229: /* col_name_list ::= col_name */ yytestcase(yyruleno==229); - case 283: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==283); - case 297: /* func_list ::= func */ yytestcase(yyruleno==297); - case 397: /* literal_list ::= signed_literal */ yytestcase(yyruleno==397); - case 464: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==464); - case 470: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==470); - case 529: /* select_list ::= select_item */ yytestcase(yyruleno==529); - case 540: /* partition_list ::= partition_item */ yytestcase(yyruleno==540); - case 596: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==596); + case 223: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==223); + case 228: /* col_name_list ::= col_name */ yytestcase(yyruleno==228); + case 282: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==282); + case 296: /* func_list ::= func */ yytestcase(yyruleno==296); + case 396: /* literal_list ::= signed_literal */ yytestcase(yyruleno==396); + case 463: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==463); + case 469: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==469); + case 528: /* select_list ::= select_item */ yytestcase(yyruleno==528); + case 539: /* partition_list ::= partition_item */ yytestcase(yyruleno==539); + case 595: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==595); { yylhsminor.yy824 = createNodeList(pCxt, yymsp[0].minor.yy952); } yymsp[0].minor.yy824 = yylhsminor.yy824; break; case 140: /* retention_list ::= retention_list NK_COMMA retention */ case 173: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==173); case 180: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==180); - case 225: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==225); - case 230: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==230); - case 284: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==284); - case 298: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==298); - case 398: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==398); - case 465: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==465); - case 530: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==530); - case 541: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==541); - case 597: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==597); + case 224: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==224); + case 229: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==229); + case 283: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==283); + case 297: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==297); + case 397: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==397); + case 464: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==464); + case 529: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==529); + case 540: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==540); + case 596: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==596); { yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-2].minor.yy824, yymsp[0].minor.yy952); } yymsp[-2].minor.yy824 = yylhsminor.yy824; break; @@ -5022,11 +5019,11 @@ static YYACTIONTYPE yy_reduce( yymsp[-2].minor.yy952 = yylhsminor.yy952; break; case 142: /* speed_opt ::= */ - case 331: /* bufsize_opt ::= */ yytestcase(yyruleno==331); + case 330: /* bufsize_opt ::= */ yytestcase(yyruleno==330); { yymsp[1].minor.yy480 = 0; } break; case 143: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 332: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==332); + case 331: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==331); { yymsp[-1].minor.yy480 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 145: /* start_opt ::= START WITH NK_INTEGER */ @@ -5055,8 +5052,8 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy952); } break; case 157: /* cmd ::= ALTER TABLE alter_table_clause */ - case 370: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==370); - case 371: /* cmd ::= insert_query */ yytestcase(yyruleno==371); + case 369: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==369); + case 370: /* cmd ::= insert_query */ yytestcase(yyruleno==370); { pCxt->pRootNode = yymsp[0].minor.yy952; } break; case 158: /* cmd ::= ALTER STABLE alter_table_clause */ @@ -5103,7 +5100,7 @@ static YYACTIONTYPE yy_reduce( yymsp[-5].minor.yy952 = yylhsminor.yy952; break; case 170: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 471: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==471); + case 470: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==470); { yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-1].minor.yy824, yymsp[0].minor.yy952); } yymsp[-1].minor.yy824 = yylhsminor.yy824; break; @@ -5116,17 +5113,17 @@ static YYACTIONTYPE yy_reduce( yymsp[-1].minor.yy952 = yylhsminor.yy952; break; case 175: /* specific_cols_opt ::= */ - case 207: /* tags_def_opt ::= */ yytestcase(yyruleno==207); - case 282: /* tag_list_opt ::= */ yytestcase(yyruleno==282); - case 341: /* col_list_opt ::= */ yytestcase(yyruleno==341); - case 343: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==343); - case 538: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==538); - case 563: /* group_by_clause_opt ::= */ yytestcase(yyruleno==563); - case 583: /* order_by_clause_opt ::= */ yytestcase(yyruleno==583); + case 206: /* tags_def_opt ::= */ yytestcase(yyruleno==206); + case 281: /* tag_list_opt ::= */ yytestcase(yyruleno==281); + case 340: /* col_list_opt ::= */ yytestcase(yyruleno==340); + case 342: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==342); + case 537: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==537); + case 562: /* group_by_clause_opt ::= */ yytestcase(yyruleno==562); + case 582: /* order_by_clause_opt ::= */ yytestcase(yyruleno==582); { yymsp[1].minor.yy824 = NULL; } break; case 176: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 342: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==342); + case 341: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==341); { yymsp[-2].minor.yy824 = yymsp[-1].minor.yy824; } break; case 177: /* full_table_name ::= table_name */ @@ -5141,567 +5138,563 @@ static YYACTIONTYPE yy_reduce( { yylhsminor.yy952 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84, NULL); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 182: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy952 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy169, yymsp[-2].minor.yy84, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy952 = yylhsminor.yy952; - break; - case 183: /* type_name ::= BOOL */ + case 182: /* type_name ::= BOOL */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 184: /* type_name ::= TINYINT */ + case 183: /* type_name ::= TINYINT */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 185: /* type_name ::= SMALLINT */ + case 184: /* type_name ::= SMALLINT */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 186: /* type_name ::= INT */ - case 187: /* type_name ::= INTEGER */ yytestcase(yyruleno==187); + case 185: /* type_name ::= INT */ + case 186: /* type_name ::= INTEGER */ yytestcase(yyruleno==186); { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 188: /* type_name ::= BIGINT */ + case 187: /* type_name ::= BIGINT */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 189: /* type_name ::= FLOAT */ + case 188: /* type_name ::= FLOAT */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 190: /* type_name ::= DOUBLE */ + case 189: /* type_name ::= DOUBLE */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 191: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + case 190: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 192: /* type_name ::= TIMESTAMP */ + case 191: /* type_name ::= TIMESTAMP */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 193: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + case 192: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 194: /* type_name ::= TINYINT UNSIGNED */ + case 193: /* type_name ::= TINYINT UNSIGNED */ { yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 195: /* type_name ::= SMALLINT UNSIGNED */ + case 194: /* type_name ::= SMALLINT UNSIGNED */ { yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 196: /* type_name ::= INT UNSIGNED */ + case 195: /* type_name ::= INT UNSIGNED */ { yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 197: /* type_name ::= BIGINT UNSIGNED */ + case 196: /* type_name ::= BIGINT UNSIGNED */ { yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 198: /* type_name ::= JSON */ + case 197: /* type_name ::= JSON */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 199: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + case 198: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 200: /* type_name ::= MEDIUMBLOB */ + case 199: /* type_name ::= MEDIUMBLOB */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 201: /* type_name ::= BLOB */ + case 200: /* type_name ::= BLOB */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 202: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + case 201: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 203: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + case 202: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } break; - case 204: /* type_name ::= DECIMAL */ + case 203: /* type_name ::= DECIMAL */ { yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 205: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + case 204: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy84 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 206: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + case 205: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ { yymsp[-5].minor.yy84 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 208: /* tags_def_opt ::= tags_def */ - case 344: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==344); - case 463: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==463); + case 207: /* tags_def_opt ::= tags_def */ + case 343: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==343); + case 462: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==462); { yylhsminor.yy824 = yymsp[0].minor.yy824; } yymsp[0].minor.yy824 = yylhsminor.yy824; break; - case 209: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ - case 345: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==345); + case 208: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ + case 344: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==344); { yymsp[-3].minor.yy824 = yymsp[-1].minor.yy824; } break; - case 210: /* table_options ::= */ + case 209: /* table_options ::= */ { yymsp[1].minor.yy952 = createDefaultTableOptions(pCxt); } break; - case 211: /* table_options ::= table_options COMMENT NK_STRING */ + case 210: /* table_options ::= table_options COMMENT NK_STRING */ { yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 212: /* table_options ::= table_options MAX_DELAY duration_list */ + case 211: /* table_options ::= table_options MAX_DELAY duration_list */ { yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy824); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 213: /* table_options ::= table_options WATERMARK duration_list */ + case 212: /* table_options ::= table_options WATERMARK duration_list */ { yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy824); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 214: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + case 213: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ { yylhsminor.yy952 = setTableOption(pCxt, yymsp[-4].minor.yy952, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy824); } yymsp[-4].minor.yy952 = yylhsminor.yy952; break; - case 215: /* table_options ::= table_options TTL NK_INTEGER */ + case 214: /* table_options ::= table_options TTL NK_INTEGER */ { yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 216: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + case 215: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ { yylhsminor.yy952 = setTableOption(pCxt, yymsp[-4].minor.yy952, TABLE_OPTION_SMA, yymsp[-1].minor.yy824); } yymsp[-4].minor.yy952 = yylhsminor.yy952; break; - case 217: /* table_options ::= table_options DELETE_MARK duration_list */ + case 216: /* table_options ::= table_options DELETE_MARK duration_list */ { yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy824); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 218: /* alter_table_options ::= alter_table_option */ + case 217: /* alter_table_options ::= alter_table_option */ { yylhsminor.yy952 = createAlterTableOptions(pCxt); yylhsminor.yy952 = setTableOption(pCxt, yylhsminor.yy952, yymsp[0].minor.yy25.type, &yymsp[0].minor.yy25.val); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 219: /* alter_table_options ::= alter_table_options alter_table_option */ + case 218: /* alter_table_options ::= alter_table_options alter_table_option */ { yylhsminor.yy952 = setTableOption(pCxt, yymsp[-1].minor.yy952, yymsp[0].minor.yy25.type, &yymsp[0].minor.yy25.val); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 220: /* alter_table_option ::= COMMENT NK_STRING */ + case 219: /* alter_table_option ::= COMMENT NK_STRING */ { yymsp[-1].minor.yy25.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; } break; - case 221: /* alter_table_option ::= TTL NK_INTEGER */ + case 220: /* alter_table_option ::= TTL NK_INTEGER */ { yymsp[-1].minor.yy25.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; } break; - case 222: /* duration_list ::= duration_literal */ - case 427: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==427); + case 221: /* duration_list ::= duration_literal */ + case 426: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==426); { yylhsminor.yy824 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); } yymsp[0].minor.yy824 = yylhsminor.yy824; break; - case 223: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 428: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==428); + case 222: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 427: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==427); { yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-2].minor.yy824, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); } yymsp[-2].minor.yy824 = yylhsminor.yy824; break; - case 226: /* rollup_func_name ::= function_name */ + case 225: /* rollup_func_name ::= function_name */ { yylhsminor.yy952 = createFunctionNode(pCxt, &yymsp[0].minor.yy169, NULL); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 227: /* rollup_func_name ::= FIRST */ - case 228: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==228); - case 286: /* tag_item ::= QTAGS */ yytestcase(yyruleno==286); + case 226: /* rollup_func_name ::= FIRST */ + case 227: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==227); + case 285: /* tag_item ::= QTAGS */ yytestcase(yyruleno==285); { yylhsminor.yy952 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 231: /* col_name ::= column_name */ - case 287: /* tag_item ::= column_name */ yytestcase(yyruleno==287); + case 230: /* col_name ::= column_name */ + case 286: /* tag_item ::= column_name */ yytestcase(yyruleno==286); { yylhsminor.yy952 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy169); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 232: /* cmd ::= SHOW DNODES */ + case 231: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 233: /* cmd ::= SHOW USERS */ + case 232: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 234: /* cmd ::= SHOW USER PRIVILEGES */ + case 233: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 235: /* cmd ::= SHOW DATABASES */ + case 234: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 236: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + case 235: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy952, yymsp[0].minor.yy952, OP_TYPE_LIKE); } break; - case 237: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + case 236: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy952, yymsp[0].minor.yy952, OP_TYPE_LIKE); } break; - case 238: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ + case 237: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy952, NULL, OP_TYPE_LIKE); } break; - case 239: /* cmd ::= SHOW MNODES */ + case 238: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 240: /* cmd ::= SHOW QNODES */ + case 239: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 241: /* cmd ::= SHOW FUNCTIONS */ + case 240: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 242: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + case 241: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy952, yymsp[-1].minor.yy952, OP_TYPE_EQUAL); } break; - case 243: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + case 242: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy169), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169), OP_TYPE_EQUAL); } break; - case 244: /* cmd ::= SHOW STREAMS */ + case 243: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 245: /* cmd ::= SHOW ACCOUNTS */ + case 244: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 246: /* cmd ::= SHOW APPS */ + case 245: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 247: /* cmd ::= SHOW CONNECTIONS */ + case 246: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 248: /* cmd ::= SHOW LICENCES */ - case 249: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==249); + case 247: /* cmd ::= SHOW LICENCES */ + case 248: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==248); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 250: /* cmd ::= SHOW CREATE DATABASE db_name */ + case 249: /* cmd ::= SHOW CREATE DATABASE db_name */ { pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy169); } break; - case 251: /* cmd ::= SHOW CREATE TABLE full_table_name */ + case 250: /* cmd ::= SHOW CREATE TABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy952); } break; - case 252: /* cmd ::= SHOW CREATE STABLE full_table_name */ + case 251: /* cmd ::= SHOW CREATE STABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy952); } break; - case 253: /* cmd ::= SHOW QUERIES */ + case 252: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 254: /* cmd ::= SHOW SCORES */ + case 253: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 255: /* cmd ::= SHOW TOPICS */ + case 254: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 256: /* cmd ::= SHOW VARIABLES */ - case 257: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==257); + case 255: /* cmd ::= SHOW VARIABLES */ + case 256: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==256); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 258: /* cmd ::= SHOW LOCAL VARIABLES */ + case 257: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 259: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + case 258: /* 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.yy952); } break; - case 260: /* cmd ::= SHOW BNODES */ + case 259: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 261: /* cmd ::= SHOW SNODES */ + case 260: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 262: /* cmd ::= SHOW CLUSTER */ + case 261: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 263: /* cmd ::= SHOW TRANSACTIONS */ + case 262: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 264: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + case 263: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ { pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy952); } break; - case 265: /* cmd ::= SHOW CONSUMERS */ + case 264: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 266: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 265: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 267: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + case 266: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy952, yymsp[-1].minor.yy952, OP_TYPE_EQUAL); } break; - case 268: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + case 267: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy169), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169), OP_TYPE_EQUAL); } break; - case 269: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + case 268: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy952, yymsp[0].minor.yy952, yymsp[-3].minor.yy824); } break; - case 270: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + case 269: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ { pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy169), yymsp[-4].minor.yy824); } break; - case 271: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + case 270: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 272: /* cmd ::= SHOW VNODES */ + case 271: /* cmd ::= SHOW VNODES */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } break; - case 273: /* cmd ::= SHOW db_name_cond_opt ALIVE */ + case 272: /* cmd ::= SHOW db_name_cond_opt ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy952, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; - case 274: /* cmd ::= SHOW CLUSTER ALIVE */ + case 273: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; - case 275: /* db_name_cond_opt ::= */ - case 280: /* from_db_opt ::= */ yytestcase(yyruleno==280); + case 274: /* db_name_cond_opt ::= */ + case 279: /* from_db_opt ::= */ yytestcase(yyruleno==279); { yymsp[1].minor.yy952 = createDefaultDatabaseCondValue(pCxt); } break; - case 276: /* db_name_cond_opt ::= db_name NK_DOT */ + case 275: /* db_name_cond_opt ::= db_name NK_DOT */ { yylhsminor.yy952 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy169); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 278: /* like_pattern_opt ::= LIKE NK_STRING */ + case 277: /* like_pattern_opt ::= LIKE NK_STRING */ { yymsp[-1].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 279: /* table_name_cond ::= table_name */ + case 278: /* table_name_cond ::= table_name */ { yylhsminor.yy952 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 281: /* from_db_opt ::= FROM db_name */ + case 280: /* from_db_opt ::= FROM db_name */ { yymsp[-1].minor.yy952 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169); } break; - case 285: /* tag_item ::= TBNAME */ + case 284: /* tag_item ::= TBNAME */ { yylhsminor.yy952 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 288: /* tag_item ::= column_name column_alias */ + case 287: /* tag_item ::= column_name column_alias */ { yylhsminor.yy952 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy169), &yymsp[0].minor.yy169); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 289: /* tag_item ::= column_name AS column_alias */ + case 288: /* tag_item ::= column_name AS column_alias */ { yylhsminor.yy952 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy169), &yymsp[0].minor.yy169); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 290: /* cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ + case 289: /* cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy957, yymsp[-3].minor.yy952, yymsp[-1].minor.yy952, NULL, yymsp[0].minor.yy952); } break; - case 291: /* cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ + case 290: /* cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy957, yymsp[-5].minor.yy952, yymsp[-3].minor.yy952, yymsp[-1].minor.yy824, NULL); } break; - case 292: /* cmd ::= DROP INDEX exists_opt full_index_name */ + case 291: /* cmd ::= DROP INDEX exists_opt full_index_name */ { pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy952); } break; - case 293: /* full_index_name ::= index_name */ + case 292: /* full_index_name ::= index_name */ { yylhsminor.yy952 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy169); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 294: /* full_index_name ::= db_name NK_DOT index_name */ + case 293: /* full_index_name ::= db_name NK_DOT index_name */ { yylhsminor.yy952 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy169); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 295: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + case 294: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ { yymsp[-9].minor.yy952 = createIndexOption(pCxt, yymsp[-7].minor.yy824, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), NULL, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); } break; - case 296: /* 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 */ + case 295: /* 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.yy952 = createIndexOption(pCxt, yymsp[-9].minor.yy824, releaseRawExprNode(pCxt, yymsp[-5].minor.yy952), releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), yymsp[-1].minor.yy952, yymsp[0].minor.yy952); } break; - case 299: /* func ::= sma_func_name NK_LP expression_list NK_RP */ + case 298: /* func ::= sma_func_name NK_LP expression_list NK_RP */ { yylhsminor.yy952 = createFunctionNode(pCxt, &yymsp[-3].minor.yy169, yymsp[-1].minor.yy824); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 300: /* sma_func_name ::= function_name */ - case 514: /* alias_opt ::= table_alias */ yytestcase(yyruleno==514); + case 299: /* sma_func_name ::= function_name */ + case 513: /* alias_opt ::= table_alias */ yytestcase(yyruleno==513); { yylhsminor.yy169 = yymsp[0].minor.yy169; } yymsp[0].minor.yy169 = yylhsminor.yy169; break; - case 305: /* sma_stream_opt ::= */ - case 346: /* stream_options ::= */ yytestcase(yyruleno==346); + case 304: /* sma_stream_opt ::= */ + case 345: /* stream_options ::= */ yytestcase(yyruleno==345); { yymsp[1].minor.yy952 = createStreamOptions(pCxt); } break; - case 306: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + case 305: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ { ((SStreamOptions*)yymsp[-2].minor.yy952)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); yylhsminor.yy952 = yymsp[-2].minor.yy952; } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 307: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + case 306: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ { ((SStreamOptions*)yymsp[-2].minor.yy952)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); yylhsminor.yy952 = yymsp[-2].minor.yy952; } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 308: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + case 307: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ { ((SStreamOptions*)yymsp[-2].minor.yy952)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); yylhsminor.yy952 = yymsp[-2].minor.yy952; } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 309: /* with_meta ::= AS */ + case 308: /* with_meta ::= AS */ { yymsp[0].minor.yy480 = 0; } break; - case 310: /* with_meta ::= WITH META AS */ + case 309: /* with_meta ::= WITH META AS */ { yymsp[-2].minor.yy480 = 1; } break; - case 311: /* with_meta ::= ONLY META AS */ + case 310: /* with_meta ::= ONLY META AS */ { yymsp[-2].minor.yy480 = 2; } break; - case 312: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + case 311: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ { pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy957, &yymsp[-2].minor.yy169, yymsp[0].minor.yy952); } break; - case 313: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + case 312: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy957, &yymsp[-3].minor.yy169, &yymsp[0].minor.yy169, yymsp[-2].minor.yy480); } break; - case 314: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + case 313: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy957, &yymsp[-4].minor.yy169, yymsp[-1].minor.yy952, yymsp[-3].minor.yy480, yymsp[0].minor.yy952); } break; - case 315: /* cmd ::= DROP TOPIC exists_opt topic_name */ + case 314: /* cmd ::= DROP TOPIC exists_opt topic_name */ { pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); } break; - case 316: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + case 315: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ { pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy957, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy169); } break; - case 317: /* cmd ::= DESC full_table_name */ - case 318: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==318); + case 316: /* cmd ::= DESC full_table_name */ + case 317: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==317); { pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy952); } break; - case 319: /* cmd ::= RESET QUERY CACHE */ + case 318: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 320: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 321: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==321); + case 319: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 320: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==320); { pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy957, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); } break; - case 324: /* explain_options ::= */ + case 323: /* explain_options ::= */ { yymsp[1].minor.yy952 = createDefaultExplainOptions(pCxt); } break; - case 325: /* explain_options ::= explain_options VERBOSE NK_BOOL */ + case 324: /* explain_options ::= explain_options VERBOSE NK_BOOL */ { yylhsminor.yy952 = setExplainVerbose(pCxt, yymsp[-2].minor.yy952, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 326: /* explain_options ::= explain_options RATIO NK_FLOAT */ + case 325: /* explain_options ::= explain_options RATIO NK_FLOAT */ { yylhsminor.yy952 = setExplainRatio(pCxt, yymsp[-2].minor.yy952, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 327: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + case 326: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ { pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy957, yymsp[-9].minor.yy957, &yymsp[-6].minor.yy169, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy84, yymsp[-1].minor.yy480, &yymsp[0].minor.yy169, yymsp[-10].minor.yy957); } break; - case 328: /* cmd ::= DROP FUNCTION exists_opt function_name */ + case 327: /* cmd ::= DROP FUNCTION exists_opt function_name */ { pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); } break; - case 333: /* language_opt ::= */ + case 332: /* language_opt ::= */ { yymsp[1].minor.yy169 = nil_token; } break; - case 334: /* language_opt ::= LANGUAGE NK_STRING */ + case 333: /* language_opt ::= LANGUAGE NK_STRING */ { yymsp[-1].minor.yy169 = yymsp[0].minor.yy0; } break; - case 337: /* 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 */ + case 336: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ { pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy957, &yymsp[-8].minor.yy169, yymsp[-5].minor.yy952, yymsp[-7].minor.yy952, yymsp[-3].minor.yy824, yymsp[-2].minor.yy952, yymsp[0].minor.yy952, yymsp[-4].minor.yy824); } break; - case 338: /* cmd ::= DROP STREAM exists_opt stream_name */ + case 337: /* cmd ::= DROP STREAM exists_opt stream_name */ { pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); } break; - case 339: /* cmd ::= PAUSE STREAM exists_opt stream_name */ + case 338: /* cmd ::= PAUSE STREAM exists_opt stream_name */ { pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); } break; - case 340: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + case 339: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ { pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy957, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); } break; - case 347: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 348: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==348); + case 346: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 347: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==347); { yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-2].minor.yy952, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 349: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + case 348: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ { yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-3].minor.yy952, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 350: /* stream_options ::= stream_options WATERMARK duration_literal */ + case 349: /* stream_options ::= stream_options WATERMARK duration_literal */ { yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-2].minor.yy952, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 351: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + case 350: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ { yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-3].minor.yy952, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 352: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + case 351: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ { yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-2].minor.yy952, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 353: /* stream_options ::= stream_options DELETE_MARK duration_literal */ + case 352: /* stream_options ::= stream_options DELETE_MARK duration_literal */ { yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-2].minor.yy952, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 354: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + case 353: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ { yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-3].minor.yy952, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 356: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 552: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==552); - case 573: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==573); + case 355: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 551: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==551); + case 572: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==572); { yymsp[-3].minor.yy952 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy952); } break; - case 359: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 358: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 360: /* cmd ::= KILL QUERY NK_STRING */ + case 359: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 361: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 360: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 362: /* cmd ::= BALANCE VGROUP */ + case 361: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 363: /* cmd ::= BALANCE VGROUP LEADER */ + case 362: /* cmd ::= BALANCE VGROUP LEADER */ { pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt); } break; - case 364: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 363: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 365: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + case 364: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ { pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy824); } break; - case 366: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 365: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 367: /* dnode_list ::= DNODE NK_INTEGER */ + case 366: /* dnode_list ::= DNODE NK_INTEGER */ { yymsp[-1].minor.yy824 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 369: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ + case 368: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ { pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); } break; - case 372: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + case 371: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ { yymsp[-6].minor.yy952 = createInsertStmt(pCxt, yymsp[-4].minor.yy952, yymsp[-2].minor.yy824, yymsp[0].minor.yy952); } break; - case 373: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ + case 372: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ { yymsp[-3].minor.yy952 = createInsertStmt(pCxt, yymsp[-1].minor.yy952, NULL, yymsp[0].minor.yy952); } break; - case 374: /* literal ::= NK_INTEGER */ + case 373: /* literal ::= NK_INTEGER */ { yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 375: /* literal ::= NK_FLOAT */ + case 374: /* literal ::= NK_FLOAT */ { yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 376: /* literal ::= NK_STRING */ + case 375: /* literal ::= NK_STRING */ { yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 377: /* literal ::= NK_BOOL */ + case 376: /* literal ::= NK_BOOL */ { yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 378: /* literal ::= TIMESTAMP NK_STRING */ + case 377: /* literal ::= TIMESTAMP NK_STRING */ { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 379: /* literal ::= duration_literal */ - case 389: /* signed_literal ::= signed */ yytestcase(yyruleno==389); - case 410: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==410); - case 411: /* expression ::= literal */ yytestcase(yyruleno==411); - case 412: /* expression ::= pseudo_column */ yytestcase(yyruleno==412); - case 413: /* expression ::= column_reference */ yytestcase(yyruleno==413); - case 414: /* expression ::= function_expression */ yytestcase(yyruleno==414); - case 415: /* expression ::= case_when_expression */ yytestcase(yyruleno==415); - case 446: /* function_expression ::= literal_func */ yytestcase(yyruleno==446); - case 495: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==495); - case 499: /* boolean_primary ::= predicate */ yytestcase(yyruleno==499); - case 501: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==501); - case 502: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==502); - case 505: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==505); - case 507: /* table_reference ::= table_primary */ yytestcase(yyruleno==507); - case 508: /* table_reference ::= joined_table */ yytestcase(yyruleno==508); - case 512: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==512); - case 575: /* query_simple ::= query_specification */ yytestcase(yyruleno==575); - case 576: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==576); - case 579: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==579); - case 581: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==581); + case 378: /* literal ::= duration_literal */ + case 388: /* signed_literal ::= signed */ yytestcase(yyruleno==388); + case 409: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==409); + case 410: /* expression ::= literal */ yytestcase(yyruleno==410); + case 411: /* expression ::= pseudo_column */ yytestcase(yyruleno==411); + case 412: /* expression ::= column_reference */ yytestcase(yyruleno==412); + case 413: /* expression ::= function_expression */ yytestcase(yyruleno==413); + case 414: /* expression ::= case_when_expression */ yytestcase(yyruleno==414); + case 445: /* function_expression ::= literal_func */ yytestcase(yyruleno==445); + case 494: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==494); + case 498: /* boolean_primary ::= predicate */ yytestcase(yyruleno==498); + case 500: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==500); + case 501: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==501); + case 504: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==504); + case 506: /* table_reference ::= table_primary */ yytestcase(yyruleno==506); + case 507: /* table_reference ::= joined_table */ yytestcase(yyruleno==507); + case 511: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==511); + case 574: /* query_simple ::= query_specification */ yytestcase(yyruleno==574); + case 575: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==575); + case 578: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==578); + case 580: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==580); { yylhsminor.yy952 = yymsp[0].minor.yy952; } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 380: /* literal ::= NULL */ + case 379: /* literal ::= NULL */ { yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 381: /* literal ::= NK_QUESTION */ + case 380: /* literal ::= NK_QUESTION */ { yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 382: /* duration_literal ::= NK_VARIABLE */ + case 381: /* duration_literal ::= NK_VARIABLE */ { yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 383: /* signed ::= NK_INTEGER */ + case 382: /* signed ::= NK_INTEGER */ { yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 384: /* signed ::= NK_PLUS NK_INTEGER */ + case 383: /* signed ::= NK_PLUS NK_INTEGER */ { yymsp[-1].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 385: /* signed ::= NK_MINUS NK_INTEGER */ + case 384: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; @@ -5709,14 +5702,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 386: /* signed ::= NK_FLOAT */ + case 385: /* signed ::= NK_FLOAT */ { yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 387: /* signed ::= NK_PLUS NK_FLOAT */ + case 386: /* signed ::= NK_PLUS NK_FLOAT */ { yymsp[-1].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 388: /* signed ::= NK_MINUS NK_FLOAT */ + case 387: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; @@ -5724,57 +5717,57 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 390: /* signed_literal ::= NK_STRING */ + case 389: /* signed_literal ::= NK_STRING */ { yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 391: /* signed_literal ::= NK_BOOL */ + case 390: /* signed_literal ::= NK_BOOL */ { yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 392: /* signed_literal ::= TIMESTAMP NK_STRING */ + case 391: /* signed_literal ::= TIMESTAMP NK_STRING */ { yymsp[-1].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 393: /* signed_literal ::= duration_literal */ - case 395: /* signed_literal ::= literal_func */ yytestcase(yyruleno==395); - case 466: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==466); - case 532: /* select_item ::= common_expression */ yytestcase(yyruleno==532); - case 542: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==542); - case 580: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==580); - case 582: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==582); - case 595: /* search_condition ::= common_expression */ yytestcase(yyruleno==595); + case 392: /* signed_literal ::= duration_literal */ + case 394: /* signed_literal ::= literal_func */ yytestcase(yyruleno==394); + case 465: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==465); + case 531: /* select_item ::= common_expression */ yytestcase(yyruleno==531); + case 541: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==541); + case 579: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==579); + case 581: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==581); + case 594: /* search_condition ::= common_expression */ yytestcase(yyruleno==594); { yylhsminor.yy952 = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 394: /* signed_literal ::= NULL */ + case 393: /* signed_literal ::= NULL */ { yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 396: /* signed_literal ::= NK_QUESTION */ + case 395: /* signed_literal ::= NK_QUESTION */ { yylhsminor.yy952 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 416: /* expression ::= NK_LP expression NK_RP */ - case 500: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==500); - case 594: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==594); + case 415: /* expression ::= NK_LP expression NK_RP */ + case 499: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==499); + case 593: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==593); { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 417: /* expression ::= NK_PLUS expr_or_subquery */ + case 416: /* expression ::= NK_PLUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 418: /* expression ::= NK_MINUS expr_or_subquery */ + case 417: /* expression ::= NK_MINUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy952), NULL)); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 419: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 418: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5782,7 +5775,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 420: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 419: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5790,7 +5783,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 421: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 420: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5798,7 +5791,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 422: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 421: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5806,7 +5799,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 423: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 422: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5814,14 +5807,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 424: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 423: /* expression ::= column_reference NK_ARROW NK_STRING */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 425: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 424: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5829,7 +5822,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 426: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 425: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5837,71 +5830,71 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 429: /* column_reference ::= column_name */ + case 428: /* column_reference ::= column_name */ { yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy169, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy169)); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 430: /* column_reference ::= table_name NK_DOT column_name */ + case 429: /* column_reference ::= table_name NK_DOT column_name */ { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy169, createColumnNode(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy169)); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 431: /* pseudo_column ::= ROWTS */ - case 432: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==432); - case 434: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==434); - case 435: /* pseudo_column ::= QEND */ yytestcase(yyruleno==435); - case 436: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==436); - case 437: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==437); - case 438: /* pseudo_column ::= WEND */ yytestcase(yyruleno==438); - case 439: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==439); - case 440: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==440); - case 441: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==441); - case 442: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==442); - case 448: /* literal_func ::= NOW */ yytestcase(yyruleno==448); + case 430: /* pseudo_column ::= ROWTS */ + case 431: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==431); + case 433: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==433); + case 434: /* pseudo_column ::= QEND */ yytestcase(yyruleno==434); + case 435: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==435); + case 436: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==436); + case 437: /* pseudo_column ::= WEND */ yytestcase(yyruleno==437); + case 438: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==438); + case 439: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==439); + case 440: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==440); + case 441: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==441); + case 447: /* literal_func ::= NOW */ yytestcase(yyruleno==447); { yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 433: /* pseudo_column ::= table_name NK_DOT TBNAME */ + case 432: /* pseudo_column ::= table_name NK_DOT TBNAME */ { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy169)))); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 443: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 444: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==444); + case 442: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 443: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==443); { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy169, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy169, yymsp[-1].minor.yy824)); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 445: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + case 444: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), yymsp[-1].minor.yy84)); } yymsp[-5].minor.yy952 = yylhsminor.yy952; break; - case 447: /* literal_func ::= noarg_func NK_LP NK_RP */ + case 446: /* literal_func ::= noarg_func NK_LP NK_RP */ { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy169, NULL)); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 462: /* star_func_para_list ::= NK_STAR */ + case 461: /* star_func_para_list ::= NK_STAR */ { yylhsminor.yy824 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy824 = yylhsminor.yy824; break; - case 467: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 535: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==535); + case 466: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 534: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==534); { yylhsminor.yy952 = createColumnNode(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 468: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ + case 467: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy824, yymsp[-1].minor.yy952)); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 469: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + case 468: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), yymsp[-2].minor.yy824, yymsp[-1].minor.yy952)); } yymsp[-4].minor.yy952 = yylhsminor.yy952; break; - case 472: /* when_then_expr ::= WHEN common_expression THEN common_expression */ + case 471: /* when_then_expr ::= WHEN common_expression THEN common_expression */ { yymsp[-3].minor.yy952 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); } break; - case 474: /* case_when_else_opt ::= ELSE common_expression */ + case 473: /* case_when_else_opt ::= ELSE common_expression */ { yymsp[-1].minor.yy952 = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); } break; - case 475: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 480: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==480); + case 474: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 479: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==479); { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5909,7 +5902,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 476: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 475: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5917,7 +5910,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-4].minor.yy952 = yylhsminor.yy952; break; - case 477: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 476: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5925,71 +5918,71 @@ static YYACTIONTYPE yy_reduce( } yymsp[-5].minor.yy952 = yylhsminor.yy952; break; - case 478: /* predicate ::= expr_or_subquery IS NULL */ + case 477: /* predicate ::= expr_or_subquery IS NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), NULL)); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 479: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 478: /* predicate ::= expr_or_subquery IS NOT NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy952); yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), NULL)); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 481: /* compare_op ::= NK_LT */ + case 480: /* compare_op ::= NK_LT */ { yymsp[0].minor.yy520 = OP_TYPE_LOWER_THAN; } break; - case 482: /* compare_op ::= NK_GT */ + case 481: /* compare_op ::= NK_GT */ { yymsp[0].minor.yy520 = OP_TYPE_GREATER_THAN; } break; - case 483: /* compare_op ::= NK_LE */ + case 482: /* compare_op ::= NK_LE */ { yymsp[0].minor.yy520 = OP_TYPE_LOWER_EQUAL; } break; - case 484: /* compare_op ::= NK_GE */ + case 483: /* compare_op ::= NK_GE */ { yymsp[0].minor.yy520 = OP_TYPE_GREATER_EQUAL; } break; - case 485: /* compare_op ::= NK_NE */ + case 484: /* compare_op ::= NK_NE */ { yymsp[0].minor.yy520 = OP_TYPE_NOT_EQUAL; } break; - case 486: /* compare_op ::= NK_EQ */ + case 485: /* compare_op ::= NK_EQ */ { yymsp[0].minor.yy520 = OP_TYPE_EQUAL; } break; - case 487: /* compare_op ::= LIKE */ + case 486: /* compare_op ::= LIKE */ { yymsp[0].minor.yy520 = OP_TYPE_LIKE; } break; - case 488: /* compare_op ::= NOT LIKE */ + case 487: /* compare_op ::= NOT LIKE */ { yymsp[-1].minor.yy520 = OP_TYPE_NOT_LIKE; } break; - case 489: /* compare_op ::= MATCH */ + case 488: /* compare_op ::= MATCH */ { yymsp[0].minor.yy520 = OP_TYPE_MATCH; } break; - case 490: /* compare_op ::= NMATCH */ + case 489: /* compare_op ::= NMATCH */ { yymsp[0].minor.yy520 = OP_TYPE_NMATCH; } break; - case 491: /* compare_op ::= CONTAINS */ + case 490: /* compare_op ::= CONTAINS */ { yymsp[0].minor.yy520 = OP_TYPE_JSON_CONTAINS; } break; - case 492: /* in_op ::= IN */ + case 491: /* in_op ::= IN */ { yymsp[0].minor.yy520 = OP_TYPE_IN; } break; - case 493: /* in_op ::= NOT IN */ + case 492: /* in_op ::= NOT IN */ { yymsp[-1].minor.yy520 = OP_TYPE_NOT_IN; } break; - case 494: /* in_predicate_value ::= NK_LP literal_list NK_RP */ + case 493: /* in_predicate_value ::= NK_LP literal_list NK_RP */ { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy824)); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 496: /* boolean_value_expression ::= NOT boolean_primary */ + case 495: /* boolean_value_expression ::= NOT boolean_primary */ { SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy952), NULL)); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 497: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 496: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -5997,7 +5990,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 498: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 497: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952); @@ -6005,43 +5998,43 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 506: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ + case 505: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ { yylhsminor.yy952 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy952, yymsp[0].minor.yy952, NULL); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 509: /* table_primary ::= table_name alias_opt */ + case 508: /* table_primary ::= table_name alias_opt */ { yylhsminor.yy952 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy169, &yymsp[0].minor.yy169); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 510: /* table_primary ::= db_name NK_DOT table_name alias_opt */ + case 509: /* table_primary ::= db_name NK_DOT table_name alias_opt */ { yylhsminor.yy952 = createRealTableNode(pCxt, &yymsp[-3].minor.yy169, &yymsp[-1].minor.yy169, &yymsp[0].minor.yy169); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 511: /* table_primary ::= subquery alias_opt */ + case 510: /* table_primary ::= subquery alias_opt */ { yylhsminor.yy952 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952), &yymsp[0].minor.yy169); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 513: /* alias_opt ::= */ + case 512: /* alias_opt ::= */ { yymsp[1].minor.yy169 = nil_token; } break; - case 515: /* alias_opt ::= AS table_alias */ + case 514: /* alias_opt ::= AS table_alias */ { yymsp[-1].minor.yy169 = yymsp[0].minor.yy169; } break; - case 516: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 517: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==517); + case 515: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 516: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==516); { yymsp[-2].minor.yy952 = yymsp[-1].minor.yy952; } break; - case 518: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + case 517: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ { yylhsminor.yy952 = createJoinTableNode(pCxt, yymsp[-4].minor.yy932, yymsp[-5].minor.yy952, yymsp[-2].minor.yy952, yymsp[0].minor.yy952); } yymsp[-5].minor.yy952 = yylhsminor.yy952; break; - case 519: /* join_type ::= */ + case 518: /* join_type ::= */ { yymsp[1].minor.yy932 = JOIN_TYPE_INNER; } break; - case 520: /* join_type ::= INNER */ + case 519: /* join_type ::= INNER */ { yymsp[0].minor.yy932 = JOIN_TYPE_INNER; } break; - case 521: /* query_specification ::= SELECT hint_list tag_mode_opt set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 520: /* query_specification ::= SELECT hint_list tag_mode_opt set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { yymsp[-13].minor.yy952 = createSelectStmt(pCxt, yymsp[-10].minor.yy957, yymsp[-9].minor.yy824, yymsp[-8].minor.yy952, yymsp[-12].minor.yy824); yymsp[-13].minor.yy952 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy952, yymsp[-11].minor.yy957); @@ -6055,92 +6048,92 @@ static YYACTIONTYPE yy_reduce( yymsp[-13].minor.yy952 = addFillClause(pCxt, yymsp[-13].minor.yy952, yymsp[-3].minor.yy952); } break; - case 522: /* hint_list ::= */ + case 521: /* hint_list ::= */ { yymsp[1].minor.yy824 = createHintNodeList(pCxt, NULL); } break; - case 523: /* hint_list ::= NK_HINT */ + case 522: /* hint_list ::= NK_HINT */ { yylhsminor.yy824 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } yymsp[0].minor.yy824 = yylhsminor.yy824; break; - case 528: /* set_quantifier_opt ::= ALL */ + case 527: /* set_quantifier_opt ::= ALL */ { yymsp[0].minor.yy957 = false; } break; - case 531: /* select_item ::= NK_STAR */ + case 530: /* select_item ::= NK_STAR */ { yylhsminor.yy952 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy952 = yylhsminor.yy952; break; - case 533: /* select_item ::= common_expression column_alias */ - case 543: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==543); + case 532: /* select_item ::= common_expression column_alias */ + case 542: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==542); { yylhsminor.yy952 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952), &yymsp[0].minor.yy169); } yymsp[-1].minor.yy952 = yylhsminor.yy952; break; - case 534: /* select_item ::= common_expression AS column_alias */ - case 544: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==544); + case 533: /* select_item ::= common_expression AS column_alias */ + case 543: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==543); { yylhsminor.yy952 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), &yymsp[0].minor.yy169); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 539: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 564: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==564); - case 584: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==584); + case 538: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 563: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==563); + case 583: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==583); { yymsp[-2].minor.yy824 = yymsp[0].minor.yy824; } break; - case 546: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + case 545: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ { yymsp[-5].minor.yy952 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); } break; - case 547: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + case 546: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ { yymsp[-3].minor.yy952 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); } break; - case 548: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + case 547: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-5].minor.yy952 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), NULL, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); } break; - case 549: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + case 548: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-7].minor.yy952 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy952), releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), yymsp[-1].minor.yy952, yymsp[0].minor.yy952); } break; - case 550: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + case 549: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ { yymsp[-6].minor.yy952 = createEventWindowNode(pCxt, yymsp[-3].minor.yy952, yymsp[0].minor.yy952); } break; - case 554: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ + case 553: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ { yymsp[-3].minor.yy952 = createFillNode(pCxt, yymsp[-1].minor.yy214, NULL); } break; - case 555: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + case 554: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ { yymsp[-5].minor.yy952 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy824)); } break; - case 556: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + case 555: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ { yymsp[-5].minor.yy952 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy824)); } break; - case 557: /* fill_mode ::= NONE */ + case 556: /* fill_mode ::= NONE */ { yymsp[0].minor.yy214 = FILL_MODE_NONE; } break; - case 558: /* fill_mode ::= PREV */ + case 557: /* fill_mode ::= PREV */ { yymsp[0].minor.yy214 = FILL_MODE_PREV; } break; - case 559: /* fill_mode ::= NULL */ + case 558: /* fill_mode ::= NULL */ { yymsp[0].minor.yy214 = FILL_MODE_NULL; } break; - case 560: /* fill_mode ::= NULL_F */ + case 559: /* fill_mode ::= NULL_F */ { yymsp[0].minor.yy214 = FILL_MODE_NULL_F; } break; - case 561: /* fill_mode ::= LINEAR */ + case 560: /* fill_mode ::= LINEAR */ { yymsp[0].minor.yy214 = FILL_MODE_LINEAR; } break; - case 562: /* fill_mode ::= NEXT */ + case 561: /* fill_mode ::= NEXT */ { yymsp[0].minor.yy214 = FILL_MODE_NEXT; } break; - case 565: /* group_by_list ::= expr_or_subquery */ + case 564: /* group_by_list ::= expr_or_subquery */ { yylhsminor.yy824 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy952))); } yymsp[0].minor.yy824 = yylhsminor.yy824; break; - case 566: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + case 565: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ { yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-2].minor.yy824, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy952))); } yymsp[-2].minor.yy824 = yylhsminor.yy824; break; - case 570: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + case 569: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ { yymsp[-5].minor.yy952 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); } break; - case 571: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + case 570: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ { yymsp[-3].minor.yy952 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); } break; - case 574: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 573: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { yylhsminor.yy952 = addOrderByClause(pCxt, yymsp[-3].minor.yy952, yymsp[-2].minor.yy824); yylhsminor.yy952 = addSlimitClause(pCxt, yylhsminor.yy952, yymsp[-1].minor.yy952); @@ -6148,50 +6141,50 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 577: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + case 576: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ { yylhsminor.yy952 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy952, yymsp[0].minor.yy952); } yymsp[-3].minor.yy952 = yylhsminor.yy952; break; - case 578: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + case 577: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ { yylhsminor.yy952 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy952, yymsp[0].minor.yy952); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 586: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 590: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==590); + case 585: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 589: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==589); { yymsp[-1].minor.yy952 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 587: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 591: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==591); + case 586: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 590: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==590); { yymsp[-3].minor.yy952 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 588: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 592: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==592); + case 587: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 591: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==591); { yymsp[-3].minor.yy952 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 593: /* subquery ::= NK_LP query_expression NK_RP */ + case 592: /* subquery ::= NK_LP query_expression NK_RP */ { yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy952); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 598: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + case 597: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ { yylhsminor.yy952 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), yymsp[-1].minor.yy498, yymsp[0].minor.yy977); } yymsp[-2].minor.yy952 = yylhsminor.yy952; break; - case 599: /* ordering_specification_opt ::= */ + case 598: /* ordering_specification_opt ::= */ { yymsp[1].minor.yy498 = ORDER_ASC; } break; - case 600: /* ordering_specification_opt ::= ASC */ + case 599: /* ordering_specification_opt ::= ASC */ { yymsp[0].minor.yy498 = ORDER_ASC; } break; - case 601: /* ordering_specification_opt ::= DESC */ + case 600: /* ordering_specification_opt ::= DESC */ { yymsp[0].minor.yy498 = ORDER_DESC; } break; - case 602: /* null_ordering_opt ::= */ + case 601: /* null_ordering_opt ::= */ { yymsp[1].minor.yy977 = NULL_ORDER_DEFAULT; } break; - case 603: /* null_ordering_opt ::= NULLS FIRST */ + case 602: /* null_ordering_opt ::= NULLS FIRST */ { yymsp[-1].minor.yy977 = NULL_ORDER_FIRST; } break; - case 604: /* null_ordering_opt ::= NULLS LAST */ + case 603: /* null_ordering_opt ::= NULLS LAST */ { yymsp[-1].minor.yy977 = NULL_ORDER_LAST; } break; default: diff --git a/tests/system-test/0-others/show.py b/tests/system-test/0-others/show.py index 0482a76bdd..4ef323db22 100644 --- a/tests/system-test/0-others/show.py +++ b/tests/system-test/0-others/show.py @@ -210,18 +210,6 @@ class TDTestCase: licences_info = tdSql.queryResult tdSql.checkEqual(grants_info,licences_info) - def show_create_table_with_col_comment(self): - tdSql.execute("create database comment_test_db") - tdSql.execute("use comment_test_db") - tdSql.execute("create table normal_table(ts timestamp, c2 int comment 'c2 comment')") - tdSql.execute("create stable super_table(ts timestamp comment 'ts', c2 int comment 'c2 comment') tags(tg int comment 'tg comment')") - tdSql.query('show create table normal_table') - create_sql = "create table `normal_table` (`ts` timestamp, `c2` int)" - tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - tdSql.query('show create table super_table') - create_sql = "create stable `super_table` (`ts` timestamp, `c2` int) tags (`tg` int)" - tdSql.checkEqual(tdSql.queryResult[0][1].lower(), create_sql) - def run(self): self.check_gitinfo() self.show_base() @@ -230,7 +218,6 @@ class TDTestCase: self.show_create_sql() self.show_create_sysdb_sql() self.show_create_systb_sql() - self.show_create_table_with_col_comment() def stop(self): tdSql.close() From 0c768f5beb699b021356d3403e3f7579e4c5a7ec Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 24 Aug 2023 14:02:25 +0800 Subject: [PATCH 42/46] fix(file/stat): fix atime --- source/os/src/osFile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/os/src/osFile.c b/source/os/src/osFile.c index c4309b2c55..a32417b24a 100644 --- a/source/os/src/osFile.c +++ b/source/os/src/osFile.c @@ -212,7 +212,7 @@ int32_t taosStatFile(const char *path, int64_t *size, int32_t *mtime, int32_t *a } if (atime != NULL) { - *atime = fileStat.st_mtime; + *atime = fileStat.st_atime; } return 0; From 09cd6e59ac899fb47826f5cc4727e1e46324d1c6 Mon Sep 17 00:00:00 2001 From: wangjiaming Date: Thu, 24 Aug 2023 14:07:40 +0800 Subject: [PATCH 43/46] Revert "add doc for column comment" --- docs/en/12-taos-sql/03-table.md | 7 ++----- docs/zh/12-taos-sql/03-table.md | 12 +++--------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/docs/en/12-taos-sql/03-table.md b/docs/en/12-taos-sql/03-table.md index b84c17bfac..10c44848c9 100644 --- a/docs/en/12-taos-sql/03-table.md +++ b/docs/en/12-taos-sql/03-table.md @@ -91,15 +91,12 @@ ALTER TABLE [db_name.]tb_name alter_table_clause alter_table_clause: { alter_table_options - | ADD COLUMN col_name column_definition + | ADD COLUMN col_name column_type | DROP COLUMN col_name - | MODIFY COLUMN col_name column_definition + | MODIFY COLUMN col_name column_type | RENAME COLUMN old_col_name new_col_name } -column_definition: - type_name [comment 'string_value'] - alter_table_options: alter_table_option ... diff --git a/docs/zh/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md index f5540aeb63..9258258263 100644 --- a/docs/zh/12-taos-sql/03-table.md +++ b/docs/zh/12-taos-sql/03-table.md @@ -23,10 +23,7 @@ create_subtable_clause: { } create_definition: - col_name column_definition - -column_definition: - type_name [comment 'string_value'] + col_name column_type table_options: table_option ... @@ -92,15 +89,12 @@ ALTER TABLE [db_name.]tb_name alter_table_clause alter_table_clause: { alter_table_options - | ADD COLUMN col_name column_definition + | ADD COLUMN col_name column_type | DROP COLUMN col_name - | MODIFY COLUMN col_name column_definition + | MODIFY COLUMN col_name column_type | RENAME COLUMN old_col_name new_col_name } -column_definition: - type_name [comment 'string_value'] - alter_table_options: alter_table_option ... From 13baeb1108d007bedc2cd4a5df9a82c369adcb3e Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 24 Aug 2023 14:35:00 +0800 Subject: [PATCH 44/46] fix: add hints comments --- docs/en/12-taos-sql/06-select.md | 30 +++++++++++++++++++++++++++++- docs/zh/12-taos-sql/06-select.md | 30 +++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 2 deletions(-) mode change 100644 => 100755 docs/en/12-taos-sql/06-select.md mode change 100644 => 100755 docs/zh/12-taos-sql/06-select.md diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md old mode 100644 new mode 100755 index b28d5acb18..5af06fa0db --- a/docs/en/12-taos-sql/06-select.md +++ b/docs/en/12-taos-sql/06-select.md @@ -9,7 +9,7 @@ description: This document describes how to query data in TDengine. ```sql SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE()} -SELECT [DISTINCT] select_list +SELECT [hints] [DISTINCT] select_list from_clause [WHERE condition] [partition_by_clause] @@ -21,6 +21,11 @@ SELECT [DISTINCT] select_list [LIMIT limit_val [OFFSET offset_val]] [>> export_file] +hints: /*+ [hint([hint_param_list])] [hint([hint_param_list])] */ + +hint: + BATCH_SCAN | NO_BATCH_SCAN + select_list: select_expr [, select_expr] ... @@ -70,6 +75,29 @@ order_expr: {expr | position | c_alias} [DESC | ASC] [NULLS FIRST | NULLS LAST] ``` +## Hints + +Hints are a means of user control over query optimization for individual statements. Hints will be ignore automatically if they are not applicable to the current query statement. The specific instructions are as follows: + +- Hints syntax starts with `/*+` and ends with `*/`, spaces are allowed before or after. +- Hints syntax can only follow the SELECT keyword. +- Each hints can contain multiple hint, separated by spaces. When multiple hints conflict or are identical, whichever comes first takes effect. +- When an error occurs with a hint in hints, the effective hint before the error is still valid, and the current and subsequent hints are ignored. +- hint_param_list are arguments to each hint, which varies according to each hint. + +The list of currently supported Hints is as follows + +| **Hint** | **Params** | **Comment** | **Scopt** | +| :-----------: | -------------- | -------------------------- | -------------------------- | +| BATCH_SCAN | None | Batch table scan | JOIN statment for stable | +| NO_BATCH_SCAN | None | Sequential table scan | JOIN statment for stable | + +For example + +```sql +SELECT /*+ BATCH_SCAN() */ a.ts FROM stable1 a, stable2 b where a.tag0 = b.tag0 and a.ts = b.ts; +``` + ## Lists A query can be performed on some or all columns. Data and tag columns can all be included in the SELECT list. diff --git a/docs/zh/12-taos-sql/06-select.md b/docs/zh/12-taos-sql/06-select.md old mode 100644 new mode 100755 index 9560c3c4df..cb3e0b86b0 --- a/docs/zh/12-taos-sql/06-select.md +++ b/docs/zh/12-taos-sql/06-select.md @@ -9,7 +9,7 @@ description: 查询数据的详细语法 ```sql SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE()} -SELECT [DISTINCT] select_list +SELECT [hints] [DISTINCT] select_list from_clause [WHERE condition] [partition_by_clause] @@ -21,6 +21,11 @@ SELECT [DISTINCT] select_list [LIMIT limit_val [OFFSET offset_val]] [>> export_file] +hints: /*+ [hint([hint_param_list])] [hint([hint_param_list])] */ + +hint: + BATCH_SCAN | NO_BATCH_SCAN + select_list: select_expr [, select_expr] ... @@ -70,6 +75,29 @@ order_expr: {expr | position | c_alias} [DESC | ASC] [NULLS FIRST | NULLS LAST] ``` +## Hints + +Hints 是用户控制单个语句查询优化的一种手段,当 Hint 不适用于当前的查询语句时会被自动忽略,具体说明如下: + +- Hints 语法以`/*+`开始,终于`*/`,前后可有空格。 +- Hints 语法只能跟随在 SELECT 关键字后。 +- 每个 Hints 可以包含多个 Hint,Hint 间以空格分开,当多个 Hint 冲突或相同时以先出现的为准。 +- 当 Hints 中某个 Hint 出现错误时,错误出现之前的有效 Hint 仍然有效,当前及之后的 Hint 被忽略。 +- hint_param_list 是每个 Hint 的参数,根据每个 Hint 的不同而不同。 + +目前支持的 Hints 列表如下: + +| **Hint** | **参数** | **说明** | **适用范围** | +| :-----------: | -------------- | -------------------------- | -------------------------- | +| BATCH_SCAN | 无 | 采用批量读表的方式 | 超级表 JOIN 语句 | +| NO_BATCH_SCAN | 无 | 采用顺序读表的方式 | 超级表 JOIN 语句 | + +举例: + +```sql +SELECT /*+ BATCH_SCAN() */ a.ts FROM stable1 a, stable2 b where a.tag0 = b.tag0 and a.ts = b.ts; +``` + ## 列表 查询语句可以指定部分或全部列作为返回结果。数据列和标签列都可以出现在列表中。 From f905a77217c6e9b87e4ca27af205eb8c1c2a04d5 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 24 Aug 2023 14:37:16 +0800 Subject: [PATCH 45/46] fix: typo --- docs/en/12-taos-sql/06-select.md | 4 +- docs/en/12-taos-sql/06-select.md.bak | 478 +++++++++++++++++++++++++++ 2 files changed, 480 insertions(+), 2 deletions(-) create mode 100755 docs/en/12-taos-sql/06-select.md.bak diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md index 5af06fa0db..0bb1d7dfcd 100755 --- a/docs/en/12-taos-sql/06-select.md +++ b/docs/en/12-taos-sql/06-select.md @@ -85,14 +85,14 @@ Hints are a means of user control over query optimization for individual stateme - When an error occurs with a hint in hints, the effective hint before the error is still valid, and the current and subsequent hints are ignored. - hint_param_list are arguments to each hint, which varies according to each hint. -The list of currently supported Hints is as follows +The list of currently supported Hints is as follows: | **Hint** | **Params** | **Comment** | **Scopt** | | :-----------: | -------------- | -------------------------- | -------------------------- | | BATCH_SCAN | None | Batch table scan | JOIN statment for stable | | NO_BATCH_SCAN | None | Sequential table scan | JOIN statment for stable | -For example +For example: ```sql SELECT /*+ BATCH_SCAN() */ a.ts FROM stable1 a, stable2 b where a.tag0 = b.tag0 and a.ts = b.ts; diff --git a/docs/en/12-taos-sql/06-select.md.bak b/docs/en/12-taos-sql/06-select.md.bak new file mode 100755 index 0000000000..5af06fa0db --- /dev/null +++ b/docs/en/12-taos-sql/06-select.md.bak @@ -0,0 +1,478 @@ +--- +title: Select +sidebar_label: Select +description: This document describes how to query data in TDengine. +--- + +## Syntax + +```sql +SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE()} + +SELECT [hints] [DISTINCT] select_list + from_clause + [WHERE condition] + [partition_by_clause] + [interp_clause] + [window_clause] + [group_by_clause] + [order_by_clasue] + [SLIMIT limit_val [SOFFSET offset_val]] + [LIMIT limit_val [OFFSET offset_val]] + [>> export_file] + +hints: /*+ [hint([hint_param_list])] [hint([hint_param_list])] */ + +hint: + BATCH_SCAN | NO_BATCH_SCAN + +select_list: + select_expr [, select_expr] ... + +select_expr: { + * + | query_name.* + | [schema_name.] {table_name | view_name} .* + | t_alias.* + | expr [[AS] c_alias] +} + +from_clause: { + table_reference [, table_reference] ... + | join_clause [, join_clause] ... +} + +table_reference: + table_expr t_alias + +table_expr: { + table_name + | view_name + | ( subquery ) +} + +join_clause: + table_reference [INNER] JOIN table_reference ON condition + +window_clause: { + SESSION(ts_col, tol_val) + | STATE_WINDOW(col) + | INTERVAL(interval_val [, interval_offset]) [SLIDING (sliding_val)] [WATERMARK(watermark_val)] [FILL(fill_mod_and_val)] + +interp_clause: + RANGE(ts_val [, ts_val]) EVERY(every_val) FILL(fill_mod_and_val) + +partition_by_clause: + PARTITION BY expr [, expr] ... + +group_by_clause: + GROUP BY expr [, expr] ... HAVING condition + +order_by_clasue: + ORDER BY order_expr [, order_expr] ... + +order_expr: + {expr | position | c_alias} [DESC | ASC] [NULLS FIRST | NULLS LAST] +``` + +## Hints + +Hints are a means of user control over query optimization for individual statements. Hints will be ignore automatically if they are not applicable to the current query statement. The specific instructions are as follows: + +- Hints syntax starts with `/*+` and ends with `*/`, spaces are allowed before or after. +- Hints syntax can only follow the SELECT keyword. +- Each hints can contain multiple hint, separated by spaces. When multiple hints conflict or are identical, whichever comes first takes effect. +- When an error occurs with a hint in hints, the effective hint before the error is still valid, and the current and subsequent hints are ignored. +- hint_param_list are arguments to each hint, which varies according to each hint. + +The list of currently supported Hints is as follows + +| **Hint** | **Params** | **Comment** | **Scopt** | +| :-----------: | -------------- | -------------------------- | -------------------------- | +| BATCH_SCAN | None | Batch table scan | JOIN statment for stable | +| NO_BATCH_SCAN | None | Sequential table scan | JOIN statment for stable | + +For example + +```sql +SELECT /*+ BATCH_SCAN() */ a.ts FROM stable1 a, stable2 b where a.tag0 = b.tag0 and a.ts = b.ts; +``` + +## Lists + +A query can be performed on some or all columns. Data and tag columns can all be included in the SELECT list. + +### Wildcards + +You can use an asterisk (\*) as a wildcard character to indicate all columns. For normal tables or sub-tables, the asterisk indicates only data columns. For supertables, tag columns are also included when using asterisk (\*). + +```sql +SELECT * FROM d1001; +``` + +You can use a table name as a prefix before an asterisk. For example, the following SQL statements both return all columns from the d1001 table: + +```sql +SELECT * FROM d1001; +SELECT d1001.* FROM d1001; +``` + +However, in a JOIN query, using a table name prefix with an asterisk returns different results. In this case, querying * returns all data in all columns in all tables (not including tags), whereas using a table name prefix returns all data in all columns in the specified table only. + +```sql +SELECT * FROM d1001, d1003 WHERE d1001.ts=d1003.ts; +SELECT d1001.* FROM d1001,d1003 WHERE d1001.ts = d1003.ts; +``` + +The first of the preceding SQL statements returns all columns from the d1001 and d1003 tables, but the second of the preceding SQL statements returns all columns from the d1001 table only. + +With regard to the other SQL functions that support wildcards, the differences are as follows: +`count(*)` only returns one column. `first`, `last`, and `last_row` return all columns. + +### Tag Columns + +You can query tag columns in supertables and subtables and receive results in the same way as querying data columns. + +```sql +SELECT location, groupid, current FROM d1001 LIMIT 2; +``` + +### Distinct Values + +The DISTINCT keyword returns only values that are different over one or more columns. You can use the DISTINCT keyword with tag columns and data columns. + +The following SQL statement returns distinct values from a tag column: + +```sql +SELECT DISTINCT tag_name [, tag_name ...] FROM stb_name; +``` + +The following SQL statement returns distinct values from a data column: + +```sql +SELECT DISTINCT col_name [, col_name ...] FROM tb_name; +``` + +:::info + +1. Configuration parameter `maxNumOfDistinctRes` in `taos.cfg` is used to control the number of rows to output. The minimum configurable value is 100,000, the maximum configurable value is 100,000,000, the default value is 1,000,000. If the actual number of rows exceeds the value of this parameter, only the number of rows specified by this parameter will be output. +2. It can't be guaranteed that the results selected by using `DISTINCT` on columns of `FLOAT` or `DOUBLE` are exactly unique because of the precision errors in floating point numbers. + +::: + +### Column Names + +When using `SELECT`, the column names in the result set will be the same as that in the select clause if `AS` is not used. `AS` can be used to rename the column names in the result set. For example: + +```sql +taos> SELECT ts, ts AS primary_key_ts FROM d1001; +``` + +`AS` can't be used together with `first(*)`, `last(*)`, or `last_row(*)`. + +### Pseudocolumns + +**Pseudocolumn:** A pseudo-column behaves like a table column but is not actually stored in the table. You can select from pseudo-columns, but you cannot insert, update, or delete their values. A pseudo-column is also similar to a function without arguments. This section describes these pseudo-columns: + +**TBNAME** +The TBNAME pseudocolumn in a supertable contains the names of subtables within the supertable. + +The following SQL statement returns all unique subtable names and locations within the meters supertable: + +```mysql +SELECT DISTINCT TBNAME, location FROM meters; +``` + +Use the `INS_TAGS` system table in `INFORMATION_SCHEMA` to query the information for subtables in a supertable. For example, the following statement returns the name and tag values for each subtable in the `meters` supertable. + +```mysql +SELECT table_name, tag_name, tag_type, tag_value FROM information_schema.ins_tags WHERE stable_name='meters'; +``` + +The following SQL statement returns the number of subtables within the meters supertable. + +```mysql +SELECT COUNT(*) FROM (SELECT DISTINCT TBNAME FROM meters); +``` + +In the preceding two statements, only tags can be used as filtering conditions in the WHERE clause. For example: + +**\_QSTART and \_QEND** + +The \_QSTART and \_QEND pseudocolumns contain the beginning and end of the time range of a query. If the WHERE clause in a statement does not contain valid timestamps, the time range is equal to [-2^63, 2^63 - 1]. + +The \_QSTART and \_QEND pseudocolumns cannot be used in a WHERE clause. + +**\_WSTART, \_WEND, and \_WDURATION** + +The \_WSTART, \_WEND, and \_WDURATION pseudocolumns indicate the beginning, end, and duration of a window. + +These pseudocolumns can be used only in time window-based aggregations and must occur after the aggregation clause. + +**\_c0 and \_ROWTS** + +In TDengine, the first column of all tables must be a timestamp. This column is the primary key of the table. The \_c0 and \_ROWTS pseudocolumns both represent the values of this column. These pseudocolumns enable greater flexibility and standardization. For example, you can use functions such as MAX and MIN with these pseudocolumns. + +```sql +select _rowts, max(current) from meters; +``` + +**\_IROWTS** + +The \_IROWTS pseudocolumn can only be used with INTERP function. This pseudocolumn can be used to retrieve the corresponding timestamp column associated with the interpolation results. + +```sql +select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear); +``` + +## Query Objects + +`FROM` can be followed by a number of tables or super tables, or can be followed by a sub-query. +If no database is specified as current database in use, table names must be preceded with database name, for example, `power.d1001`. + +You can perform INNER JOIN statements based on the primary key. The following conditions apply: + +1. You can use FROM table list or an explicit JOIN clause. +2. For standard tables and subtables, you must specify an ON condition and the condition must be equivalent to the primary key. +3. For supertables, the ON condition must be equivalent to the primary key. In addition, the tag columns of the tables on which the INNER JOIN is performed must have a one-to-one relationship. You cannot specify an OR condition. +4. The tables that are included in a JOIN clause must be of the same type (supertable, standard table, or subtable). +5. You can include subqueries before and after the JOIN keyword. +6. You cannot include more than ten tables in a JOIN clause. +7. You cannot include a FILL clause and a JOIN clause in the same statement. + +## GROUP BY + +If you use a GROUP BY clause, the SELECT list can only include the following items: + +1. Constants +2. Aggregate functions +3. Expressions that are consistent with the expression following the GROUP BY clause +4. Expressions that include the preceding expression + +The GROUP BY clause groups each row of data by the value of the expression following the clause and returns a combined result for each group. + +The expressions in a GROUP BY clause can include any column in any table or view. It is not necessary that the expressions appear in the SELECT list. + +The GROUP BY clause does not guarantee that the results are ordered. If you want to ensure that grouped data is ordered, use the ORDER BY clause. + + +## PARTITION BY + +The PARTITION BY clause is a TDengine-specific extension to standard SQL. This clause partitions data based on the part_list and performs computations per partition. + +For more information, see TDengine Extensions. + +## ORDER BY + +The ORDER BY keyword orders query results. If you do not include an ORDER BY clause in a query, the order of the results can be inconsistent. + +You can specify integers after ORDER BY to indicate the order in which you want the items in the SELECT list to be displayed. For example, 1 indicates the first item in the select list. + +You can specify ASC for ascending order or DESC for descending order. + +You can also use the NULLS keyword to specify the position of null values. Ascending order uses NULLS LAST by default. Descending order uses NULLS FIRST by default. + +## LIMIT + +The LIMIT keyword controls the number of results that are displayed. You can also use the OFFSET keyword to specify the result to display first. `LIMIT` and `OFFSET` are executed after `ORDER BY` in the query execution. You can include an offset in a LIMIT clause. For example, LIMIT 5 OFFSET 2 can also be written LIMIT 2, 5. Both of these clauses display the third through the seventh results. + +In a statement that includes a PARTITION BY/GROUP BY clause, the LIMIT keyword is performed on each partition/group, not on the entire set of results. + +## SLIMIT + +The SLIMIT keyword is used with a PARTITION BY/GROUP BY clause to control the number of partitions/groups that are displayed. You can include an offset in a SLIMIT clause. For example, SLIMIT 5 OFFSET 2 can also be written LIMIT 2, 5. Both of these clauses display the third through the seventh partitions/groups. + +Note: If you include an ORDER BY clause, only one partition/group can be displayed. + +## Special Query + +Some special query functions can be invoked without `FROM` sub-clause. + +### Obtain Current Database + +The following SQL statement returns the current database. If a database has not been specified on login or with the `USE` command, a null value is returned. + +```sql +SELECT DATABASE(); +``` + +### Obtain Current Version + +```sql +SELECT CLIENT_VERSION(); +SELECT SERVER_VERSION(); +``` + +### Obtain Server Status + +The following SQL statement returns the status of the TDengine server. An integer indicates that the server is running normally. An error code indicates that an error has occurred. This statement can also detect whether a connection pool or third-party tool is connected to TDengine properly. By using this statement, you can ensure that connections in a pool are not lost due to an incorrect heartbeat detection statement. + +```sql +SELECT SERVER_STATUS(); +``` + +### Obtain Current Time + +```sql +SELECT NOW(); +``` + +### Obtain Current Date + +```sql +SELECT TODAY(); +``` + +### Obtain Current Time Zone + +```sql +SELECT TIMEZONE(); +``` + +## Regular Expression + +### Syntax + +```txt +WHERE (column|tbname) match/MATCH/nmatch/NMATCH _regex_ +``` + +### Specification + +TDengine supports POSIX regular expression syntax. For more information, see [Regular Expressions](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html). + +### Restrictions + +Regular expression filtering is supported only on table names (TBNAME), BINARY tags, and NCHAR tags. Regular expression filtering cannot be performed on data columns. + +A regular expression string cannot exceed 128 bytes. You can configure this value by modifying the maxRegexStringLen parameter on the TDengine Client. The modified value takes effect when the client is restarted. + +## CASE Expressions + +### Syntax + +```txt +CASE value WHEN compare_value THEN result [WHEN compare_value THEN result ...] [ELSE result] END +CASE WHEN condition THEN result [WHEN condition THEN result ...] [ELSE result] END +``` + +### Description +CASE expressions let you use IF ... THEN ... ELSE logic in SQL statements without having to invoke procedures. + +The first CASE syntax returns the `result` for the first `value`=`compare_value` comparison that is true. + +The second syntax returns the `result` for the first `condition` that is true. + +If no comparison or condition is true, the result after ELSE is returned, or NULL if there is no ELSE part. + +The return type of the CASE expression is the result type of the first WHEN WHEN part, and the result type of the other WHEN WHEN parts and ELSE parts can be converted to them, otherwise TDengine will report an error. + +### Examples + +A device has three status codes to display its status. The statements are as follows: + +```sql +SELECT CASE dev_status WHEN 1 THEN 'Running' WHEN 2 THEN 'Warning' WHEN 3 THEN 'Downtime' ELSE 'Unknown' END FROM dev_table; +``` + +The average voltage value of the smart meter is counted. When the voltage is less than 200 or more than 250, it is considered that the statistics is wrong, and the value is corrected to 220. The statement is as follows: + +```sql +SELECT AVG(CASE WHEN voltage < 200 or voltage > 250 THEN 220 ELSE voltage END) FROM meters; +``` + +## JOIN + +TDengine supports the `INTER JOIN` based on the timestamp primary key, that is, the `JOIN` condition must contain the timestamp primary key. As long as the requirement of timestamp-based primary key is met, `INTER JOIN` can be made between normal tables, sub-tables, super tables and sub-queries at will, and there is no limit on the number of tables. + +For standard tables: + +```sql +SELECT * +FROM temp_tb_1 t1, pressure_tb_1 t2 +WHERE t1.ts = t2.ts +``` + +For supertables: + +```sql +SELECT * +FROM temp_stable t1, temp_stable t2 +WHERE t1.ts = t2.ts AND t1.deviceid = t2.deviceid AND t1.status=0; +``` + +For sub-table and super table: + +```sql +SELECT * +FROM temp_ctable t1, temp_stable t2 +WHERE t1.ts = t2.ts AND t1.deviceid = t2.deviceid AND t1.status=0; +``` + +Similarly, join operations can be performed on the result sets of multiple subqueries. + +## Nested Query + +Nested query is also called sub query. This means that in a single SQL statement the result of inner query can be used as the data source of the outer query. + +From 2.2.0.0, unassociated sub query can be used in the `FROM` clause. Unassociated means the sub query doesn't use the parameters in the parent query. More specifically, in the `tb_name_list` of `SELECT` statement, an independent SELECT statement can be used. So a complete nested query looks like: + +``` +SELECT ... FROM (SELECT ... FROM ...) ...; +``` + +:::info + +- The result of a nested query is returned as a virtual table used by the outer query. It's recommended to give an alias to this table for the convenience of using it in the outer query. +- JOIN operation is allowed between tables/STables inside both inner and outer queries. Join operation can be performed on the result set of the inner query. +- The features that can be used in the inner query are the same as those that can be used in a non-nested query. + - `ORDER BY` inside the inner query is unnecessary and will slow down the query performance significantly. It is best to avoid the use of `ORDER BY` inside the inner query. +- Compared to the non-nested query, the functionality that can be used in the outer query has the following restrictions: + - Functions + - If the result set returned by the inner query doesn't contain timestamp column, then functions relying on timestamp can't be used in the outer query, like INTERP,DERIVATIVE, IRATE, LAST_ROW, FIRST, LAST, TWA, STATEDURATION, TAIL, UNIQUE. + - If the result set returned by the inner query are not sorted in order by timestamp, then functions relying on data ordered by timestamp can't be used in the outer query, like LEASTSQUARES, ELAPSED, INTERP, DERIVATIVE, IRATE, TWA, DIFF, STATECOUNT, STATEDURATION, CSUM, MAVG, TAIL, UNIQUE. + - Functions that need to scan the data twice can't be used in the outer query, like PERCENTILE. + +::: + +## UNION ALL + +```txt title=Syntax +SELECT ... +UNION ALL SELECT ... +[UNION ALL SELECT ...] +``` + +TDengine supports the `UNION ALL` operation. `UNION ALL` operator can be used to combine the result set from multiple select statements as long as the result set of these select statements have exactly the same columns. `UNION ALL` doesn't remove redundant rows from multiple result sets. In a single SQL statement, at most 100 `UNION ALL` can be supported. + +### Examples + +table `tb1` is created using below SQL statement: + +``` +CREATE TABLE tb1 (ts TIMESTAMP, col1 INT, col2 FLOAT, col3 BINARY(50)); +``` + +The rows in the past one hour in `tb1` can be selected using below SQL statement: + +``` +SELECT * FROM tb1 WHERE ts >= NOW - 1h; +``` + +The rows between 2018-06-01 08:00:00.000 and 2018-06-02 08:00:00.000 and col3 ends with 'nny' can be selected in the descending order of timestamp using below SQL statement: + +``` +SELECT * FROM tb1 WHERE ts > '2018-06-01 08:00:00.000' AND ts <= '2018-06-02 08:00:00.000' AND col3 LIKE '%nny' ORDER BY ts DESC; +``` + +The sum of col1 and col2 for rows later than 2018-06-01 08:00:00.000 and whose col2 is bigger than 1.2 can be selected and renamed as "complex", while only 10 rows are output from the 5th row, by below SQL statement: + +``` +SELECT (col1 + col2) AS 'complex' FROM tb1 WHERE ts > '2018-06-01 08:00:00.000' AND col2 > 1.2 LIMIT 10 OFFSET 5; +``` + +The rows in the past 10 minutes and whose col2 is bigger than 3.14 are selected and output to the result file `/home/testoutput.csv` with below SQL statement: + +``` +SELECT COUNT(*) FROM tb1 WHERE ts >= NOW - 10m AND col2 > 3.14 >> /home/testoutput.csv; +``` From c5618588a177798ba26a0e7f12cc97befe7eb346 Mon Sep 17 00:00:00 2001 From: dapan1121 <72057773+dapan1121@users.noreply.github.com> Date: Thu, 24 Aug 2023 14:38:23 +0800 Subject: [PATCH 46/46] Delete 06-select.md.bak --- docs/en/12-taos-sql/06-select.md.bak | 478 --------------------------- 1 file changed, 478 deletions(-) delete mode 100755 docs/en/12-taos-sql/06-select.md.bak diff --git a/docs/en/12-taos-sql/06-select.md.bak b/docs/en/12-taos-sql/06-select.md.bak deleted file mode 100755 index 5af06fa0db..0000000000 --- a/docs/en/12-taos-sql/06-select.md.bak +++ /dev/null @@ -1,478 +0,0 @@ ---- -title: Select -sidebar_label: Select -description: This document describes how to query data in TDengine. ---- - -## Syntax - -```sql -SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE()} - -SELECT [hints] [DISTINCT] select_list - from_clause - [WHERE condition] - [partition_by_clause] - [interp_clause] - [window_clause] - [group_by_clause] - [order_by_clasue] - [SLIMIT limit_val [SOFFSET offset_val]] - [LIMIT limit_val [OFFSET offset_val]] - [>> export_file] - -hints: /*+ [hint([hint_param_list])] [hint([hint_param_list])] */ - -hint: - BATCH_SCAN | NO_BATCH_SCAN - -select_list: - select_expr [, select_expr] ... - -select_expr: { - * - | query_name.* - | [schema_name.] {table_name | view_name} .* - | t_alias.* - | expr [[AS] c_alias] -} - -from_clause: { - table_reference [, table_reference] ... - | join_clause [, join_clause] ... -} - -table_reference: - table_expr t_alias - -table_expr: { - table_name - | view_name - | ( subquery ) -} - -join_clause: - table_reference [INNER] JOIN table_reference ON condition - -window_clause: { - SESSION(ts_col, tol_val) - | STATE_WINDOW(col) - | INTERVAL(interval_val [, interval_offset]) [SLIDING (sliding_val)] [WATERMARK(watermark_val)] [FILL(fill_mod_and_val)] - -interp_clause: - RANGE(ts_val [, ts_val]) EVERY(every_val) FILL(fill_mod_and_val) - -partition_by_clause: - PARTITION BY expr [, expr] ... - -group_by_clause: - GROUP BY expr [, expr] ... HAVING condition - -order_by_clasue: - ORDER BY order_expr [, order_expr] ... - -order_expr: - {expr | position | c_alias} [DESC | ASC] [NULLS FIRST | NULLS LAST] -``` - -## Hints - -Hints are a means of user control over query optimization for individual statements. Hints will be ignore automatically if they are not applicable to the current query statement. The specific instructions are as follows: - -- Hints syntax starts with `/*+` and ends with `*/`, spaces are allowed before or after. -- Hints syntax can only follow the SELECT keyword. -- Each hints can contain multiple hint, separated by spaces. When multiple hints conflict or are identical, whichever comes first takes effect. -- When an error occurs with a hint in hints, the effective hint before the error is still valid, and the current and subsequent hints are ignored. -- hint_param_list are arguments to each hint, which varies according to each hint. - -The list of currently supported Hints is as follows - -| **Hint** | **Params** | **Comment** | **Scopt** | -| :-----------: | -------------- | -------------------------- | -------------------------- | -| BATCH_SCAN | None | Batch table scan | JOIN statment for stable | -| NO_BATCH_SCAN | None | Sequential table scan | JOIN statment for stable | - -For example - -```sql -SELECT /*+ BATCH_SCAN() */ a.ts FROM stable1 a, stable2 b where a.tag0 = b.tag0 and a.ts = b.ts; -``` - -## Lists - -A query can be performed on some or all columns. Data and tag columns can all be included in the SELECT list. - -### Wildcards - -You can use an asterisk (\*) as a wildcard character to indicate all columns. For normal tables or sub-tables, the asterisk indicates only data columns. For supertables, tag columns are also included when using asterisk (\*). - -```sql -SELECT * FROM d1001; -``` - -You can use a table name as a prefix before an asterisk. For example, the following SQL statements both return all columns from the d1001 table: - -```sql -SELECT * FROM d1001; -SELECT d1001.* FROM d1001; -``` - -However, in a JOIN query, using a table name prefix with an asterisk returns different results. In this case, querying * returns all data in all columns in all tables (not including tags), whereas using a table name prefix returns all data in all columns in the specified table only. - -```sql -SELECT * FROM d1001, d1003 WHERE d1001.ts=d1003.ts; -SELECT d1001.* FROM d1001,d1003 WHERE d1001.ts = d1003.ts; -``` - -The first of the preceding SQL statements returns all columns from the d1001 and d1003 tables, but the second of the preceding SQL statements returns all columns from the d1001 table only. - -With regard to the other SQL functions that support wildcards, the differences are as follows: -`count(*)` only returns one column. `first`, `last`, and `last_row` return all columns. - -### Tag Columns - -You can query tag columns in supertables and subtables and receive results in the same way as querying data columns. - -```sql -SELECT location, groupid, current FROM d1001 LIMIT 2; -``` - -### Distinct Values - -The DISTINCT keyword returns only values that are different over one or more columns. You can use the DISTINCT keyword with tag columns and data columns. - -The following SQL statement returns distinct values from a tag column: - -```sql -SELECT DISTINCT tag_name [, tag_name ...] FROM stb_name; -``` - -The following SQL statement returns distinct values from a data column: - -```sql -SELECT DISTINCT col_name [, col_name ...] FROM tb_name; -``` - -:::info - -1. Configuration parameter `maxNumOfDistinctRes` in `taos.cfg` is used to control the number of rows to output. The minimum configurable value is 100,000, the maximum configurable value is 100,000,000, the default value is 1,000,000. If the actual number of rows exceeds the value of this parameter, only the number of rows specified by this parameter will be output. -2. It can't be guaranteed that the results selected by using `DISTINCT` on columns of `FLOAT` or `DOUBLE` are exactly unique because of the precision errors in floating point numbers. - -::: - -### Column Names - -When using `SELECT`, the column names in the result set will be the same as that in the select clause if `AS` is not used. `AS` can be used to rename the column names in the result set. For example: - -```sql -taos> SELECT ts, ts AS primary_key_ts FROM d1001; -``` - -`AS` can't be used together with `first(*)`, `last(*)`, or `last_row(*)`. - -### Pseudocolumns - -**Pseudocolumn:** A pseudo-column behaves like a table column but is not actually stored in the table. You can select from pseudo-columns, but you cannot insert, update, or delete their values. A pseudo-column is also similar to a function without arguments. This section describes these pseudo-columns: - -**TBNAME** -The TBNAME pseudocolumn in a supertable contains the names of subtables within the supertable. - -The following SQL statement returns all unique subtable names and locations within the meters supertable: - -```mysql -SELECT DISTINCT TBNAME, location FROM meters; -``` - -Use the `INS_TAGS` system table in `INFORMATION_SCHEMA` to query the information for subtables in a supertable. For example, the following statement returns the name and tag values for each subtable in the `meters` supertable. - -```mysql -SELECT table_name, tag_name, tag_type, tag_value FROM information_schema.ins_tags WHERE stable_name='meters'; -``` - -The following SQL statement returns the number of subtables within the meters supertable. - -```mysql -SELECT COUNT(*) FROM (SELECT DISTINCT TBNAME FROM meters); -``` - -In the preceding two statements, only tags can be used as filtering conditions in the WHERE clause. For example: - -**\_QSTART and \_QEND** - -The \_QSTART and \_QEND pseudocolumns contain the beginning and end of the time range of a query. If the WHERE clause in a statement does not contain valid timestamps, the time range is equal to [-2^63, 2^63 - 1]. - -The \_QSTART and \_QEND pseudocolumns cannot be used in a WHERE clause. - -**\_WSTART, \_WEND, and \_WDURATION** - -The \_WSTART, \_WEND, and \_WDURATION pseudocolumns indicate the beginning, end, and duration of a window. - -These pseudocolumns can be used only in time window-based aggregations and must occur after the aggregation clause. - -**\_c0 and \_ROWTS** - -In TDengine, the first column of all tables must be a timestamp. This column is the primary key of the table. The \_c0 and \_ROWTS pseudocolumns both represent the values of this column. These pseudocolumns enable greater flexibility and standardization. For example, you can use functions such as MAX and MIN with these pseudocolumns. - -```sql -select _rowts, max(current) from meters; -``` - -**\_IROWTS** - -The \_IROWTS pseudocolumn can only be used with INTERP function. This pseudocolumn can be used to retrieve the corresponding timestamp column associated with the interpolation results. - -```sql -select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear); -``` - -## Query Objects - -`FROM` can be followed by a number of tables or super tables, or can be followed by a sub-query. -If no database is specified as current database in use, table names must be preceded with database name, for example, `power.d1001`. - -You can perform INNER JOIN statements based on the primary key. The following conditions apply: - -1. You can use FROM table list or an explicit JOIN clause. -2. For standard tables and subtables, you must specify an ON condition and the condition must be equivalent to the primary key. -3. For supertables, the ON condition must be equivalent to the primary key. In addition, the tag columns of the tables on which the INNER JOIN is performed must have a one-to-one relationship. You cannot specify an OR condition. -4. The tables that are included in a JOIN clause must be of the same type (supertable, standard table, or subtable). -5. You can include subqueries before and after the JOIN keyword. -6. You cannot include more than ten tables in a JOIN clause. -7. You cannot include a FILL clause and a JOIN clause in the same statement. - -## GROUP BY - -If you use a GROUP BY clause, the SELECT list can only include the following items: - -1. Constants -2. Aggregate functions -3. Expressions that are consistent with the expression following the GROUP BY clause -4. Expressions that include the preceding expression - -The GROUP BY clause groups each row of data by the value of the expression following the clause and returns a combined result for each group. - -The expressions in a GROUP BY clause can include any column in any table or view. It is not necessary that the expressions appear in the SELECT list. - -The GROUP BY clause does not guarantee that the results are ordered. If you want to ensure that grouped data is ordered, use the ORDER BY clause. - - -## PARTITION BY - -The PARTITION BY clause is a TDengine-specific extension to standard SQL. This clause partitions data based on the part_list and performs computations per partition. - -For more information, see TDengine Extensions. - -## ORDER BY - -The ORDER BY keyword orders query results. If you do not include an ORDER BY clause in a query, the order of the results can be inconsistent. - -You can specify integers after ORDER BY to indicate the order in which you want the items in the SELECT list to be displayed. For example, 1 indicates the first item in the select list. - -You can specify ASC for ascending order or DESC for descending order. - -You can also use the NULLS keyword to specify the position of null values. Ascending order uses NULLS LAST by default. Descending order uses NULLS FIRST by default. - -## LIMIT - -The LIMIT keyword controls the number of results that are displayed. You can also use the OFFSET keyword to specify the result to display first. `LIMIT` and `OFFSET` are executed after `ORDER BY` in the query execution. You can include an offset in a LIMIT clause. For example, LIMIT 5 OFFSET 2 can also be written LIMIT 2, 5. Both of these clauses display the third through the seventh results. - -In a statement that includes a PARTITION BY/GROUP BY clause, the LIMIT keyword is performed on each partition/group, not on the entire set of results. - -## SLIMIT - -The SLIMIT keyword is used with a PARTITION BY/GROUP BY clause to control the number of partitions/groups that are displayed. You can include an offset in a SLIMIT clause. For example, SLIMIT 5 OFFSET 2 can also be written LIMIT 2, 5. Both of these clauses display the third through the seventh partitions/groups. - -Note: If you include an ORDER BY clause, only one partition/group can be displayed. - -## Special Query - -Some special query functions can be invoked without `FROM` sub-clause. - -### Obtain Current Database - -The following SQL statement returns the current database. If a database has not been specified on login or with the `USE` command, a null value is returned. - -```sql -SELECT DATABASE(); -``` - -### Obtain Current Version - -```sql -SELECT CLIENT_VERSION(); -SELECT SERVER_VERSION(); -``` - -### Obtain Server Status - -The following SQL statement returns the status of the TDengine server. An integer indicates that the server is running normally. An error code indicates that an error has occurred. This statement can also detect whether a connection pool or third-party tool is connected to TDengine properly. By using this statement, you can ensure that connections in a pool are not lost due to an incorrect heartbeat detection statement. - -```sql -SELECT SERVER_STATUS(); -``` - -### Obtain Current Time - -```sql -SELECT NOW(); -``` - -### Obtain Current Date - -```sql -SELECT TODAY(); -``` - -### Obtain Current Time Zone - -```sql -SELECT TIMEZONE(); -``` - -## Regular Expression - -### Syntax - -```txt -WHERE (column|tbname) match/MATCH/nmatch/NMATCH _regex_ -``` - -### Specification - -TDengine supports POSIX regular expression syntax. For more information, see [Regular Expressions](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html). - -### Restrictions - -Regular expression filtering is supported only on table names (TBNAME), BINARY tags, and NCHAR tags. Regular expression filtering cannot be performed on data columns. - -A regular expression string cannot exceed 128 bytes. You can configure this value by modifying the maxRegexStringLen parameter on the TDengine Client. The modified value takes effect when the client is restarted. - -## CASE Expressions - -### Syntax - -```txt -CASE value WHEN compare_value THEN result [WHEN compare_value THEN result ...] [ELSE result] END -CASE WHEN condition THEN result [WHEN condition THEN result ...] [ELSE result] END -``` - -### Description -CASE expressions let you use IF ... THEN ... ELSE logic in SQL statements without having to invoke procedures. - -The first CASE syntax returns the `result` for the first `value`=`compare_value` comparison that is true. - -The second syntax returns the `result` for the first `condition` that is true. - -If no comparison or condition is true, the result after ELSE is returned, or NULL if there is no ELSE part. - -The return type of the CASE expression is the result type of the first WHEN WHEN part, and the result type of the other WHEN WHEN parts and ELSE parts can be converted to them, otherwise TDengine will report an error. - -### Examples - -A device has three status codes to display its status. The statements are as follows: - -```sql -SELECT CASE dev_status WHEN 1 THEN 'Running' WHEN 2 THEN 'Warning' WHEN 3 THEN 'Downtime' ELSE 'Unknown' END FROM dev_table; -``` - -The average voltage value of the smart meter is counted. When the voltage is less than 200 or more than 250, it is considered that the statistics is wrong, and the value is corrected to 220. The statement is as follows: - -```sql -SELECT AVG(CASE WHEN voltage < 200 or voltage > 250 THEN 220 ELSE voltage END) FROM meters; -``` - -## JOIN - -TDengine supports the `INTER JOIN` based on the timestamp primary key, that is, the `JOIN` condition must contain the timestamp primary key. As long as the requirement of timestamp-based primary key is met, `INTER JOIN` can be made between normal tables, sub-tables, super tables and sub-queries at will, and there is no limit on the number of tables. - -For standard tables: - -```sql -SELECT * -FROM temp_tb_1 t1, pressure_tb_1 t2 -WHERE t1.ts = t2.ts -``` - -For supertables: - -```sql -SELECT * -FROM temp_stable t1, temp_stable t2 -WHERE t1.ts = t2.ts AND t1.deviceid = t2.deviceid AND t1.status=0; -``` - -For sub-table and super table: - -```sql -SELECT * -FROM temp_ctable t1, temp_stable t2 -WHERE t1.ts = t2.ts AND t1.deviceid = t2.deviceid AND t1.status=0; -``` - -Similarly, join operations can be performed on the result sets of multiple subqueries. - -## Nested Query - -Nested query is also called sub query. This means that in a single SQL statement the result of inner query can be used as the data source of the outer query. - -From 2.2.0.0, unassociated sub query can be used in the `FROM` clause. Unassociated means the sub query doesn't use the parameters in the parent query. More specifically, in the `tb_name_list` of `SELECT` statement, an independent SELECT statement can be used. So a complete nested query looks like: - -``` -SELECT ... FROM (SELECT ... FROM ...) ...; -``` - -:::info - -- The result of a nested query is returned as a virtual table used by the outer query. It's recommended to give an alias to this table for the convenience of using it in the outer query. -- JOIN operation is allowed between tables/STables inside both inner and outer queries. Join operation can be performed on the result set of the inner query. -- The features that can be used in the inner query are the same as those that can be used in a non-nested query. - - `ORDER BY` inside the inner query is unnecessary and will slow down the query performance significantly. It is best to avoid the use of `ORDER BY` inside the inner query. -- Compared to the non-nested query, the functionality that can be used in the outer query has the following restrictions: - - Functions - - If the result set returned by the inner query doesn't contain timestamp column, then functions relying on timestamp can't be used in the outer query, like INTERP,DERIVATIVE, IRATE, LAST_ROW, FIRST, LAST, TWA, STATEDURATION, TAIL, UNIQUE. - - If the result set returned by the inner query are not sorted in order by timestamp, then functions relying on data ordered by timestamp can't be used in the outer query, like LEASTSQUARES, ELAPSED, INTERP, DERIVATIVE, IRATE, TWA, DIFF, STATECOUNT, STATEDURATION, CSUM, MAVG, TAIL, UNIQUE. - - Functions that need to scan the data twice can't be used in the outer query, like PERCENTILE. - -::: - -## UNION ALL - -```txt title=Syntax -SELECT ... -UNION ALL SELECT ... -[UNION ALL SELECT ...] -``` - -TDengine supports the `UNION ALL` operation. `UNION ALL` operator can be used to combine the result set from multiple select statements as long as the result set of these select statements have exactly the same columns. `UNION ALL` doesn't remove redundant rows from multiple result sets. In a single SQL statement, at most 100 `UNION ALL` can be supported. - -### Examples - -table `tb1` is created using below SQL statement: - -``` -CREATE TABLE tb1 (ts TIMESTAMP, col1 INT, col2 FLOAT, col3 BINARY(50)); -``` - -The rows in the past one hour in `tb1` can be selected using below SQL statement: - -``` -SELECT * FROM tb1 WHERE ts >= NOW - 1h; -``` - -The rows between 2018-06-01 08:00:00.000 and 2018-06-02 08:00:00.000 and col3 ends with 'nny' can be selected in the descending order of timestamp using below SQL statement: - -``` -SELECT * FROM tb1 WHERE ts > '2018-06-01 08:00:00.000' AND ts <= '2018-06-02 08:00:00.000' AND col3 LIKE '%nny' ORDER BY ts DESC; -``` - -The sum of col1 and col2 for rows later than 2018-06-01 08:00:00.000 and whose col2 is bigger than 1.2 can be selected and renamed as "complex", while only 10 rows are output from the 5th row, by below SQL statement: - -``` -SELECT (col1 + col2) AS 'complex' FROM tb1 WHERE ts > '2018-06-01 08:00:00.000' AND col2 > 1.2 LIMIT 10 OFFSET 5; -``` - -The rows in the past 10 minutes and whose col2 is bigger than 3.14 are selected and output to the result file `/home/testoutput.csv` with below SQL statement: - -``` -SELECT COUNT(*) FROM tb1 WHERE ts >= NOW - 10m AND col2 > 3.14 >> /home/testoutput.csv; -```