From 5b8cc2234b249a0299262bbc8a791e65127ac5ef Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Fri, 9 Dec 2022 14:38:29 +0800 Subject: [PATCH 01/74] fix: mem leak --- source/client/src/clientMain.c | 16 +++++----- source/client/src/clientTmq.c | 57 +++++++++++++++++++++++++++------- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 8f029e6061..333cfa3dfd 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -186,10 +186,10 @@ void taos_free_result(TAOS_RES *res) { destroyRequest(pRequest); } else if (TD_RES_TMQ_METADATA(res)) { SMqTaosxRspObj *pRsp = (SMqTaosxRspObj *)res; - if (pRsp->rsp.blockData) taosArrayDestroyP(pRsp->rsp.blockData, taosMemoryFree); - if (pRsp->rsp.blockDataLen) taosArrayDestroy(pRsp->rsp.blockDataLen); - if (pRsp->rsp.withTbName) taosArrayDestroyP(pRsp->rsp.blockTbName, taosMemoryFree); - if (pRsp->rsp.withSchema) taosArrayDestroyP(pRsp->rsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); + taosArrayDestroyP(pRsp->rsp.blockData, taosMemoryFree); + taosArrayDestroy(pRsp->rsp.blockDataLen); + taosArrayDestroyP(pRsp->rsp.blockTbName, taosMemoryFree); + taosArrayDestroyP(pRsp->rsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); // taosx taosArrayDestroy(pRsp->rsp.createTableLen); taosArrayDestroyP(pRsp->rsp.createTableReq, taosMemoryFree); @@ -199,10 +199,10 @@ void taos_free_result(TAOS_RES *res) { taosMemoryFree(pRsp); } else if (TD_RES_TMQ(res)) { SMqRspObj *pRsp = (SMqRspObj *)res; - if (pRsp->rsp.blockData) taosArrayDestroyP(pRsp->rsp.blockData, taosMemoryFree); - if (pRsp->rsp.blockDataLen) taosArrayDestroy(pRsp->rsp.blockDataLen); - if (pRsp->rsp.withTbName) taosArrayDestroyP(pRsp->rsp.blockTbName, taosMemoryFree); - if (pRsp->rsp.withSchema) taosArrayDestroyP(pRsp->rsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); + taosArrayDestroyP(pRsp->rsp.blockData, taosMemoryFree); + taosArrayDestroy(pRsp->rsp.blockDataLen); + taosArrayDestroyP(pRsp->rsp.blockTbName, taosMemoryFree); + taosArrayDestroyP(pRsp->rsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); pRsp->resInfo.pRspMsg = NULL; doFreeReqResultInfo(&pRsp->resInfo); taosMemoryFree(pRsp); diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index db717a4e4e..4352ec69d3 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -814,24 +814,55 @@ int32_t tmqHandleAllDelayedTask(tmq_t* tmq) { return 0; } +static void tmqFreeRspWrapper(SMqRspWrapper* rspWrapper) { + if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__END_RSP) { + // do nothing + } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__EP_RSP) { + SMqAskEpRspWrapper* pEpRspWrapper = (SMqAskEpRspWrapper*)rspWrapper; + tDeleteSMqAskEpRsp(&pEpRspWrapper->msg); + } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_RSP) { + SMqPollRspWrapper* pRsp = (SMqPollRspWrapper*)rspWrapper; + taosArrayDestroyP(pRsp->dataRsp.blockData, taosMemoryFree); + taosArrayDestroy(pRsp->dataRsp.blockDataLen); + taosArrayDestroyP(pRsp->dataRsp.blockTbName, taosMemoryFree); + taosArrayDestroyP(pRsp->dataRsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); + } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_META_RSP) { + SMqPollRspWrapper* pRsp = (SMqPollRspWrapper*)rspWrapper; + taosMemoryFree(pRsp->metaRsp.metaRsp); + } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__TAOSX_RSP) { + SMqPollRspWrapper* pRsp = (SMqPollRspWrapper*)rspWrapper; + taosArrayDestroyP(pRsp->taosxRsp.blockData, taosMemoryFree); + taosArrayDestroy(pRsp->taosxRsp.blockDataLen); + taosArrayDestroyP(pRsp->taosxRsp.blockTbName, taosMemoryFree); + taosArrayDestroyP(pRsp->taosxRsp.blockSchema, (FDelete)tDeleteSSchemaWrapper); + // taosx + taosArrayDestroy(pRsp->taosxRsp.createTableLen); + taosArrayDestroyP(pRsp->taosxRsp.createTableReq, taosMemoryFree); + } +} + void tmqClearUnhandleMsg(tmq_t* tmq) { - SMqRspWrapper* msg = NULL; + SMqRspWrapper* rspWrapper = NULL; while (1) { - taosGetQitem(tmq->qall, (void**)&msg); - if (msg) - taosFreeQitem(msg); - else + taosGetQitem(tmq->qall, (void**)&rspWrapper); + if (rspWrapper) { + tmqFreeRspWrapper(rspWrapper); + taosFreeQitem(rspWrapper); + } else { break; + } } - msg = NULL; + rspWrapper = NULL; taosReadAllQitems(tmq->mqueue, tmq->qall); while (1) { - taosGetQitem(tmq->qall, (void**)&msg); - if (msg) - taosFreeQitem(msg); - else + taosGetQitem(tmq->qall, (void**)&rspWrapper); + if (rspWrapper) { + tmqFreeRspWrapper(rspWrapper); + taosFreeQitem(rspWrapper); + } else { break; + } } } @@ -1644,6 +1675,7 @@ int32_t tmqHandleNoPollRsp(tmq_t* tmq, SMqRspWrapper* rspWrapper, bool* pReset) tDeleteSMqAskEpRsp(rspMsg); *pReset = true; } else { + tmqFreeRspWrapper(rspWrapper); *pReset = false; } } else { @@ -1695,6 +1727,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { } else { tscDebug("msg discard since epoch mismatch: msg epoch %d, consumer epoch %d", pollRspWrapper->dataRsp.head.epoch, consumerEpoch); + tmqFreeRspWrapper(rspWrapper); taosFreeQitem(pollRspWrapper); } } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_META_RSP) { @@ -1713,6 +1746,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { } else { tscDebug("msg discard since epoch mismatch: msg epoch %d, consumer epoch %d", pollRspWrapper->metaRsp.head.epoch, consumerEpoch); + tmqFreeRspWrapper(rspWrapper); taosFreeQitem(pollRspWrapper); } } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__TAOSX_RSP) { @@ -1743,6 +1777,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { } else { tscDebug("msg discard since epoch mismatch: msg epoch %d, consumer epoch %d", pollRspWrapper->taosxRsp.head.epoch, consumerEpoch); + tmqFreeRspWrapper(rspWrapper); taosFreeQitem(pollRspWrapper); } } else { @@ -1794,7 +1829,7 @@ TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) { while (1) { tmqHandleAllDelayedTask(tmq); if (tmqPollImpl(tmq, timeout) < 0) { - tscDebug("return since poll err"); + tscDebug("consumer:%" PRId64 " return since poll err", tmq->consumerId); /*return NULL;*/ } From e150913c7b18d63331c58c69b79a5ffb9b67e794 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 9 Dec 2022 17:08:51 +0800 Subject: [PATCH 02/74] change default sch value --- source/libs/qworker/inc/qwInt.h | 8 ++++---- source/libs/qworker/src/qwUtil.c | 11 +++++++++-- source/libs/qworker/src/qworker.c | 33 +++++++++++++++++-------------- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/source/libs/qworker/inc/qwInt.h b/source/libs/qworker/inc/qwInt.h index af361323a7..9d8fad6fea 100644 --- a/source/libs/qworker/inc/qwInt.h +++ b/source/libs/qworker/inc/qwInt.h @@ -31,7 +31,7 @@ extern "C" { #define QW_DEFAULT_SCHEDULER_NUMBER 100 #define QW_DEFAULT_TASK_NUMBER 10000 -#define QW_DEFAULT_SCH_TASK_NUMBER 10000 +#define QW_DEFAULT_SCH_TASK_NUMBER 3000 #define QW_DEFAULT_SHORT_RUN_TIMES 2 #define QW_DEFAULT_HEARTBEAT_MSEC 5000 #define QW_SCH_TIMEOUT_MSEC 180000 @@ -247,7 +247,7 @@ typedef struct SQWorkerMgmt { #define QW_ERR_RET(c) \ do { \ - int32_t _code = (c); \ + int32_t _code = (c); \ if (_code != TSDB_CODE_SUCCESS) { \ terrno = _code; \ return _code; \ @@ -255,7 +255,7 @@ typedef struct SQWorkerMgmt { } while (0) #define QW_RET(c) \ do { \ - int32_t _code = (c); \ + int32_t _code = (c); \ if (_code != TSDB_CODE_SUCCESS) { \ terrno = _code; \ } \ @@ -263,7 +263,7 @@ typedef struct SQWorkerMgmt { } while (0) #define QW_ERR_JRET(c) \ do { \ - code = (c); \ + code = (c); \ if (code != TSDB_CODE_SUCCESS) { \ terrno = code; \ goto _return; \ diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index ce3b493638..f3d073634d 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -281,7 +281,7 @@ void qwFreeTaskHandle(qTaskInfo_t *taskHandle) { int32_t qwKillTaskHandle(SQWTaskCtx *ctx, int32_t rspCode) { int32_t code = 0; - + // Note: free/kill may in RC qTaskInfo_t taskHandle = atomic_load_ptr(&ctx->taskHandle); if (taskHandle && atomic_val_compare_exchange_ptr(&ctx->taskHandle, taskHandle, NULL)) { @@ -463,6 +463,8 @@ void qwDestroyImpl(void *pMgmt) { int8_t nodeType = mgmt->nodeType; int32_t nodeId = mgmt->nodeId; + int32_t taskCount = 0; + int32_t schStatusCount = 0; qDebug("start to destroy qworker, type:%d, id:%d, handle:%p", nodeType, nodeId, mgmt); taosTmrStop(mgmt->hbTimer); @@ -472,6 +474,7 @@ void qwDestroyImpl(void *pMgmt) { uint64_t qId, tId; int32_t eId; void *pIter = taosHashIterate(mgmt->ctxHash, NULL); + while (pIter) { SQWTaskCtx *ctx = (SQWTaskCtx *)pIter; void *key = taosHashGetKey(pIter, NULL); @@ -480,6 +483,7 @@ void qwDestroyImpl(void *pMgmt) { qwFreeTaskCtx(ctx); QW_TASK_DLOG_E("task ctx freed"); pIter = taosHashIterate(mgmt->ctxHash, pIter); + taskCount++; } taosHashCleanup(mgmt->ctxHash); @@ -487,7 +491,9 @@ void qwDestroyImpl(void *pMgmt) { while (pIter) { SQWSchStatus *sch = (SQWSchStatus *)pIter; qwDestroySchStatus(sch); + pIter = taosHashIterate(mgmt->schHash, pIter); + schStatusCount++; } taosHashCleanup(mgmt->schHash); @@ -499,7 +505,8 @@ void qwDestroyImpl(void *pMgmt) { qwCloseRef(); - qDebug("qworker destroyed, type:%d, id:%d, handle:%p", nodeType, nodeId, mgmt); + qDebug("qworker destroyed, type:%d, id:%d, handle:%p, taskCount:%d, schStatusCount: %d", nodeType, nodeId, mgmt, + taskCount, schStatusCount); } int32_t qwOpenRef(void) { diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index c5db4105d7..81f73b1226 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -8,9 +8,9 @@ #include "qwMsg.h" #include "tcommon.h" #include "tdatablock.h" +#include "tglobal.h" #include "tmsg.h" #include "tname.h" -#include "tglobal.h" SQWorkerMgmt gQwMgmt = { .lock = 0, @@ -117,7 +117,7 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) { if (queryStop) { *queryStop = true; } - + return TSDB_CODE_SUCCESS; } @@ -275,7 +275,7 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, QW_ERR_RET(code); } - QW_TASK_DLOG("no more data in sink and query end, fetched blocks %d rows %"PRId64, pOutput->numOfBlocks, + QW_TASK_DLOG("no more data in sink and query end, fetched blocks %d rows %" PRId64, pOutput->numOfBlocks, pOutput->numOfRows); qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_SUCC); @@ -327,12 +327,14 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, } if (0 == ctx->level) { - QW_TASK_DLOG("task fetched blocks %d rows %"PRId64", level %d", pOutput->numOfBlocks, pOutput->numOfRows, ctx->level); + QW_TASK_DLOG("task fetched blocks %d rows %" PRId64 ", level %d", pOutput->numOfBlocks, pOutput->numOfRows, + ctx->level); break; } if (pOutput->numOfRows >= QW_MIN_RES_ROWS) { - QW_TASK_DLOG("task fetched blocks %d rows %" PRId64 " reaches the min rows", pOutput->numOfBlocks, pOutput->numOfRows); + QW_TASK_DLOG("task fetched blocks %d rows %" PRId64 " reaches the min rows", pOutput->numOfBlocks, + pOutput->numOfRows); break; } } @@ -538,7 +540,7 @@ _return: SQWMsg qwMsg = {.msgType = ctx->msgType, .connInfo = ctx->ctrlConnInfo}; qwDbgSimulateRedirect(&qwMsg, ctx, &rsped); qwDbgSimulateDead(QW_FPARAMS(), ctx, &rsped); - if (!rsped) { + if (!rsped) { qwSendQueryRsp(QW_FPARAMS(), input->msgType + 1, ctx, code, false); } } @@ -650,8 +652,8 @@ _return: code = qwHandlePostPhaseEvents(QW_FPARAMS(), QW_PHASE_POST_QUERY, &input, NULL); if (QUERY_RSP_POLICY_QUICK == tsQueryRspPolicy && ctx != NULL && QW_EVENT_RECEIVED(ctx, QW_EVENT_FETCH)) { - void *rsp = NULL; - int32_t dataLen = 0; + void *rsp = NULL; + int32_t dataLen = 0; SOutputData sOutput = {0}; if (qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rsp, &sOutput)) { return TSDB_CODE_SUCCESS; @@ -671,8 +673,8 @@ _return: qwBuildAndSendFetchRsp(ctx->fetchType, &qwMsg->connInfo, rsp, dataLen, code); rsp = NULL; - QW_TASK_DLOG("fetch rsp send, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code, - tstrerror(code), dataLen); + QW_TASK_DLOG("fetch rsp send, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code, tstrerror(code), + dataLen); } } @@ -689,7 +691,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { do { ctx = NULL; - + QW_ERR_JRET(qwHandlePrePhaseEvents(QW_FPARAMS(), QW_PHASE_PRE_CQUERY, &input, NULL)); QW_ERR_JRET(qwGetTaskCtx(QW_FPARAMS(), &ctx)); @@ -748,7 +750,8 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { } QW_LOCK(QW_WRITE, &ctx->lock); - if ((queryStop && (0 == atomic_load_8((int8_t *)&ctx->queryContinue))) || code || 0 == atomic_load_8((int8_t *)&ctx->queryContinue)) { + if ((queryStop && (0 == atomic_load_8((int8_t *)&ctx->queryContinue))) || code || + 0 == atomic_load_8((int8_t *)&ctx->queryContinue)) { // Note: query is not running anymore QW_SET_PHASE(ctx, 0); QW_UNLOCK(QW_WRITE, &ctx->lock); @@ -1176,7 +1179,7 @@ void qWorkerStopAllTasks(void *qWorkerMgmt) { QW_DLOG("start to stop all tasks, taskNum:%d", taosHashGetSize(mgmt->ctxHash)); uint64_t qId, tId; - int32_t eId; + int32_t eId; void *pIter = taosHashIterate(mgmt->ctxHash, NULL); while (pIter) { SQWTaskCtx *ctx = (SQWTaskCtx *)pIter; @@ -1186,7 +1189,7 @@ void qWorkerStopAllTasks(void *qWorkerMgmt) { QW_LOCK(QW_WRITE, &ctx->lock); QW_TASK_DLOG_E("start to force stop task"); - + if (QW_EVENT_RECEIVED(ctx, QW_EVENT_DROP) || QW_EVENT_PROCESSED(ctx, QW_EVENT_DROP)) { QW_TASK_WLOG_E("task already dropping"); QW_UNLOCK(QW_WRITE, &ctx->lock); @@ -1194,7 +1197,7 @@ void qWorkerStopAllTasks(void *qWorkerMgmt) { pIter = taosHashIterate(mgmt->ctxHash, pIter); continue; } - + if (QW_QUERY_RUNNING(ctx)) { qwKillTaskHandle(ctx, TSDB_CODE_VND_STOPPED); } else if (!QW_EVENT_PROCESSED(ctx, QW_EVENT_DROP)) { From a6fff957958d328e582613b8be36110cb0175da0 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Fri, 9 Dec 2022 16:51:18 +0800 Subject: [PATCH 03/74] fix: close wal ref --- include/libs/wal/wal.h | 20 ++++++++++---------- source/dnode/vnode/src/tq/tq.c | 14 ++++++++++---- source/libs/wal/src/walMgmt.c | 1 + source/libs/wal/src/walRef.c | 7 +++++-- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/include/libs/wal/wal.h b/include/libs/wal/wal.h index 8b9fc84334..a1ae1e429d 100644 --- a/include/libs/wal/wal.h +++ b/include/libs/wal/wal.h @@ -33,16 +33,16 @@ extern "C" { #define wTrace(...) { if (wDebugFlag & DEBUG_TRACE) { taosPrintLog("WAL ", DEBUG_TRACE, wDebugFlag, __VA_ARGS__); }} // clang-format on -#define WAL_PROTO_VER 0 -#define WAL_NOSUFFIX_LEN 20 -#define WAL_SUFFIX_AT (WAL_NOSUFFIX_LEN + 1) -#define WAL_LOG_SUFFIX "log" -#define WAL_INDEX_SUFFIX "idx" -#define WAL_REFRESH_MS 1000 -#define WAL_PATH_LEN (TSDB_FILENAME_LEN + 12) -#define WAL_FILE_LEN (WAL_PATH_LEN + 32) -#define WAL_MAGIC 0xFAFBFCFDF4F3F2F1ULL -#define WAL_SCAN_BUF_SIZE (1024 * 1024 * 3) +#define WAL_PROTO_VER 0 +#define WAL_NOSUFFIX_LEN 20 +#define WAL_SUFFIX_AT (WAL_NOSUFFIX_LEN + 1) +#define WAL_LOG_SUFFIX "log" +#define WAL_INDEX_SUFFIX "idx" +#define WAL_REFRESH_MS 1000 +#define WAL_PATH_LEN (TSDB_FILENAME_LEN + 12) +#define WAL_FILE_LEN (WAL_PATH_LEN + 32) +#define WAL_MAGIC 0xFAFBFCFDF4F3F2F1ULL +#define WAL_SCAN_BUF_SIZE (1024 * 1024 * 3) typedef enum { TAOS_WAL_WRITE = 1, diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 191fc1b49c..389c8013f9 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -725,9 +725,15 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t version, char* msg, int32_t msgL } taosWUnLockLatch(&pTq->pushLock); - code = taosHashRemove(pTq->pHandle, pReq->subKey, strlen(pReq->subKey)); - if (code != 0) { - tqError("cannot process tq delete req %s, since no such handle", pReq->subKey); + STqHandle* pHandle = taosHashGet(pTq->pHandle, pReq->subKey, strlen(pReq->subKey)); + if (pHandle) { + if (pHandle->pRef) { + walCloseRef(pTq->pVnode->pWal, pHandle->pRef->refId); + } + code = taosHashRemove(pTq->pHandle, pReq->subKey, strlen(pReq->subKey)); + if (code != 0) { + tqError("cannot process tq delete req %s, since no such handle", pReq->subKey); + } } code = tqOffsetDelete(pTq->pOffsetStore, pReq->subKey); @@ -736,7 +742,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t version, char* msg, int32_t msgL } if (tqMetaDeleteHandle(pTq, pReq->subKey) < 0) { - ASSERT(0); + tqError("cannot process tq delete req %s, since no such offset in tdb", pReq->subKey); } return 0; } diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c index f53088fac6..702d05f576 100644 --- a/source/libs/wal/src/walMgmt.c +++ b/source/libs/wal/src/walMgmt.c @@ -223,6 +223,7 @@ void walClose(SWal *pWal) { taosMemoryFree(pRef); } taosHashCleanup(pWal->pRefHash); + pWal->pRefHash = NULL; taosThreadMutexUnlock(&pWal->mutex); taosRemoveRef(tsWal.refSetId, pWal->refId); diff --git a/source/libs/wal/src/walRef.c b/source/libs/wal/src/walRef.c index eae5d9f1a7..e86111109c 100644 --- a/source/libs/wal/src/walRef.c +++ b/source/libs/wal/src/walRef.c @@ -32,15 +32,18 @@ SWalRef *walOpenRef(SWal *pWal) { return pRef; } -#if 1 void walCloseRef(SWal *pWal, int64_t refId) { SWalRef **ppRef = taosHashGet(pWal->pRefHash, &refId, sizeof(int64_t)); if (ppRef == NULL) return; SWalRef *pRef = *ppRef; + if (pRef) { + wDebug("vgId:%d, wal close ref %" PRId64 ", refId %" PRId64, pWal->cfg.vgId, pRef->refVer, pRef->refId); + } else { + wDebug("vgId:%d, wal close ref null, refId %" PRId64, pWal->cfg.vgId, refId); + } taosHashRemove(pWal->pRefHash, &refId, sizeof(int64_t)); taosMemoryFree(pRef); } -#endif int32_t walRefVer(SWalRef *pRef, int64_t ver) { SWal *pWal = pRef->pWal; From 6f663c3035db3c9c828c2f7a3e33056eed9a5443 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 9 Dec 2022 17:21:27 +0800 Subject: [PATCH 04/74] release: build 3.0.2.0 --- cmake/cmake.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/cmake.version b/cmake/cmake.version index 9faa7c75dd..b4084bd095 100644 --- a/cmake/cmake.version +++ b/cmake/cmake.version @@ -2,7 +2,7 @@ IF (DEFINED VERNUMBER) SET(TD_VER_NUMBER ${VERNUMBER}) ELSE () - SET(TD_VER_NUMBER "3.0.1.8") + SET(TD_VER_NUMBER "3.0.2.0") ENDIF () IF (DEFINED VERCOMPATIBLE) From 44dc2564ebb13acf571867e4faf441da38ec222d Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 9 Dec 2022 21:07:03 +0800 Subject: [PATCH 05/74] fix(query): return with error code if the table does not exist during creating tsdbReader --- source/dnode/vnode/src/tsdb/tsdbRead.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index a4581f5472..9afc0ae7e8 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -3827,12 +3827,17 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL pReader->pSchema = metaGetTbTSchema(pReader->pTsdb->pVnode->pMeta, pReader->suid, -1, 1); if (pReader->pSchema == NULL) { tsdbError("failed to get table schema, suid:%" PRIu64 ", ver:-1, %s", pReader->suid, pReader->idStr); + // no valid error code set in metaGetTbTSchema, so let's set the error code here. + code = TSDB_CODE_PAR_TABLE_NOT_EXIST; + goto _err; } } else if (numOfTables > 0) { STableKeyInfo* pKey = pTableList; pReader->pSchema = metaGetTbTSchema(pReader->pTsdb->pVnode->pMeta, pKey->uid, -1, 1); if (pReader->pSchema == NULL) { tsdbError("failed to get table schema, uid:%" PRIu64 ", ver:-1, %s", pKey->uid, pReader->idStr); + code = TSDB_CODE_PAR_TABLE_NOT_EXIST; + goto _err; } } @@ -3840,7 +3845,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL updateBlockSMAInfo(pReader->pSchema, &pReader->suppInfo); } - STsdbReader* p = (pReader->innerReader[0] != NULL)? pReader->innerReader[0]:pReader; + STsdbReader* p = (pReader->innerReader[0] != NULL) ? pReader->innerReader[0] : pReader; pReader->status.pTableMap = createDataBlockScanInfo(p, &pReader->blockInfoBuf, pTableList, numOfTables); if (pReader->status.pTableMap == NULL) { tsdbReaderClose(p); @@ -3888,10 +3893,11 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL tsdbDebug("%p total numOfTable:%d in this query %s", pReader, numOfTables, pReader->idStr); return code; - _err: +_err: tsdbError("failed to create data reader, code:%s %s", tstrerror(code), idstr); + tsdbReaderClose(pReader); return code; - } +} void tsdbReaderClose(STsdbReader* pReader) { if (pReader == NULL) { From c5db51f484da4137ace02d8afbc28a2c7ba44803 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 9 Dec 2022 21:48:48 +0800 Subject: [PATCH 06/74] fix mem leak --- source/dnode/vnode/src/meta/metaCache.c | 38 ++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/source/dnode/vnode/src/meta/metaCache.c b/source/dnode/vnode/src/meta/metaCache.c index 0ed68dce95..84f3094b23 100644 --- a/source/dnode/vnode/src/meta/metaCache.c +++ b/source/dnode/vnode/src/meta/metaCache.c @@ -32,9 +32,9 @@ typedef struct SMetaStbStatsEntry { } SMetaStbStatsEntry; typedef struct STagFilterResEntry { - uint64_t suid; // uid for super table - SList list; // the linked list of md5 digest, extracted from the serialized tag query condition - uint32_t qTimes;// queried times for current super table + uint64_t suid; // uid for super table + SList list; // the linked list of md5 digest, extracted from the serialized tag query condition + uint32_t qTimes; // queried times for current super table } STagFilterResEntry; struct SMetaCache { @@ -126,13 +126,14 @@ int32_t metaCacheOpen(SMeta* pMeta) { goto _err2; } - pCache->sTagFilterResCache.pUidResCache = taosLRUCacheInit(5*1024*1024, -1, 0.5); + pCache->sTagFilterResCache.pUidResCache = taosLRUCacheInit(5 * 1024 * 1024, -1, 0.5); if (pCache->sTagFilterResCache.pUidResCache == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _err2; } - pCache->sTagFilterResCache.pTableEntry = taosHashInit(1024, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), false, HASH_NO_LOCK); + pCache->sTagFilterResCache.pTableEntry = + taosHashInit(1024, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), false, HASH_NO_LOCK); if (pCache->sTagFilterResCache.pTableEntry == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _err2; @@ -419,7 +420,8 @@ int32_t metaStatsCacheGet(SMeta* pMeta, int64_t uid, SMetaStbStats* pInfo) { return code; } -int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pKey, int32_t keyLen, SArray* pList1, bool* acquireRes) { +int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pKey, int32_t keyLen, SArray* pList1, + bool* acquireRes) { uint64_t* pBuf = pMeta->pCache->sTagFilterResCache.keyBuf; // generate the composed key for LRU cache @@ -428,8 +430,8 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK pBuf[0] = suid; memcpy(&pBuf[1], pKey, keyLen); - int32_t len = keyLen + sizeof(uint64_t); - LRUHandle *pHandle = taosLRUCacheLookup(pCache, pBuf, len); + int32_t len = keyLen + sizeof(uint64_t); + LRUHandle* pHandle = taosLRUCacheLookup(pCache, pBuf, len); if (pHandle == NULL) { *acquireRes = 0; return TSDB_CODE_SUCCESS; @@ -439,7 +441,7 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK *acquireRes = 1; const char* p = taosLRUCacheValue(pMeta->pCache->sTagFilterResCache.pUidResCache, pHandle); - int32_t size = *(int32_t*) p; + int32_t size = *(int32_t*)p; taosArrayAddBatch(pList1, p + sizeof(int32_t), size); (*pEntry)->qTimes += 1; @@ -467,12 +469,14 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK // remove the keys, of which query uid lists have been replaced already. size_t s = taosArrayGetSize(pList); - for(int32_t i = 0; i < s; ++i) { + for (int32_t i = 0; i < s; ++i) { SListNode** p1 = taosArrayGet(pList, i); tdListPopNode(&(*pEntry)->list, *p1); } - (*pEntry)->qTimes = 0; // reset the query times + (*pEntry)->qTimes = 0; // reset the query times + + taosArrayDestroy(pList); } } @@ -487,7 +491,8 @@ static void freePayload(const void* key, size_t keyLen, void* value) { } // check both the payload size and selectivity ratio -int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int32_t keyLen, void* pPayload, int32_t payloadLen, double selectivityRatio) { +int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int32_t keyLen, void* pPayload, + int32_t payloadLen, double selectivityRatio) { if (selectivityRatio > tsSelectivityRatio) { metaDebug("vgId:%d, suid:%" PRIu64 " failed to add to uid list cache, due to selectivity ratio %.2f less than threshold %.2f", @@ -525,9 +530,10 @@ int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int ASSERT(sizeof(uint64_t) + keyLen == 24); // add to cache. - taosLRUCacheInsert(pCache, pBuf, sizeof(uint64_t) + keyLen, pPayload, payloadLen, freePayload, NULL, TAOS_LRU_PRIORITY_LOW); - metaDebug("vgId:%d, suid:%"PRIu64" list cache added into cache, total:%d, tables:%d", TD_VID(pMeta->pVnode), - suid, (int32_t) taosLRUCacheGetUsage(pCache), taosHashGetSize(pTableEntry)); + taosLRUCacheInsert(pCache, pBuf, sizeof(uint64_t) + keyLen, pPayload, payloadLen, freePayload, NULL, + TAOS_LRU_PRIORITY_LOW); + metaDebug("vgId:%d, suid:%" PRIu64 " list cache added into cache, total:%d, tables:%d", TD_VID(pMeta->pVnode), suid, + (int32_t)taosLRUCacheGetUsage(pCache), taosHashGetSize(pTableEntry)); return TSDB_CODE_SUCCESS; } @@ -539,7 +545,7 @@ int32_t metaUidCacheClear(SMeta* pMeta, uint64_t suid) { return TSDB_CODE_SUCCESS; } - int32_t keyLen = sizeof(uint64_t) * 3; + int32_t keyLen = sizeof(uint64_t) * 3; uint64_t p[3] = {0}; p[0] = suid; From e7e34456fb4630a6c2eaad2a2159993f3e8f28fe Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 9 Dec 2022 22:25:26 +0800 Subject: [PATCH 07/74] fix mem leak --- source/dnode/vnode/src/meta/metaCache.c | 1 + source/libs/executor/src/groupoperator.c | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/source/dnode/vnode/src/meta/metaCache.c b/source/dnode/vnode/src/meta/metaCache.c index 84f3094b23..37dcec4f85 100644 --- a/source/dnode/vnode/src/meta/metaCache.c +++ b/source/dnode/vnode/src/meta/metaCache.c @@ -472,6 +472,7 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK for (int32_t i = 0; i < s; ++i) { SListNode** p1 = taosArrayGet(pList, i); tdListPopNode(&(*pEntry)->list, *p1); + taosMemoryFree(*p1); } (*pEntry)->qTimes = 0; // reset the query times diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 2cd1bd7dec..1a43ddecdd 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -314,7 +314,8 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { } int32_t rowIndex = j - num; - applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, pOperator->exprSupp.numOfExprs); + applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, + pOperator->exprSupp.numOfExprs); // assign the group keys or user input constant values if required doAssignGroupKeys(pCtx, pOperator->exprSupp.numOfExprs, pBlock->info.rows, rowIndex); @@ -331,7 +332,8 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { } int32_t rowIndex = pBlock->info.rows - num; - applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, pOperator->exprSupp.numOfExprs); + applyAggFunctionOnPartialTuples(pTaskInfo, pCtx, NULL, rowIndex, num, pBlock->info.rows, + pOperator->exprSupp.numOfExprs); doAssignGroupKeys(pCtx, pOperator->exprSupp.numOfExprs, pBlock->info.rows, rowIndex); } } @@ -469,8 +471,8 @@ SOperatorInfo* createGroupOperatorInfo(SOperatorInfo* downstream, SAggPhysiNode* initResultRowInfo(&pInfo->binfo.resultRowInfo); setOperatorInfo(pOperator, "GroupbyAggOperator", 0, true, OP_NOT_OPENED, pInfo, pTaskInfo); - pOperator->fpSet = - createOperatorFpSet(optrDummyOpenFn, hashGroupbyAggregate, NULL, destroyGroupOperatorInfo, optrDefaultBufFn, NULL); + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, hashGroupbyAggregate, NULL, destroyGroupOperatorInfo, + optrDefaultBufFn, NULL); code = appendDownstream(pOperator, &downstream, 1); if (code != TSDB_CODE_SUCCESS) { goto _error; @@ -776,6 +778,12 @@ static void destroyPartitionOperatorInfo(void* param) { taosArrayDestroy(pInfo->pGroupColVals); taosMemoryFree(pInfo->keyBuf); + + int32_t size = taosArrayGetSize(pInfo->sortedGroupArray); + for (int32_t i = 0; i < size; i++) { + SDataGroupInfo* pGp = taosArrayGet(pInfo->sortedGroupArray, i); + taosArrayDestroy(pGp->pPageList); + } taosArrayDestroy(pInfo->sortedGroupArray); void* pGroupIter = taosHashIterate(pInfo->pGroupSet, NULL); @@ -850,7 +858,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition pOperator->exprSupp.numOfExprs = numOfCols; pOperator->exprSupp.pExprInfo = pExprInfo; - pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, hashPartition, NULL, destroyPartitionOperatorInfo, optrDefaultBufFn, NULL); + pOperator->fpSet = + createOperatorFpSet(optrDummyOpenFn, hashPartition, NULL, destroyPartitionOperatorInfo, optrDefaultBufFn, NULL); code = appendDownstream(pOperator, &downstream, 1); return pOperator; @@ -1141,8 +1150,8 @@ SOperatorInfo* createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SStr pInfo, pTaskInfo); pOperator->exprSupp.numOfExprs = numOfCols; pOperator->exprSupp.pExprInfo = pExprInfo; - pOperator->fpSet = - createOperatorFpSet(optrDummyOpenFn, doStreamHashPartition, NULL, destroyStreamPartitionOperatorInfo, optrDefaultBufFn, NULL); + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, doStreamHashPartition, NULL, + destroyStreamPartitionOperatorInfo, optrDefaultBufFn, NULL); initParDownStream(downstream, &pInfo->partitionSup, &pInfo->scalarSup); code = appendDownstream(pOperator, &downstream, 1); From ab77b02813cf02d29899129e9725a0760ca4f20f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 10 Dec 2022 10:55:47 +0800 Subject: [PATCH 08/74] fix: donot print log while assert --- source/util/src/tlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 3825b91c6d..747187254f 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -801,7 +801,7 @@ bool taosAssert(bool condition, const char *file, int32_t line, const char *form taosPrintTrace(flags, level, dflag); if (tsAssert) { - taosCloseLog(); + // taosCloseLog(); taosMsleep(300); #ifdef NDEBUG From 3bce02438ff1ae9aef8bca81eea542d8fd606cd3 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Sat, 10 Dec 2022 11:12:54 +0800 Subject: [PATCH 09/74] TD-21115 --- source/libs/transport/src/transCli.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index f3f07ebbb9..03e3fb52c4 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -1626,9 +1626,9 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { pCtx->retryNextInterval = pCtx->retryMaxInterval; } - if (-1 != pCtx->retryMaxTimeout && taosGetTimestampMs() - pCtx->retryInitTimestamp >= pCtx->retryMaxTimeout) { - return false; - } + // if (-1 != pCtx->retryMaxTimeout && taosGetTimestampMs() - pCtx->retryInitTimestamp >= pCtx->retryMaxTimeout) { + // return false; + // } } else { pCtx->retryNextInterval = 0; pCtx->epsetRetryCnt++; From c5abada99e5d0500233b539169632357e10a57b1 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Sat, 10 Dec 2022 11:46:47 +0800 Subject: [PATCH 10/74] fix: fix gpd error --- source/libs/executor/src/executor.c | 5 +++-- source/libs/function/src/udfd.c | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 6fca2858dc..834c581fed 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -109,8 +109,9 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu SStreamScanInfo* pInfo = pOperator->info; - ASSERT(pInfo->validBlockIndex == 0); - ASSERT(taosArrayGetSize(pInfo->pBlockLists) == 0); + if (pInfo->validBlockIndex != 0 || taosArrayGetSize(pInfo->pBlockLists) == 0) { + return TSDB_CODE_APP_ERROR; + } if (type == STREAM_INPUT__MERGED_SUBMIT) { // ASSERT(numOfBlocks > 1); diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 2f3db636c8..2ab1e8b64c 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -744,10 +744,15 @@ bool isUdfdUvMsgComplete(SUdfdUvConn *pipe) { } void udfdHandleRequest(SUdfdUvConn *conn) { + char* inputBuf = taosMemoryMalloc(conn->inputLen); + memcpy(inputBuf, conn->inputBuf, conn->inputLen); + int32_t inputLen = conn->inputLen; + taosMemoryFree(conn->inputBuf); + uv_work_t * work = taosMemoryMalloc(sizeof(uv_work_t)); SUvUdfWork *udfWork = taosMemoryMalloc(sizeof(SUvUdfWork)); udfWork->client = conn->client; - udfWork->input = uv_buf_init(conn->inputBuf, conn->inputLen); + udfWork->input = uv_buf_init(inputBuf, inputLen); conn->inputBuf = NULL; conn->inputLen = 0; conn->inputCap = 0; From c1a68f7f3bfd4d2611c819009db260a554533045 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 10 Dec 2022 12:09:07 +0800 Subject: [PATCH 11/74] fix(query): remove invalid assert and fix the error in memcpy data. --- source/libs/executor/src/timesliceoperator.c | 27 +++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index 2374d80bbf..af3c44d032 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -96,13 +96,26 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo if (!pLinearInfo->isStartSet) { if (!colDataIsNull_s(pColInfoData, rowIndex)) { pLinearInfo->start.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); - memcpy(pLinearInfo->start.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); + char* p = colDataGetData(pColInfoData, rowIndex); + if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { + ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); + memcpy(pLinearInfo->start.val, p, varDataTLen(p)); + } else { + memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes); + } } pLinearInfo->isStartSet = true; } else if (!pLinearInfo->isEndSet) { if (!colDataIsNull_s(pColInfoData, rowIndex)) { pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); - memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); + + char* p = colDataGetData(pColInfoData, rowIndex); + if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { + ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); + memcpy(pLinearInfo->start.val, p, varDataTLen(p)); + } else { + memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes); + } } pLinearInfo->isEndSet = true; } else { @@ -111,7 +124,15 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo if (!colDataIsNull_s(pColInfoData, rowIndex)) { pLinearInfo->end.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); - memcpy(pLinearInfo->end.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); + + char* p = colDataGetData(pColInfoData, rowIndex); + if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { + ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); + memcpy(pLinearInfo->start.val, p, varDataTLen(p)); + } else { + memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes); + } + } else { pLinearInfo->end.key = INT64_MIN; } From 0486d82b921f4c4ddfae2408e6f36f56e68f5b81 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Sat, 10 Dec 2022 13:24:47 +0800 Subject: [PATCH 12/74] fix: fix stream core --- source/libs/executor/src/scanoperator.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index eae2ff3c72..647f776afa 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2001,7 +2001,6 @@ FETCH_NEXT_BLOCK: goto NEXT_SUBMIT_BLK; } else { - ASSERT(0); return NULL; } } From 50b66df39f9348191be34ee378b94d90e415896a Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 10 Dec 2022 14:02:57 +0800 Subject: [PATCH 13/74] fix: control rpc qitem memory --- include/util/tqueue.h | 3 ++- source/client/src/clientTmq.c | 12 ++++++------ source/dnode/mgmt/mgmt_mnode/src/mmWorker.c | 2 +- source/dnode/mgmt/mgmt_qnode/src/qmWorker.c | 2 +- source/dnode/mgmt/mgmt_snode/src/smWorker.c | 2 +- source/dnode/mgmt/mgmt_vnode/src/vmWorker.c | 2 +- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 2 +- source/dnode/vnode/src/sma/smaRollup.c | 2 +- source/dnode/vnode/src/tq/tq.c | 4 ++-- source/libs/executor/src/dataDeleter.c | 2 +- source/libs/executor/src/dataDispatcher.c | 2 +- source/libs/stream/src/stream.c | 6 +++--- source/libs/stream/src/streamData.c | 6 +++--- source/libs/stream/src/streamExec.c | 4 ++-- source/libs/sync/test/sync_test_lib/src/syncIO.c | 6 +++--- source/libs/transport/test/svrBench.c | 2 +- source/util/src/tqueue.c | 10 ++++++---- 17 files changed, 36 insertions(+), 33 deletions(-) diff --git a/include/util/tqueue.h b/include/util/tqueue.h index 8b46bbd064..25a0019106 100644 --- a/include/util/tqueue.h +++ b/include/util/tqueue.h @@ -65,6 +65,7 @@ typedef struct STaosQnode { STaosQnode *next; STaosQueue *queue; int64_t timestamp; + int32_t dataSize; int32_t size; int8_t itype; int8_t reserved[3]; @@ -103,7 +104,7 @@ typedef struct STaosQall { STaosQueue *taosOpenQueue(); void taosCloseQueue(STaosQueue *queue); void taosSetQueueFp(STaosQueue *queue, FItem itemFp, FItems itemsFp); -void *taosAllocateQitem(int32_t size, EQItype itype); +void *taosAllocateQitem(int32_t size, EQItype itype, int32_t dataSize); void taosFreeQitem(void *pItem); void taosWriteQitem(STaosQueue *queue, void *pItem); int32_t taosReadQitem(STaosQueue *queue, void **ppItem); diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index db717a4e4e..f82e54515f 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -691,7 +691,7 @@ void tmqAssignAskEpTask(void* param, void* tmrId) { int64_t refId = *(int64_t*)param; tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId); if (tmq != NULL) { - int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM); + int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM, 0); *pTaskType = TMQ_DELAYED_TASK__ASK_EP; taosWriteQitem(tmq->delayedTask, pTaskType); tsem_post(&tmq->rspSem); @@ -703,7 +703,7 @@ void tmqAssignDelayedCommitTask(void* param, void* tmrId) { int64_t refId = *(int64_t*)param; tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId); if (tmq != NULL) { - int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM); + int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM, 0); *pTaskType = TMQ_DELAYED_TASK__COMMIT; taosWriteQitem(tmq->delayedTask, pTaskType); tsem_post(&tmq->rspSem); @@ -715,7 +715,7 @@ void tmqAssignDelayedReportTask(void* param, void* tmrId) { int64_t refId = *(int64_t*)param; tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId); if (tmq != NULL) { - int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM); + int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM, 0); *pTaskType = TMQ_DELAYED_TASK__REPORT; taosWriteQitem(tmq->delayedTask, pTaskType); tsem_post(&tmq->rspSem); @@ -1140,7 +1140,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) { goto CREATE_MSG_FAIL; } if (code == TSDB_CODE_TQ_NO_COMMITTED_OFFSET) { - SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM); + SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM, 0); if (pRspWrapper == NULL) { tscWarn("msg discard from vgId:%d, epoch %d since out of memory", vgId, epoch); goto CREATE_MSG_FAIL; @@ -1173,7 +1173,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) { // handle meta rsp int8_t rspType = ((SMqRspHead*)pMsg->pData)->mqMsgType; - SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM); + SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM, 0); if (pRspWrapper == NULL) { taosMemoryFree(pMsg->pData); taosMemoryFree(pMsg->pEpSet); @@ -1363,7 +1363,7 @@ int32_t tmqAskEpCb(void* param, SDataBuf* pMsg, int32_t code) { tmqUpdateEp(tmq, head->epoch, &rsp); tDeleteSMqAskEpRsp(&rsp); } else { - SMqAskEpRspWrapper* pWrapper = taosAllocateQitem(sizeof(SMqAskEpRspWrapper), DEF_QITEM); + SMqAskEpRspWrapper* pWrapper = taosAllocateQitem(sizeof(SMqAskEpRspWrapper), DEF_QITEM, 0); if (pWrapper == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; code = -1; diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c index 857fbcbce5..5d86e11c57 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c @@ -159,7 +159,7 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { } if (pWorker == NULL) return -1; - SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) return -1; memcpy(pMsg, pRpc, sizeof(SRpcMsg)); pRpc->pCont = NULL; diff --git a/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c b/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c index 3e5ad65db7..579a4e2090 100644 --- a/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c +++ b/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c @@ -58,7 +58,7 @@ int32_t qmPutNodeMsgToFetchQueue(SQnodeMgmt *pMgmt, SRpcMsg *pMsg) { } int32_t qmPutRpcMsgToQueue(SQnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { - SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) return -1; memcpy(pMsg, pRpc, sizeof(SRpcMsg)); pRpc->pCont = NULL; diff --git a/source/dnode/mgmt/mgmt_snode/src/smWorker.c b/source/dnode/mgmt/mgmt_snode/src/smWorker.c index 2e66aeae37..e1cc378396 100644 --- a/source/dnode/mgmt/mgmt_snode/src/smWorker.c +++ b/source/dnode/mgmt/mgmt_snode/src/smWorker.c @@ -130,7 +130,7 @@ void smStopWorker(SSnodeMgmt *pMgmt) { } int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { - SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) { rpcFreeCont(pRpc->pCont); pRpc->pCont = NULL; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index 08ea880b97..c48216ed7d 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -233,7 +233,7 @@ int32_t vmPutMsgToMgmtQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } int32_t vmPutRpcMsgToQueue(SVnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { - SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + SRpcMsg *pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) { rpcFreeCont(pRpc->pCont); pRpc->pCont = NULL; diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 99f8bd002a..33646d6d67 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -141,7 +141,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { } pRpc->info.wrapper = pWrapper; - pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM); + pMsg = taosAllocateQitem(sizeof(SRpcMsg), RPC_QITEM, pRpc->contLen); if (pMsg == NULL) goto _OVER; memcpy(pMsg, pRpc, sizeof(SRpcMsg)); diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 6bd2ae3435..ba99e5515d 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -763,7 +763,7 @@ static int32_t tdExecuteRSmaImplAsync(SSma *pSma, const void *pMsg, int32_t inpu tb_uid_t suid) { const SSubmitReq *pReq = (const SSubmitReq *)pMsg; - void *qItem = taosAllocateQitem(pReq->header.contLen, DEF_QITEM); + void *qItem = taosAllocateQitem(pReq->header.contLen, DEF_QITEM, 0); if (!qItem) { return TSDB_CODE_FAILED; } diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 191fc1b49c..af3137f7b9 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -1265,7 +1265,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) { qDebug("delete req enqueue stream task: %d, ver: %" PRId64, pTask->taskId, ver); if (!failed) { - SStreamRefDataBlock* pRefBlock = taosAllocateQitem(sizeof(SStreamRefDataBlock), DEF_QITEM); + SStreamRefDataBlock* pRefBlock = taosAllocateQitem(sizeof(SStreamRefDataBlock), DEF_QITEM, 0); pRefBlock->type = STREAM_INPUT__REF_DATA_BLOCK; pRefBlock->pBlock = pDelBlock; pRefBlock->dataRef = pRef; @@ -1297,7 +1297,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) { } #if 0 - SStreamDataBlock* pStreamBlock = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* pStreamBlock = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); pStreamBlock->type = STREAM_INPUT__DATA_BLOCK; pStreamBlock->blocks = taosArrayInit(0, sizeof(SSDataBlock)); SSDataBlock block = {0}; diff --git a/source/libs/executor/src/dataDeleter.c b/source/libs/executor/src/dataDeleter.c index 12fb449238..eff7a5ef93 100644 --- a/source/libs/executor/src/dataDeleter.c +++ b/source/libs/executor/src/dataDeleter.c @@ -133,7 +133,7 @@ static int32_t getStatus(SDataDeleterHandle* pDeleter) { static int32_t putDataBlock(SDataSinkHandle* pHandle, const SInputData* pInput, bool* pContinue) { SDataDeleterHandle* pDeleter = (SDataDeleterHandle*)pHandle; - SDataDeleterBuf* pBuf = taosAllocateQitem(sizeof(SDataDeleterBuf), DEF_QITEM); + SDataDeleterBuf* pBuf = taosAllocateQitem(sizeof(SDataDeleterBuf), DEF_QITEM, 0); if (NULL == pBuf) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/source/libs/executor/src/dataDispatcher.c b/source/libs/executor/src/dataDispatcher.c index c45226e02b..c2fa438c80 100644 --- a/source/libs/executor/src/dataDispatcher.c +++ b/source/libs/executor/src/dataDispatcher.c @@ -126,7 +126,7 @@ static int32_t getStatus(SDataDispatchHandle* pDispatcher) { static int32_t putDataBlock(SDataSinkHandle* pHandle, const SInputData* pInput, bool* pContinue) { SDataDispatchHandle* pDispatcher = (SDataDispatchHandle*)pHandle; - SDataDispatchBuf* pBuf = taosAllocateQitem(sizeof(SDataDispatchBuf), DEF_QITEM); + SDataDispatchBuf* pBuf = taosAllocateQitem(sizeof(SDataDispatchBuf), DEF_QITEM, 0); if (NULL == pBuf) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/source/libs/stream/src/stream.c b/source/libs/stream/src/stream.c index 79549675a3..5b542dd54b 100644 --- a/source/libs/stream/src/stream.c +++ b/source/libs/stream/src/stream.c @@ -56,7 +56,7 @@ void streamSchedByTimer(void* param, void* tmrId) { } if (atomic_load_8(&pTask->triggerStatus) == TASK_TRIGGER_STATUS__ACTIVE) { - SStreamTrigger* trigger = taosAllocateQitem(sizeof(SStreamTrigger), DEF_QITEM); + SStreamTrigger* trigger = taosAllocateQitem(sizeof(SStreamTrigger), DEF_QITEM, 0); if (trigger == NULL) return; trigger->type = STREAM_INPUT__GET_RES; trigger->pBlock = taosMemoryCalloc(1, sizeof(SSDataBlock)); @@ -112,7 +112,7 @@ int32_t streamSchedExec(SStreamTask* pTask) { } int32_t streamTaskEnqueue(SStreamTask* pTask, const SStreamDispatchReq* pReq, SRpcMsg* pRsp) { - SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); int8_t status; // enqueue @@ -150,7 +150,7 @@ int32_t streamTaskEnqueue(SStreamTask* pTask, const SStreamDispatchReq* pReq, SR } int32_t streamTaskEnqueueRetrieve(SStreamTask* pTask, SStreamRetrieveReq* pReq, SRpcMsg* pRsp) { - SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); int8_t status = TASK_INPUT_STATUS__NORMAL; // enqueue diff --git a/source/libs/stream/src/streamData.c b/source/libs/stream/src/streamData.c index 2fea5b9eca..6cc684dddf 100644 --- a/source/libs/stream/src/streamData.c +++ b/source/libs/stream/src/streamData.c @@ -67,7 +67,7 @@ int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock } SStreamDataSubmit* streamDataSubmitNew(SSubmitReq* pReq) { - SStreamDataSubmit* pDataSubmit = (SStreamDataSubmit*)taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM); + SStreamDataSubmit* pDataSubmit = (SStreamDataSubmit*)taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM, 0); if (pDataSubmit == NULL) return NULL; pDataSubmit->dataRef = (int32_t*)taosMemoryMalloc(sizeof(int32_t)); if (pDataSubmit->dataRef == NULL) goto FAIL; @@ -81,7 +81,7 @@ FAIL: } SStreamMergedSubmit* streamMergedSubmitNew() { - SStreamMergedSubmit* pMerged = (SStreamMergedSubmit*)taosAllocateQitem(sizeof(SStreamMergedSubmit), DEF_QITEM); + SStreamMergedSubmit* pMerged = (SStreamMergedSubmit*)taosAllocateQitem(sizeof(SStreamMergedSubmit), DEF_QITEM, 0); if (pMerged == NULL) return NULL; pMerged->reqs = taosArrayInit(0, sizeof(void*)); pMerged->dataRefs = taosArrayInit(0, sizeof(void*)); @@ -107,7 +107,7 @@ static FORCE_INLINE void streamDataSubmitRefInc(SStreamDataSubmit* pDataSubmit) } SStreamDataSubmit* streamSubmitRefClone(SStreamDataSubmit* pSubmit) { - SStreamDataSubmit* pSubmitClone = taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM); + SStreamDataSubmit* pSubmitClone = taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM, 0); if (pSubmitClone == NULL) { return NULL; } diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index d20c2902f5..20608a6cf3 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -127,7 +127,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) { taosArrayDestroy(pRes); break; } - SStreamDataBlock* qRes = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* qRes = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); if (qRes == NULL) { taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes); terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -235,7 +235,7 @@ int32_t streamExecForAll(SStreamTask* pTask) { qDebug("stream task %d exec end", pTask->taskId); if (taosArrayGetSize(pRes) != 0) { - SStreamDataBlock* qRes = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM); + SStreamDataBlock* qRes = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0); if (qRes == NULL) { taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes); streamFreeQitem(input); diff --git a/source/libs/sync/test/sync_test_lib/src/syncIO.c b/source/libs/sync/test/sync_test_lib/src/syncIO.c index 415fecd9f2..4b305f823f 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncIO.c +++ b/source/libs/sync/test/sync_test_lib/src/syncIO.c @@ -97,7 +97,7 @@ int32_t syncIOEqMsg(const SMsgCb *msgcb, SRpcMsg *pMsg) { syncRpcMsgLog2(logBuf, pMsg); SRpcMsg *pTemp; - pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM); + pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM, 0); memcpy(pTemp, pMsg, sizeof(SRpcMsg)); STaosQueue *pMsgQ = gSyncIO->pMsgQ; @@ -381,7 +381,7 @@ static void syncIOProcessRequest(void *pParent, SRpcMsg *pMsg, SEpSet *pEpSet) { syncRpcMsgLog2((char *)"==syncIOProcessRequest==", pMsg); SSyncIO *io = pParent; SRpcMsg *pTemp; - pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM); + pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM, 0); memcpy(pTemp, pMsg, sizeof(SRpcMsg)); taosWriteQitem(io->pMsgQ, pTemp); } @@ -441,7 +441,7 @@ static void syncIOTickQ(void *param, void *tmrId) { SRpcMsg rpcMsg; syncPingReply2RpcMsg(pMsg, &rpcMsg); SRpcMsg *pTemp; - pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM); + pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM, 0); memcpy(pTemp, &rpcMsg, sizeof(SRpcMsg)); syncRpcMsgLog2((char *)"==syncIOTickQ==", &rpcMsg); taosWriteQitem(io->pMsgQ, pTemp); diff --git a/source/libs/transport/test/svrBench.c b/source/libs/transport/test/svrBench.c index 464559c1e0..4e2395b17b 100644 --- a/source/libs/transport/test/svrBench.c +++ b/source/libs/transport/test/svrBench.c @@ -128,7 +128,7 @@ void *processShellMsg(void *arg) { void processRequestMsg(void *pParent, SRpcMsg *pMsg, SEpSet *pEpSet) { SRpcMsg *pTemp; - pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM); + pTemp = taosAllocateQitem(sizeof(SRpcMsg), DEF_QITEM, 0); memcpy(pTemp, pMsg, sizeof(SRpcMsg)); int32_t idx = balance % multiQ->numOfThread; diff --git a/source/util/src/tqueue.c b/source/util/src/tqueue.c index 0f992184b5..1079dff0bf 100644 --- a/source/util/src/tqueue.c +++ b/source/util/src/tqueue.c @@ -109,20 +109,22 @@ int64_t taosQueueMemorySize(STaosQueue *queue) { return memOfItems; } -void *taosAllocateQitem(int32_t size, EQItype itype) { +void *taosAllocateQitem(int32_t size, EQItype itype, int32_t dataSize) { STaosQnode *pNode = taosMemoryCalloc(1, sizeof(STaosQnode) + size); if (pNode == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } + pNode->dataSize = dataSize; pNode->size = size; pNode->itype = itype; pNode->timestamp = taosGetTimestampUs(); if (itype == RPC_QITEM) { - int64_t alloced = atomic_add_fetch_64(&tsRpcQueueMemoryUsed, size); + int64_t alloced = atomic_add_fetch_64(&tsRpcQueueMemoryUsed, size + dataSize); if (alloced > tsRpcQueueMemoryAllowed) { + uError("failed to alloc qitem, size:%d alloc:%" PRId64 " allowed:%" PRId64, size + dataSize, alloced, tsRpcQueueMemoryUsed); taosMemoryFree(pNode); terrno = TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE; return NULL; @@ -139,8 +141,8 @@ void taosFreeQitem(void *pItem) { if (pItem == NULL) return; STaosQnode *pNode = (STaosQnode *)((char *)pItem - sizeof(STaosQnode)); - if (pNode->itype > 0) { - int64_t alloced = atomic_sub_fetch_64(&tsRpcQueueMemoryUsed, pNode->size); + if (pNode->itype == RPC_QITEM) { + int64_t alloced = atomic_sub_fetch_64(&tsRpcQueueMemoryUsed, pNode->size + pNode->dataSize); uTrace("item:%p, node:%p is freed, alloc:%" PRId64, pItem, pNode, alloced); } else { uTrace("item:%p, node:%p is freed", pItem, pNode); From 7563ba2dfc064069a9316e1914f04f7d11b4210f Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 10 Dec 2022 14:07:34 +0800 Subject: [PATCH 14/74] fix(query): keep the correct value. --- source/libs/executor/src/timesliceoperator.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index af3c44d032..0886bfd859 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -49,10 +49,10 @@ static void doKeepPrevRows(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlock if (!colDataIsNull_s(pColInfoData, rowIndex)) { pkey->isNull = false; char* val = colDataGetData(pColInfoData, rowIndex); - if (!IS_VAR_DATA_TYPE(pkey->type)) { - memcpy(pkey->pData, val, pkey->bytes); - } else { + if (IS_VAR_DATA_TYPE(pkey->type)) { memcpy(pkey->pData, val, varDataLen(val)); + } else { + memcpy(pkey->pData, val, pkey->bytes); } } else { pkey->isNull = true; @@ -112,9 +112,9 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo char* p = colDataGetData(pColInfoData, rowIndex); if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); - memcpy(pLinearInfo->start.val, p, varDataTLen(p)); + memcpy(pLinearInfo->end.val, p, varDataTLen(p)); } else { - memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes); + memcpy(pLinearInfo->end.val, p, pLinearInfo->bytes); } } pLinearInfo->isEndSet = true; @@ -128,9 +128,9 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo char* p = colDataGetData(pColInfoData, rowIndex); if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { ASSERT(varDataTLen(p) <= pColInfoData->info.bytes); - memcpy(pLinearInfo->start.val, p, varDataTLen(p)); + memcpy(pLinearInfo->end.val, p, varDataTLen(p)); } else { - memcpy(pLinearInfo->start.val, p, pLinearInfo->bytes); + memcpy(pLinearInfo->end.val, p, pLinearInfo->bytes); } } else { From eeefd1a4b586cdded6fb38ad6b2715b2c5373656 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 10 Dec 2022 14:35:56 +0800 Subject: [PATCH 15/74] fix(query): does not return error code if queried table does not exists. --- source/dnode/vnode/src/tsdb/tsdbMergeTree.c | 2 +- source/dnode/vnode/src/tsdb/tsdbRead.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 01fbcf657f..ad264b8bb3 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -121,7 +121,7 @@ static SBlockData *loadLastBlock(SLDataIter *pIter, const char *idStr) { return &pInfo->blockData[1]; } - if (pIter->pSttBlk == NULL) { + if (pIter->pSttBlk == NULL || pInfo->pSchema == NULL) { return NULL; } diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 9afc0ae7e8..a0334684a3 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2790,7 +2790,8 @@ static int32_t doLoadLastBlockSequentially(STsdbReader* pReader) { while (1) { // load the last data block of current table STableBlockScanInfo* pScanInfo = *(STableBlockScanInfo**)pStatus->pTableIter; - bool hasVal = initLastBlockReader(pLastBlockReader, pScanInfo, pReader); + + bool hasVal = initLastBlockReader(pLastBlockReader, pScanInfo, pReader); if (!hasVal) { bool hasNexTable = moveToNextTable(pOrderedCheckInfo, pStatus); if (!hasNexTable) { @@ -3823,21 +3824,18 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL } // NOTE: the endVersion in pCond is the data version not schema version, so pCond->endVersion is not correct here. + // no valid error code set in metaGetTbTSchema, so let's set the error code here. + // we should proceed in case of tmq processing. if (pCond->suid != 0) { pReader->pSchema = metaGetTbTSchema(pReader->pTsdb->pVnode->pMeta, pReader->suid, -1, 1); if (pReader->pSchema == NULL) { tsdbError("failed to get table schema, suid:%" PRIu64 ", ver:-1, %s", pReader->suid, pReader->idStr); - // no valid error code set in metaGetTbTSchema, so let's set the error code here. - code = TSDB_CODE_PAR_TABLE_NOT_EXIST; - goto _err; } } else if (numOfTables > 0) { STableKeyInfo* pKey = pTableList; pReader->pSchema = metaGetTbTSchema(pReader->pTsdb->pVnode->pMeta, pKey->uid, -1, 1); if (pReader->pSchema == NULL) { tsdbError("failed to get table schema, uid:%" PRIu64 ", ver:-1, %s", pKey->uid, pReader->idStr); - code = TSDB_CODE_PAR_TABLE_NOT_EXIST; - goto _err; } } From 1aff3cceebb5163b21c96901ba240cfc0bd88ee7 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Sat, 10 Dec 2022 15:03:24 +0800 Subject: [PATCH 16/74] fix: show queries crash issue --- source/client/src/clientImpl.c | 5 +++-- source/dnode/mnode/impl/src/mndProfile.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index e6584f4a00..e26512d065 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -190,8 +190,9 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, (*pRequest)->body.param = param; STscObj* pTscObj = (*pRequest)->pTscObj; - if (taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, - sizeof((*pRequest)->self))) { + int32_t err = taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, + sizeof((*pRequest)->self)); + if (err) { tscError("%" PRId64 " failed to add to request container, reqId:0x%" PRIx64 ", conn:%" PRId64 ", %s", (*pRequest)->self, (*pRequest)->requestId, pTscObj->id, sql); diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c index fe76ba31d7..ffc357b2e8 100644 --- a/source/dnode/mnode/impl/src/mndProfile.c +++ b/source/dnode/mnode/impl/src/mndProfile.c @@ -769,7 +769,7 @@ static int32_t mndRetrieveQueries(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p } int32_t numOfQueries = taosArrayGetSize(pConn->pQueries); - for (int32_t i = 0; i < numOfQueries; ++i) { + for (int32_t i = 0; i < numOfQueries && numOfRows < rows; ++i) { SQueryDesc *pQuery = taosArrayGet(pConn->pQueries, i); cols = 0; From 652f51fec524eb93bd269f0996b6c06a3b660607 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 10 Dec 2022 15:09:55 +0800 Subject: [PATCH 17/74] fix: control rpc qitem memory --- include/util/tqueue.h | 4 ++-- source/dnode/mgmt/mgmt_mnode/src/mmWorker.c | 2 +- source/dnode/mgmt/mgmt_qnode/src/qmWorker.c | 4 ++-- source/dnode/mgmt/mgmt_snode/src/smWorker.c | 4 ++-- source/dnode/mgmt/mgmt_vnode/src/vmWorker.c | 2 +- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 2 +- source/util/src/tqueue.c | 6 ++++-- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/util/tqueue.h b/include/util/tqueue.h index 25a0019106..1f6b205cdf 100644 --- a/include/util/tqueue.h +++ b/include/util/tqueue.h @@ -65,7 +65,7 @@ typedef struct STaosQnode { STaosQnode *next; STaosQueue *queue; int64_t timestamp; - int32_t dataSize; + int64_t dataSize; int32_t size; int8_t itype; int8_t reserved[3]; @@ -104,7 +104,7 @@ typedef struct STaosQall { STaosQueue *taosOpenQueue(); void taosCloseQueue(STaosQueue *queue); void taosSetQueueFp(STaosQueue *queue, FItem itemFp, FItems itemsFp); -void *taosAllocateQitem(int32_t size, EQItype itype, int32_t dataSize); +void *taosAllocateQitem(int32_t size, EQItype itype, int64_t dataSize); void taosFreeQitem(void *pItem); void taosWriteQitem(STaosQueue *queue, void *pItem); int32_t taosReadQitem(STaosQueue *queue, void **ppItem); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c index 5d86e11c57..095857825d 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c @@ -164,7 +164,7 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { memcpy(pMsg, pRpc, sizeof(SRpcMsg)); pRpc->pCont = NULL; - dTrace("msg:%p, is created and will put into %s queue, type:%s", pMsg, pWorker->name, TMSG_INFO(pRpc->msgType)); + dTrace("msg:%p, is created and will put into %s queue, type:%s len:%d", pMsg, pWorker->name, TMSG_INFO(pRpc->msgType), pRpc->contLen); int32_t code = mmPutMsgToWorker(pMgmt, pWorker, pMsg); if (code != 0) { dTrace("msg:%p, is freed", pMsg); diff --git a/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c b/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c index 579a4e2090..28da0f9c5f 100644 --- a/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c +++ b/source/dnode/mgmt/mgmt_qnode/src/qmWorker.c @@ -65,12 +65,12 @@ int32_t qmPutRpcMsgToQueue(SQnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { switch (qtype) { case QUERY_QUEUE: - dTrace("msg:%p, is created and will put into qnode-query queue", pMsg); + dTrace("msg:%p, is created and will put into qnode-query queue, len:%d", pMsg, pRpc->contLen); taosWriteQitem(pMgmt->queryWorker.queue, pMsg); return 0; case READ_QUEUE: case FETCH_QUEUE: - dTrace("msg:%p, is created and will put into qnode-fetch queue", pMsg); + dTrace("msg:%p, is created and will put into qnode-fetch queue, len:%d", pMsg, pRpc->contLen); taosWriteQitem(pMgmt->fetchWorker.queue, pMsg); return 0; default: diff --git a/source/dnode/mgmt/mgmt_snode/src/smWorker.c b/source/dnode/mgmt/mgmt_snode/src/smWorker.c index e1cc378396..9bd5be5201 100644 --- a/source/dnode/mgmt/mgmt_snode/src/smWorker.c +++ b/source/dnode/mgmt/mgmt_snode/src/smWorker.c @@ -139,8 +139,8 @@ int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { SSnode *pSnode = pMgmt->pSnode; if (pSnode == NULL) { - dError("msg:%p failed to put into snode queue since %s, type:%s qtype:%d", pMsg, terrstr(), - TMSG_INFO(pMsg->msgType), qtype); + dError("msg:%p failed to put into snode queue since %s, type:%s qtype:%d len:%d", pMsg, terrstr(), + TMSG_INFO(pMsg->msgType), qtype, pRpc->contLen); taosFreeQitem(pMsg); rpcFreeCont(pRpc->pCont); pRpc->pCont = NULL; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index c48216ed7d..7e3915f3d1 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -241,7 +241,7 @@ int32_t vmPutRpcMsgToQueue(SVnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { } SMsgHead *pHead = pRpc->pCont; - dTrace("vgId:%d, msg:%p is created, type:%s", pHead->vgId, pMsg, TMSG_INFO(pRpc->msgType)); + dTrace("vgId:%d, msg:%p is created, type:%s len:%d", pHead->vgId, pMsg, TMSG_INFO(pRpc->msgType), pRpc->contLen); pHead->contLen = htonl(pHead->contLen); pHead->vgId = htonl(pHead->vgId); diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 33646d6d67..4fa09a46b7 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -145,7 +145,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { if (pMsg == NULL) goto _OVER; memcpy(pMsg, pRpc, sizeof(SRpcMsg)); - dGTrace("msg:%p, is created, type:%s handle:%p", pMsg, TMSG_INFO(pRpc->msgType), pMsg->info.handle); + dGTrace("msg:%p, is created, type:%s handle:%p len:%d", pMsg, TMSG_INFO(pRpc->msgType), pMsg->info.handle, pRpc->contLen); code = dmProcessNodeMsg(pWrapper, pMsg); diff --git a/source/util/src/tqueue.c b/source/util/src/tqueue.c index 1079dff0bf..42b6358893 100644 --- a/source/util/src/tqueue.c +++ b/source/util/src/tqueue.c @@ -109,7 +109,7 @@ int64_t taosQueueMemorySize(STaosQueue *queue) { return memOfItems; } -void *taosAllocateQitem(int32_t size, EQItype itype, int32_t dataSize) { +void *taosAllocateQitem(int32_t size, EQItype itype, int64_t dataSize) { STaosQnode *pNode = taosMemoryCalloc(1, sizeof(STaosQnode) + size); if (pNode == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -124,7 +124,9 @@ void *taosAllocateQitem(int32_t size, EQItype itype, int32_t dataSize) { if (itype == RPC_QITEM) { int64_t alloced = atomic_add_fetch_64(&tsRpcQueueMemoryUsed, size + dataSize); if (alloced > tsRpcQueueMemoryAllowed) { - uError("failed to alloc qitem, size:%d alloc:%" PRId64 " allowed:%" PRId64, size + dataSize, alloced, tsRpcQueueMemoryUsed); + uError("failed to alloc qitem, size:%" PRId64 " alloc:%" PRId64 " allowed:%" PRId64, size + dataSize, alloced, + tsRpcQueueMemoryUsed); + atomic_sub_fetch_64(&tsRpcQueueMemoryUsed, size + dataSize); taosMemoryFree(pNode); terrno = TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE; return NULL; From 3024e91a8d170a985e1d11e85dd42a15e94a98a1 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Sat, 10 Dec 2022 15:45:59 +0800 Subject: [PATCH 18/74] fix: restore stream code --- source/libs/executor/src/executor.c | 5 ++--- source/libs/executor/src/scanoperator.c | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 834c581fed..6fca2858dc 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -109,9 +109,8 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu SStreamScanInfo* pInfo = pOperator->info; - if (pInfo->validBlockIndex != 0 || taosArrayGetSize(pInfo->pBlockLists) == 0) { - return TSDB_CODE_APP_ERROR; - } + ASSERT(pInfo->validBlockIndex == 0); + ASSERT(taosArrayGetSize(pInfo->pBlockLists) == 0); if (type == STREAM_INPUT__MERGED_SUBMIT) { // ASSERT(numOfBlocks > 1); diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 647f776afa..f92e543c2f 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2001,6 +2001,7 @@ FETCH_NEXT_BLOCK: goto NEXT_SUBMIT_BLK; } else { + ASSERT(0) return NULL; } } From 25029a2e7a7a6be44459be3d6cf929c44dd9cdfd Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Sat, 10 Dec 2022 15:53:32 +0800 Subject: [PATCH 19/74] fix: restore stream code --- source/libs/executor/src/scanoperator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index f92e543c2f..eae2ff3c72 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2001,7 +2001,7 @@ FETCH_NEXT_BLOCK: goto NEXT_SUBMIT_BLK; } else { - ASSERT(0) + ASSERT(0); return NULL; } } From 3c777c492d1aee1461e28bbfd55c3ae48f98b319 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Mon, 12 Dec 2022 10:20:03 +0800 Subject: [PATCH 20/74] fix: fix taosd crash caused by assert --- source/libs/executor/src/timesliceoperator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index f7bee7d351..a82dc13318 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -91,11 +91,15 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSliceInfo->tsCol.slotId); SFillLinearInfo* pLinearInfo = taosArrayGet(pSliceInfo->pLinearInfo, i); + + if (!IS_MATHABLE_TYPE(pColInfoData->info.type)) { + continue; + } + // null value is represented by using key = INT64_MIN for now. // TODO: optimize to ignore null values for linear interpolation. if (!pLinearInfo->isStartSet) { if (!colDataIsNull_s(pColInfoData, rowIndex)) { - ASSERT(IS_MATHABLE_TYPE(pColInfoData->info.type)); pLinearInfo->start.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); char* p = colDataGetData(pColInfoData, rowIndex); From dc9c5e769e18bd54a6953b68e7aa696c9d031569 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 12 Dec 2022 11:24:21 +0800 Subject: [PATCH 21/74] enh: dynamically check the support of fma/avx/sse42/avx2 in cmake files. --- cmake/cmake.define | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/cmake/cmake.define b/cmake/cmake.define index e34785cba6..d73c42e375 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -123,21 +123,31 @@ ELSE () SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k") ENDIF () - IF (TD_INTEL_64 OR TD_INTEL_32) - ADD_DEFINITIONS("-msse4.2") - IF("${FMA_SUPPORT}" MATCHES "true") - MESSAGE(STATUS "fma function supported") - ADD_DEFINITIONS("-mfma") - ELSE () - MESSAGE(STATUS "fma function NOT supported") - ENDIF() + INCLUDE(CheckCCompilerFlag) + CHECK_C_COMPILER_FLAG("-msse4.2" GCC_SUPPORT_SSE42) + CHECK_C_COMPILER_FLAG("-mfma" GCC_SUPPORT_FMA) + CHECK_C_COMPILER_FLAG("-mavx" GCC_SUPPORT_AVX) + CHECK_C_COMPILER_FLAG("-mavx2" GCC_SUPPORT_AVX2) - IF("${SIMD_SUPPORT}" MATCHES "true") - ADD_DEFINITIONS("-mavx -mavx2") - MESSAGE(STATUS "SIMD instructions (AVX/AVX2) is ACTIVATED") - ELSE() - MESSAGE(STATUS "SIMD instruction (AVX/AVX2)is NOT ACTIVATED") + IF (GCC_SUPPORT_SSE42) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") + ENDIF() + IF (GCC_SUPPORT_FMA) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfma") + ENDIF() + + IF ("${SIMD_SUPPORT}" MATCHES "true") + IF (GCC_SUPPORT_AVX) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") ENDIF() - ENDIF () + IF (GCC_SUPPORT_AVX2) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") + ENDIF() + MESSAGE(STATUS "SIMD instructions (AVX/AVX2) is ACTIVATED") + ENDIF() ENDIF () From 4b5f4e5175af12019837f431fce217a05fb0f000 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 12 Dec 2022 13:07:30 +0800 Subject: [PATCH 22/74] fix(query): fix error in check if load block is needed --- source/libs/executor/src/scanoperator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index a0f11e9a47..d5239b340c 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -110,9 +110,9 @@ static bool overlapWithTimeWindow(SInterval* pInterval, SDataBlockInfo* pBlockIn if (order == TSDB_ORDER_ASC) { w = getAlignQueryTimeWindow(pInterval, pInterval->precision, pBlockInfo->window.skey); - assert(w.ekey >= pBlockInfo->window.skey); + ASSERT(w.ekey >= pBlockInfo->window.skey); - if (TMAX(w.skey, pBlockInfo->window.skey) <= TMIN(w.ekey, pBlockInfo->window.ekey)) { + if (w.ekey < pBlockInfo->window.ekey) { return true; } @@ -122,16 +122,16 @@ static bool overlapWithTimeWindow(SInterval* pInterval, SDataBlockInfo* pBlockIn break; } - assert(w.ekey > pBlockInfo->window.ekey); + ASSERT(w.ekey > pBlockInfo->window.ekey); if (TMAX(w.skey, pBlockInfo->window.skey) <= pBlockInfo->window.ekey) { return true; } } } else { w = getAlignQueryTimeWindow(pInterval, pInterval->precision, pBlockInfo->window.ekey); - assert(w.skey <= pBlockInfo->window.ekey); + ASSERT(w.skey <= pBlockInfo->window.ekey); - if (TMAX(w.skey, pBlockInfo->window.skey) <= TMIN(w.ekey, pBlockInfo->window.ekey)) { + if (w.skey > pBlockInfo->window.skey) { return true; } From 6283581cb82509030c1ef0686ec02e704c7f8f7e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 12 Dec 2022 13:19:59 +0800 Subject: [PATCH 23/74] fix(query): remove invalid update block timestamp range. --- source/libs/executor/src/timewindowoperator.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index d9a011a892..30b7f6b8fb 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1073,8 +1073,6 @@ static int32_t doOpenIntervalAgg(SOperatorInfo* pOperator) { // the pDataBlock are always the same one, no need to call this again setInputDataBlock(pSup, pBlock, pInfo->inputOrder, scanFlag, true); - blockDataUpdateTsWindow(pBlock, pInfo->primaryTsIndex); - hashIntervalAgg(pOperator, &pInfo->binfo.resultRowInfo, pBlock, scanFlag); } From dc64bb5110f7a248cfec05a49ffe810c4b8fc332 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Mon, 12 Dec 2022 13:22:23 +0800 Subject: [PATCH 24/74] enh: shielding sql command 'alter database strict' --- source/libs/parser/inc/sql.y | 2 +- source/libs/parser/src/sql.c | 3790 +++++++++++++++++----------------- 2 files changed, 1893 insertions(+), 1899 deletions(-) diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index b060f7fc83..c85759446a 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -232,7 +232,7 @@ alter_db_option(A) ::= KEEP integer_list(B). alter_db_option(A) ::= KEEP variable_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; } alter_db_option(A) ::= PAGES NK_INTEGER(B). { A.type = DB_OPTION_PAGES; A.val = B; } alter_db_option(A) ::= REPLICA NK_INTEGER(B). { A.type = DB_OPTION_REPLICA; A.val = B; } -alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; } +//alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; } alter_db_option(A) ::= WAL_LEVEL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; } alter_db_option(A) ::= STT_TRIGGER NK_INTEGER(B). { A.type = DB_OPTION_STT_TRIGGER; A.val = B; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index b4d4a3457e..a83f85696a 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 710 -#define YYNRULE 540 +#define YYNSTATE 709 +#define YYNRULE 539 #define YYNTOKEN 322 -#define YY_MAX_SHIFT 709 -#define YY_MIN_SHIFTREDUCE 1052 -#define YY_MAX_SHIFTREDUCE 1591 -#define YY_ERROR_ACTION 1592 -#define YY_ACCEPT_ACTION 1593 -#define YY_NO_ACTION 1594 -#define YY_MIN_REDUCE 1595 -#define YY_MAX_REDUCE 2134 +#define YY_MAX_SHIFT 708 +#define YY_MIN_SHIFTREDUCE 1050 +#define YY_MAX_SHIFTREDUCE 1588 +#define YY_ERROR_ACTION 1589 +#define YY_ACCEPT_ACTION 1590 +#define YY_NO_ACTION 1591 +#define YY_MIN_REDUCE 1592 +#define YY_MAX_REDUCE 2130 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -218,476 +218,476 @@ typedef union { *********** Begin parsing tables **********************************************/ #define YY_ACTTAB_COUNT (2410) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1950, 458, 157, 459, 1631, 566, 167, 1703, 467, 2105, - /* 10 */ 459, 1631, 43, 41, 1522, 365, 1651, 2110, 1796, 1798, - /* 20 */ 360, 2105, 1373, 1595, 565, 173, 598, 332, 1850, 2106, - /* 30 */ 567, 1968, 1741, 1452, 405, 1371, 1664, 2109, 514, 581, - /* 40 */ 52, 2106, 2108, 1933, 1919, 399, 614, 122, 121, 120, - /* 50 */ 119, 118, 117, 116, 115, 114, 464, 1750, 1447, 597, - /* 60 */ 36, 35, 460, 16, 42, 40, 39, 38, 37, 1949, - /* 70 */ 1379, 1929, 1935, 1984, 318, 597, 100, 1951, 618, 1953, - /* 80 */ 1954, 613, 608, 608, 258, 597, 1526, 546, 170, 1938, - /* 90 */ 2037, 2105, 1398, 476, 354, 2033, 12, 2052, 1462, 1950, - /* 100 */ 1933, 513, 512, 511, 1398, 1968, 2111, 173, 175, 128, - /* 110 */ 507, 2106, 567, 560, 506, 505, 2063, 158, 706, 1607, - /* 120 */ 504, 510, 58, 2049, 85, 561, 503, 598, 1929, 1935, - /* 130 */ 1968, 1398, 1085, 1454, 1455, 1104, 1593, 1103, 615, 608, - /* 140 */ 2110, 123, 1846, 1919, 2105, 614, 43, 41, 497, 1558, - /* 150 */ 210, 46, 559, 181, 360, 1727, 1373, 1399, 1750, 1950, - /* 160 */ 2109, 46, 1428, 1437, 2106, 2107, 1105, 1452, 1949, 1371, - /* 170 */ 598, 1087, 1984, 1090, 1091, 100, 1951, 618, 1953, 1954, - /* 180 */ 613, 1374, 608, 1372, 123, 134, 62, 141, 2008, 2037, - /* 190 */ 1968, 502, 1447, 354, 2033, 33, 274, 16, 581, 375, - /* 200 */ 1398, 1750, 652, 1919, 1379, 614, 1377, 1378, 1398, 1427, - /* 210 */ 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, - /* 220 */ 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, 1949, 97, - /* 230 */ 12, 2110, 1984, 1950, 1429, 100, 1951, 618, 1953, 1954, - /* 240 */ 613, 546, 608, 132, 1397, 2105, 1429, 170, 1400, 2037, - /* 250 */ 556, 1742, 706, 354, 2033, 42, 40, 39, 38, 37, - /* 260 */ 2111, 173, 9, 650, 1968, 2106, 567, 1454, 1455, 1797, - /* 270 */ 1798, 176, 615, 1309, 1310, 2064, 58, 1919, 58, 614, - /* 280 */ 43, 41, 146, 145, 647, 646, 645, 143, 360, 1400, - /* 290 */ 1373, 58, 1399, 1950, 509, 508, 1428, 1437, 1618, 578, - /* 300 */ 176, 1452, 1949, 1371, 457, 598, 1984, 462, 1637, 100, - /* 310 */ 1951, 618, 1953, 1954, 613, 1374, 608, 1372, 225, 178, - /* 320 */ 643, 2012, 169, 2037, 1968, 1581, 1447, 354, 2033, 1483, - /* 330 */ 131, 16, 615, 562, 557, 1790, 1750, 1919, 1379, 614, - /* 340 */ 1377, 1378, 1919, 1427, 1430, 1431, 1432, 1433, 1434, 1435, - /* 350 */ 1436, 610, 606, 1445, 1446, 1448, 1449, 1450, 1451, 1453, - /* 360 */ 1456, 2, 1949, 9, 12, 1950, 1984, 677, 675, 100, - /* 370 */ 1951, 618, 1953, 1954, 613, 398, 608, 397, 82, 320, - /* 380 */ 58, 2125, 531, 2037, 529, 80, 706, 354, 2033, 255, - /* 390 */ 2045, 577, 257, 124, 576, 441, 1968, 2105, 2071, 127, - /* 400 */ 30, 1454, 1455, 541, 612, 1256, 1257, 406, 1745, 1919, - /* 410 */ 1488, 614, 565, 173, 43, 41, 1457, 2106, 567, 585, - /* 420 */ 407, 1379, 360, 1725, 1373, 176, 47, 176, 1846, 351, - /* 430 */ 1428, 1437, 1861, 257, 1949, 1452, 185, 1371, 1984, 183, - /* 440 */ 176, 310, 1951, 618, 1953, 1954, 613, 650, 608, 1374, - /* 450 */ 2003, 1372, 466, 189, 188, 462, 1637, 36, 35, 664, - /* 460 */ 1447, 42, 40, 39, 38, 37, 146, 145, 647, 646, - /* 470 */ 645, 143, 1379, 77, 1377, 1378, 76, 1427, 1430, 1431, - /* 480 */ 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, 1446, 1448, - /* 490 */ 1449, 1450, 1451, 1453, 1456, 2, 598, 1617, 44, 598, - /* 500 */ 1739, 1950, 1803, 513, 512, 511, 1398, 598, 1803, 353, - /* 510 */ 403, 128, 507, 404, 1735, 364, 506, 505, 1801, 1616, - /* 520 */ 706, 413, 504, 510, 1801, 352, 363, 1750, 503, 176, - /* 530 */ 1750, 650, 1968, 155, 155, 1454, 1455, 1104, 1750, 1103, - /* 540 */ 615, 1919, 1752, 1752, 527, 1919, 1538, 614, 43, 41, - /* 550 */ 146, 145, 647, 646, 645, 143, 360, 525, 1373, 523, - /* 560 */ 1737, 1950, 598, 1919, 1428, 1437, 394, 1173, 1105, 1452, - /* 570 */ 1949, 1371, 598, 578, 1984, 176, 427, 100, 1951, 618, - /* 580 */ 1953, 1954, 613, 1374, 608, 1372, 428, 396, 392, 2010, - /* 590 */ 1733, 2037, 1968, 1750, 1447, 354, 2033, 226, 230, 9, - /* 600 */ 615, 7, 1175, 1750, 131, 1919, 1379, 614, 1377, 1378, - /* 610 */ 80, 1427, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, - /* 620 */ 606, 1445, 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, - /* 630 */ 1949, 167, 44, 1746, 1984, 366, 605, 100, 1951, 618, - /* 640 */ 1953, 1954, 613, 155, 608, 265, 266, 1615, 1429, 2125, - /* 650 */ 264, 2037, 1752, 1851, 706, 354, 2033, 1614, 1950, 1728, - /* 660 */ 1350, 1351, 580, 171, 2045, 2046, 2099, 129, 2050, 1454, - /* 670 */ 1455, 36, 35, 6, 29, 42, 40, 39, 38, 37, - /* 680 */ 36, 35, 43, 41, 42, 40, 39, 38, 37, 1968, - /* 690 */ 360, 1919, 1373, 91, 598, 598, 2077, 615, 1428, 1437, - /* 700 */ 1613, 1919, 1919, 1452, 614, 1371, 1803, 25, 474, 475, - /* 710 */ 39, 38, 37, 329, 600, 1743, 2009, 1374, 602, 1372, - /* 720 */ 2009, 476, 1801, 609, 155, 1750, 1750, 1949, 1447, 227, - /* 730 */ 1612, 1984, 1780, 1753, 159, 1951, 618, 1953, 1954, 613, - /* 740 */ 1379, 608, 1377, 1378, 1919, 1427, 1430, 1431, 1432, 1433, - /* 750 */ 1434, 1435, 1436, 610, 606, 1445, 1446, 1448, 1449, 1450, - /* 760 */ 1451, 1453, 1456, 2, 36, 35, 12, 1950, 42, 40, - /* 770 */ 39, 38, 37, 1846, 1919, 547, 2074, 566, 1548, 1473, - /* 780 */ 317, 2105, 1396, 2052, 187, 598, 642, 1611, 706, 435, - /* 790 */ 1610, 1609, 448, 1596, 1606, 447, 565, 173, 1968, 1747, - /* 800 */ 1726, 2106, 567, 1454, 1455, 1605, 615, 1608, 1604, 2048, - /* 810 */ 419, 1919, 449, 614, 113, 421, 1750, 112, 111, 110, - /* 820 */ 109, 108, 107, 106, 105, 104, 553, 1546, 1547, 1549, - /* 830 */ 1550, 1919, 1428, 1437, 1919, 1919, 532, 665, 1919, 1720, - /* 840 */ 1984, 598, 598, 306, 1951, 618, 1953, 1954, 613, 1919, - /* 850 */ 608, 1374, 1919, 1372, 1603, 139, 367, 333, 1661, 36, - /* 860 */ 35, 1519, 652, 42, 40, 39, 38, 37, 2109, 409, - /* 870 */ 1401, 1401, 1750, 1750, 2052, 1602, 1377, 1378, 1515, 1427, - /* 880 */ 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, - /* 890 */ 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, 1919, 445, - /* 900 */ 2047, 1704, 440, 439, 438, 437, 434, 433, 432, 431, - /* 910 */ 430, 426, 425, 424, 423, 334, 416, 415, 414, 1919, - /* 920 */ 411, 410, 331, 683, 682, 681, 680, 370, 144, 679, - /* 930 */ 678, 135, 673, 672, 671, 670, 669, 668, 667, 666, - /* 940 */ 148, 662, 661, 660, 369, 368, 657, 656, 655, 654, - /* 950 */ 653, 156, 1601, 1600, 598, 1599, 294, 36, 35, 357, - /* 960 */ 356, 42, 40, 39, 38, 37, 1598, 1950, 542, 1387, - /* 970 */ 292, 66, 598, 133, 65, 644, 2008, 252, 1794, 1401, - /* 980 */ 1452, 51, 1380, 36, 35, 1750, 582, 42, 40, 39, - /* 990 */ 38, 37, 193, 454, 452, 585, 1919, 1919, 1968, 1919, - /* 1000 */ 11, 10, 337, 1750, 648, 1447, 615, 1794, 1862, 554, - /* 1010 */ 1919, 1919, 325, 614, 182, 235, 573, 1379, 1213, 640, - /* 1020 */ 639, 638, 1217, 637, 1219, 1220, 636, 1222, 633, 58, - /* 1030 */ 1228, 630, 1230, 1231, 627, 624, 1949, 209, 288, 598, - /* 1040 */ 1984, 1780, 1803, 100, 1951, 618, 1953, 1954, 613, 649, - /* 1050 */ 608, 584, 1794, 269, 1481, 2125, 216, 2037, 1802, 214, - /* 1060 */ 211, 354, 2033, 709, 338, 604, 336, 335, 99, 499, - /* 1070 */ 1750, 246, 2056, 501, 598, 162, 1906, 281, 1373, 1090, - /* 1080 */ 1091, 493, 489, 485, 481, 208, 2057, 1515, 593, 1833, - /* 1090 */ 598, 1371, 166, 546, 501, 500, 1495, 2105, 699, 695, - /* 1100 */ 691, 687, 279, 1518, 595, 1750, 74, 73, 402, 578, - /* 1110 */ 1482, 180, 2111, 173, 67, 570, 500, 2106, 567, 598, - /* 1120 */ 1382, 1750, 81, 234, 382, 206, 1379, 569, 1388, 316, - /* 1130 */ 1383, 1969, 390, 596, 388, 384, 380, 377, 374, 98, - /* 1140 */ 131, 48, 272, 3, 137, 1381, 125, 371, 1588, 60, - /* 1150 */ 1750, 1855, 113, 1391, 1393, 112, 111, 110, 109, 108, - /* 1160 */ 107, 106, 105, 104, 75, 606, 1445, 1446, 1448, 1449, - /* 1170 */ 1450, 1451, 239, 218, 706, 594, 217, 1950, 176, 45, - /* 1180 */ 598, 32, 358, 1476, 1477, 1478, 1479, 1480, 1484, 1485, - /* 1190 */ 1486, 1487, 205, 199, 275, 204, 1644, 1642, 472, 172, - /* 1200 */ 2045, 2046, 1545, 129, 2050, 1950, 220, 222, 1968, 219, - /* 1210 */ 221, 1750, 260, 262, 197, 50, 615, 140, 516, 519, - /* 1220 */ 545, 1919, 142, 614, 233, 241, 1590, 1591, 1940, 1344, - /* 1230 */ 96, 229, 1320, 11, 10, 1632, 1968, 1374, 574, 1372, - /* 1240 */ 93, 422, 1587, 144, 615, 1133, 1949, 658, 1950, 1919, - /* 1250 */ 1984, 614, 2067, 100, 1951, 618, 1953, 1954, 613, 60, - /* 1260 */ 608, 45, 1377, 1378, 83, 601, 267, 2037, 1385, 1153, - /* 1270 */ 590, 354, 2033, 1791, 1949, 271, 1950, 1942, 1984, 1968, - /* 1280 */ 1134, 101, 1951, 618, 1953, 1954, 613, 615, 608, 579, - /* 1290 */ 254, 31, 1919, 1384, 614, 2037, 1206, 36, 35, 2036, - /* 1300 */ 2033, 42, 40, 39, 38, 37, 251, 1968, 45, 622, - /* 1310 */ 1, 142, 1489, 4, 1438, 615, 144, 1949, 659, 1950, - /* 1320 */ 1919, 1984, 614, 1638, 101, 1951, 618, 1953, 1954, 613, - /* 1330 */ 376, 608, 126, 381, 330, 571, 142, 1950, 2037, 1337, - /* 1340 */ 1151, 282, 603, 2033, 186, 616, 408, 1401, 1856, 1984, - /* 1350 */ 1968, 443, 101, 1951, 618, 1953, 1954, 613, 612, 608, - /* 1360 */ 412, 287, 1234, 1919, 1238, 614, 2037, 417, 1968, 1245, - /* 1370 */ 324, 2033, 701, 1396, 429, 1848, 615, 436, 442, 444, - /* 1380 */ 1950, 1919, 190, 614, 450, 1243, 451, 453, 1949, 147, - /* 1390 */ 455, 1402, 1984, 518, 456, 310, 1951, 618, 1953, 1954, - /* 1400 */ 613, 611, 608, 599, 2002, 465, 1949, 1404, 528, 468, - /* 1410 */ 1984, 1968, 1403, 160, 1951, 618, 1953, 1954, 613, 615, - /* 1420 */ 608, 196, 224, 469, 1919, 198, 614, 1405, 1937, 470, - /* 1430 */ 201, 473, 471, 1950, 1107, 203, 477, 521, 1896, 1933, - /* 1440 */ 78, 1937, 515, 79, 496, 533, 498, 223, 494, 1949, - /* 1450 */ 207, 495, 1933, 1984, 1950, 102, 101, 1951, 618, 1953, - /* 1460 */ 1954, 613, 228, 608, 1968, 568, 2126, 1929, 1935, 343, - /* 1470 */ 2037, 319, 615, 535, 1740, 2034, 213, 1919, 608, 614, - /* 1480 */ 1929, 1935, 355, 373, 64, 1968, 1736, 63, 215, 149, - /* 1490 */ 1895, 608, 150, 615, 372, 1738, 1734, 151, 1919, 152, - /* 1500 */ 614, 536, 1949, 543, 283, 231, 1984, 550, 1950, 159, - /* 1510 */ 1951, 618, 1953, 1954, 613, 555, 608, 537, 540, 237, - /* 1520 */ 588, 2068, 578, 1949, 2078, 546, 552, 1984, 344, 2105, - /* 1530 */ 304, 1951, 618, 1953, 1954, 613, 546, 608, 240, 1968, - /* 1540 */ 2105, 558, 5, 551, 2111, 173, 564, 615, 548, 2106, - /* 1550 */ 567, 2075, 1919, 131, 614, 2111, 173, 549, 248, 2059, - /* 1560 */ 2106, 567, 1950, 36, 35, 245, 345, 42, 40, 39, - /* 1570 */ 38, 37, 250, 1515, 563, 575, 572, 1949, 130, 1950, - /* 1580 */ 2128, 1984, 249, 2083, 160, 1951, 618, 1953, 1954, 613, - /* 1590 */ 2082, 608, 163, 1968, 247, 1400, 583, 259, 349, 2104, - /* 1600 */ 253, 615, 2053, 348, 284, 1950, 1919, 586, 614, 587, - /* 1610 */ 1968, 1867, 174, 2045, 2046, 359, 129, 2050, 615, 591, - /* 1620 */ 1866, 1865, 350, 1919, 88, 614, 285, 592, 286, 57, - /* 1630 */ 90, 1949, 92, 1950, 1751, 1984, 1968, 2127, 311, 1951, - /* 1640 */ 618, 1953, 1954, 613, 615, 608, 2018, 1795, 1949, 1919, - /* 1650 */ 1721, 614, 1984, 289, 620, 311, 1951, 618, 1953, 1954, - /* 1660 */ 613, 278, 608, 702, 1968, 703, 705, 49, 298, 361, - /* 1670 */ 291, 312, 615, 313, 1949, 302, 1950, 1919, 1984, 614, - /* 1680 */ 293, 295, 1951, 618, 1953, 1954, 613, 1913, 608, 321, - /* 1690 */ 322, 1912, 1950, 71, 1911, 1910, 72, 1907, 378, 379, - /* 1700 */ 1365, 1366, 1949, 179, 383, 1905, 1984, 1968, 385, 311, - /* 1710 */ 1951, 618, 1953, 1954, 613, 615, 608, 386, 387, 154, - /* 1720 */ 1919, 1904, 614, 1968, 389, 1903, 1902, 391, 393, 1901, - /* 1730 */ 1340, 615, 1339, 395, 1878, 534, 1919, 1877, 614, 400, - /* 1740 */ 401, 1876, 1875, 1950, 1841, 1949, 1300, 1840, 1838, 1984, - /* 1750 */ 136, 1837, 296, 1951, 618, 1953, 1954, 613, 1836, 608, - /* 1760 */ 1839, 1949, 1835, 1834, 1832, 1984, 1831, 1830, 297, 1951, - /* 1770 */ 618, 1953, 1954, 613, 1968, 608, 184, 546, 418, 1829, - /* 1780 */ 420, 2105, 615, 1828, 1827, 1826, 1950, 1919, 1825, 614, - /* 1790 */ 1824, 1823, 1822, 1821, 1820, 1819, 2111, 173, 1818, 1817, - /* 1800 */ 1816, 2106, 567, 1950, 1815, 1814, 1813, 138, 1812, 1811, - /* 1810 */ 1810, 1809, 1949, 1808, 1807, 1806, 1984, 1968, 1302, 303, - /* 1820 */ 1951, 618, 1953, 1954, 613, 615, 608, 1805, 1804, 446, - /* 1830 */ 1919, 1666, 614, 191, 1968, 1665, 1181, 1663, 192, 1627, - /* 1840 */ 1093, 168, 615, 1092, 194, 1626, 69, 1919, 1891, 614, - /* 1850 */ 1939, 1885, 195, 1874, 1873, 1949, 1950, 70, 200, 1984, - /* 1860 */ 202, 1858, 307, 1951, 618, 1953, 1954, 613, 461, 608, - /* 1870 */ 463, 1729, 1949, 1950, 1662, 1660, 1984, 478, 479, 299, - /* 1880 */ 1951, 618, 1953, 1954, 613, 480, 608, 1968, 1126, 1658, - /* 1890 */ 482, 483, 1656, 486, 1654, 615, 484, 487, 488, 490, - /* 1900 */ 1919, 492, 614, 1641, 1968, 1640, 1623, 1731, 491, 1249, - /* 1910 */ 1730, 1250, 615, 1172, 1171, 1170, 1169, 1919, 1168, 614, - /* 1920 */ 212, 59, 1163, 1165, 1950, 1949, 674, 1652, 676, 1984, - /* 1930 */ 1164, 1162, 308, 1951, 618, 1953, 1954, 613, 339, 608, - /* 1940 */ 1645, 1950, 1949, 340, 1643, 341, 1984, 517, 520, 300, - /* 1950 */ 1951, 618, 1953, 1954, 613, 1968, 608, 1622, 1621, 522, - /* 1960 */ 524, 1620, 1357, 615, 526, 103, 1355, 1950, 1919, 1354, - /* 1970 */ 614, 530, 1968, 24, 1890, 1884, 1346, 538, 1872, 1870, - /* 1980 */ 615, 17, 14, 2110, 1950, 1919, 53, 614, 1560, 18, - /* 1990 */ 56, 243, 28, 1949, 26, 236, 539, 1984, 1968, 232, - /* 2000 */ 309, 1951, 618, 1953, 1954, 613, 615, 608, 342, 153, - /* 2010 */ 1949, 1919, 238, 614, 1984, 1968, 1544, 301, 1951, 618, - /* 2020 */ 1953, 1954, 613, 615, 608, 161, 544, 1537, 1919, 244, - /* 2030 */ 614, 242, 27, 1940, 84, 1950, 1949, 61, 19, 1575, - /* 2040 */ 1984, 1574, 346, 314, 1951, 618, 1953, 1954, 613, 1580, - /* 2050 */ 608, 1581, 1579, 1949, 1578, 347, 1512, 1984, 256, 1511, - /* 2060 */ 315, 1951, 618, 1953, 1954, 613, 1968, 608, 55, 164, - /* 2070 */ 1871, 1869, 1868, 20, 615, 589, 1857, 263, 1950, 1919, - /* 2080 */ 261, 614, 1542, 15, 54, 268, 86, 87, 89, 273, - /* 2090 */ 93, 270, 10, 21, 1950, 1464, 8, 1463, 1987, 1389, - /* 2100 */ 1442, 607, 165, 177, 1949, 1440, 34, 1474, 1984, 1968, - /* 2110 */ 1439, 1962, 1951, 618, 1953, 1954, 613, 615, 608, 13, - /* 2120 */ 1420, 22, 1919, 1412, 614, 1968, 617, 23, 619, 1235, - /* 2130 */ 621, 362, 623, 615, 1232, 625, 626, 628, 1919, 629, - /* 2140 */ 614, 1229, 1223, 631, 1221, 1950, 632, 1949, 634, 635, - /* 2150 */ 1227, 1984, 1212, 1226, 1961, 1951, 618, 1953, 1954, 613, - /* 2160 */ 641, 608, 94, 1949, 276, 95, 1225, 1984, 1244, 68, - /* 2170 */ 1960, 1951, 618, 1953, 1954, 613, 1968, 608, 1224, 1240, - /* 2180 */ 1124, 651, 1159, 1158, 615, 1157, 1156, 1155, 1950, 1919, - /* 2190 */ 1154, 614, 1179, 1152, 1150, 1149, 1148, 663, 277, 1146, - /* 2200 */ 1145, 1144, 1143, 1142, 1141, 1950, 1140, 1139, 1176, 1174, - /* 2210 */ 1136, 1135, 1132, 1131, 1949, 1130, 1659, 1129, 1984, 1968, - /* 2220 */ 684, 326, 1951, 618, 1953, 1954, 613, 615, 608, 686, - /* 2230 */ 1657, 685, 1919, 688, 614, 689, 1968, 1655, 690, 692, - /* 2240 */ 693, 694, 1653, 696, 615, 697, 698, 1639, 700, 1919, - /* 2250 */ 1082, 614, 1619, 280, 704, 708, 1375, 1949, 1950, 1594, - /* 2260 */ 290, 1984, 707, 1594, 327, 1951, 618, 1953, 1954, 613, - /* 2270 */ 1594, 608, 1594, 1594, 1949, 1950, 1594, 1594, 1984, 1594, - /* 2280 */ 1594, 323, 1951, 618, 1953, 1954, 613, 1594, 608, 1968, - /* 2290 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 615, 1594, 1594, - /* 2300 */ 1594, 1594, 1919, 1594, 614, 1594, 1968, 1594, 1594, 1594, - /* 2310 */ 1594, 1594, 1594, 1594, 615, 1594, 1594, 1594, 1594, 1919, - /* 2320 */ 1594, 614, 1594, 1594, 1594, 1594, 1950, 1949, 1594, 1594, - /* 2330 */ 1594, 1984, 1594, 1594, 328, 1951, 618, 1953, 1954, 613, - /* 2340 */ 1594, 608, 1594, 1594, 616, 1594, 1594, 1594, 1984, 1594, - /* 2350 */ 1594, 306, 1951, 618, 1953, 1954, 613, 1968, 608, 1594, - /* 2360 */ 1594, 1594, 1594, 1594, 1594, 615, 1594, 1594, 1594, 1594, - /* 2370 */ 1919, 1594, 614, 1594, 1594, 1594, 1594, 1594, 1594, 1594, - /* 2380 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, - /* 2390 */ 1594, 1594, 1594, 1594, 1594, 1949, 1594, 1594, 1594, 1984, - /* 2400 */ 1594, 1594, 305, 1951, 618, 1953, 1954, 613, 1594, 608, + /* 0 */ 1946, 458, 1735, 459, 1628, 565, 584, 33, 274, 2101, + /* 10 */ 158, 1799, 43, 41, 1519, 1700, 351, 2106, 329, 1857, + /* 20 */ 360, 2101, 1370, 1592, 564, 173, 597, 1797, 352, 2102, + /* 30 */ 566, 1964, 464, 1449, 167, 1368, 155, 2105, 460, 580, + /* 40 */ 52, 2102, 2104, 399, 1915, 1748, 613, 122, 121, 120, + /* 50 */ 119, 118, 117, 116, 115, 114, 1847, 1746, 1444, 227, + /* 60 */ 36, 35, 1776, 16, 42, 40, 39, 38, 37, 1945, + /* 70 */ 1376, 1799, 467, 1980, 459, 1628, 100, 1947, 617, 1949, + /* 80 */ 1950, 612, 565, 607, 596, 545, 2101, 1798, 170, 2101, + /* 90 */ 2033, 1615, 1737, 167, 354, 2029, 12, 58, 597, 1946, + /* 100 */ 1933, 564, 173, 1929, 2107, 173, 2102, 566, 175, 2102, + /* 110 */ 566, 1929, 123, 47, 332, 1846, 2059, 113, 705, 497, + /* 120 */ 112, 111, 110, 109, 108, 107, 106, 105, 104, 1746, + /* 130 */ 1964, 1925, 1931, 1451, 1452, 1915, 1590, 1799, 614, 1925, + /* 140 */ 1931, 343, 607, 1915, 353, 613, 43, 41, 476, 1555, + /* 150 */ 607, 62, 97, 1797, 360, 1723, 1370, 1396, 596, 1946, + /* 160 */ 46, 365, 1425, 1434, 1792, 1794, 132, 1449, 1945, 1368, + /* 170 */ 597, 1102, 1980, 1101, 1738, 100, 1947, 617, 1949, 1950, + /* 180 */ 612, 1371, 607, 1369, 178, 134, 210, 141, 2004, 2033, + /* 190 */ 1964, 258, 1444, 354, 2029, 1793, 1794, 16, 580, 375, + /* 200 */ 596, 1746, 1103, 1915, 1376, 613, 1374, 1375, 405, 1424, + /* 210 */ 1427, 1428, 1429, 1430, 1431, 1432, 1433, 609, 605, 1442, + /* 220 */ 1443, 1445, 1446, 1447, 1448, 1450, 1453, 2, 1945, 58, + /* 230 */ 12, 85, 1980, 1946, 225, 100, 1947, 617, 1949, 1950, + /* 240 */ 612, 545, 607, 58, 1395, 2101, 176, 170, 318, 2033, + /* 250 */ 1083, 80, 705, 354, 2029, 42, 40, 39, 38, 37, + /* 260 */ 2107, 173, 176, 649, 1964, 2102, 566, 1451, 1452, 560, + /* 270 */ 1253, 1254, 614, 1170, 1742, 2060, 46, 1915, 1395, 613, + /* 280 */ 43, 41, 146, 145, 646, 645, 644, 143, 360, 1085, + /* 290 */ 1370, 1088, 1089, 1946, 82, 320, 1425, 1434, 530, 577, + /* 300 */ 528, 1449, 1945, 1368, 597, 1102, 1980, 1101, 1172, 100, + /* 310 */ 1947, 617, 1949, 1950, 612, 1371, 607, 1369, 123, 58, + /* 320 */ 58, 2008, 1397, 2033, 1964, 502, 1444, 354, 2029, 169, + /* 330 */ 131, 16, 614, 1614, 1396, 1746, 1103, 1915, 1376, 613, + /* 340 */ 1374, 1375, 1786, 1424, 1427, 1428, 1429, 1430, 1431, 1432, + /* 350 */ 1433, 609, 605, 1442, 1443, 1445, 1446, 1447, 1448, 1450, + /* 360 */ 1453, 2, 1945, 9, 12, 1946, 1980, 526, 441, 100, + /* 370 */ 1947, 617, 1949, 1950, 612, 2106, 607, 1915, 176, 2101, + /* 380 */ 524, 2121, 522, 2033, 1613, 91, 705, 354, 2029, 255, + /* 390 */ 2041, 576, 176, 124, 575, 2105, 1964, 2101, 2067, 2102, + /* 400 */ 2103, 1451, 1452, 398, 611, 397, 2106, 1739, 157, 1915, + /* 410 */ 1604, 613, 564, 173, 43, 41, 1454, 2102, 566, 1395, + /* 420 */ 1306, 1307, 360, 1397, 1370, 176, 189, 188, 1915, 457, + /* 430 */ 1425, 1434, 462, 1634, 1945, 1449, 577, 1368, 1980, 1661, + /* 440 */ 597, 310, 1947, 617, 1949, 1950, 612, 2048, 607, 1371, + /* 450 */ 1999, 1369, 466, 1612, 403, 462, 1634, 36, 35, 1545, + /* 460 */ 1444, 42, 40, 39, 38, 37, 257, 131, 176, 176, + /* 470 */ 1611, 1746, 1376, 2045, 1374, 1375, 583, 1424, 1427, 1428, + /* 480 */ 1429, 1430, 1431, 1432, 1433, 609, 605, 1442, 1443, 1445, + /* 490 */ 1446, 1447, 1448, 1450, 1453, 2, 133, 1915, 44, 2004, + /* 500 */ 1578, 1946, 1370, 555, 512, 511, 510, 552, 1543, 1544, + /* 510 */ 1546, 1547, 128, 506, 1915, 1368, 651, 505, 545, 1610, + /* 520 */ 705, 1398, 2101, 504, 509, 579, 171, 2041, 2042, 503, + /* 530 */ 129, 2046, 1964, 508, 507, 1451, 1452, 2107, 173, 226, + /* 540 */ 614, 597, 2102, 566, 1799, 1915, 1535, 613, 43, 41, + /* 550 */ 1376, 364, 80, 676, 674, 404, 360, 1609, 1370, 597, + /* 560 */ 1797, 1946, 597, 1915, 1425, 1434, 127, 257, 1394, 1449, + /* 570 */ 1945, 1368, 1746, 413, 1980, 1741, 427, 100, 1947, 617, + /* 580 */ 1949, 1950, 612, 1371, 607, 1369, 561, 556, 642, 2006, + /* 590 */ 1746, 2033, 1964, 1746, 1444, 354, 2029, 1480, 705, 1842, + /* 600 */ 614, 1915, 1347, 1348, 9, 1915, 1376, 613, 1374, 1375, + /* 610 */ 181, 1424, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 609, + /* 620 */ 605, 1442, 1443, 1445, 1446, 1447, 1448, 1450, 1453, 2, + /* 630 */ 1945, 517, 44, 597, 1980, 144, 597, 100, 1947, 617, + /* 640 */ 1949, 1950, 612, 597, 607, 597, 527, 428, 597, 2121, + /* 650 */ 474, 2033, 1608, 1902, 705, 354, 2029, 475, 1946, 1743, + /* 660 */ 224, 1371, 139, 1369, 1746, 182, 2095, 1746, 30, 1451, + /* 670 */ 1452, 1724, 1607, 1964, 1746, 520, 1746, 597, 1485, 1746, + /* 680 */ 514, 559, 43, 41, 185, 223, 1374, 1375, 51, 1964, + /* 690 */ 360, 541, 1370, 1376, 1523, 597, 1915, 614, 1425, 1434, + /* 700 */ 1395, 382, 1915, 1449, 613, 1368, 36, 35, 1746, 581, + /* 710 */ 42, 40, 39, 38, 37, 363, 1915, 1371, 1398, 1369, + /* 720 */ 558, 77, 64, 155, 76, 63, 1746, 1945, 1444, 663, + /* 730 */ 1606, 1980, 1748, 476, 159, 1947, 617, 1949, 1950, 612, + /* 740 */ 1376, 607, 1374, 1375, 1731, 1424, 1427, 1428, 1429, 1430, + /* 750 */ 1431, 1432, 1433, 609, 605, 1442, 1443, 1445, 1446, 1447, + /* 760 */ 1448, 1450, 1453, 2, 36, 35, 12, 1946, 42, 40, + /* 770 */ 39, 38, 37, 366, 1915, 546, 2070, 597, 265, 266, + /* 780 */ 317, 155, 1393, 264, 599, 597, 2005, 501, 705, 435, + /* 790 */ 1748, 269, 448, 1593, 9, 447, 7, 1603, 1964, 592, + /* 800 */ 25, 1722, 288, 1451, 1452, 1776, 614, 649, 1746, 500, + /* 810 */ 419, 1915, 449, 613, 113, 421, 1746, 112, 111, 110, + /* 820 */ 109, 108, 107, 106, 105, 104, 146, 145, 646, 645, + /* 830 */ 644, 143, 1425, 1434, 394, 597, 531, 39, 38, 37, + /* 840 */ 1980, 1915, 1426, 306, 1947, 617, 1949, 1950, 612, 594, + /* 850 */ 607, 1371, 1733, 1369, 1602, 396, 392, 333, 1658, 1459, + /* 860 */ 2105, 29, 235, 651, 1729, 1395, 1746, 36, 35, 409, + /* 870 */ 230, 42, 40, 39, 38, 37, 1374, 1375, 608, 1424, + /* 880 */ 1427, 1428, 1429, 1430, 1431, 1432, 1433, 609, 605, 1442, + /* 890 */ 1443, 1445, 1446, 1447, 1448, 1450, 1453, 2, 1915, 445, + /* 900 */ 1088, 1089, 440, 439, 438, 437, 434, 433, 432, 431, + /* 910 */ 430, 426, 425, 424, 423, 334, 416, 415, 414, 1516, + /* 920 */ 411, 410, 331, 682, 681, 680, 679, 370, 1601, 678, + /* 930 */ 677, 135, 672, 671, 670, 669, 668, 667, 666, 665, + /* 940 */ 148, 661, 660, 659, 369, 368, 656, 655, 654, 653, + /* 950 */ 652, 156, 597, 1600, 641, 584, 294, 36, 35, 357, + /* 960 */ 356, 42, 40, 39, 38, 37, 595, 1946, 1858, 1384, + /* 970 */ 292, 66, 1915, 597, 65, 6, 512, 511, 510, 601, + /* 980 */ 1449, 2005, 1377, 1746, 128, 506, 1721, 275, 2048, 505, + /* 990 */ 2048, 155, 193, 454, 452, 504, 509, 1915, 1964, 1934, + /* 1000 */ 1749, 503, 337, 1398, 1746, 1444, 614, 1426, 11, 10, + /* 1010 */ 1929, 1915, 325, 613, 2044, 1599, 2043, 1376, 1210, 639, + /* 1020 */ 638, 637, 1214, 636, 1216, 1217, 635, 1219, 632, 58, + /* 1030 */ 1225, 629, 1227, 1228, 626, 623, 1945, 572, 1925, 1931, + /* 1040 */ 1980, 569, 1598, 100, 1947, 617, 1949, 1950, 612, 607, + /* 1050 */ 607, 540, 1597, 1596, 1478, 2121, 597, 2033, 1829, 1915, + /* 1060 */ 211, 354, 2029, 708, 338, 603, 336, 335, 99, 499, + /* 1070 */ 367, 643, 2052, 501, 1790, 162, 1595, 281, 1842, 1842, + /* 1080 */ 1395, 493, 489, 485, 481, 208, 1915, 1746, 647, 183, + /* 1090 */ 187, 1790, 166, 1605, 649, 500, 1915, 1915, 698, 694, + /* 1100 */ 690, 686, 279, 664, 1492, 1716, 74, 73, 402, 648, + /* 1110 */ 1479, 180, 1790, 146, 145, 646, 645, 644, 143, 568, + /* 1120 */ 1915, 48, 81, 3, 67, 206, 2053, 1512, 1385, 316, + /* 1130 */ 1380, 1701, 390, 406, 388, 384, 380, 377, 374, 98, + /* 1140 */ 1648, 137, 272, 125, 2073, 31, 407, 234, 577, 1587, + /* 1150 */ 1588, 36, 35, 1388, 1390, 42, 40, 39, 38, 37, + /* 1160 */ 60, 1515, 513, 11, 10, 605, 1442, 1443, 1445, 1446, + /* 1170 */ 1447, 1448, 1641, 216, 75, 593, 214, 1946, 176, 131, + /* 1180 */ 1512, 32, 358, 1473, 1474, 1475, 1476, 1477, 1481, 1482, + /* 1190 */ 1483, 1484, 205, 199, 515, 204, 36, 35, 472, 239, + /* 1200 */ 42, 40, 39, 38, 37, 1946, 218, 252, 1964, 217, + /* 1210 */ 422, 1639, 260, 1542, 197, 220, 614, 222, 219, 1379, + /* 1220 */ 221, 1915, 1426, 613, 233, 50, 1378, 553, 209, 1341, + /* 1230 */ 544, 229, 604, 518, 1131, 96, 1964, 45, 172, 2041, + /* 1240 */ 2042, 246, 129, 2046, 614, 93, 1945, 373, 1946, 1915, + /* 1250 */ 1980, 613, 241, 100, 1947, 617, 1949, 1950, 612, 573, + /* 1260 */ 607, 570, 1936, 262, 83, 600, 1965, 2033, 1851, 1132, + /* 1270 */ 140, 354, 2029, 371, 1945, 1629, 1946, 45, 1980, 1964, + /* 1280 */ 1787, 101, 1947, 617, 1949, 1950, 612, 614, 607, 545, + /* 1290 */ 1317, 142, 1915, 2101, 613, 2033, 657, 36, 35, 2032, + /* 1300 */ 2029, 42, 40, 39, 38, 37, 2063, 1964, 2107, 173, + /* 1310 */ 578, 1938, 254, 2102, 566, 614, 267, 1945, 1151, 1946, + /* 1320 */ 1915, 1980, 613, 589, 101, 1947, 617, 1949, 1950, 612, + /* 1330 */ 1435, 607, 144, 1, 60, 1635, 45, 1946, 2033, 251, + /* 1340 */ 658, 4, 602, 2029, 271, 615, 577, 381, 376, 1980, + /* 1350 */ 1964, 330, 101, 1947, 617, 1949, 1950, 612, 611, 607, + /* 1360 */ 1334, 1585, 1149, 1915, 282, 613, 2033, 1382, 1964, 1398, + /* 1370 */ 324, 2029, 621, 186, 1381, 1470, 614, 131, 408, 1852, + /* 1380 */ 1946, 1915, 1933, 613, 700, 1203, 412, 1486, 1945, 287, + /* 1390 */ 142, 144, 1980, 1929, 417, 310, 1947, 617, 1949, 1950, + /* 1400 */ 612, 610, 607, 598, 1998, 443, 1945, 1393, 429, 1844, + /* 1410 */ 1980, 1964, 436, 160, 1947, 617, 1949, 1950, 612, 614, + /* 1420 */ 607, 1925, 1931, 355, 1915, 1231, 613, 126, 142, 451, + /* 1430 */ 442, 444, 607, 1946, 450, 190, 174, 2041, 2042, 1399, + /* 1440 */ 129, 2046, 1401, 1235, 1242, 453, 455, 456, 465, 1945, + /* 1450 */ 468, 469, 1400, 1980, 1946, 1584, 101, 1947, 617, 1949, + /* 1460 */ 1950, 612, 196, 607, 1964, 567, 2122, 198, 470, 1402, + /* 1470 */ 2033, 471, 614, 1105, 201, 2030, 473, 1915, 496, 613, + /* 1480 */ 1240, 147, 477, 203, 78, 1964, 79, 207, 494, 495, + /* 1490 */ 103, 1892, 498, 614, 372, 1891, 532, 1736, 1915, 535, + /* 1500 */ 613, 319, 1945, 534, 228, 283, 1980, 549, 1946, 159, + /* 1510 */ 1947, 617, 1949, 1950, 612, 213, 607, 1732, 542, 215, + /* 1520 */ 149, 150, 536, 1945, 1734, 539, 1730, 1980, 554, 151, + /* 1530 */ 304, 1947, 617, 1949, 1950, 612, 545, 607, 152, 1964, + /* 1540 */ 2101, 231, 2079, 587, 551, 5, 563, 614, 344, 557, + /* 1550 */ 2064, 2071, 1915, 548, 613, 2107, 173, 2074, 237, 240, + /* 1560 */ 2102, 566, 1946, 36, 35, 2055, 245, 42, 40, 39, + /* 1570 */ 38, 37, 550, 247, 562, 345, 1512, 1945, 547, 1946, + /* 1580 */ 2124, 1980, 574, 2078, 160, 1947, 617, 1949, 1950, 612, + /* 1590 */ 249, 607, 250, 1964, 130, 163, 571, 1397, 349, 582, + /* 1600 */ 2100, 614, 2049, 348, 259, 1946, 1915, 284, 613, 253, + /* 1610 */ 1964, 585, 586, 285, 1863, 359, 590, 1862, 614, 1861, + /* 1620 */ 350, 248, 88, 1915, 286, 613, 591, 1747, 57, 92, + /* 1630 */ 2014, 1945, 90, 1946, 619, 1980, 1964, 2123, 311, 1947, + /* 1640 */ 617, 1949, 1950, 612, 614, 607, 1791, 289, 1945, 1915, + /* 1650 */ 1717, 613, 1980, 278, 701, 311, 1947, 617, 1949, 1950, + /* 1660 */ 612, 704, 607, 313, 1964, 702, 49, 321, 298, 361, + /* 1670 */ 322, 312, 614, 302, 1945, 293, 1946, 1915, 1980, 613, + /* 1680 */ 291, 295, 1947, 617, 1949, 1950, 612, 1909, 607, 1908, + /* 1690 */ 71, 1907, 1946, 1906, 72, 1903, 378, 379, 1362, 1363, + /* 1700 */ 179, 383, 1945, 1901, 385, 386, 1980, 1964, 387, 311, + /* 1710 */ 1947, 617, 1949, 1950, 612, 614, 607, 1900, 389, 154, + /* 1720 */ 1915, 1899, 613, 1964, 1898, 391, 393, 1897, 1337, 395, + /* 1730 */ 1336, 614, 1874, 1873, 400, 533, 1915, 401, 613, 1872, + /* 1740 */ 1871, 1837, 1836, 1946, 1297, 1945, 1834, 136, 1833, 1980, + /* 1750 */ 1832, 1835, 296, 1947, 617, 1949, 1950, 612, 1831, 607, + /* 1760 */ 1830, 1945, 1828, 1827, 1826, 1980, 184, 1825, 297, 1947, + /* 1770 */ 617, 1949, 1950, 612, 1964, 607, 420, 545, 418, 1824, + /* 1780 */ 1823, 2101, 614, 1822, 1821, 1820, 1946, 1915, 1819, 613, + /* 1790 */ 1818, 1817, 1816, 1815, 1814, 1813, 2107, 173, 1812, 1811, + /* 1800 */ 1810, 2102, 566, 1946, 1809, 1808, 1807, 138, 1806, 1805, + /* 1810 */ 1804, 1299, 1945, 1803, 1802, 446, 1980, 1964, 1801, 303, + /* 1820 */ 1947, 617, 1949, 1950, 612, 614, 607, 1800, 1663, 191, + /* 1830 */ 1915, 1178, 613, 1662, 1964, 192, 1660, 1624, 1091, 194, + /* 1840 */ 69, 1623, 614, 1090, 1887, 1881, 168, 1915, 1870, 613, + /* 1850 */ 1935, 1869, 195, 202, 461, 1945, 1946, 1854, 463, 1980, + /* 1860 */ 70, 200, 307, 1947, 617, 1949, 1950, 612, 1725, 607, + /* 1870 */ 1659, 1657, 1945, 1946, 478, 1655, 1980, 480, 479, 299, + /* 1880 */ 1947, 617, 1949, 1950, 612, 482, 607, 1964, 483, 1124, + /* 1890 */ 1653, 484, 488, 486, 487, 614, 1651, 490, 492, 1638, + /* 1900 */ 1915, 1637, 613, 491, 1964, 1620, 1727, 1247, 1246, 1726, + /* 1910 */ 673, 1169, 614, 1168, 1167, 1161, 1166, 1915, 675, 613, + /* 1920 */ 59, 1649, 212, 1163, 1946, 1945, 1162, 1160, 1642, 1980, + /* 1930 */ 339, 1640, 308, 1947, 617, 1949, 1950, 612, 340, 607, + /* 1940 */ 341, 1946, 1945, 1619, 516, 519, 1980, 521, 1618, 300, + /* 1950 */ 1947, 617, 1949, 1950, 612, 1964, 607, 523, 1617, 525, + /* 1960 */ 102, 1352, 1351, 614, 1354, 529, 1886, 1946, 1915, 24, + /* 1970 */ 613, 1343, 1964, 1880, 537, 1868, 1866, 2106, 17, 14, + /* 1980 */ 614, 53, 232, 26, 1946, 1915, 1557, 613, 56, 243, + /* 1990 */ 538, 236, 61, 1945, 238, 342, 161, 1980, 1964, 1541, + /* 2000 */ 309, 1947, 617, 1949, 1950, 612, 614, 607, 1534, 242, + /* 2010 */ 1945, 1915, 543, 613, 1980, 1964, 153, 301, 1947, 617, + /* 2020 */ 1949, 1950, 612, 614, 607, 27, 244, 1936, 1915, 28, + /* 2030 */ 613, 84, 19, 1572, 1571, 1946, 1945, 346, 1577, 1578, + /* 2040 */ 1980, 1576, 1575, 314, 1947, 617, 1949, 1950, 612, 347, + /* 2050 */ 607, 1509, 1508, 1945, 55, 256, 164, 1980, 1867, 1865, + /* 2060 */ 315, 1947, 617, 1949, 1950, 612, 1964, 607, 1864, 261, + /* 2070 */ 588, 1853, 18, 20, 614, 1539, 87, 263, 1946, 1915, + /* 2080 */ 268, 613, 86, 15, 270, 273, 54, 89, 93, 21, + /* 2090 */ 8, 10, 1461, 1460, 1946, 1386, 1983, 165, 177, 1417, + /* 2100 */ 1439, 606, 618, 1224, 1945, 620, 616, 34, 1980, 1964, + /* 2110 */ 1471, 1958, 1947, 617, 1949, 1950, 612, 614, 607, 1437, + /* 2120 */ 1436, 13, 1915, 22, 613, 1964, 1409, 23, 362, 1232, + /* 2130 */ 622, 624, 1229, 614, 627, 625, 630, 1226, 1915, 628, + /* 2140 */ 613, 1220, 631, 633, 1218, 1946, 1223, 1945, 634, 1209, + /* 2150 */ 1222, 1980, 94, 1221, 1957, 1947, 617, 1949, 1950, 612, + /* 2160 */ 276, 607, 640, 1945, 1241, 95, 1237, 1980, 68, 1122, + /* 2170 */ 1956, 1947, 617, 1949, 1950, 612, 1964, 607, 650, 1176, + /* 2180 */ 1157, 1156, 1155, 1154, 614, 1153, 1152, 1150, 1946, 1915, + /* 2190 */ 1148, 613, 1147, 1146, 1144, 662, 1143, 277, 1142, 1141, + /* 2200 */ 1140, 1139, 1138, 1137, 1173, 1946, 1171, 1134, 1133, 1130, + /* 2210 */ 1129, 1128, 1127, 1656, 1945, 683, 1654, 684, 1980, 1964, + /* 2220 */ 685, 326, 1947, 617, 1949, 1950, 612, 614, 607, 687, + /* 2230 */ 688, 689, 1915, 1652, 613, 691, 1964, 693, 692, 1650, + /* 2240 */ 695, 696, 697, 1636, 614, 699, 1080, 1616, 280, 1915, + /* 2250 */ 703, 613, 1372, 290, 1591, 706, 707, 1945, 1946, 1591, + /* 2260 */ 1591, 1980, 1591, 1591, 327, 1947, 617, 1949, 1950, 612, + /* 2270 */ 1591, 607, 1591, 1591, 1945, 1946, 1591, 1591, 1980, 1591, + /* 2280 */ 1591, 323, 1947, 617, 1949, 1950, 612, 1591, 607, 1964, + /* 2290 */ 1591, 1591, 1591, 1591, 1591, 1591, 1591, 614, 1591, 1591, + /* 2300 */ 1591, 1591, 1915, 1591, 613, 1591, 1964, 1591, 1591, 1591, + /* 2310 */ 1591, 1591, 1591, 1591, 614, 1591, 1591, 1591, 1591, 1915, + /* 2320 */ 1591, 613, 1591, 1591, 1591, 1591, 1946, 1945, 1591, 1591, + /* 2330 */ 1591, 1980, 1591, 1591, 328, 1947, 617, 1949, 1950, 612, + /* 2340 */ 1591, 607, 1591, 1591, 615, 1591, 1591, 1591, 1980, 1591, + /* 2350 */ 1591, 306, 1947, 617, 1949, 1950, 612, 1964, 607, 1591, + /* 2360 */ 1591, 1591, 1591, 1591, 1591, 614, 1591, 1591, 1591, 1591, + /* 2370 */ 1915, 1591, 613, 1591, 1591, 1591, 1591, 1591, 1591, 1591, + /* 2380 */ 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591, + /* 2390 */ 1591, 1591, 1591, 1591, 1591, 1945, 1591, 1591, 1591, 1980, + /* 2400 */ 1591, 1591, 305, 1947, 617, 1949, 1950, 612, 1591, 607, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 325, 329, 340, 331, 332, 427, 356, 345, 329, 431, - /* 10 */ 331, 332, 12, 13, 14, 367, 0, 427, 370, 371, - /* 20 */ 20, 431, 22, 0, 446, 447, 333, 377, 378, 451, - /* 30 */ 452, 356, 358, 33, 333, 35, 0, 447, 22, 364, - /* 40 */ 347, 451, 452, 369, 369, 385, 371, 24, 25, 26, - /* 50 */ 27, 28, 29, 30, 31, 32, 14, 364, 58, 20, - /* 60 */ 8, 9, 20, 63, 12, 13, 14, 15, 16, 394, - /* 70 */ 70, 397, 398, 398, 373, 20, 401, 402, 403, 404, - /* 80 */ 405, 406, 408, 408, 58, 20, 14, 427, 413, 358, - /* 90 */ 415, 431, 20, 62, 419, 420, 96, 400, 14, 325, - /* 100 */ 369, 65, 66, 67, 20, 356, 446, 447, 433, 73, - /* 110 */ 74, 451, 452, 364, 78, 79, 441, 324, 118, 326, - /* 120 */ 84, 85, 96, 426, 98, 20, 90, 333, 397, 398, - /* 130 */ 356, 20, 4, 133, 134, 20, 322, 22, 364, 408, - /* 140 */ 427, 347, 364, 369, 431, 371, 12, 13, 354, 97, - /* 150 */ 35, 96, 403, 375, 20, 0, 22, 20, 364, 325, - /* 160 */ 447, 96, 162, 163, 451, 452, 51, 33, 394, 35, - /* 170 */ 333, 43, 398, 45, 46, 401, 402, 403, 404, 405, - /* 180 */ 406, 181, 408, 183, 347, 411, 4, 413, 414, 415, - /* 190 */ 356, 354, 58, 419, 420, 416, 417, 63, 364, 385, - /* 200 */ 20, 364, 62, 369, 70, 371, 206, 207, 20, 209, + /* 0 */ 325, 329, 357, 331, 332, 427, 371, 416, 417, 431, + /* 10 */ 340, 356, 12, 13, 14, 345, 381, 427, 363, 384, + /* 20 */ 20, 431, 22, 0, 446, 447, 333, 372, 348, 451, + /* 30 */ 452, 356, 14, 33, 356, 35, 356, 447, 20, 364, + /* 40 */ 347, 451, 452, 385, 369, 365, 371, 24, 25, 26, + /* 50 */ 27, 28, 29, 30, 31, 32, 378, 364, 58, 349, + /* 60 */ 8, 9, 352, 63, 12, 13, 14, 15, 16, 394, + /* 70 */ 70, 356, 329, 398, 331, 332, 401, 402, 403, 404, + /* 80 */ 405, 406, 427, 408, 20, 427, 431, 372, 413, 431, + /* 90 */ 415, 325, 358, 356, 419, 420, 96, 96, 333, 325, + /* 100 */ 358, 446, 447, 369, 446, 447, 451, 452, 433, 451, + /* 110 */ 452, 369, 347, 96, 377, 378, 441, 21, 118, 354, + /* 120 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 364, + /* 130 */ 356, 397, 398, 133, 134, 369, 322, 356, 364, 397, + /* 140 */ 398, 399, 408, 369, 363, 371, 12, 13, 62, 97, + /* 150 */ 408, 4, 337, 372, 20, 0, 22, 20, 20, 325, + /* 160 */ 96, 367, 162, 163, 370, 371, 351, 33, 394, 35, + /* 170 */ 333, 20, 398, 22, 359, 401, 402, 403, 404, 405, + /* 180 */ 406, 181, 408, 183, 347, 411, 35, 413, 414, 415, + /* 190 */ 356, 58, 58, 419, 420, 370, 371, 63, 364, 385, + /* 200 */ 20, 364, 51, 369, 70, 371, 206, 207, 333, 209, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 394, 337, - /* 230 */ 96, 3, 398, 325, 162, 401, 402, 403, 404, 405, - /* 240 */ 406, 427, 408, 351, 20, 431, 162, 413, 20, 415, - /* 250 */ 167, 359, 118, 419, 420, 12, 13, 14, 15, 16, - /* 260 */ 446, 447, 229, 108, 356, 451, 452, 133, 134, 370, - /* 270 */ 371, 245, 364, 162, 163, 441, 96, 369, 96, 371, - /* 280 */ 12, 13, 127, 128, 129, 130, 131, 132, 20, 20, - /* 290 */ 22, 96, 20, 325, 342, 343, 162, 163, 325, 333, - /* 300 */ 245, 33, 394, 35, 330, 333, 398, 333, 334, 401, - /* 310 */ 402, 403, 404, 405, 406, 181, 408, 183, 128, 347, - /* 320 */ 107, 413, 355, 415, 356, 97, 58, 419, 420, 161, - /* 330 */ 364, 63, 364, 250, 251, 368, 364, 369, 70, 371, - /* 340 */ 206, 207, 369, 209, 210, 211, 212, 213, 214, 215, + /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 394, 96, + /* 230 */ 96, 98, 398, 325, 128, 401, 402, 403, 404, 405, + /* 240 */ 406, 427, 408, 96, 20, 431, 245, 413, 373, 415, + /* 250 */ 4, 339, 118, 419, 420, 12, 13, 14, 15, 16, + /* 260 */ 446, 447, 245, 108, 356, 451, 452, 133, 134, 20, + /* 270 */ 133, 134, 364, 35, 362, 441, 96, 369, 20, 371, + /* 280 */ 12, 13, 127, 128, 129, 130, 131, 132, 20, 43, + /* 290 */ 22, 45, 46, 325, 188, 189, 162, 163, 192, 333, + /* 300 */ 194, 33, 394, 35, 333, 20, 398, 22, 70, 401, + /* 310 */ 402, 403, 404, 405, 406, 181, 408, 183, 347, 96, + /* 320 */ 96, 413, 20, 415, 356, 354, 58, 419, 420, 355, + /* 330 */ 364, 63, 364, 325, 20, 364, 51, 369, 70, 371, + /* 340 */ 206, 207, 368, 209, 210, 211, 212, 213, 214, 215, /* 350 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - /* 360 */ 226, 227, 394, 229, 96, 325, 398, 342, 343, 401, - /* 370 */ 402, 403, 404, 405, 406, 180, 408, 182, 188, 189, - /* 380 */ 96, 413, 192, 415, 194, 339, 118, 419, 420, 423, - /* 390 */ 424, 425, 164, 427, 428, 80, 356, 431, 430, 353, - /* 400 */ 232, 133, 134, 389, 364, 133, 134, 22, 362, 369, - /* 410 */ 242, 371, 446, 447, 12, 13, 14, 451, 452, 371, - /* 420 */ 35, 70, 20, 0, 22, 245, 96, 245, 364, 381, - /* 430 */ 162, 163, 384, 164, 394, 33, 58, 35, 398, 375, - /* 440 */ 245, 401, 402, 403, 404, 405, 406, 108, 408, 181, - /* 450 */ 410, 183, 330, 138, 139, 333, 334, 8, 9, 70, - /* 460 */ 58, 12, 13, 14, 15, 16, 127, 128, 129, 130, - /* 470 */ 131, 132, 70, 95, 206, 207, 98, 209, 210, 211, + /* 360 */ 226, 227, 394, 229, 96, 325, 398, 21, 80, 401, + /* 370 */ 402, 403, 404, 405, 406, 427, 408, 369, 245, 431, + /* 380 */ 34, 413, 36, 415, 325, 337, 118, 419, 420, 423, + /* 390 */ 424, 425, 245, 427, 428, 447, 356, 431, 430, 451, + /* 400 */ 452, 133, 134, 180, 364, 182, 3, 359, 324, 369, + /* 410 */ 326, 371, 446, 447, 12, 13, 14, 451, 452, 20, + /* 420 */ 162, 163, 20, 20, 22, 245, 138, 139, 369, 330, + /* 430 */ 162, 163, 333, 334, 394, 33, 333, 35, 398, 0, + /* 440 */ 333, 401, 402, 403, 404, 405, 406, 400, 408, 181, + /* 450 */ 410, 183, 330, 325, 347, 333, 334, 8, 9, 206, + /* 460 */ 58, 12, 13, 14, 15, 16, 164, 364, 245, 245, + /* 470 */ 325, 364, 70, 426, 206, 207, 385, 209, 210, 211, /* 480 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 490 */ 222, 223, 224, 225, 226, 227, 333, 325, 96, 333, - /* 500 */ 357, 325, 356, 65, 66, 67, 20, 333, 356, 363, - /* 510 */ 347, 73, 74, 347, 357, 363, 78, 79, 372, 325, - /* 520 */ 118, 347, 84, 85, 372, 348, 348, 364, 90, 245, - /* 530 */ 364, 108, 356, 356, 356, 133, 134, 20, 364, 22, - /* 540 */ 364, 369, 365, 365, 21, 369, 97, 371, 12, 13, - /* 550 */ 127, 128, 129, 130, 131, 132, 20, 34, 22, 36, - /* 560 */ 357, 325, 333, 369, 162, 163, 176, 35, 51, 33, - /* 570 */ 394, 35, 333, 333, 398, 245, 347, 401, 402, 403, - /* 580 */ 404, 405, 406, 181, 408, 183, 347, 197, 198, 413, - /* 590 */ 357, 415, 356, 364, 58, 419, 420, 127, 357, 229, - /* 600 */ 364, 231, 70, 364, 364, 369, 70, 371, 206, 207, - /* 610 */ 339, 209, 210, 211, 212, 213, 214, 215, 216, 217, + /* 490 */ 222, 223, 224, 225, 226, 227, 411, 369, 96, 414, + /* 500 */ 97, 325, 22, 167, 65, 66, 67, 254, 255, 256, + /* 510 */ 257, 258, 73, 74, 369, 35, 62, 78, 427, 325, + /* 520 */ 118, 20, 431, 84, 85, 422, 423, 424, 425, 90, + /* 530 */ 427, 428, 356, 342, 343, 133, 134, 446, 447, 127, + /* 540 */ 364, 333, 451, 452, 356, 369, 97, 371, 12, 13, + /* 550 */ 70, 363, 339, 342, 343, 347, 20, 325, 22, 333, + /* 560 */ 372, 325, 333, 369, 162, 163, 353, 164, 20, 33, + /* 570 */ 394, 35, 364, 347, 398, 362, 347, 401, 402, 403, + /* 580 */ 404, 405, 406, 181, 408, 183, 250, 251, 107, 413, + /* 590 */ 364, 415, 356, 364, 58, 419, 420, 161, 118, 364, + /* 600 */ 364, 369, 190, 191, 229, 369, 70, 371, 206, 207, + /* 610 */ 375, 209, 210, 211, 212, 213, 214, 215, 216, 217, /* 620 */ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - /* 630 */ 394, 356, 96, 362, 398, 348, 63, 401, 402, 403, - /* 640 */ 404, 405, 406, 356, 408, 127, 128, 325, 162, 413, - /* 650 */ 132, 415, 365, 378, 118, 419, 420, 325, 325, 0, - /* 660 */ 190, 191, 422, 423, 424, 425, 430, 427, 428, 133, - /* 670 */ 134, 8, 9, 39, 2, 12, 13, 14, 15, 16, - /* 680 */ 8, 9, 12, 13, 12, 13, 14, 15, 16, 356, - /* 690 */ 20, 369, 22, 337, 333, 333, 379, 364, 162, 163, - /* 700 */ 325, 369, 369, 33, 371, 35, 356, 44, 347, 347, - /* 710 */ 14, 15, 16, 363, 412, 359, 414, 181, 412, 183, - /* 720 */ 414, 62, 372, 357, 356, 364, 364, 394, 58, 349, - /* 730 */ 325, 398, 352, 365, 401, 402, 403, 404, 405, 406, - /* 740 */ 70, 408, 206, 207, 369, 209, 210, 211, 212, 213, + /* 630 */ 394, 4, 96, 333, 398, 44, 333, 401, 402, 403, + /* 640 */ 404, 405, 406, 333, 408, 333, 19, 347, 333, 413, + /* 650 */ 347, 415, 325, 0, 118, 419, 420, 347, 325, 347, + /* 660 */ 33, 181, 347, 183, 364, 164, 430, 364, 232, 133, + /* 670 */ 134, 0, 325, 356, 364, 48, 364, 333, 242, 364, + /* 680 */ 53, 364, 12, 13, 58, 58, 206, 207, 97, 356, + /* 690 */ 20, 347, 22, 70, 14, 333, 369, 364, 162, 163, + /* 700 */ 20, 48, 369, 33, 371, 35, 8, 9, 364, 347, + /* 710 */ 12, 13, 14, 15, 16, 348, 369, 181, 20, 183, + /* 720 */ 403, 95, 95, 356, 98, 98, 364, 394, 58, 70, + /* 730 */ 325, 398, 365, 62, 401, 402, 403, 404, 405, 406, + /* 740 */ 70, 408, 206, 207, 357, 209, 210, 211, 212, 213, /* 750 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, /* 760 */ 224, 225, 226, 227, 8, 9, 96, 325, 12, 13, - /* 770 */ 14, 15, 16, 364, 369, 442, 443, 427, 206, 206, - /* 780 */ 18, 431, 20, 400, 375, 333, 357, 325, 118, 27, - /* 790 */ 325, 325, 30, 0, 325, 33, 446, 447, 356, 347, - /* 800 */ 0, 451, 452, 133, 134, 325, 364, 326, 325, 426, + /* 770 */ 14, 15, 16, 348, 369, 442, 443, 333, 127, 128, + /* 780 */ 18, 356, 20, 132, 412, 333, 414, 108, 118, 27, + /* 790 */ 365, 347, 30, 0, 229, 33, 231, 325, 356, 347, + /* 800 */ 44, 0, 349, 133, 134, 352, 364, 108, 364, 130, /* 810 */ 48, 369, 50, 371, 21, 53, 364, 24, 25, 26, - /* 820 */ 27, 28, 29, 30, 31, 32, 254, 255, 256, 257, - /* 830 */ 258, 369, 162, 163, 369, 369, 394, 344, 369, 346, - /* 840 */ 398, 333, 333, 401, 402, 403, 404, 405, 406, 369, - /* 850 */ 408, 181, 369, 183, 325, 347, 347, 95, 0, 8, - /* 860 */ 9, 4, 62, 12, 13, 14, 15, 16, 3, 107, - /* 870 */ 20, 20, 364, 364, 400, 325, 206, 207, 244, 209, + /* 820 */ 27, 28, 29, 30, 31, 32, 127, 128, 129, 130, + /* 830 */ 131, 132, 162, 163, 176, 333, 394, 14, 15, 16, + /* 840 */ 398, 369, 162, 401, 402, 403, 404, 405, 406, 347, + /* 850 */ 408, 181, 357, 183, 325, 197, 198, 95, 0, 14, + /* 860 */ 3, 2, 164, 62, 357, 20, 364, 8, 9, 107, + /* 870 */ 357, 12, 13, 14, 15, 16, 206, 207, 357, 209, /* 880 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 890 */ 220, 221, 222, 223, 224, 225, 226, 227, 369, 137, - /* 900 */ 426, 345, 140, 141, 142, 143, 144, 145, 146, 147, - /* 910 */ 148, 149, 150, 151, 152, 153, 154, 155, 156, 369, - /* 920 */ 158, 159, 160, 65, 66, 67, 68, 69, 44, 71, + /* 900 */ 45, 46, 140, 141, 142, 143, 144, 145, 146, 147, + /* 910 */ 148, 149, 150, 151, 152, 153, 154, 155, 156, 4, + /* 920 */ 158, 159, 160, 65, 66, 67, 68, 69, 325, 71, /* 930 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, /* 940 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - /* 950 */ 92, 18, 325, 325, 333, 325, 23, 8, 9, 12, - /* 960 */ 13, 12, 13, 14, 15, 16, 325, 325, 347, 22, - /* 970 */ 37, 38, 333, 411, 41, 366, 414, 455, 369, 20, - /* 980 */ 33, 97, 35, 8, 9, 364, 347, 12, 13, 14, - /* 990 */ 15, 16, 59, 60, 61, 371, 369, 369, 356, 369, - /* 1000 */ 1, 2, 37, 364, 366, 58, 364, 369, 384, 444, - /* 1010 */ 369, 369, 63, 371, 164, 164, 44, 70, 109, 110, + /* 950 */ 92, 18, 333, 325, 357, 371, 23, 8, 9, 12, + /* 960 */ 13, 12, 13, 14, 15, 16, 347, 325, 384, 22, + /* 970 */ 37, 38, 369, 333, 41, 39, 65, 66, 67, 412, + /* 980 */ 33, 414, 35, 364, 73, 74, 0, 347, 400, 78, + /* 990 */ 400, 356, 59, 60, 61, 84, 85, 369, 356, 358, + /* 1000 */ 365, 90, 37, 20, 364, 58, 364, 162, 1, 2, + /* 1010 */ 369, 369, 63, 371, 426, 325, 426, 70, 109, 110, /* 1020 */ 111, 112, 113, 114, 115, 116, 117, 118, 119, 96, - /* 1030 */ 121, 122, 123, 124, 125, 126, 394, 335, 349, 333, - /* 1040 */ 398, 352, 356, 401, 402, 403, 404, 405, 406, 366, - /* 1050 */ 408, 385, 369, 347, 105, 413, 100, 415, 372, 103, + /* 1030 */ 121, 122, 123, 124, 125, 126, 394, 44, 397, 398, + /* 1040 */ 398, 44, 325, 401, 402, 403, 404, 405, 406, 408, + /* 1050 */ 408, 389, 325, 325, 105, 413, 333, 415, 0, 369, /* 1060 */ 33, 419, 420, 19, 99, 118, 101, 102, 135, 104, - /* 1070 */ 364, 438, 430, 108, 333, 48, 0, 33, 22, 45, - /* 1080 */ 46, 54, 55, 56, 57, 58, 243, 244, 347, 0, - /* 1090 */ 333, 35, 48, 427, 108, 130, 97, 431, 54, 55, - /* 1100 */ 56, 57, 58, 246, 347, 364, 173, 174, 175, 333, - /* 1110 */ 161, 178, 446, 447, 107, 44, 130, 451, 452, 333, - /* 1120 */ 35, 364, 95, 164, 48, 98, 70, 262, 181, 196, - /* 1130 */ 183, 356, 199, 347, 201, 202, 203, 204, 205, 95, - /* 1140 */ 364, 42, 98, 44, 42, 35, 44, 335, 173, 44, - /* 1150 */ 364, 379, 21, 206, 207, 24, 25, 26, 27, 28, - /* 1160 */ 29, 30, 31, 32, 157, 218, 219, 220, 221, 222, - /* 1170 */ 223, 224, 44, 100, 118, 131, 103, 325, 245, 44, - /* 1180 */ 333, 232, 233, 234, 235, 236, 237, 238, 239, 240, - /* 1190 */ 241, 242, 165, 166, 347, 168, 0, 0, 171, 423, - /* 1200 */ 424, 425, 97, 427, 428, 325, 100, 100, 356, 103, - /* 1210 */ 103, 364, 168, 44, 187, 164, 364, 44, 22, 22, - /* 1220 */ 169, 369, 44, 371, 58, 97, 133, 134, 47, 185, - /* 1230 */ 96, 187, 97, 1, 2, 332, 356, 181, 266, 183, - /* 1240 */ 106, 152, 267, 44, 364, 35, 394, 13, 325, 369, - /* 1250 */ 398, 371, 379, 401, 402, 403, 404, 405, 406, 44, - /* 1260 */ 408, 44, 206, 207, 98, 413, 97, 415, 183, 35, - /* 1270 */ 97, 419, 420, 368, 394, 97, 325, 96, 398, 356, - /* 1280 */ 70, 401, 402, 403, 404, 405, 406, 364, 408, 429, - /* 1290 */ 448, 2, 369, 183, 371, 415, 97, 8, 9, 419, - /* 1300 */ 420, 12, 13, 14, 15, 16, 421, 356, 44, 44, - /* 1310 */ 432, 44, 97, 247, 97, 364, 44, 394, 13, 325, - /* 1320 */ 369, 398, 371, 0, 401, 402, 403, 404, 405, 406, - /* 1330 */ 396, 408, 44, 48, 395, 264, 44, 325, 415, 179, - /* 1340 */ 35, 387, 419, 420, 42, 394, 376, 20, 379, 398, - /* 1350 */ 356, 161, 401, 402, 403, 404, 405, 406, 364, 408, - /* 1360 */ 376, 97, 97, 369, 97, 371, 415, 374, 356, 97, - /* 1370 */ 419, 420, 49, 20, 333, 333, 364, 376, 374, 374, - /* 1380 */ 325, 369, 333, 371, 94, 97, 341, 333, 394, 97, - /* 1390 */ 333, 20, 398, 4, 327, 401, 402, 403, 404, 405, - /* 1400 */ 406, 407, 408, 409, 410, 327, 394, 20, 19, 391, - /* 1410 */ 398, 356, 20, 401, 402, 403, 404, 405, 406, 364, - /* 1420 */ 408, 339, 33, 371, 369, 339, 371, 20, 358, 334, - /* 1430 */ 339, 334, 386, 325, 52, 339, 333, 48, 369, 369, - /* 1440 */ 339, 358, 53, 339, 327, 195, 356, 58, 336, 394, - /* 1450 */ 339, 336, 369, 398, 325, 333, 401, 402, 403, 404, - /* 1460 */ 405, 406, 337, 408, 356, 453, 454, 397, 398, 399, - /* 1470 */ 415, 327, 364, 393, 356, 420, 356, 369, 408, 371, - /* 1480 */ 397, 398, 399, 385, 95, 356, 356, 98, 356, 356, - /* 1490 */ 369, 408, 356, 364, 385, 356, 356, 356, 369, 356, - /* 1500 */ 371, 186, 394, 333, 391, 337, 398, 369, 325, 401, - /* 1510 */ 402, 403, 404, 405, 406, 253, 408, 390, 371, 382, - /* 1520 */ 252, 379, 333, 394, 379, 427, 369, 398, 369, 431, - /* 1530 */ 401, 402, 403, 404, 405, 406, 427, 408, 382, 356, - /* 1540 */ 431, 369, 259, 261, 446, 447, 172, 364, 248, 451, - /* 1550 */ 452, 443, 369, 364, 371, 446, 447, 260, 435, 440, - /* 1560 */ 451, 452, 325, 8, 9, 439, 268, 12, 13, 14, - /* 1570 */ 15, 16, 396, 244, 445, 265, 263, 394, 364, 325, - /* 1580 */ 456, 398, 434, 437, 401, 402, 403, 404, 405, 406, - /* 1590 */ 437, 408, 437, 356, 436, 20, 333, 337, 361, 450, - /* 1600 */ 449, 364, 400, 334, 382, 325, 369, 369, 371, 369, - /* 1610 */ 356, 369, 423, 424, 425, 361, 427, 428, 364, 166, - /* 1620 */ 369, 369, 369, 369, 337, 371, 382, 380, 352, 96, - /* 1630 */ 337, 394, 96, 325, 364, 398, 356, 454, 401, 402, - /* 1640 */ 403, 404, 405, 406, 364, 408, 418, 369, 394, 369, - /* 1650 */ 346, 371, 398, 333, 360, 401, 402, 403, 404, 405, - /* 1660 */ 406, 337, 408, 36, 356, 328, 327, 388, 350, 361, - /* 1670 */ 338, 350, 364, 392, 394, 350, 325, 369, 398, 371, - /* 1680 */ 323, 401, 402, 403, 404, 405, 406, 0, 408, 383, - /* 1690 */ 383, 0, 325, 188, 0, 0, 42, 0, 35, 200, - /* 1700 */ 35, 35, 394, 35, 200, 0, 398, 356, 35, 401, - /* 1710 */ 402, 403, 404, 405, 406, 364, 408, 35, 200, 164, - /* 1720 */ 369, 0, 371, 356, 200, 0, 0, 35, 22, 0, - /* 1730 */ 183, 364, 181, 35, 0, 385, 369, 0, 371, 177, - /* 1740 */ 176, 0, 0, 325, 0, 394, 47, 0, 0, 398, - /* 1750 */ 42, 0, 401, 402, 403, 404, 405, 406, 0, 408, - /* 1760 */ 0, 394, 0, 0, 0, 398, 0, 0, 401, 402, + /* 1070 */ 347, 366, 430, 108, 369, 48, 325, 33, 364, 364, + /* 1080 */ 20, 54, 55, 56, 57, 58, 369, 364, 366, 375, + /* 1090 */ 375, 369, 48, 326, 108, 130, 369, 369, 54, 55, + /* 1100 */ 56, 57, 58, 344, 97, 346, 173, 174, 175, 366, + /* 1110 */ 161, 178, 369, 127, 128, 129, 130, 131, 132, 262, + /* 1120 */ 369, 42, 95, 44, 107, 98, 243, 244, 181, 196, + /* 1130 */ 183, 345, 199, 22, 201, 202, 203, 204, 205, 95, + /* 1140 */ 0, 42, 98, 44, 379, 2, 35, 164, 333, 133, + /* 1150 */ 134, 8, 9, 206, 207, 12, 13, 14, 15, 16, + /* 1160 */ 44, 246, 22, 1, 2, 218, 219, 220, 221, 222, + /* 1170 */ 223, 224, 0, 100, 157, 131, 103, 325, 245, 364, + /* 1180 */ 244, 232, 233, 234, 235, 236, 237, 238, 239, 240, + /* 1190 */ 241, 242, 165, 166, 22, 168, 8, 9, 171, 44, + /* 1200 */ 12, 13, 14, 15, 16, 325, 100, 455, 356, 103, + /* 1210 */ 152, 0, 168, 97, 187, 100, 364, 100, 103, 35, + /* 1220 */ 103, 369, 162, 371, 58, 164, 35, 444, 335, 185, + /* 1230 */ 169, 187, 63, 22, 35, 96, 356, 44, 423, 424, + /* 1240 */ 425, 438, 427, 428, 364, 106, 394, 385, 325, 369, + /* 1250 */ 398, 371, 97, 401, 402, 403, 404, 405, 406, 266, + /* 1260 */ 408, 264, 47, 44, 98, 413, 356, 415, 379, 70, + /* 1270 */ 44, 419, 420, 335, 394, 332, 325, 44, 398, 356, + /* 1280 */ 368, 401, 402, 403, 404, 405, 406, 364, 408, 427, + /* 1290 */ 97, 44, 369, 431, 371, 415, 13, 8, 9, 419, + /* 1300 */ 420, 12, 13, 14, 15, 16, 379, 356, 446, 447, + /* 1310 */ 429, 96, 448, 451, 452, 364, 97, 394, 35, 325, + /* 1320 */ 369, 398, 371, 97, 401, 402, 403, 404, 405, 406, + /* 1330 */ 97, 408, 44, 432, 44, 0, 44, 325, 415, 421, + /* 1340 */ 13, 247, 419, 420, 97, 394, 333, 48, 396, 398, + /* 1350 */ 356, 395, 401, 402, 403, 404, 405, 406, 364, 408, + /* 1360 */ 179, 173, 35, 369, 387, 371, 415, 183, 356, 20, + /* 1370 */ 419, 420, 44, 42, 183, 206, 364, 364, 376, 379, + /* 1380 */ 325, 369, 358, 371, 49, 97, 376, 97, 394, 97, + /* 1390 */ 44, 44, 398, 369, 374, 401, 402, 403, 404, 405, + /* 1400 */ 406, 407, 408, 409, 410, 161, 394, 20, 333, 333, + /* 1410 */ 398, 356, 376, 401, 402, 403, 404, 405, 406, 364, + /* 1420 */ 408, 397, 398, 399, 369, 97, 371, 44, 44, 341, + /* 1430 */ 374, 374, 408, 325, 94, 333, 423, 424, 425, 20, + /* 1440 */ 427, 428, 20, 97, 97, 333, 333, 327, 327, 394, + /* 1450 */ 391, 371, 20, 398, 325, 267, 401, 402, 403, 404, + /* 1460 */ 405, 406, 339, 408, 356, 453, 454, 339, 334, 20, + /* 1470 */ 415, 386, 364, 52, 339, 420, 334, 369, 327, 371, + /* 1480 */ 97, 97, 333, 339, 339, 356, 339, 339, 336, 336, + /* 1490 */ 333, 369, 356, 364, 385, 369, 195, 356, 369, 186, + /* 1500 */ 371, 327, 394, 393, 337, 391, 398, 369, 325, 401, + /* 1510 */ 402, 403, 404, 405, 406, 356, 408, 356, 333, 356, + /* 1520 */ 356, 356, 390, 394, 356, 371, 356, 398, 253, 356, + /* 1530 */ 401, 402, 403, 404, 405, 406, 427, 408, 356, 356, + /* 1540 */ 431, 337, 437, 252, 369, 259, 172, 364, 369, 369, + /* 1550 */ 379, 443, 369, 260, 371, 446, 447, 379, 382, 382, + /* 1560 */ 451, 452, 325, 8, 9, 440, 439, 12, 13, 14, + /* 1570 */ 15, 16, 261, 436, 445, 268, 244, 394, 248, 325, + /* 1580 */ 456, 398, 265, 437, 401, 402, 403, 404, 405, 406, + /* 1590 */ 434, 408, 396, 356, 364, 437, 263, 20, 361, 333, + /* 1600 */ 450, 364, 400, 334, 337, 325, 369, 382, 371, 449, + /* 1610 */ 356, 369, 369, 382, 369, 361, 166, 369, 364, 369, + /* 1620 */ 369, 435, 337, 369, 352, 371, 380, 364, 96, 96, + /* 1630 */ 418, 394, 337, 325, 360, 398, 356, 454, 401, 402, + /* 1640 */ 403, 404, 405, 406, 364, 408, 369, 333, 394, 369, + /* 1650 */ 346, 371, 398, 337, 36, 401, 402, 403, 404, 405, + /* 1660 */ 406, 327, 408, 392, 356, 328, 388, 383, 350, 361, + /* 1670 */ 383, 350, 364, 350, 394, 323, 325, 369, 398, 371, + /* 1680 */ 338, 401, 402, 403, 404, 405, 406, 0, 408, 0, + /* 1690 */ 188, 0, 325, 0, 42, 0, 35, 200, 35, 35, + /* 1700 */ 35, 200, 394, 0, 35, 35, 398, 356, 200, 401, + /* 1710 */ 402, 403, 404, 405, 406, 364, 408, 0, 200, 164, + /* 1720 */ 369, 0, 371, 356, 0, 35, 22, 0, 183, 35, + /* 1730 */ 181, 364, 0, 0, 177, 385, 369, 176, 371, 0, + /* 1740 */ 0, 0, 0, 325, 47, 394, 0, 42, 0, 398, + /* 1750 */ 0, 0, 401, 402, 403, 404, 405, 406, 0, 408, + /* 1760 */ 0, 394, 0, 0, 0, 398, 152, 0, 401, 402, /* 1770 */ 403, 404, 405, 406, 356, 408, 152, 427, 35, 0, - /* 1780 */ 152, 431, 364, 0, 0, 0, 325, 369, 0, 371, + /* 1780 */ 0, 431, 364, 0, 0, 0, 325, 369, 0, 371, /* 1790 */ 0, 0, 0, 0, 0, 0, 446, 447, 0, 0, /* 1800 */ 0, 451, 452, 325, 0, 0, 0, 42, 0, 0, - /* 1810 */ 0, 0, 394, 0, 0, 0, 398, 356, 22, 401, - /* 1820 */ 402, 403, 404, 405, 406, 364, 408, 0, 0, 136, - /* 1830 */ 369, 0, 371, 58, 356, 0, 35, 0, 58, 0, - /* 1840 */ 14, 44, 364, 14, 42, 0, 39, 369, 0, 371, - /* 1850 */ 47, 0, 40, 0, 0, 394, 325, 39, 39, 398, - /* 1860 */ 172, 0, 401, 402, 403, 404, 405, 406, 47, 408, - /* 1870 */ 47, 0, 394, 325, 0, 0, 398, 35, 48, 401, - /* 1880 */ 402, 403, 404, 405, 406, 39, 408, 356, 64, 0, - /* 1890 */ 35, 48, 0, 35, 0, 364, 39, 48, 39, 35, - /* 1900 */ 369, 39, 371, 0, 356, 0, 0, 0, 48, 22, - /* 1910 */ 0, 35, 364, 35, 35, 22, 35, 369, 35, 371, - /* 1920 */ 103, 105, 22, 35, 325, 394, 44, 0, 44, 398, - /* 1930 */ 35, 35, 401, 402, 403, 404, 405, 406, 22, 408, - /* 1940 */ 0, 325, 394, 22, 0, 22, 398, 50, 35, 401, - /* 1950 */ 402, 403, 404, 405, 406, 356, 408, 0, 0, 35, - /* 1960 */ 35, 0, 97, 364, 22, 20, 35, 325, 369, 35, - /* 1970 */ 371, 193, 356, 96, 0, 0, 35, 22, 0, 0, - /* 1980 */ 364, 44, 249, 3, 325, 369, 164, 371, 97, 249, - /* 1990 */ 44, 44, 44, 394, 96, 96, 164, 398, 356, 166, - /* 2000 */ 401, 402, 403, 404, 405, 406, 364, 408, 164, 184, - /* 2010 */ 394, 369, 97, 371, 398, 356, 97, 401, 402, 403, - /* 2020 */ 404, 405, 406, 364, 408, 96, 170, 97, 369, 47, - /* 2030 */ 371, 96, 96, 47, 96, 325, 394, 3, 44, 35, - /* 2040 */ 398, 35, 35, 401, 402, 403, 404, 405, 406, 97, - /* 2050 */ 408, 97, 35, 394, 35, 35, 97, 398, 47, 97, - /* 2060 */ 401, 402, 403, 404, 405, 406, 356, 408, 44, 47, - /* 2070 */ 0, 0, 0, 96, 364, 167, 0, 96, 325, 369, - /* 2080 */ 97, 371, 97, 249, 243, 96, 96, 39, 96, 47, - /* 2090 */ 106, 165, 2, 44, 325, 228, 230, 228, 96, 22, - /* 2100 */ 97, 96, 47, 47, 394, 97, 96, 206, 398, 356, - /* 2110 */ 97, 401, 402, 403, 404, 405, 406, 364, 408, 96, - /* 2120 */ 22, 96, 369, 97, 371, 356, 208, 96, 107, 97, - /* 2130 */ 35, 35, 96, 364, 97, 35, 96, 35, 369, 96, - /* 2140 */ 371, 97, 97, 35, 97, 325, 96, 394, 35, 96, - /* 2150 */ 120, 398, 22, 120, 401, 402, 403, 404, 405, 406, - /* 2160 */ 108, 408, 96, 394, 44, 96, 120, 398, 35, 96, - /* 2170 */ 401, 402, 403, 404, 405, 406, 356, 408, 120, 22, - /* 2180 */ 64, 63, 35, 35, 364, 35, 35, 35, 325, 369, - /* 2190 */ 35, 371, 70, 35, 35, 35, 35, 93, 44, 35, - /* 2200 */ 35, 22, 35, 22, 35, 325, 35, 35, 70, 35, - /* 2210 */ 35, 35, 35, 35, 394, 22, 0, 35, 398, 356, - /* 2220 */ 35, 401, 402, 403, 404, 405, 406, 364, 408, 39, - /* 2230 */ 0, 48, 369, 35, 371, 48, 356, 0, 39, 35, - /* 2240 */ 48, 39, 0, 35, 364, 48, 39, 0, 35, 369, - /* 2250 */ 35, 371, 0, 22, 21, 20, 22, 394, 325, 457, - /* 2260 */ 22, 398, 21, 457, 401, 402, 403, 404, 405, 406, + /* 1810 */ 0, 22, 394, 0, 0, 136, 398, 356, 0, 401, + /* 1820 */ 402, 403, 404, 405, 406, 364, 408, 0, 0, 58, + /* 1830 */ 369, 35, 371, 0, 356, 58, 0, 0, 14, 42, + /* 1840 */ 39, 0, 364, 14, 0, 0, 44, 369, 0, 371, + /* 1850 */ 47, 0, 40, 172, 47, 394, 325, 0, 47, 398, + /* 1860 */ 39, 39, 401, 402, 403, 404, 405, 406, 0, 408, + /* 1870 */ 0, 0, 394, 325, 35, 0, 398, 39, 48, 401, + /* 1880 */ 402, 403, 404, 405, 406, 35, 408, 356, 48, 64, + /* 1890 */ 0, 39, 39, 35, 48, 364, 0, 35, 39, 0, + /* 1900 */ 369, 0, 371, 48, 356, 0, 0, 35, 22, 0, + /* 1910 */ 44, 35, 364, 35, 35, 22, 35, 369, 44, 371, + /* 1920 */ 105, 0, 103, 35, 325, 394, 35, 35, 0, 398, + /* 1930 */ 22, 0, 401, 402, 403, 404, 405, 406, 22, 408, + /* 1940 */ 22, 325, 394, 0, 50, 35, 398, 35, 0, 401, + /* 1950 */ 402, 403, 404, 405, 406, 356, 408, 35, 0, 22, + /* 1960 */ 20, 35, 35, 364, 97, 193, 0, 325, 369, 96, + /* 1970 */ 371, 35, 356, 0, 22, 0, 0, 3, 44, 249, + /* 1980 */ 364, 164, 166, 96, 325, 369, 97, 371, 44, 44, + /* 1990 */ 164, 96, 3, 394, 97, 164, 96, 398, 356, 97, + /* 2000 */ 401, 402, 403, 404, 405, 406, 364, 408, 97, 96, + /* 2010 */ 394, 369, 170, 371, 398, 356, 184, 401, 402, 403, + /* 2020 */ 404, 405, 406, 364, 408, 96, 47, 47, 369, 44, + /* 2030 */ 371, 96, 44, 35, 35, 325, 394, 35, 97, 97, + /* 2040 */ 398, 35, 35, 401, 402, 403, 404, 405, 406, 35, + /* 2050 */ 408, 97, 97, 394, 44, 47, 47, 398, 0, 0, + /* 2060 */ 401, 402, 403, 404, 405, 406, 356, 408, 0, 97, + /* 2070 */ 167, 0, 249, 96, 364, 97, 39, 96, 325, 369, + /* 2080 */ 96, 371, 96, 249, 165, 47, 243, 96, 106, 44, + /* 2090 */ 230, 2, 228, 228, 325, 22, 96, 47, 47, 22, + /* 2100 */ 97, 96, 107, 120, 394, 35, 208, 96, 398, 356, + /* 2110 */ 206, 401, 402, 403, 404, 405, 406, 364, 408, 97, + /* 2120 */ 97, 96, 369, 96, 371, 356, 97, 96, 35, 97, + /* 2130 */ 96, 35, 97, 364, 35, 96, 35, 97, 369, 96, + /* 2140 */ 371, 97, 96, 35, 97, 325, 120, 394, 96, 22, + /* 2150 */ 120, 398, 96, 120, 401, 402, 403, 404, 405, 406, + /* 2160 */ 44, 408, 108, 394, 35, 96, 22, 398, 96, 64, + /* 2170 */ 401, 402, 403, 404, 405, 406, 356, 408, 63, 70, + /* 2180 */ 35, 35, 35, 35, 364, 35, 35, 35, 325, 369, + /* 2190 */ 35, 371, 35, 35, 35, 93, 35, 44, 22, 35, + /* 2200 */ 22, 35, 35, 35, 70, 325, 35, 35, 35, 35, + /* 2210 */ 35, 22, 35, 0, 394, 35, 0, 48, 398, 356, + /* 2220 */ 39, 401, 402, 403, 404, 405, 406, 364, 408, 35, + /* 2230 */ 48, 39, 369, 0, 371, 35, 356, 39, 48, 0, + /* 2240 */ 35, 48, 39, 0, 364, 35, 35, 0, 22, 369, + /* 2250 */ 21, 371, 22, 22, 457, 21, 20, 394, 325, 457, + /* 2260 */ 457, 398, 457, 457, 401, 402, 403, 404, 405, 406, /* 2270 */ 457, 408, 457, 457, 394, 325, 457, 457, 398, 457, /* 2280 */ 457, 401, 402, 403, 404, 405, 406, 457, 408, 356, /* 2290 */ 457, 457, 457, 457, 457, 457, 457, 364, 457, 457, @@ -718,84 +718,83 @@ static const YYCODETYPE yy_lookahead[] = { /* 2540 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, /* 2550 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, /* 2560 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2570 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2580 */ 457, 457, 457, 457, 457, + /* 2570 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, }; -#define YY_SHIFT_COUNT (709) +#define YY_SHIFT_COUNT (708) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2252) +#define YY_SHIFT_MAX (2247) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 933, 0, 134, 0, 268, 268, 268, 268, 268, 268, /* 10 */ 268, 268, 268, 402, 536, 536, 670, 536, 536, 536, /* 20 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, /* 30 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, - /* 40 */ 536, 536, 536, 536, 536, 536, 55, 180, 65, 195, - /* 50 */ 26, 284, 330, 284, 65, 65, 947, 947, 284, 947, - /* 60 */ 947, 182, 284, 39, 39, 128, 128, 111, 272, 42, - /* 70 */ 42, 39, 39, 39, 39, 39, 39, 39, 39, 39, - /* 80 */ 39, 31, 39, 39, 105, 39, 137, 39, 39, 188, - /* 90 */ 39, 39, 188, 39, 188, 188, 188, 39, 140, 762, - /* 100 */ 949, 949, 438, 1131, 1056, 1056, 1056, 1056, 1056, 1056, - /* 110 */ 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - /* 120 */ 1056, 1056, 1056, 965, 228, 111, 272, 659, 532, 269, - /* 130 */ 269, 269, 800, 370, 370, 532, 224, 224, 224, 213, - /* 140 */ 137, 33, 188, 351, 188, 351, 351, 213, 389, 909, - /* 150 */ 909, 909, 909, 909, 909, 909, 1044, 36, 793, 851, - /* 160 */ 975, 572, 115, 83, 72, 84, 517, 850, 1034, 986, - /* 170 */ 959, 843, 634, 865, 843, 1099, 857, 486, 1066, 1285, - /* 180 */ 1160, 1302, 1327, 1302, 1190, 1353, 1353, 1302, 1190, 1190, - /* 190 */ 1290, 1353, 1353, 1353, 1371, 1371, 1387, 31, 137, 31, - /* 200 */ 1392, 1407, 31, 1392, 31, 31, 31, 1353, 31, 1382, - /* 210 */ 1382, 1371, 188, 188, 188, 188, 188, 188, 188, 188, - /* 220 */ 188, 188, 188, 1353, 1371, 351, 351, 1250, 1387, 140, - /* 230 */ 1315, 137, 140, 1353, 1327, 1327, 351, 1262, 1268, 351, - /* 240 */ 1262, 1268, 351, 351, 188, 1283, 1374, 1262, 1282, 1297, - /* 250 */ 1300, 1066, 1298, 1310, 1313, 1329, 224, 1575, 1353, 1392, - /* 260 */ 140, 1268, 351, 351, 351, 351, 351, 1268, 351, 1453, - /* 270 */ 140, 213, 140, 224, 1533, 1536, 351, 389, 1353, 140, - /* 280 */ 1627, 1371, 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410, - /* 290 */ 2410, 858, 1027, 23, 1389, 52, 663, 449, 155, 672, - /* 300 */ 1289, 1555, 423, 756, 756, 756, 756, 756, 756, 756, - /* 310 */ 756, 756, 339, 190, 243, 243, 390, 378, 315, 523, - /* 320 */ 470, 518, 518, 696, 999, 168, 696, 696, 696, 884, - /* 330 */ 1076, 385, 1102, 1007, 1089, 956, 1073, 1106, 1107, 16, - /* 340 */ 1196, 1197, 1166, 1105, 1128, 1093, 1071, 972, 1051, 1135, - /* 350 */ 1169, 1173, 1178, 1199, 1232, 1215, 1085, 1110, 573, 1217, - /* 360 */ 1181, 1264, 1265, 1267, 1272, 1288, 1292, 1134, 1234, 1305, - /* 370 */ 1210, 1323, 1687, 1691, 1505, 1694, 1695, 1654, 1697, 1663, - /* 380 */ 1499, 1665, 1666, 1668, 1504, 1705, 1673, 1682, 1518, 1721, - /* 390 */ 1524, 1725, 1692, 1726, 1706, 1729, 1698, 1547, 1551, 1734, - /* 400 */ 1737, 1562, 1564, 1741, 1742, 1699, 1744, 1747, 1748, 1708, - /* 410 */ 1751, 1758, 1760, 1762, 1763, 1764, 1766, 1767, 1624, 1743, - /* 420 */ 1779, 1628, 1783, 1784, 1785, 1788, 1790, 1791, 1792, 1793, - /* 430 */ 1794, 1795, 1798, 1799, 1800, 1804, 1805, 1765, 1806, 1808, - /* 440 */ 1809, 1810, 1811, 1796, 1813, 1814, 1815, 1693, 1827, 1828, - /* 450 */ 1801, 1831, 1775, 1835, 1780, 1837, 1839, 1802, 1807, 1797, - /* 460 */ 1803, 1826, 1821, 1829, 1823, 1845, 1812, 1818, 1848, 1851, - /* 470 */ 1853, 1819, 1688, 1854, 1861, 1871, 1824, 1874, 1875, 1842, - /* 480 */ 1830, 1846, 1889, 1855, 1843, 1857, 1892, 1858, 1849, 1859, - /* 490 */ 1894, 1864, 1860, 1862, 1903, 1905, 1906, 1907, 1816, 1817, - /* 500 */ 1876, 1887, 1910, 1878, 1879, 1893, 1881, 1883, 1882, 1884, - /* 510 */ 1888, 1895, 1900, 1896, 1927, 1916, 1940, 1921, 1897, 1944, - /* 520 */ 1923, 1913, 1957, 1924, 1958, 1925, 1961, 1942, 1945, 1931, - /* 530 */ 1934, 1778, 1865, 1877, 1974, 1822, 1941, 1975, 1825, 1955, - /* 540 */ 1832, 1833, 1978, 1979, 1844, 1856, 1980, 1937, 1733, 1898, - /* 550 */ 1891, 1899, 1915, 1946, 1919, 1929, 1935, 1936, 1930, 1947, - /* 560 */ 1982, 1986, 1938, 1948, 1740, 1952, 1954, 2034, 1994, 1834, - /* 570 */ 2004, 2006, 2007, 2017, 2019, 2020, 1959, 1962, 2011, 1841, - /* 580 */ 2024, 2022, 2070, 2071, 2072, 1977, 1983, 1985, 1981, 1989, - /* 590 */ 1908, 1990, 2076, 2048, 1926, 1992, 1984, 1803, 2042, 2049, - /* 600 */ 1867, 1866, 1869, 2090, 2077, 1901, 2002, 2003, 2005, 2008, - /* 610 */ 2010, 2013, 2055, 2023, 2025, 2056, 2026, 2098, 1918, 2031, - /* 620 */ 2021, 2032, 2095, 2096, 2036, 2037, 2100, 2040, 2044, 2102, - /* 630 */ 2043, 2045, 2108, 2050, 2047, 2113, 2053, 2030, 2033, 2046, - /* 640 */ 2058, 2130, 2052, 2066, 2120, 2069, 2133, 2073, 2120, 2120, - /* 650 */ 2157, 2116, 2118, 2147, 2148, 2150, 2151, 2152, 2155, 2158, - /* 660 */ 2159, 2160, 2161, 2122, 2104, 2154, 2164, 2165, 2179, 2167, - /* 670 */ 2181, 2169, 2171, 2172, 2138, 1882, 2174, 1884, 2175, 2176, - /* 680 */ 2177, 2178, 2193, 2182, 2216, 2185, 2183, 2190, 2230, 2198, - /* 690 */ 2187, 2199, 2237, 2204, 2192, 2202, 2242, 2208, 2197, 2207, - /* 700 */ 2247, 2213, 2215, 2252, 2231, 2233, 2234, 2238, 2241, 2235, + /* 40 */ 536, 536, 536, 536, 536, 536, 180, 224, 64, 223, + /* 50 */ 133, 1, 17, 1, 64, 64, 947, 947, 1, 947, + /* 60 */ 947, 147, 1, 138, 138, 246, 246, 258, 137, 18, + /* 70 */ 18, 138, 138, 138, 138, 138, 138, 138, 138, 138, + /* 80 */ 138, 86, 138, 138, 249, 138, 314, 138, 138, 399, + /* 90 */ 138, 138, 399, 138, 399, 399, 399, 138, 454, 762, + /* 100 */ 949, 949, 96, 911, 480, 480, 480, 480, 480, 480, + /* 110 */ 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, + /* 120 */ 480, 480, 480, 965, 403, 258, 137, 671, 238, 302, + /* 130 */ 302, 302, 801, 565, 565, 238, 548, 548, 548, 481, + /* 140 */ 314, 375, 399, 623, 399, 623, 623, 481, 659, 909, + /* 150 */ 909, 909, 909, 909, 909, 909, 1044, 793, 439, 698, + /* 160 */ 1188, 253, 151, 336, 680, 845, 285, 501, 855, 679, + /* 170 */ 983, 883, 936, 857, 883, 1079, 915, 1060, 1094, 1299, + /* 180 */ 1181, 1331, 1349, 1331, 1244, 1387, 1387, 1331, 1244, 1244, + /* 190 */ 1340, 1387, 1387, 1387, 1419, 1419, 1422, 86, 314, 86, + /* 200 */ 1432, 1449, 86, 1432, 86, 86, 86, 1387, 86, 1421, + /* 210 */ 1421, 1419, 399, 399, 399, 399, 399, 399, 399, 399, + /* 220 */ 399, 399, 399, 1387, 1419, 623, 623, 1301, 1422, 454, + /* 230 */ 1313, 314, 454, 1387, 1349, 1349, 623, 1275, 1291, 623, + /* 240 */ 1275, 1291, 623, 623, 399, 1286, 1374, 1275, 1311, 1293, + /* 250 */ 1330, 1094, 1307, 1317, 1333, 1332, 548, 1577, 1387, 1432, + /* 260 */ 454, 1291, 623, 623, 623, 623, 623, 1291, 623, 1450, + /* 270 */ 454, 481, 454, 548, 1532, 1533, 623, 659, 1387, 454, + /* 280 */ 1618, 1419, 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410, + /* 290 */ 2410, 858, 1027, 23, 627, 52, 756, 449, 155, 859, + /* 300 */ 1143, 1555, 986, 1289, 1289, 1289, 1289, 1289, 1289, 1289, + /* 310 */ 1289, 1289, 699, 106, 243, 243, 658, 626, 288, 346, + /* 320 */ 412, 651, 651, 823, 1007, 436, 823, 823, 823, 591, + /* 330 */ 653, 1111, 1099, 1017, 1058, 1073, 1106, 1115, 1117, 1140, + /* 340 */ 1172, 1211, 1166, 1116, 1155, 1016, 997, 993, 1061, 1193, + /* 350 */ 1219, 1226, 1247, 1288, 1162, 1290, 1184, 1191, 1169, 1233, + /* 360 */ 1215, 1292, 1328, 1346, 1347, 1383, 1384, 1139, 1283, 1327, + /* 370 */ 1199, 1335, 1687, 1689, 1502, 1691, 1693, 1652, 1695, 1661, + /* 380 */ 1497, 1663, 1664, 1665, 1501, 1703, 1669, 1670, 1508, 1717, + /* 390 */ 1518, 1721, 1690, 1724, 1704, 1727, 1694, 1545, 1549, 1732, + /* 400 */ 1733, 1557, 1561, 1739, 1740, 1697, 1741, 1742, 1746, 1705, + /* 410 */ 1748, 1750, 1751, 1758, 1760, 1762, 1763, 1764, 1614, 1743, + /* 420 */ 1767, 1624, 1779, 1780, 1783, 1784, 1785, 1788, 1790, 1791, + /* 430 */ 1792, 1793, 1794, 1795, 1798, 1799, 1800, 1765, 1804, 1805, + /* 440 */ 1806, 1808, 1809, 1789, 1810, 1813, 1814, 1679, 1818, 1827, + /* 450 */ 1796, 1828, 1771, 1833, 1777, 1836, 1837, 1797, 1801, 1802, + /* 460 */ 1803, 1824, 1807, 1829, 1811, 1841, 1812, 1821, 1844, 1845, + /* 470 */ 1848, 1822, 1681, 1851, 1857, 1868, 1825, 1870, 1871, 1839, + /* 480 */ 1830, 1838, 1875, 1850, 1840, 1852, 1890, 1858, 1846, 1853, + /* 490 */ 1896, 1862, 1855, 1859, 1899, 1901, 1905, 1906, 1815, 1819, + /* 500 */ 1872, 1886, 1909, 1876, 1878, 1879, 1881, 1866, 1874, 1888, + /* 510 */ 1891, 1893, 1892, 1921, 1908, 1928, 1916, 1894, 1931, 1918, + /* 520 */ 1910, 1943, 1912, 1948, 1922, 1958, 1937, 1940, 1926, 1927, + /* 530 */ 1772, 1867, 1873, 1966, 1817, 1936, 1973, 1832, 1952, 1826, + /* 540 */ 1816, 1975, 1976, 1831, 1842, 1974, 1934, 1730, 1887, 1889, + /* 550 */ 1895, 1897, 1944, 1902, 1900, 1913, 1929, 1911, 1945, 1979, + /* 560 */ 1980, 1935, 1985, 1823, 1941, 1942, 1989, 1988, 1834, 1998, + /* 570 */ 1999, 2002, 2006, 2007, 2014, 1954, 1955, 2008, 1843, 2010, + /* 580 */ 2009, 2058, 2059, 2068, 1977, 1972, 1978, 1981, 1984, 1903, + /* 590 */ 1986, 2071, 2037, 1919, 1991, 1982, 1803, 2038, 2045, 1864, + /* 600 */ 1860, 1865, 2089, 2073, 1904, 2000, 2003, 2005, 2022, 2011, + /* 610 */ 2023, 2050, 2025, 2027, 2051, 2029, 2077, 1898, 2031, 1995, + /* 620 */ 2032, 2070, 2093, 2034, 2035, 2096, 2039, 2040, 2099, 2043, + /* 630 */ 2044, 2101, 2046, 2047, 2108, 2052, 1983, 2026, 2030, 2033, + /* 640 */ 2127, 2054, 2056, 2116, 2069, 2129, 2072, 2116, 2116, 2144, + /* 650 */ 2105, 2115, 2145, 2146, 2147, 2148, 2150, 2151, 2152, 2155, + /* 660 */ 2157, 2158, 2109, 2102, 2153, 2159, 2161, 2176, 2164, 2178, + /* 670 */ 2166, 2167, 2168, 2134, 1866, 2171, 1874, 2172, 2173, 2174, + /* 680 */ 2175, 2189, 2177, 2213, 2180, 2169, 2181, 2216, 2194, 2182, + /* 690 */ 2192, 2233, 2200, 2190, 2198, 2239, 2205, 2193, 2203, 2243, + /* 700 */ 2210, 2211, 2247, 2226, 2229, 2230, 2231, 2234, 2236, }; #define YY_REDUCE_COUNT (290) #define YY_REDUCE_MIN (-422) @@ -805,105 +804,105 @@ static const short yy_reduce_ofst[] = { /* 10 */ 880, 923, 951, 994, 333, 1012, 1055, 1108, 1129, 1183, /* 20 */ 1237, 40, 1254, 1308, 442, 1280, 1351, 1367, 1418, 1461, /* 30 */ 1478, 1531, 1548, 1599, 1616, 1642, 1659, 1710, 1753, 1769, - /* 40 */ 1820, 1863, 1880, 1933, 1950, 2001, -34, 350, 240, -340, - /* 50 */ 666, 1098, 1109, 1350, 776, 1189, 1070, 1083, -422, -326, - /* 60 */ -269, -410, -287, -206, -163, -328, -321, -350, -352, -26, - /* 70 */ 122, -307, -28, 163, 166, 174, 229, 239, 361, 362, - /* 80 */ 452, 46, 508, 621, -251, 639, 48, 706, 741, 177, - /* 90 */ 757, 786, 146, 847, 178, 152, 287, 509, -108, -299, - /* 100 */ -221, -221, -338, -207, -27, 172, 194, 322, 332, 375, - /* 110 */ 405, 462, 465, 466, 469, 480, 483, 529, 550, 627, - /* 120 */ 628, 630, 641, -33, -303, 275, -101, 271, -48, -303, - /* 130 */ 383, 474, 356, 302, 306, 25, -222, 64, 409, 380, - /* 140 */ 624, 562, 368, 609, 686, 638, 683, 689, 493, 143, - /* 150 */ 157, 203, 233, 241, 366, 429, 14, 556, 481, 317, - /* 160 */ 522, 565, 702, 633, 775, 775, 812, 772, 903, 905, - /* 170 */ 873, 860, 860, 842, 860, 885, 878, 775, 934, 939, - /* 180 */ 954, 970, 969, 984, 993, 1041, 1042, 1001, 1004, 1005, - /* 190 */ 1045, 1049, 1054, 1057, 1067, 1078, 1018, 1082, 1052, 1086, - /* 200 */ 1095, 1046, 1091, 1097, 1096, 1101, 1104, 1103, 1111, 1112, - /* 210 */ 1115, 1117, 1090, 1118, 1120, 1130, 1132, 1133, 1136, 1139, - /* 220 */ 1140, 1141, 1143, 1122, 1144, 1069, 1121, 1080, 1113, 1125, - /* 230 */ 1127, 1147, 1168, 1170, 1142, 1145, 1138, 1146, 1137, 1157, - /* 240 */ 1153, 1156, 1159, 1172, 775, 1119, 1126, 1155, 1158, 1123, - /* 250 */ 1148, 1176, 1124, 1149, 1151, 860, 1214, 1202, 1263, 1269, - /* 260 */ 1260, 1222, 1238, 1240, 1242, 1251, 1252, 1244, 1253, 1247, - /* 270 */ 1287, 1276, 1293, 1270, 1228, 1294, 1278, 1304, 1320, 1324, - /* 280 */ 1337, 1339, 1279, 1281, 1306, 1307, 1318, 1321, 1325, 1332, - /* 290 */ 1357, + /* 40 */ 1820, 1863, 1880, 1933, 1950, 2001, -34, -345, 103, -342, + /* 50 */ 91, 862, 1109, 1350, 815, 1013, -258, 1024, -422, -266, + /* 60 */ 641, -410, -52, -235, -29, -328, -257, -263, -206, 99, + /* 70 */ 122, -307, -163, 107, 208, 226, 229, 300, 303, 310, + /* 80 */ 312, 213, 315, 344, 317, 362, -365, 444, 452, -320, + /* 90 */ 502, 619, -219, 640, 367, 188, 425, 723, -185, -125, + /* 100 */ -409, -409, 84, -330, -234, 8, 59, 128, 145, 194, + /* 110 */ 232, 327, 347, 405, 472, 529, 603, 628, 690, 717, + /* 120 */ 727, 728, 751, -26, 47, -322, -175, -88, 191, 47, + /* 130 */ 588, 590, 48, 372, 567, 211, 235, 714, 715, -290, + /* 140 */ 584, 85, 635, 705, -285, 722, 743, 453, 759, -355, + /* 150 */ 387, 495, 507, 513, 521, 597, 662, 767, 786, 765, + /* 160 */ 752, 783, 893, 803, 910, 910, 938, 889, 943, 912, + /* 170 */ 927, 881, 881, 864, 881, 918, 901, 910, 952, 956, + /* 180 */ 977, 1002, 1000, 1010, 1020, 1075, 1076, 1036, 1056, 1057, + /* 190 */ 1088, 1102, 1112, 1113, 1120, 1121, 1059, 1123, 1080, 1128, + /* 200 */ 1134, 1085, 1135, 1142, 1144, 1145, 1147, 1149, 1148, 1152, + /* 210 */ 1153, 1151, 1136, 1141, 1159, 1161, 1163, 1164, 1165, 1168, + /* 220 */ 1170, 1173, 1182, 1157, 1174, 1122, 1126, 1110, 1114, 1167, + /* 230 */ 1132, 1154, 1204, 1185, 1171, 1178, 1138, 1105, 1176, 1175, + /* 240 */ 1146, 1177, 1179, 1180, 910, 1125, 1127, 1158, 1137, 1186, + /* 250 */ 1156, 1196, 1124, 1150, 1160, 881, 1230, 1202, 1266, 1269, + /* 260 */ 1267, 1225, 1242, 1243, 1245, 1248, 1250, 1231, 1251, 1246, + /* 270 */ 1285, 1272, 1295, 1263, 1212, 1274, 1277, 1304, 1314, 1316, + /* 280 */ 1337, 1334, 1278, 1271, 1284, 1287, 1318, 1321, 1323, 1342, + /* 290 */ 1352, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 10 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 20 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 30 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 40 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 50 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 60 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1849, 1592, 1592, - /* 70 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 80 */ 1592, 1670, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 90 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1668, 1842, - /* 100 */ 2039, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 110 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 120 */ 1592, 1592, 1592, 1592, 2051, 1592, 1592, 1670, 1592, 2051, - /* 130 */ 2051, 2051, 1668, 2011, 2011, 1592, 1592, 1592, 1592, 1779, - /* 140 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1779, 1592, 1592, - /* 150 */ 1592, 1592, 1592, 1592, 1592, 1592, 1886, 1592, 1592, 2076, - /* 160 */ 2129, 1592, 1592, 2079, 1592, 1592, 1592, 1854, 1592, 1732, - /* 170 */ 2066, 2043, 2057, 2113, 2044, 2041, 2060, 1592, 2070, 1592, - /* 180 */ 1879, 1847, 1592, 1847, 1844, 1592, 1592, 1847, 1844, 1844, - /* 190 */ 1723, 1592, 1592, 1592, 1592, 1592, 1592, 1670, 1592, 1670, - /* 200 */ 1592, 1592, 1670, 1592, 1670, 1670, 1670, 1592, 1670, 1649, - /* 210 */ 1649, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 220 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1899, 1592, 1668, - /* 230 */ 1888, 1592, 1668, 1592, 1592, 1592, 1592, 2086, 2084, 1592, - /* 240 */ 2086, 2084, 1592, 1592, 1592, 2098, 2094, 2086, 2102, 2100, - /* 250 */ 2072, 2070, 2132, 2119, 2115, 2057, 1592, 1592, 1592, 1592, - /* 260 */ 1668, 2084, 1592, 1592, 1592, 1592, 1592, 2084, 1592, 1592, - /* 270 */ 1668, 1592, 1668, 1592, 1592, 1748, 1592, 1592, 1592, 1668, - /* 280 */ 1624, 1592, 1881, 1892, 1864, 1864, 1782, 1782, 1782, 1671, - /* 290 */ 1597, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 300 */ 1592, 1592, 1592, 2097, 2096, 1967, 1592, 2015, 2014, 2013, - /* 310 */ 2004, 1966, 1744, 1592, 1965, 1964, 1592, 1592, 1592, 1592, - /* 320 */ 1592, 1860, 1859, 1958, 1592, 1592, 1959, 1957, 1956, 1592, - /* 330 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 340 */ 1592, 1592, 1592, 1592, 1592, 1592, 2116, 2120, 1592, 1592, - /* 350 */ 1592, 1592, 1592, 1592, 2040, 1592, 1592, 1592, 1592, 1592, - /* 360 */ 1941, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 370 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 380 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 390 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 400 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 410 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 420 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 430 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 440 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 450 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1629, - /* 460 */ 1946, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 470 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 480 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 490 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 500 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1710, 1709, - /* 510 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 520 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 530 */ 1592, 1592, 1949, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 540 */ 1592, 1592, 1592, 1592, 1592, 1592, 2112, 2073, 1592, 1592, - /* 550 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 560 */ 1592, 1941, 1592, 2095, 1592, 1592, 2110, 1592, 2114, 1592, - /* 570 */ 1592, 1592, 1592, 1592, 1592, 1592, 2050, 2046, 1592, 1592, - /* 580 */ 2042, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 590 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1940, 1592, 2001, - /* 600 */ 1592, 1592, 1592, 2035, 1592, 1592, 1986, 1592, 1592, 1592, - /* 610 */ 1592, 1592, 1592, 1592, 1592, 1592, 1949, 1592, 1952, 1592, - /* 620 */ 1592, 1592, 1592, 1592, 1776, 1592, 1592, 1592, 1592, 1592, - /* 630 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1761, 1759, 1758, - /* 640 */ 1757, 1592, 1754, 1592, 1789, 1592, 1592, 1592, 1785, 1784, - /* 650 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 660 */ 1592, 1592, 1592, 1592, 1592, 1690, 1592, 1592, 1592, 1592, - /* 670 */ 1592, 1592, 1592, 1592, 1592, 1681, 1592, 1680, 1592, 1592, - /* 680 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 690 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 700 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 0 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 10 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 20 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 30 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 40 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 50 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 60 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1845, 1589, 1589, + /* 70 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 80 */ 1589, 1667, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 90 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1665, 1838, + /* 100 */ 2035, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 110 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 120 */ 1589, 1589, 1589, 1589, 2047, 1589, 1589, 1667, 1589, 2047, + /* 130 */ 2047, 2047, 1665, 2007, 2007, 1589, 1589, 1589, 1589, 1775, + /* 140 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1775, 1589, 1589, + /* 150 */ 1589, 1589, 1589, 1589, 1589, 1589, 1882, 1589, 1589, 2072, + /* 160 */ 2125, 1589, 1589, 2075, 1589, 1589, 1589, 1850, 1589, 1728, + /* 170 */ 2062, 2039, 2053, 2109, 2040, 2037, 2056, 1589, 2066, 1589, + /* 180 */ 1875, 1843, 1589, 1843, 1840, 1589, 1589, 1843, 1840, 1840, + /* 190 */ 1719, 1589, 1589, 1589, 1589, 1589, 1589, 1667, 1589, 1667, + /* 200 */ 1589, 1589, 1667, 1589, 1667, 1667, 1667, 1589, 1667, 1646, + /* 210 */ 1646, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 220 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1895, 1589, 1665, + /* 230 */ 1884, 1589, 1665, 1589, 1589, 1589, 1589, 2082, 2080, 1589, + /* 240 */ 2082, 2080, 1589, 1589, 1589, 2094, 2090, 2082, 2098, 2096, + /* 250 */ 2068, 2066, 2128, 2115, 2111, 2053, 1589, 1589, 1589, 1589, + /* 260 */ 1665, 2080, 1589, 1589, 1589, 1589, 1589, 2080, 1589, 1589, + /* 270 */ 1665, 1589, 1665, 1589, 1589, 1744, 1589, 1589, 1589, 1665, + /* 280 */ 1621, 1589, 1877, 1888, 1860, 1860, 1778, 1778, 1778, 1668, + /* 290 */ 1594, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 300 */ 1589, 1589, 1589, 2093, 2092, 1963, 1589, 2011, 2010, 2009, + /* 310 */ 2000, 1962, 1740, 1589, 1961, 1960, 1589, 1589, 1589, 1589, + /* 320 */ 1589, 1856, 1855, 1954, 1589, 1589, 1955, 1953, 1952, 1589, + /* 330 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 340 */ 1589, 1589, 1589, 1589, 1589, 1589, 2112, 2116, 1589, 1589, + /* 350 */ 1589, 1589, 1589, 1589, 2036, 1589, 1589, 1589, 1589, 1589, + /* 360 */ 1937, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 370 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 380 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 390 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 400 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 410 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 420 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 430 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 440 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 450 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1626, + /* 460 */ 1942, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 470 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 480 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 490 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 500 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1707, 1706, 1589, + /* 510 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 520 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 530 */ 1589, 1945, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 540 */ 1589, 1589, 1589, 1589, 1589, 2108, 2069, 1589, 1589, 1589, + /* 550 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 560 */ 1937, 1589, 2091, 1589, 1589, 2106, 1589, 2110, 1589, 1589, + /* 570 */ 1589, 1589, 1589, 1589, 1589, 2046, 2042, 1589, 1589, 2038, + /* 580 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 590 */ 1589, 1589, 1589, 1589, 1589, 1589, 1936, 1589, 1997, 1589, + /* 600 */ 1589, 1589, 2031, 1589, 1589, 1982, 1589, 1589, 1589, 1589, + /* 610 */ 1589, 1589, 1589, 1589, 1589, 1945, 1589, 1948, 1589, 1589, + /* 620 */ 1589, 1589, 1589, 1772, 1589, 1589, 1589, 1589, 1589, 1589, + /* 630 */ 1589, 1589, 1589, 1589, 1589, 1589, 1757, 1755, 1754, 1753, + /* 640 */ 1589, 1750, 1589, 1785, 1589, 1589, 1589, 1781, 1780, 1589, + /* 650 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 660 */ 1589, 1589, 1589, 1589, 1687, 1589, 1589, 1589, 1589, 1589, + /* 670 */ 1589, 1589, 1589, 1589, 1678, 1589, 1677, 1589, 1589, 1589, + /* 680 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 690 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 700 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1914,428 +1913,427 @@ static const char *const yyRuleName[] = { /* 115 */ "alter_db_option ::= KEEP variable_list", /* 116 */ "alter_db_option ::= PAGES NK_INTEGER", /* 117 */ "alter_db_option ::= REPLICA NK_INTEGER", - /* 118 */ "alter_db_option ::= STRICT NK_STRING", - /* 119 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 120 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 121 */ "integer_list ::= NK_INTEGER", - /* 122 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 123 */ "variable_list ::= NK_VARIABLE", - /* 124 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 125 */ "retention_list ::= retention", - /* 126 */ "retention_list ::= retention_list NK_COMMA retention", - /* 127 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 128 */ "speed_opt ::=", - /* 129 */ "speed_opt ::= MAX_SPEED NK_INTEGER", - /* 130 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 131 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 132 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 133 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 134 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 135 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 136 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 137 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 138 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", - /* 139 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 140 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 141 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 142 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 143 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 144 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 145 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 146 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", - /* 147 */ "multi_create_clause ::= create_subtable_clause", - /* 148 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 149 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", - /* 150 */ "multi_drop_clause ::= drop_table_clause", - /* 151 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 152 */ "drop_table_clause ::= exists_opt full_table_name", - /* 153 */ "specific_cols_opt ::=", - /* 154 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 155 */ "full_table_name ::= table_name", - /* 156 */ "full_table_name ::= db_name NK_DOT table_name", - /* 157 */ "column_def_list ::= column_def", - /* 158 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 159 */ "column_def ::= column_name type_name", - /* 160 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 161 */ "type_name ::= BOOL", - /* 162 */ "type_name ::= TINYINT", - /* 163 */ "type_name ::= SMALLINT", - /* 164 */ "type_name ::= INT", - /* 165 */ "type_name ::= INTEGER", - /* 166 */ "type_name ::= BIGINT", - /* 167 */ "type_name ::= FLOAT", - /* 168 */ "type_name ::= DOUBLE", - /* 169 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 170 */ "type_name ::= TIMESTAMP", - /* 171 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 172 */ "type_name ::= TINYINT UNSIGNED", - /* 173 */ "type_name ::= SMALLINT UNSIGNED", - /* 174 */ "type_name ::= INT UNSIGNED", - /* 175 */ "type_name ::= BIGINT UNSIGNED", - /* 176 */ "type_name ::= JSON", - /* 177 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 178 */ "type_name ::= MEDIUMBLOB", - /* 179 */ "type_name ::= BLOB", - /* 180 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 181 */ "type_name ::= DECIMAL", - /* 182 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 183 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 184 */ "tags_def_opt ::=", - /* 185 */ "tags_def_opt ::= tags_def", - /* 186 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 187 */ "table_options ::=", - /* 188 */ "table_options ::= table_options COMMENT NK_STRING", - /* 189 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 190 */ "table_options ::= table_options WATERMARK duration_list", - /* 191 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 192 */ "table_options ::= table_options TTL NK_INTEGER", - /* 193 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 194 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 195 */ "alter_table_options ::= alter_table_option", - /* 196 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 197 */ "alter_table_option ::= COMMENT NK_STRING", - /* 198 */ "alter_table_option ::= TTL NK_INTEGER", - /* 199 */ "duration_list ::= duration_literal", - /* 200 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 201 */ "rollup_func_list ::= rollup_func_name", - /* 202 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 203 */ "rollup_func_name ::= function_name", - /* 204 */ "rollup_func_name ::= FIRST", - /* 205 */ "rollup_func_name ::= LAST", - /* 206 */ "col_name_list ::= col_name", - /* 207 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 208 */ "col_name ::= column_name", - /* 209 */ "cmd ::= SHOW DNODES", - /* 210 */ "cmd ::= SHOW USERS", - /* 211 */ "cmd ::= SHOW USER PRIVILEGES", - /* 212 */ "cmd ::= SHOW DATABASES", - /* 213 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 214 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 215 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 216 */ "cmd ::= SHOW MNODES", - /* 217 */ "cmd ::= SHOW QNODES", - /* 218 */ "cmd ::= SHOW FUNCTIONS", - /* 219 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 220 */ "cmd ::= SHOW STREAMS", - /* 221 */ "cmd ::= SHOW ACCOUNTS", - /* 222 */ "cmd ::= SHOW APPS", - /* 223 */ "cmd ::= SHOW CONNECTIONS", - /* 224 */ "cmd ::= SHOW LICENCES", - /* 225 */ "cmd ::= SHOW GRANTS", - /* 226 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 227 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 228 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 229 */ "cmd ::= SHOW QUERIES", - /* 230 */ "cmd ::= SHOW SCORES", - /* 231 */ "cmd ::= SHOW TOPICS", - /* 232 */ "cmd ::= SHOW VARIABLES", - /* 233 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 234 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 235 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 236 */ "cmd ::= SHOW BNODES", - /* 237 */ "cmd ::= SHOW SNODES", - /* 238 */ "cmd ::= SHOW CLUSTER", - /* 239 */ "cmd ::= SHOW TRANSACTIONS", - /* 240 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 241 */ "cmd ::= SHOW CONSUMERS", - /* 242 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 243 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 244 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 245 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 246 */ "cmd ::= SHOW VNODES NK_STRING", - /* 247 */ "db_name_cond_opt ::=", - /* 248 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 249 */ "like_pattern_opt ::=", - /* 250 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 251 */ "table_name_cond ::= table_name", - /* 252 */ "from_db_opt ::=", - /* 253 */ "from_db_opt ::= FROM db_name", - /* 254 */ "tag_list_opt ::=", - /* 255 */ "tag_list_opt ::= tag_item", - /* 256 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 257 */ "tag_item ::= TBNAME", - /* 258 */ "tag_item ::= QTAGS", - /* 259 */ "tag_item ::= column_name", - /* 260 */ "tag_item ::= column_name column_alias", - /* 261 */ "tag_item ::= column_name AS column_alias", - /* 262 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", - /* 263 */ "cmd ::= DROP INDEX exists_opt full_table_name", - /* 264 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 265 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", - /* 266 */ "func_list ::= func", - /* 267 */ "func_list ::= func_list NK_COMMA func", - /* 268 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 269 */ "sma_stream_opt ::=", - /* 270 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 271 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 272 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 277 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 278 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 279 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 280 */ "cmd ::= DESC full_table_name", - /* 281 */ "cmd ::= DESCRIBE full_table_name", - /* 282 */ "cmd ::= RESET QUERY CACHE", - /* 283 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 284 */ "analyze_opt ::=", - /* 285 */ "analyze_opt ::= ANALYZE", - /* 286 */ "explain_options ::=", - /* 287 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 288 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 289 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 290 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 291 */ "agg_func_opt ::=", - /* 292 */ "agg_func_opt ::= AGGREGATE", - /* 293 */ "bufsize_opt ::=", - /* 294 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 295 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", - /* 296 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 297 */ "stream_options ::=", - /* 298 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 299 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 300 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 301 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 302 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 303 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 304 */ "subtable_opt ::=", - /* 305 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 306 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 307 */ "cmd ::= KILL QUERY NK_STRING", - /* 308 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 309 */ "cmd ::= BALANCE VGROUP", - /* 310 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 311 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 312 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 313 */ "dnode_list ::= DNODE NK_INTEGER", - /* 314 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 315 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 316 */ "cmd ::= query_or_subquery", - /* 317 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 318 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 319 */ "literal ::= NK_INTEGER", - /* 320 */ "literal ::= NK_FLOAT", - /* 321 */ "literal ::= NK_STRING", - /* 322 */ "literal ::= NK_BOOL", - /* 323 */ "literal ::= TIMESTAMP NK_STRING", - /* 324 */ "literal ::= duration_literal", - /* 325 */ "literal ::= NULL", - /* 326 */ "literal ::= NK_QUESTION", - /* 327 */ "duration_literal ::= NK_VARIABLE", - /* 328 */ "signed ::= NK_INTEGER", - /* 329 */ "signed ::= NK_PLUS NK_INTEGER", - /* 330 */ "signed ::= NK_MINUS NK_INTEGER", - /* 331 */ "signed ::= NK_FLOAT", - /* 332 */ "signed ::= NK_PLUS NK_FLOAT", - /* 333 */ "signed ::= NK_MINUS NK_FLOAT", - /* 334 */ "signed_literal ::= signed", - /* 335 */ "signed_literal ::= NK_STRING", - /* 336 */ "signed_literal ::= NK_BOOL", - /* 337 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 338 */ "signed_literal ::= duration_literal", - /* 339 */ "signed_literal ::= NULL", - /* 340 */ "signed_literal ::= literal_func", - /* 341 */ "signed_literal ::= NK_QUESTION", - /* 342 */ "literal_list ::= signed_literal", - /* 343 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 344 */ "db_name ::= NK_ID", - /* 345 */ "table_name ::= NK_ID", - /* 346 */ "column_name ::= NK_ID", - /* 347 */ "function_name ::= NK_ID", - /* 348 */ "table_alias ::= NK_ID", - /* 349 */ "column_alias ::= NK_ID", - /* 350 */ "user_name ::= NK_ID", - /* 351 */ "topic_name ::= NK_ID", - /* 352 */ "stream_name ::= NK_ID", - /* 353 */ "cgroup_name ::= NK_ID", - /* 354 */ "expr_or_subquery ::= expression", - /* 355 */ "expression ::= literal", - /* 356 */ "expression ::= pseudo_column", - /* 357 */ "expression ::= column_reference", - /* 358 */ "expression ::= function_expression", - /* 359 */ "expression ::= case_when_expression", - /* 360 */ "expression ::= NK_LP expression NK_RP", - /* 361 */ "expression ::= NK_PLUS expr_or_subquery", - /* 362 */ "expression ::= NK_MINUS expr_or_subquery", - /* 363 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 364 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 365 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 366 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 367 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 368 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 369 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 370 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 371 */ "expression_list ::= expr_or_subquery", - /* 372 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 373 */ "column_reference ::= column_name", - /* 374 */ "column_reference ::= table_name NK_DOT column_name", - /* 375 */ "pseudo_column ::= ROWTS", - /* 376 */ "pseudo_column ::= TBNAME", - /* 377 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 378 */ "pseudo_column ::= QSTART", - /* 379 */ "pseudo_column ::= QEND", - /* 380 */ "pseudo_column ::= QDURATION", - /* 381 */ "pseudo_column ::= WSTART", - /* 382 */ "pseudo_column ::= WEND", - /* 383 */ "pseudo_column ::= WDURATION", - /* 384 */ "pseudo_column ::= IROWTS", - /* 385 */ "pseudo_column ::= QTAGS", - /* 386 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 387 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 388 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 389 */ "function_expression ::= literal_func", - /* 390 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 391 */ "literal_func ::= NOW", - /* 392 */ "noarg_func ::= NOW", - /* 393 */ "noarg_func ::= TODAY", - /* 394 */ "noarg_func ::= TIMEZONE", - /* 395 */ "noarg_func ::= DATABASE", - /* 396 */ "noarg_func ::= CLIENT_VERSION", - /* 397 */ "noarg_func ::= SERVER_VERSION", - /* 398 */ "noarg_func ::= SERVER_STATUS", - /* 399 */ "noarg_func ::= CURRENT_USER", - /* 400 */ "noarg_func ::= USER", - /* 401 */ "star_func ::= COUNT", - /* 402 */ "star_func ::= FIRST", - /* 403 */ "star_func ::= LAST", - /* 404 */ "star_func ::= LAST_ROW", - /* 405 */ "star_func_para_list ::= NK_STAR", - /* 406 */ "star_func_para_list ::= other_para_list", - /* 407 */ "other_para_list ::= star_func_para", - /* 408 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 409 */ "star_func_para ::= expr_or_subquery", - /* 410 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 411 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 412 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 413 */ "when_then_list ::= when_then_expr", - /* 414 */ "when_then_list ::= when_then_list when_then_expr", - /* 415 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 416 */ "case_when_else_opt ::=", - /* 417 */ "case_when_else_opt ::= ELSE common_expression", - /* 418 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 419 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 420 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 421 */ "predicate ::= expr_or_subquery IS NULL", - /* 422 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 423 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 424 */ "compare_op ::= NK_LT", - /* 425 */ "compare_op ::= NK_GT", - /* 426 */ "compare_op ::= NK_LE", - /* 427 */ "compare_op ::= NK_GE", - /* 428 */ "compare_op ::= NK_NE", - /* 429 */ "compare_op ::= NK_EQ", - /* 430 */ "compare_op ::= LIKE", - /* 431 */ "compare_op ::= NOT LIKE", - /* 432 */ "compare_op ::= MATCH", - /* 433 */ "compare_op ::= NMATCH", - /* 434 */ "compare_op ::= CONTAINS", - /* 435 */ "in_op ::= IN", - /* 436 */ "in_op ::= NOT IN", - /* 437 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 438 */ "boolean_value_expression ::= boolean_primary", - /* 439 */ "boolean_value_expression ::= NOT boolean_primary", - /* 440 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 441 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 442 */ "boolean_primary ::= predicate", - /* 443 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 444 */ "common_expression ::= expr_or_subquery", - /* 445 */ "common_expression ::= boolean_value_expression", - /* 446 */ "from_clause_opt ::=", - /* 447 */ "from_clause_opt ::= FROM table_reference_list", - /* 448 */ "table_reference_list ::= table_reference", - /* 449 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 450 */ "table_reference ::= table_primary", - /* 451 */ "table_reference ::= joined_table", - /* 452 */ "table_primary ::= table_name alias_opt", - /* 453 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 454 */ "table_primary ::= subquery alias_opt", - /* 455 */ "table_primary ::= parenthesized_joined_table", - /* 456 */ "alias_opt ::=", - /* 457 */ "alias_opt ::= table_alias", - /* 458 */ "alias_opt ::= AS table_alias", - /* 459 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 460 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 461 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 462 */ "join_type ::=", - /* 463 */ "join_type ::= INNER", - /* 464 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 465 */ "set_quantifier_opt ::=", - /* 466 */ "set_quantifier_opt ::= DISTINCT", - /* 467 */ "set_quantifier_opt ::= ALL", - /* 468 */ "select_list ::= select_item", - /* 469 */ "select_list ::= select_list NK_COMMA select_item", - /* 470 */ "select_item ::= NK_STAR", - /* 471 */ "select_item ::= common_expression", - /* 472 */ "select_item ::= common_expression column_alias", - /* 473 */ "select_item ::= common_expression AS column_alias", - /* 474 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 475 */ "where_clause_opt ::=", - /* 476 */ "where_clause_opt ::= WHERE search_condition", - /* 477 */ "partition_by_clause_opt ::=", - /* 478 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 479 */ "partition_list ::= partition_item", - /* 480 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 481 */ "partition_item ::= expr_or_subquery", - /* 482 */ "partition_item ::= expr_or_subquery column_alias", - /* 483 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 484 */ "twindow_clause_opt ::=", - /* 485 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 486 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 487 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 488 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 489 */ "sliding_opt ::=", - /* 490 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 491 */ "fill_opt ::=", - /* 492 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 493 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 494 */ "fill_mode ::= NONE", - /* 495 */ "fill_mode ::= PREV", - /* 496 */ "fill_mode ::= NULL", - /* 497 */ "fill_mode ::= LINEAR", - /* 498 */ "fill_mode ::= NEXT", - /* 499 */ "group_by_clause_opt ::=", - /* 500 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 501 */ "group_by_list ::= expr_or_subquery", - /* 502 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 503 */ "having_clause_opt ::=", - /* 504 */ "having_clause_opt ::= HAVING search_condition", - /* 505 */ "range_opt ::=", - /* 506 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 507 */ "every_opt ::=", - /* 508 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 509 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 510 */ "query_simple ::= query_specification", - /* 511 */ "query_simple ::= union_query_expression", - /* 512 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 513 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 514 */ "query_simple_or_subquery ::= query_simple", - /* 515 */ "query_simple_or_subquery ::= subquery", - /* 516 */ "query_or_subquery ::= query_expression", - /* 517 */ "query_or_subquery ::= subquery", - /* 518 */ "order_by_clause_opt ::=", - /* 519 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 520 */ "slimit_clause_opt ::=", - /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 522 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 523 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 524 */ "limit_clause_opt ::=", - /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 526 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 527 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 528 */ "subquery ::= NK_LP query_expression NK_RP", - /* 529 */ "subquery ::= NK_LP subquery NK_RP", - /* 530 */ "search_condition ::= common_expression", - /* 531 */ "sort_specification_list ::= sort_specification", - /* 532 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 533 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 534 */ "ordering_specification_opt ::=", - /* 535 */ "ordering_specification_opt ::= ASC", - /* 536 */ "ordering_specification_opt ::= DESC", - /* 537 */ "null_ordering_opt ::=", - /* 538 */ "null_ordering_opt ::= NULLS FIRST", - /* 539 */ "null_ordering_opt ::= NULLS LAST", + /* 118 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 119 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", + /* 120 */ "integer_list ::= NK_INTEGER", + /* 121 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 122 */ "variable_list ::= NK_VARIABLE", + /* 123 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 124 */ "retention_list ::= retention", + /* 125 */ "retention_list ::= retention_list NK_COMMA retention", + /* 126 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 127 */ "speed_opt ::=", + /* 128 */ "speed_opt ::= MAX_SPEED NK_INTEGER", + /* 129 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 130 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 131 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 132 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 133 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 134 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 135 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 136 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 137 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", + /* 138 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 139 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 140 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 141 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 142 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 143 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 144 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 145 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", + /* 146 */ "multi_create_clause ::= create_subtable_clause", + /* 147 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 148 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", + /* 149 */ "multi_drop_clause ::= drop_table_clause", + /* 150 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 151 */ "drop_table_clause ::= exists_opt full_table_name", + /* 152 */ "specific_cols_opt ::=", + /* 153 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 154 */ "full_table_name ::= table_name", + /* 155 */ "full_table_name ::= db_name NK_DOT table_name", + /* 156 */ "column_def_list ::= column_def", + /* 157 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 158 */ "column_def ::= column_name type_name", + /* 159 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 160 */ "type_name ::= BOOL", + /* 161 */ "type_name ::= TINYINT", + /* 162 */ "type_name ::= SMALLINT", + /* 163 */ "type_name ::= INT", + /* 164 */ "type_name ::= INTEGER", + /* 165 */ "type_name ::= BIGINT", + /* 166 */ "type_name ::= FLOAT", + /* 167 */ "type_name ::= DOUBLE", + /* 168 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 169 */ "type_name ::= TIMESTAMP", + /* 170 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 171 */ "type_name ::= TINYINT UNSIGNED", + /* 172 */ "type_name ::= SMALLINT UNSIGNED", + /* 173 */ "type_name ::= INT UNSIGNED", + /* 174 */ "type_name ::= BIGINT UNSIGNED", + /* 175 */ "type_name ::= JSON", + /* 176 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 177 */ "type_name ::= MEDIUMBLOB", + /* 178 */ "type_name ::= BLOB", + /* 179 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 180 */ "type_name ::= DECIMAL", + /* 181 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 182 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 183 */ "tags_def_opt ::=", + /* 184 */ "tags_def_opt ::= tags_def", + /* 185 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 186 */ "table_options ::=", + /* 187 */ "table_options ::= table_options COMMENT NK_STRING", + /* 188 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 189 */ "table_options ::= table_options WATERMARK duration_list", + /* 190 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 191 */ "table_options ::= table_options TTL NK_INTEGER", + /* 192 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 193 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 194 */ "alter_table_options ::= alter_table_option", + /* 195 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 196 */ "alter_table_option ::= COMMENT NK_STRING", + /* 197 */ "alter_table_option ::= TTL NK_INTEGER", + /* 198 */ "duration_list ::= duration_literal", + /* 199 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 200 */ "rollup_func_list ::= rollup_func_name", + /* 201 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 202 */ "rollup_func_name ::= function_name", + /* 203 */ "rollup_func_name ::= FIRST", + /* 204 */ "rollup_func_name ::= LAST", + /* 205 */ "col_name_list ::= col_name", + /* 206 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 207 */ "col_name ::= column_name", + /* 208 */ "cmd ::= SHOW DNODES", + /* 209 */ "cmd ::= SHOW USERS", + /* 210 */ "cmd ::= SHOW USER PRIVILEGES", + /* 211 */ "cmd ::= SHOW DATABASES", + /* 212 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 213 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 214 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 215 */ "cmd ::= SHOW MNODES", + /* 216 */ "cmd ::= SHOW QNODES", + /* 217 */ "cmd ::= SHOW FUNCTIONS", + /* 218 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 219 */ "cmd ::= SHOW STREAMS", + /* 220 */ "cmd ::= SHOW ACCOUNTS", + /* 221 */ "cmd ::= SHOW APPS", + /* 222 */ "cmd ::= SHOW CONNECTIONS", + /* 223 */ "cmd ::= SHOW LICENCES", + /* 224 */ "cmd ::= SHOW GRANTS", + /* 225 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 226 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 227 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 228 */ "cmd ::= SHOW QUERIES", + /* 229 */ "cmd ::= SHOW SCORES", + /* 230 */ "cmd ::= SHOW TOPICS", + /* 231 */ "cmd ::= SHOW VARIABLES", + /* 232 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 233 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 234 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 235 */ "cmd ::= SHOW BNODES", + /* 236 */ "cmd ::= SHOW SNODES", + /* 237 */ "cmd ::= SHOW CLUSTER", + /* 238 */ "cmd ::= SHOW TRANSACTIONS", + /* 239 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 240 */ "cmd ::= SHOW CONSUMERS", + /* 241 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 242 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 243 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 244 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 245 */ "cmd ::= SHOW VNODES NK_STRING", + /* 246 */ "db_name_cond_opt ::=", + /* 247 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 248 */ "like_pattern_opt ::=", + /* 249 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 250 */ "table_name_cond ::= table_name", + /* 251 */ "from_db_opt ::=", + /* 252 */ "from_db_opt ::= FROM db_name", + /* 253 */ "tag_list_opt ::=", + /* 254 */ "tag_list_opt ::= tag_item", + /* 255 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 256 */ "tag_item ::= TBNAME", + /* 257 */ "tag_item ::= QTAGS", + /* 258 */ "tag_item ::= column_name", + /* 259 */ "tag_item ::= column_name column_alias", + /* 260 */ "tag_item ::= column_name AS column_alias", + /* 261 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", + /* 262 */ "cmd ::= DROP INDEX exists_opt full_table_name", + /* 263 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 264 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", + /* 265 */ "func_list ::= func", + /* 266 */ "func_list ::= func_list NK_COMMA func", + /* 267 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 268 */ "sma_stream_opt ::=", + /* 269 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 270 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 271 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 272 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 277 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 278 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 279 */ "cmd ::= DESC full_table_name", + /* 280 */ "cmd ::= DESCRIBE full_table_name", + /* 281 */ "cmd ::= RESET QUERY CACHE", + /* 282 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 283 */ "analyze_opt ::=", + /* 284 */ "analyze_opt ::= ANALYZE", + /* 285 */ "explain_options ::=", + /* 286 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 287 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 288 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 289 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 290 */ "agg_func_opt ::=", + /* 291 */ "agg_func_opt ::= AGGREGATE", + /* 292 */ "bufsize_opt ::=", + /* 293 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 294 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", + /* 295 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 296 */ "stream_options ::=", + /* 297 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 298 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 299 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 300 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 301 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 302 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 303 */ "subtable_opt ::=", + /* 304 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 305 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 306 */ "cmd ::= KILL QUERY NK_STRING", + /* 307 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 308 */ "cmd ::= BALANCE VGROUP", + /* 309 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 310 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 311 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 312 */ "dnode_list ::= DNODE NK_INTEGER", + /* 313 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 314 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 315 */ "cmd ::= query_or_subquery", + /* 316 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 317 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 318 */ "literal ::= NK_INTEGER", + /* 319 */ "literal ::= NK_FLOAT", + /* 320 */ "literal ::= NK_STRING", + /* 321 */ "literal ::= NK_BOOL", + /* 322 */ "literal ::= TIMESTAMP NK_STRING", + /* 323 */ "literal ::= duration_literal", + /* 324 */ "literal ::= NULL", + /* 325 */ "literal ::= NK_QUESTION", + /* 326 */ "duration_literal ::= NK_VARIABLE", + /* 327 */ "signed ::= NK_INTEGER", + /* 328 */ "signed ::= NK_PLUS NK_INTEGER", + /* 329 */ "signed ::= NK_MINUS NK_INTEGER", + /* 330 */ "signed ::= NK_FLOAT", + /* 331 */ "signed ::= NK_PLUS NK_FLOAT", + /* 332 */ "signed ::= NK_MINUS NK_FLOAT", + /* 333 */ "signed_literal ::= signed", + /* 334 */ "signed_literal ::= NK_STRING", + /* 335 */ "signed_literal ::= NK_BOOL", + /* 336 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 337 */ "signed_literal ::= duration_literal", + /* 338 */ "signed_literal ::= NULL", + /* 339 */ "signed_literal ::= literal_func", + /* 340 */ "signed_literal ::= NK_QUESTION", + /* 341 */ "literal_list ::= signed_literal", + /* 342 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 343 */ "db_name ::= NK_ID", + /* 344 */ "table_name ::= NK_ID", + /* 345 */ "column_name ::= NK_ID", + /* 346 */ "function_name ::= NK_ID", + /* 347 */ "table_alias ::= NK_ID", + /* 348 */ "column_alias ::= NK_ID", + /* 349 */ "user_name ::= NK_ID", + /* 350 */ "topic_name ::= NK_ID", + /* 351 */ "stream_name ::= NK_ID", + /* 352 */ "cgroup_name ::= NK_ID", + /* 353 */ "expr_or_subquery ::= expression", + /* 354 */ "expression ::= literal", + /* 355 */ "expression ::= pseudo_column", + /* 356 */ "expression ::= column_reference", + /* 357 */ "expression ::= function_expression", + /* 358 */ "expression ::= case_when_expression", + /* 359 */ "expression ::= NK_LP expression NK_RP", + /* 360 */ "expression ::= NK_PLUS expr_or_subquery", + /* 361 */ "expression ::= NK_MINUS expr_or_subquery", + /* 362 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 363 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 364 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 365 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 366 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 367 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 368 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 369 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 370 */ "expression_list ::= expr_or_subquery", + /* 371 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 372 */ "column_reference ::= column_name", + /* 373 */ "column_reference ::= table_name NK_DOT column_name", + /* 374 */ "pseudo_column ::= ROWTS", + /* 375 */ "pseudo_column ::= TBNAME", + /* 376 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 377 */ "pseudo_column ::= QSTART", + /* 378 */ "pseudo_column ::= QEND", + /* 379 */ "pseudo_column ::= QDURATION", + /* 380 */ "pseudo_column ::= WSTART", + /* 381 */ "pseudo_column ::= WEND", + /* 382 */ "pseudo_column ::= WDURATION", + /* 383 */ "pseudo_column ::= IROWTS", + /* 384 */ "pseudo_column ::= QTAGS", + /* 385 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 386 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 387 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 388 */ "function_expression ::= literal_func", + /* 389 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 390 */ "literal_func ::= NOW", + /* 391 */ "noarg_func ::= NOW", + /* 392 */ "noarg_func ::= TODAY", + /* 393 */ "noarg_func ::= TIMEZONE", + /* 394 */ "noarg_func ::= DATABASE", + /* 395 */ "noarg_func ::= CLIENT_VERSION", + /* 396 */ "noarg_func ::= SERVER_VERSION", + /* 397 */ "noarg_func ::= SERVER_STATUS", + /* 398 */ "noarg_func ::= CURRENT_USER", + /* 399 */ "noarg_func ::= USER", + /* 400 */ "star_func ::= COUNT", + /* 401 */ "star_func ::= FIRST", + /* 402 */ "star_func ::= LAST", + /* 403 */ "star_func ::= LAST_ROW", + /* 404 */ "star_func_para_list ::= NK_STAR", + /* 405 */ "star_func_para_list ::= other_para_list", + /* 406 */ "other_para_list ::= star_func_para", + /* 407 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 408 */ "star_func_para ::= expr_or_subquery", + /* 409 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 410 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 411 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 412 */ "when_then_list ::= when_then_expr", + /* 413 */ "when_then_list ::= when_then_list when_then_expr", + /* 414 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 415 */ "case_when_else_opt ::=", + /* 416 */ "case_when_else_opt ::= ELSE common_expression", + /* 417 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 418 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 419 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 420 */ "predicate ::= expr_or_subquery IS NULL", + /* 421 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 422 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 423 */ "compare_op ::= NK_LT", + /* 424 */ "compare_op ::= NK_GT", + /* 425 */ "compare_op ::= NK_LE", + /* 426 */ "compare_op ::= NK_GE", + /* 427 */ "compare_op ::= NK_NE", + /* 428 */ "compare_op ::= NK_EQ", + /* 429 */ "compare_op ::= LIKE", + /* 430 */ "compare_op ::= NOT LIKE", + /* 431 */ "compare_op ::= MATCH", + /* 432 */ "compare_op ::= NMATCH", + /* 433 */ "compare_op ::= CONTAINS", + /* 434 */ "in_op ::= IN", + /* 435 */ "in_op ::= NOT IN", + /* 436 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 437 */ "boolean_value_expression ::= boolean_primary", + /* 438 */ "boolean_value_expression ::= NOT boolean_primary", + /* 439 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 440 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 441 */ "boolean_primary ::= predicate", + /* 442 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 443 */ "common_expression ::= expr_or_subquery", + /* 444 */ "common_expression ::= boolean_value_expression", + /* 445 */ "from_clause_opt ::=", + /* 446 */ "from_clause_opt ::= FROM table_reference_list", + /* 447 */ "table_reference_list ::= table_reference", + /* 448 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 449 */ "table_reference ::= table_primary", + /* 450 */ "table_reference ::= joined_table", + /* 451 */ "table_primary ::= table_name alias_opt", + /* 452 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 453 */ "table_primary ::= subquery alias_opt", + /* 454 */ "table_primary ::= parenthesized_joined_table", + /* 455 */ "alias_opt ::=", + /* 456 */ "alias_opt ::= table_alias", + /* 457 */ "alias_opt ::= AS table_alias", + /* 458 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 459 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 460 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 461 */ "join_type ::=", + /* 462 */ "join_type ::= INNER", + /* 463 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 464 */ "set_quantifier_opt ::=", + /* 465 */ "set_quantifier_opt ::= DISTINCT", + /* 466 */ "set_quantifier_opt ::= ALL", + /* 467 */ "select_list ::= select_item", + /* 468 */ "select_list ::= select_list NK_COMMA select_item", + /* 469 */ "select_item ::= NK_STAR", + /* 470 */ "select_item ::= common_expression", + /* 471 */ "select_item ::= common_expression column_alias", + /* 472 */ "select_item ::= common_expression AS column_alias", + /* 473 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 474 */ "where_clause_opt ::=", + /* 475 */ "where_clause_opt ::= WHERE search_condition", + /* 476 */ "partition_by_clause_opt ::=", + /* 477 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 478 */ "partition_list ::= partition_item", + /* 479 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 480 */ "partition_item ::= expr_or_subquery", + /* 481 */ "partition_item ::= expr_or_subquery column_alias", + /* 482 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 483 */ "twindow_clause_opt ::=", + /* 484 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 485 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 486 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 487 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 488 */ "sliding_opt ::=", + /* 489 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 490 */ "fill_opt ::=", + /* 491 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 492 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 493 */ "fill_mode ::= NONE", + /* 494 */ "fill_mode ::= PREV", + /* 495 */ "fill_mode ::= NULL", + /* 496 */ "fill_mode ::= LINEAR", + /* 497 */ "fill_mode ::= NEXT", + /* 498 */ "group_by_clause_opt ::=", + /* 499 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 500 */ "group_by_list ::= expr_or_subquery", + /* 501 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 502 */ "having_clause_opt ::=", + /* 503 */ "having_clause_opt ::= HAVING search_condition", + /* 504 */ "range_opt ::=", + /* 505 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 506 */ "every_opt ::=", + /* 507 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 508 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 509 */ "query_simple ::= query_specification", + /* 510 */ "query_simple ::= union_query_expression", + /* 511 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 512 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 513 */ "query_simple_or_subquery ::= query_simple", + /* 514 */ "query_simple_or_subquery ::= subquery", + /* 515 */ "query_or_subquery ::= query_expression", + /* 516 */ "query_or_subquery ::= subquery", + /* 517 */ "order_by_clause_opt ::=", + /* 518 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 519 */ "slimit_clause_opt ::=", + /* 520 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 522 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 523 */ "limit_clause_opt ::=", + /* 524 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 526 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 527 */ "subquery ::= NK_LP query_expression NK_RP", + /* 528 */ "subquery ::= NK_LP subquery NK_RP", + /* 529 */ "search_condition ::= common_expression", + /* 530 */ "sort_specification_list ::= sort_specification", + /* 531 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 532 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 533 */ "ordering_specification_opt ::=", + /* 534 */ "ordering_specification_opt ::= ASC", + /* 535 */ "ordering_specification_opt ::= DESC", + /* 536 */ "null_ordering_opt ::=", + /* 537 */ "null_ordering_opt ::= NULLS FIRST", + /* 538 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -3065,428 +3063,427 @@ static const struct { { 345, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ { 345, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ { 345, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ - { 345, -2 }, /* (118) alter_db_option ::= STRICT NK_STRING */ - { 345, -2 }, /* (119) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 345, -2 }, /* (120) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - { 342, -1 }, /* (121) integer_list ::= NK_INTEGER */ - { 342, -3 }, /* (122) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 343, -1 }, /* (123) variable_list ::= NK_VARIABLE */ - { 343, -3 }, /* (124) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 344, -1 }, /* (125) retention_list ::= retention */ - { 344, -3 }, /* (126) retention_list ::= retention_list NK_COMMA retention */ - { 346, -3 }, /* (127) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 341, 0 }, /* (128) speed_opt ::= */ - { 341, -2 }, /* (129) speed_opt ::= MAX_SPEED NK_INTEGER */ - { 322, -9 }, /* (130) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 322, -3 }, /* (131) cmd ::= CREATE TABLE multi_create_clause */ - { 322, -9 }, /* (132) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 322, -3 }, /* (133) cmd ::= DROP TABLE multi_drop_clause */ - { 322, -4 }, /* (134) cmd ::= DROP STABLE exists_opt full_table_name */ - { 322, -3 }, /* (135) cmd ::= ALTER TABLE alter_table_clause */ - { 322, -3 }, /* (136) cmd ::= ALTER STABLE alter_table_clause */ - { 354, -2 }, /* (137) alter_table_clause ::= full_table_name alter_table_options */ - { 354, -5 }, /* (138) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 354, -4 }, /* (139) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 354, -5 }, /* (140) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 354, -5 }, /* (141) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 354, -5 }, /* (142) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 354, -4 }, /* (143) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 354, -5 }, /* (144) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 354, -5 }, /* (145) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 354, -6 }, /* (146) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 351, -1 }, /* (147) multi_create_clause ::= create_subtable_clause */ - { 351, -2 }, /* (148) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 359, -10 }, /* (149) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - { 353, -1 }, /* (150) multi_drop_clause ::= drop_table_clause */ - { 353, -2 }, /* (151) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 362, -2 }, /* (152) drop_table_clause ::= exists_opt full_table_name */ - { 360, 0 }, /* (153) specific_cols_opt ::= */ - { 360, -3 }, /* (154) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 347, -1 }, /* (155) full_table_name ::= table_name */ - { 347, -3 }, /* (156) full_table_name ::= db_name NK_DOT table_name */ - { 348, -1 }, /* (157) column_def_list ::= column_def */ - { 348, -3 }, /* (158) column_def_list ::= column_def_list NK_COMMA column_def */ - { 365, -2 }, /* (159) column_def ::= column_name type_name */ - { 365, -4 }, /* (160) column_def ::= column_name type_name COMMENT NK_STRING */ - { 357, -1 }, /* (161) type_name ::= BOOL */ - { 357, -1 }, /* (162) type_name ::= TINYINT */ - { 357, -1 }, /* (163) type_name ::= SMALLINT */ - { 357, -1 }, /* (164) type_name ::= INT */ - { 357, -1 }, /* (165) type_name ::= INTEGER */ - { 357, -1 }, /* (166) type_name ::= BIGINT */ - { 357, -1 }, /* (167) type_name ::= FLOAT */ - { 357, -1 }, /* (168) type_name ::= DOUBLE */ - { 357, -4 }, /* (169) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 357, -1 }, /* (170) type_name ::= TIMESTAMP */ - { 357, -4 }, /* (171) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 357, -2 }, /* (172) type_name ::= TINYINT UNSIGNED */ - { 357, -2 }, /* (173) type_name ::= SMALLINT UNSIGNED */ - { 357, -2 }, /* (174) type_name ::= INT UNSIGNED */ - { 357, -2 }, /* (175) type_name ::= BIGINT UNSIGNED */ - { 357, -1 }, /* (176) type_name ::= JSON */ - { 357, -4 }, /* (177) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 357, -1 }, /* (178) type_name ::= MEDIUMBLOB */ - { 357, -1 }, /* (179) type_name ::= BLOB */ - { 357, -4 }, /* (180) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 357, -1 }, /* (181) type_name ::= DECIMAL */ - { 357, -4 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 357, -6 }, /* (183) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 349, 0 }, /* (184) tags_def_opt ::= */ - { 349, -1 }, /* (185) tags_def_opt ::= tags_def */ - { 352, -4 }, /* (186) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 350, 0 }, /* (187) table_options ::= */ - { 350, -3 }, /* (188) table_options ::= table_options COMMENT NK_STRING */ - { 350, -3 }, /* (189) table_options ::= table_options MAX_DELAY duration_list */ - { 350, -3 }, /* (190) table_options ::= table_options WATERMARK duration_list */ - { 350, -5 }, /* (191) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 350, -3 }, /* (192) table_options ::= table_options TTL NK_INTEGER */ - { 350, -5 }, /* (193) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 350, -3 }, /* (194) table_options ::= table_options DELETE_MARK duration_list */ - { 355, -1 }, /* (195) alter_table_options ::= alter_table_option */ - { 355, -2 }, /* (196) alter_table_options ::= alter_table_options alter_table_option */ - { 368, -2 }, /* (197) alter_table_option ::= COMMENT NK_STRING */ - { 368, -2 }, /* (198) alter_table_option ::= TTL NK_INTEGER */ - { 366, -1 }, /* (199) duration_list ::= duration_literal */ - { 366, -3 }, /* (200) duration_list ::= duration_list NK_COMMA duration_literal */ - { 367, -1 }, /* (201) rollup_func_list ::= rollup_func_name */ - { 367, -3 }, /* (202) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 370, -1 }, /* (203) rollup_func_name ::= function_name */ - { 370, -1 }, /* (204) rollup_func_name ::= FIRST */ - { 370, -1 }, /* (205) rollup_func_name ::= LAST */ - { 363, -1 }, /* (206) col_name_list ::= col_name */ - { 363, -3 }, /* (207) col_name_list ::= col_name_list NK_COMMA col_name */ - { 372, -1 }, /* (208) col_name ::= column_name */ - { 322, -2 }, /* (209) cmd ::= SHOW DNODES */ - { 322, -2 }, /* (210) cmd ::= SHOW USERS */ - { 322, -3 }, /* (211) cmd ::= SHOW USER PRIVILEGES */ - { 322, -2 }, /* (212) cmd ::= SHOW DATABASES */ - { 322, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 322, -4 }, /* (214) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 322, -3 }, /* (215) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 322, -2 }, /* (216) cmd ::= SHOW MNODES */ - { 322, -2 }, /* (217) cmd ::= SHOW QNODES */ - { 322, -2 }, /* (218) cmd ::= SHOW FUNCTIONS */ - { 322, -5 }, /* (219) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 322, -2 }, /* (220) cmd ::= SHOW STREAMS */ - { 322, -2 }, /* (221) cmd ::= SHOW ACCOUNTS */ - { 322, -2 }, /* (222) cmd ::= SHOW APPS */ - { 322, -2 }, /* (223) cmd ::= SHOW CONNECTIONS */ - { 322, -2 }, /* (224) cmd ::= SHOW LICENCES */ - { 322, -2 }, /* (225) cmd ::= SHOW GRANTS */ - { 322, -4 }, /* (226) cmd ::= SHOW CREATE DATABASE db_name */ - { 322, -4 }, /* (227) cmd ::= SHOW CREATE TABLE full_table_name */ - { 322, -4 }, /* (228) cmd ::= SHOW CREATE STABLE full_table_name */ - { 322, -2 }, /* (229) cmd ::= SHOW QUERIES */ - { 322, -2 }, /* (230) cmd ::= SHOW SCORES */ - { 322, -2 }, /* (231) cmd ::= SHOW TOPICS */ - { 322, -2 }, /* (232) cmd ::= SHOW VARIABLES */ - { 322, -3 }, /* (233) cmd ::= SHOW CLUSTER VARIABLES */ - { 322, -3 }, /* (234) cmd ::= SHOW LOCAL VARIABLES */ - { 322, -5 }, /* (235) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - { 322, -2 }, /* (236) cmd ::= SHOW BNODES */ - { 322, -2 }, /* (237) cmd ::= SHOW SNODES */ - { 322, -2 }, /* (238) cmd ::= SHOW CLUSTER */ - { 322, -2 }, /* (239) cmd ::= SHOW TRANSACTIONS */ - { 322, -4 }, /* (240) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 322, -2 }, /* (241) cmd ::= SHOW CONSUMERS */ - { 322, -2 }, /* (242) cmd ::= SHOW SUBSCRIPTIONS */ - { 322, -5 }, /* (243) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 322, -7 }, /* (244) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - { 322, -3 }, /* (245) cmd ::= SHOW VNODES NK_INTEGER */ - { 322, -3 }, /* (246) cmd ::= SHOW VNODES NK_STRING */ - { 373, 0 }, /* (247) db_name_cond_opt ::= */ - { 373, -2 }, /* (248) db_name_cond_opt ::= db_name NK_DOT */ - { 374, 0 }, /* (249) like_pattern_opt ::= */ - { 374, -2 }, /* (250) like_pattern_opt ::= LIKE NK_STRING */ - { 375, -1 }, /* (251) table_name_cond ::= table_name */ - { 376, 0 }, /* (252) from_db_opt ::= */ - { 376, -2 }, /* (253) from_db_opt ::= FROM db_name */ - { 377, 0 }, /* (254) tag_list_opt ::= */ - { 377, -1 }, /* (255) tag_list_opt ::= tag_item */ - { 377, -3 }, /* (256) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - { 378, -1 }, /* (257) tag_item ::= TBNAME */ - { 378, -1 }, /* (258) tag_item ::= QTAGS */ - { 378, -1 }, /* (259) tag_item ::= column_name */ - { 378, -2 }, /* (260) tag_item ::= column_name column_alias */ - { 378, -3 }, /* (261) tag_item ::= column_name AS column_alias */ - { 322, -8 }, /* (262) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 322, -4 }, /* (263) cmd ::= DROP INDEX exists_opt full_table_name */ - { 380, -10 }, /* (264) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 380, -12 }, /* (265) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - { 381, -1 }, /* (266) func_list ::= func */ - { 381, -3 }, /* (267) func_list ::= func_list NK_COMMA func */ - { 384, -4 }, /* (268) func ::= function_name NK_LP expression_list NK_RP */ - { 383, 0 }, /* (269) sma_stream_opt ::= */ - { 383, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - { 383, -3 }, /* (271) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - { 383, -3 }, /* (272) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - { 322, -6 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - { 322, -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 322, -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 322, -7 }, /* (276) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 322, -9 }, /* (277) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 322, -4 }, /* (278) cmd ::= DROP TOPIC exists_opt topic_name */ - { 322, -7 }, /* (279) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 322, -2 }, /* (280) cmd ::= DESC full_table_name */ - { 322, -2 }, /* (281) cmd ::= DESCRIBE full_table_name */ - { 322, -3 }, /* (282) cmd ::= RESET QUERY CACHE */ - { 322, -4 }, /* (283) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - { 387, 0 }, /* (284) analyze_opt ::= */ - { 387, -1 }, /* (285) analyze_opt ::= ANALYZE */ - { 388, 0 }, /* (286) explain_options ::= */ - { 388, -3 }, /* (287) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 388, -3 }, /* (288) explain_options ::= explain_options RATIO NK_FLOAT */ - { 322, -10 }, /* (289) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 322, -4 }, /* (290) cmd ::= DROP FUNCTION exists_opt function_name */ - { 389, 0 }, /* (291) agg_func_opt ::= */ - { 389, -1 }, /* (292) agg_func_opt ::= AGGREGATE */ - { 390, 0 }, /* (293) bufsize_opt ::= */ - { 390, -2 }, /* (294) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 322, -11 }, /* (295) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ - { 322, -4 }, /* (296) cmd ::= DROP STREAM exists_opt stream_name */ - { 392, 0 }, /* (297) stream_options ::= */ - { 392, -3 }, /* (298) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 392, -3 }, /* (299) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 392, -4 }, /* (300) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 392, -3 }, /* (301) stream_options ::= stream_options WATERMARK duration_literal */ - { 392, -4 }, /* (302) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 392, -3 }, /* (303) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - { 393, 0 }, /* (304) subtable_opt ::= */ - { 393, -4 }, /* (305) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 322, -3 }, /* (306) cmd ::= KILL CONNECTION NK_INTEGER */ - { 322, -3 }, /* (307) cmd ::= KILL QUERY NK_STRING */ - { 322, -3 }, /* (308) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 322, -2 }, /* (309) cmd ::= BALANCE VGROUP */ - { 322, -4 }, /* (310) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 322, -4 }, /* (311) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 322, -3 }, /* (312) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 395, -2 }, /* (313) dnode_list ::= DNODE NK_INTEGER */ - { 395, -3 }, /* (314) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 322, -4 }, /* (315) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 322, -1 }, /* (316) cmd ::= query_or_subquery */ - { 322, -7 }, /* (317) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 322, -4 }, /* (318) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 325, -1 }, /* (319) literal ::= NK_INTEGER */ - { 325, -1 }, /* (320) literal ::= NK_FLOAT */ - { 325, -1 }, /* (321) literal ::= NK_STRING */ - { 325, -1 }, /* (322) literal ::= NK_BOOL */ - { 325, -2 }, /* (323) literal ::= TIMESTAMP NK_STRING */ - { 325, -1 }, /* (324) literal ::= duration_literal */ - { 325, -1 }, /* (325) literal ::= NULL */ - { 325, -1 }, /* (326) literal ::= NK_QUESTION */ - { 369, -1 }, /* (327) duration_literal ::= NK_VARIABLE */ - { 397, -1 }, /* (328) signed ::= NK_INTEGER */ - { 397, -2 }, /* (329) signed ::= NK_PLUS NK_INTEGER */ - { 397, -2 }, /* (330) signed ::= NK_MINUS NK_INTEGER */ - { 397, -1 }, /* (331) signed ::= NK_FLOAT */ - { 397, -2 }, /* (332) signed ::= NK_PLUS NK_FLOAT */ - { 397, -2 }, /* (333) signed ::= NK_MINUS NK_FLOAT */ - { 358, -1 }, /* (334) signed_literal ::= signed */ - { 358, -1 }, /* (335) signed_literal ::= NK_STRING */ - { 358, -1 }, /* (336) signed_literal ::= NK_BOOL */ - { 358, -2 }, /* (337) signed_literal ::= TIMESTAMP NK_STRING */ - { 358, -1 }, /* (338) signed_literal ::= duration_literal */ - { 358, -1 }, /* (339) signed_literal ::= NULL */ - { 358, -1 }, /* (340) signed_literal ::= literal_func */ - { 358, -1 }, /* (341) signed_literal ::= NK_QUESTION */ - { 399, -1 }, /* (342) literal_list ::= signed_literal */ - { 399, -3 }, /* (343) literal_list ::= literal_list NK_COMMA signed_literal */ - { 333, -1 }, /* (344) db_name ::= NK_ID */ - { 364, -1 }, /* (345) table_name ::= NK_ID */ - { 356, -1 }, /* (346) column_name ::= NK_ID */ - { 371, -1 }, /* (347) function_name ::= NK_ID */ - { 400, -1 }, /* (348) table_alias ::= NK_ID */ - { 379, -1 }, /* (349) column_alias ::= NK_ID */ - { 327, -1 }, /* (350) user_name ::= NK_ID */ - { 334, -1 }, /* (351) topic_name ::= NK_ID */ - { 391, -1 }, /* (352) stream_name ::= NK_ID */ - { 386, -1 }, /* (353) cgroup_name ::= NK_ID */ - { 401, -1 }, /* (354) expr_or_subquery ::= expression */ - { 394, -1 }, /* (355) expression ::= literal */ - { 394, -1 }, /* (356) expression ::= pseudo_column */ - { 394, -1 }, /* (357) expression ::= column_reference */ - { 394, -1 }, /* (358) expression ::= function_expression */ - { 394, -1 }, /* (359) expression ::= case_when_expression */ - { 394, -3 }, /* (360) expression ::= NK_LP expression NK_RP */ - { 394, -2 }, /* (361) expression ::= NK_PLUS expr_or_subquery */ - { 394, -2 }, /* (362) expression ::= NK_MINUS expr_or_subquery */ - { 394, -3 }, /* (363) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 394, -3 }, /* (364) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 394, -3 }, /* (365) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 394, -3 }, /* (366) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 394, -3 }, /* (367) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 394, -3 }, /* (368) expression ::= column_reference NK_ARROW NK_STRING */ - { 394, -3 }, /* (369) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 394, -3 }, /* (370) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 361, -1 }, /* (371) expression_list ::= expr_or_subquery */ - { 361, -3 }, /* (372) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 403, -1 }, /* (373) column_reference ::= column_name */ - { 403, -3 }, /* (374) column_reference ::= table_name NK_DOT column_name */ - { 402, -1 }, /* (375) pseudo_column ::= ROWTS */ - { 402, -1 }, /* (376) pseudo_column ::= TBNAME */ - { 402, -3 }, /* (377) pseudo_column ::= table_name NK_DOT TBNAME */ - { 402, -1 }, /* (378) pseudo_column ::= QSTART */ - { 402, -1 }, /* (379) pseudo_column ::= QEND */ - { 402, -1 }, /* (380) pseudo_column ::= QDURATION */ - { 402, -1 }, /* (381) pseudo_column ::= WSTART */ - { 402, -1 }, /* (382) pseudo_column ::= WEND */ - { 402, -1 }, /* (383) pseudo_column ::= WDURATION */ - { 402, -1 }, /* (384) pseudo_column ::= IROWTS */ - { 402, -1 }, /* (385) pseudo_column ::= QTAGS */ - { 404, -4 }, /* (386) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 404, -4 }, /* (387) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 404, -6 }, /* (388) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 404, -1 }, /* (389) function_expression ::= literal_func */ - { 398, -3 }, /* (390) literal_func ::= noarg_func NK_LP NK_RP */ - { 398, -1 }, /* (391) literal_func ::= NOW */ - { 408, -1 }, /* (392) noarg_func ::= NOW */ - { 408, -1 }, /* (393) noarg_func ::= TODAY */ - { 408, -1 }, /* (394) noarg_func ::= TIMEZONE */ - { 408, -1 }, /* (395) noarg_func ::= DATABASE */ - { 408, -1 }, /* (396) noarg_func ::= CLIENT_VERSION */ - { 408, -1 }, /* (397) noarg_func ::= SERVER_VERSION */ - { 408, -1 }, /* (398) noarg_func ::= SERVER_STATUS */ - { 408, -1 }, /* (399) noarg_func ::= CURRENT_USER */ - { 408, -1 }, /* (400) noarg_func ::= USER */ - { 406, -1 }, /* (401) star_func ::= COUNT */ - { 406, -1 }, /* (402) star_func ::= FIRST */ - { 406, -1 }, /* (403) star_func ::= LAST */ - { 406, -1 }, /* (404) star_func ::= LAST_ROW */ - { 407, -1 }, /* (405) star_func_para_list ::= NK_STAR */ - { 407, -1 }, /* (406) star_func_para_list ::= other_para_list */ - { 409, -1 }, /* (407) other_para_list ::= star_func_para */ - { 409, -3 }, /* (408) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 410, -1 }, /* (409) star_func_para ::= expr_or_subquery */ - { 410, -3 }, /* (410) star_func_para ::= table_name NK_DOT NK_STAR */ - { 405, -4 }, /* (411) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 405, -5 }, /* (412) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 411, -1 }, /* (413) when_then_list ::= when_then_expr */ - { 411, -2 }, /* (414) when_then_list ::= when_then_list when_then_expr */ - { 414, -4 }, /* (415) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 412, 0 }, /* (416) case_when_else_opt ::= */ - { 412, -2 }, /* (417) case_when_else_opt ::= ELSE common_expression */ - { 415, -3 }, /* (418) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 415, -5 }, /* (419) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 415, -6 }, /* (420) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 415, -3 }, /* (421) predicate ::= expr_or_subquery IS NULL */ - { 415, -4 }, /* (422) predicate ::= expr_or_subquery IS NOT NULL */ - { 415, -3 }, /* (423) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 416, -1 }, /* (424) compare_op ::= NK_LT */ - { 416, -1 }, /* (425) compare_op ::= NK_GT */ - { 416, -1 }, /* (426) compare_op ::= NK_LE */ - { 416, -1 }, /* (427) compare_op ::= NK_GE */ - { 416, -1 }, /* (428) compare_op ::= NK_NE */ - { 416, -1 }, /* (429) compare_op ::= NK_EQ */ - { 416, -1 }, /* (430) compare_op ::= LIKE */ - { 416, -2 }, /* (431) compare_op ::= NOT LIKE */ - { 416, -1 }, /* (432) compare_op ::= MATCH */ - { 416, -1 }, /* (433) compare_op ::= NMATCH */ - { 416, -1 }, /* (434) compare_op ::= CONTAINS */ - { 417, -1 }, /* (435) in_op ::= IN */ - { 417, -2 }, /* (436) in_op ::= NOT IN */ - { 418, -3 }, /* (437) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 419, -1 }, /* (438) boolean_value_expression ::= boolean_primary */ - { 419, -2 }, /* (439) boolean_value_expression ::= NOT boolean_primary */ - { 419, -3 }, /* (440) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 419, -3 }, /* (441) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 420, -1 }, /* (442) boolean_primary ::= predicate */ - { 420, -3 }, /* (443) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 413, -1 }, /* (444) common_expression ::= expr_or_subquery */ - { 413, -1 }, /* (445) common_expression ::= boolean_value_expression */ - { 421, 0 }, /* (446) from_clause_opt ::= */ - { 421, -2 }, /* (447) from_clause_opt ::= FROM table_reference_list */ - { 422, -1 }, /* (448) table_reference_list ::= table_reference */ - { 422, -3 }, /* (449) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 423, -1 }, /* (450) table_reference ::= table_primary */ - { 423, -1 }, /* (451) table_reference ::= joined_table */ - { 424, -2 }, /* (452) table_primary ::= table_name alias_opt */ - { 424, -4 }, /* (453) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 424, -2 }, /* (454) table_primary ::= subquery alias_opt */ - { 424, -1 }, /* (455) table_primary ::= parenthesized_joined_table */ - { 426, 0 }, /* (456) alias_opt ::= */ - { 426, -1 }, /* (457) alias_opt ::= table_alias */ - { 426, -2 }, /* (458) alias_opt ::= AS table_alias */ - { 428, -3 }, /* (459) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 428, -3 }, /* (460) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 425, -6 }, /* (461) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 429, 0 }, /* (462) join_type ::= */ - { 429, -1 }, /* (463) join_type ::= INNER */ - { 431, -12 }, /* (464) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 432, 0 }, /* (465) set_quantifier_opt ::= */ - { 432, -1 }, /* (466) set_quantifier_opt ::= DISTINCT */ - { 432, -1 }, /* (467) set_quantifier_opt ::= ALL */ - { 433, -1 }, /* (468) select_list ::= select_item */ - { 433, -3 }, /* (469) select_list ::= select_list NK_COMMA select_item */ - { 441, -1 }, /* (470) select_item ::= NK_STAR */ - { 441, -1 }, /* (471) select_item ::= common_expression */ - { 441, -2 }, /* (472) select_item ::= common_expression column_alias */ - { 441, -3 }, /* (473) select_item ::= common_expression AS column_alias */ - { 441, -3 }, /* (474) select_item ::= table_name NK_DOT NK_STAR */ - { 396, 0 }, /* (475) where_clause_opt ::= */ - { 396, -2 }, /* (476) where_clause_opt ::= WHERE search_condition */ - { 434, 0 }, /* (477) partition_by_clause_opt ::= */ - { 434, -3 }, /* (478) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 442, -1 }, /* (479) partition_list ::= partition_item */ - { 442, -3 }, /* (480) partition_list ::= partition_list NK_COMMA partition_item */ - { 443, -1 }, /* (481) partition_item ::= expr_or_subquery */ - { 443, -2 }, /* (482) partition_item ::= expr_or_subquery column_alias */ - { 443, -3 }, /* (483) partition_item ::= expr_or_subquery AS column_alias */ - { 438, 0 }, /* (484) twindow_clause_opt ::= */ - { 438, -6 }, /* (485) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 438, -4 }, /* (486) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 438, -6 }, /* (487) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 438, -8 }, /* (488) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 382, 0 }, /* (489) sliding_opt ::= */ - { 382, -4 }, /* (490) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 437, 0 }, /* (491) fill_opt ::= */ - { 437, -4 }, /* (492) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 437, -6 }, /* (493) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 444, -1 }, /* (494) fill_mode ::= NONE */ - { 444, -1 }, /* (495) fill_mode ::= PREV */ - { 444, -1 }, /* (496) fill_mode ::= NULL */ - { 444, -1 }, /* (497) fill_mode ::= LINEAR */ - { 444, -1 }, /* (498) fill_mode ::= NEXT */ - { 439, 0 }, /* (499) group_by_clause_opt ::= */ - { 439, -3 }, /* (500) group_by_clause_opt ::= GROUP BY group_by_list */ - { 445, -1 }, /* (501) group_by_list ::= expr_or_subquery */ - { 445, -3 }, /* (502) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 440, 0 }, /* (503) having_clause_opt ::= */ - { 440, -2 }, /* (504) having_clause_opt ::= HAVING search_condition */ - { 435, 0 }, /* (505) range_opt ::= */ - { 435, -6 }, /* (506) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 436, 0 }, /* (507) every_opt ::= */ - { 436, -4 }, /* (508) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 446, -4 }, /* (509) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 447, -1 }, /* (510) query_simple ::= query_specification */ - { 447, -1 }, /* (511) query_simple ::= union_query_expression */ - { 451, -4 }, /* (512) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 451, -3 }, /* (513) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 452, -1 }, /* (514) query_simple_or_subquery ::= query_simple */ - { 452, -1 }, /* (515) query_simple_or_subquery ::= subquery */ - { 385, -1 }, /* (516) query_or_subquery ::= query_expression */ - { 385, -1 }, /* (517) query_or_subquery ::= subquery */ - { 448, 0 }, /* (518) order_by_clause_opt ::= */ - { 448, -3 }, /* (519) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 449, 0 }, /* (520) slimit_clause_opt ::= */ - { 449, -2 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 449, -4 }, /* (522) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 449, -4 }, /* (523) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 450, 0 }, /* (524) limit_clause_opt ::= */ - { 450, -2 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 450, -4 }, /* (526) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 450, -4 }, /* (527) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 427, -3 }, /* (528) subquery ::= NK_LP query_expression NK_RP */ - { 427, -3 }, /* (529) subquery ::= NK_LP subquery NK_RP */ - { 430, -1 }, /* (530) search_condition ::= common_expression */ - { 453, -1 }, /* (531) sort_specification_list ::= sort_specification */ - { 453, -3 }, /* (532) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 454, -3 }, /* (533) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 455, 0 }, /* (534) ordering_specification_opt ::= */ - { 455, -1 }, /* (535) ordering_specification_opt ::= ASC */ - { 455, -1 }, /* (536) ordering_specification_opt ::= DESC */ - { 456, 0 }, /* (537) null_ordering_opt ::= */ - { 456, -2 }, /* (538) null_ordering_opt ::= NULLS FIRST */ - { 456, -2 }, /* (539) null_ordering_opt ::= NULLS LAST */ + { 345, -2 }, /* (118) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { 345, -2 }, /* (119) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + { 342, -1 }, /* (120) integer_list ::= NK_INTEGER */ + { 342, -3 }, /* (121) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 343, -1 }, /* (122) variable_list ::= NK_VARIABLE */ + { 343, -3 }, /* (123) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 344, -1 }, /* (124) retention_list ::= retention */ + { 344, -3 }, /* (125) retention_list ::= retention_list NK_COMMA retention */ + { 346, -3 }, /* (126) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 341, 0 }, /* (127) speed_opt ::= */ + { 341, -2 }, /* (128) speed_opt ::= MAX_SPEED NK_INTEGER */ + { 322, -9 }, /* (129) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 322, -3 }, /* (130) cmd ::= CREATE TABLE multi_create_clause */ + { 322, -9 }, /* (131) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 322, -3 }, /* (132) cmd ::= DROP TABLE multi_drop_clause */ + { 322, -4 }, /* (133) cmd ::= DROP STABLE exists_opt full_table_name */ + { 322, -3 }, /* (134) cmd ::= ALTER TABLE alter_table_clause */ + { 322, -3 }, /* (135) cmd ::= ALTER STABLE alter_table_clause */ + { 354, -2 }, /* (136) alter_table_clause ::= full_table_name alter_table_options */ + { 354, -5 }, /* (137) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 354, -4 }, /* (138) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 354, -5 }, /* (139) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 354, -5 }, /* (140) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 354, -5 }, /* (141) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 354, -4 }, /* (142) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 354, -5 }, /* (143) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 354, -5 }, /* (144) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 354, -6 }, /* (145) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 351, -1 }, /* (146) multi_create_clause ::= create_subtable_clause */ + { 351, -2 }, /* (147) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 359, -10 }, /* (148) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + { 353, -1 }, /* (149) multi_drop_clause ::= drop_table_clause */ + { 353, -2 }, /* (150) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 362, -2 }, /* (151) drop_table_clause ::= exists_opt full_table_name */ + { 360, 0 }, /* (152) specific_cols_opt ::= */ + { 360, -3 }, /* (153) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + { 347, -1 }, /* (154) full_table_name ::= table_name */ + { 347, -3 }, /* (155) full_table_name ::= db_name NK_DOT table_name */ + { 348, -1 }, /* (156) column_def_list ::= column_def */ + { 348, -3 }, /* (157) column_def_list ::= column_def_list NK_COMMA column_def */ + { 365, -2 }, /* (158) column_def ::= column_name type_name */ + { 365, -4 }, /* (159) column_def ::= column_name type_name COMMENT NK_STRING */ + { 357, -1 }, /* (160) type_name ::= BOOL */ + { 357, -1 }, /* (161) type_name ::= TINYINT */ + { 357, -1 }, /* (162) type_name ::= SMALLINT */ + { 357, -1 }, /* (163) type_name ::= INT */ + { 357, -1 }, /* (164) type_name ::= INTEGER */ + { 357, -1 }, /* (165) type_name ::= BIGINT */ + { 357, -1 }, /* (166) type_name ::= FLOAT */ + { 357, -1 }, /* (167) type_name ::= DOUBLE */ + { 357, -4 }, /* (168) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (169) type_name ::= TIMESTAMP */ + { 357, -4 }, /* (170) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 357, -2 }, /* (171) type_name ::= TINYINT UNSIGNED */ + { 357, -2 }, /* (172) type_name ::= SMALLINT UNSIGNED */ + { 357, -2 }, /* (173) type_name ::= INT UNSIGNED */ + { 357, -2 }, /* (174) type_name ::= BIGINT UNSIGNED */ + { 357, -1 }, /* (175) type_name ::= JSON */ + { 357, -4 }, /* (176) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (177) type_name ::= MEDIUMBLOB */ + { 357, -1 }, /* (178) type_name ::= BLOB */ + { 357, -4 }, /* (179) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (180) type_name ::= DECIMAL */ + { 357, -4 }, /* (181) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 357, -6 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 349, 0 }, /* (183) tags_def_opt ::= */ + { 349, -1 }, /* (184) tags_def_opt ::= tags_def */ + { 352, -4 }, /* (185) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 350, 0 }, /* (186) table_options ::= */ + { 350, -3 }, /* (187) table_options ::= table_options COMMENT NK_STRING */ + { 350, -3 }, /* (188) table_options ::= table_options MAX_DELAY duration_list */ + { 350, -3 }, /* (189) table_options ::= table_options WATERMARK duration_list */ + { 350, -5 }, /* (190) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 350, -3 }, /* (191) table_options ::= table_options TTL NK_INTEGER */ + { 350, -5 }, /* (192) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 350, -3 }, /* (193) table_options ::= table_options DELETE_MARK duration_list */ + { 355, -1 }, /* (194) alter_table_options ::= alter_table_option */ + { 355, -2 }, /* (195) alter_table_options ::= alter_table_options alter_table_option */ + { 368, -2 }, /* (196) alter_table_option ::= COMMENT NK_STRING */ + { 368, -2 }, /* (197) alter_table_option ::= TTL NK_INTEGER */ + { 366, -1 }, /* (198) duration_list ::= duration_literal */ + { 366, -3 }, /* (199) duration_list ::= duration_list NK_COMMA duration_literal */ + { 367, -1 }, /* (200) rollup_func_list ::= rollup_func_name */ + { 367, -3 }, /* (201) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 370, -1 }, /* (202) rollup_func_name ::= function_name */ + { 370, -1 }, /* (203) rollup_func_name ::= FIRST */ + { 370, -1 }, /* (204) rollup_func_name ::= LAST */ + { 363, -1 }, /* (205) col_name_list ::= col_name */ + { 363, -3 }, /* (206) col_name_list ::= col_name_list NK_COMMA col_name */ + { 372, -1 }, /* (207) col_name ::= column_name */ + { 322, -2 }, /* (208) cmd ::= SHOW DNODES */ + { 322, -2 }, /* (209) cmd ::= SHOW USERS */ + { 322, -3 }, /* (210) cmd ::= SHOW USER PRIVILEGES */ + { 322, -2 }, /* (211) cmd ::= SHOW DATABASES */ + { 322, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 322, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 322, -3 }, /* (214) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 322, -2 }, /* (215) cmd ::= SHOW MNODES */ + { 322, -2 }, /* (216) cmd ::= SHOW QNODES */ + { 322, -2 }, /* (217) cmd ::= SHOW FUNCTIONS */ + { 322, -5 }, /* (218) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 322, -2 }, /* (219) cmd ::= SHOW STREAMS */ + { 322, -2 }, /* (220) cmd ::= SHOW ACCOUNTS */ + { 322, -2 }, /* (221) cmd ::= SHOW APPS */ + { 322, -2 }, /* (222) cmd ::= SHOW CONNECTIONS */ + { 322, -2 }, /* (223) cmd ::= SHOW LICENCES */ + { 322, -2 }, /* (224) cmd ::= SHOW GRANTS */ + { 322, -4 }, /* (225) cmd ::= SHOW CREATE DATABASE db_name */ + { 322, -4 }, /* (226) cmd ::= SHOW CREATE TABLE full_table_name */ + { 322, -4 }, /* (227) cmd ::= SHOW CREATE STABLE full_table_name */ + { 322, -2 }, /* (228) cmd ::= SHOW QUERIES */ + { 322, -2 }, /* (229) cmd ::= SHOW SCORES */ + { 322, -2 }, /* (230) cmd ::= SHOW TOPICS */ + { 322, -2 }, /* (231) cmd ::= SHOW VARIABLES */ + { 322, -3 }, /* (232) cmd ::= SHOW CLUSTER VARIABLES */ + { 322, -3 }, /* (233) cmd ::= SHOW LOCAL VARIABLES */ + { 322, -5 }, /* (234) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + { 322, -2 }, /* (235) cmd ::= SHOW BNODES */ + { 322, -2 }, /* (236) cmd ::= SHOW SNODES */ + { 322, -2 }, /* (237) cmd ::= SHOW CLUSTER */ + { 322, -2 }, /* (238) cmd ::= SHOW TRANSACTIONS */ + { 322, -4 }, /* (239) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 322, -2 }, /* (240) cmd ::= SHOW CONSUMERS */ + { 322, -2 }, /* (241) cmd ::= SHOW SUBSCRIPTIONS */ + { 322, -5 }, /* (242) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { 322, -7 }, /* (243) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + { 322, -3 }, /* (244) cmd ::= SHOW VNODES NK_INTEGER */ + { 322, -3 }, /* (245) cmd ::= SHOW VNODES NK_STRING */ + { 373, 0 }, /* (246) db_name_cond_opt ::= */ + { 373, -2 }, /* (247) db_name_cond_opt ::= db_name NK_DOT */ + { 374, 0 }, /* (248) like_pattern_opt ::= */ + { 374, -2 }, /* (249) like_pattern_opt ::= LIKE NK_STRING */ + { 375, -1 }, /* (250) table_name_cond ::= table_name */ + { 376, 0 }, /* (251) from_db_opt ::= */ + { 376, -2 }, /* (252) from_db_opt ::= FROM db_name */ + { 377, 0 }, /* (253) tag_list_opt ::= */ + { 377, -1 }, /* (254) tag_list_opt ::= tag_item */ + { 377, -3 }, /* (255) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + { 378, -1 }, /* (256) tag_item ::= TBNAME */ + { 378, -1 }, /* (257) tag_item ::= QTAGS */ + { 378, -1 }, /* (258) tag_item ::= column_name */ + { 378, -2 }, /* (259) tag_item ::= column_name column_alias */ + { 378, -3 }, /* (260) tag_item ::= column_name AS column_alias */ + { 322, -8 }, /* (261) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 322, -4 }, /* (262) cmd ::= DROP INDEX exists_opt full_table_name */ + { 380, -10 }, /* (263) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 380, -12 }, /* (264) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + { 381, -1 }, /* (265) func_list ::= func */ + { 381, -3 }, /* (266) func_list ::= func_list NK_COMMA func */ + { 384, -4 }, /* (267) func ::= function_name NK_LP expression_list NK_RP */ + { 383, 0 }, /* (268) sma_stream_opt ::= */ + { 383, -3 }, /* (269) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + { 383, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + { 383, -3 }, /* (271) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + { 322, -6 }, /* (272) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + { 322, -7 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 322, -9 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 322, -7 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 322, -9 }, /* (276) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 322, -4 }, /* (277) cmd ::= DROP TOPIC exists_opt topic_name */ + { 322, -7 }, /* (278) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 322, -2 }, /* (279) cmd ::= DESC full_table_name */ + { 322, -2 }, /* (280) cmd ::= DESCRIBE full_table_name */ + { 322, -3 }, /* (281) cmd ::= RESET QUERY CACHE */ + { 322, -4 }, /* (282) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + { 387, 0 }, /* (283) analyze_opt ::= */ + { 387, -1 }, /* (284) analyze_opt ::= ANALYZE */ + { 388, 0 }, /* (285) explain_options ::= */ + { 388, -3 }, /* (286) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 388, -3 }, /* (287) explain_options ::= explain_options RATIO NK_FLOAT */ + { 322, -10 }, /* (288) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 322, -4 }, /* (289) cmd ::= DROP FUNCTION exists_opt function_name */ + { 389, 0 }, /* (290) agg_func_opt ::= */ + { 389, -1 }, /* (291) agg_func_opt ::= AGGREGATE */ + { 390, 0 }, /* (292) bufsize_opt ::= */ + { 390, -2 }, /* (293) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 322, -11 }, /* (294) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + { 322, -4 }, /* (295) cmd ::= DROP STREAM exists_opt stream_name */ + { 392, 0 }, /* (296) stream_options ::= */ + { 392, -3 }, /* (297) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 392, -3 }, /* (298) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 392, -4 }, /* (299) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 392, -3 }, /* (300) stream_options ::= stream_options WATERMARK duration_literal */ + { 392, -4 }, /* (301) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 392, -3 }, /* (302) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + { 393, 0 }, /* (303) subtable_opt ::= */ + { 393, -4 }, /* (304) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + { 322, -3 }, /* (305) cmd ::= KILL CONNECTION NK_INTEGER */ + { 322, -3 }, /* (306) cmd ::= KILL QUERY NK_STRING */ + { 322, -3 }, /* (307) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 322, -2 }, /* (308) cmd ::= BALANCE VGROUP */ + { 322, -4 }, /* (309) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 322, -4 }, /* (310) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 322, -3 }, /* (311) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 395, -2 }, /* (312) dnode_list ::= DNODE NK_INTEGER */ + { 395, -3 }, /* (313) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 322, -4 }, /* (314) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 322, -1 }, /* (315) cmd ::= query_or_subquery */ + { 322, -7 }, /* (316) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { 322, -4 }, /* (317) cmd ::= INSERT INTO full_table_name query_or_subquery */ + { 325, -1 }, /* (318) literal ::= NK_INTEGER */ + { 325, -1 }, /* (319) literal ::= NK_FLOAT */ + { 325, -1 }, /* (320) literal ::= NK_STRING */ + { 325, -1 }, /* (321) literal ::= NK_BOOL */ + { 325, -2 }, /* (322) literal ::= TIMESTAMP NK_STRING */ + { 325, -1 }, /* (323) literal ::= duration_literal */ + { 325, -1 }, /* (324) literal ::= NULL */ + { 325, -1 }, /* (325) literal ::= NK_QUESTION */ + { 369, -1 }, /* (326) duration_literal ::= NK_VARIABLE */ + { 397, -1 }, /* (327) signed ::= NK_INTEGER */ + { 397, -2 }, /* (328) signed ::= NK_PLUS NK_INTEGER */ + { 397, -2 }, /* (329) signed ::= NK_MINUS NK_INTEGER */ + { 397, -1 }, /* (330) signed ::= NK_FLOAT */ + { 397, -2 }, /* (331) signed ::= NK_PLUS NK_FLOAT */ + { 397, -2 }, /* (332) signed ::= NK_MINUS NK_FLOAT */ + { 358, -1 }, /* (333) signed_literal ::= signed */ + { 358, -1 }, /* (334) signed_literal ::= NK_STRING */ + { 358, -1 }, /* (335) signed_literal ::= NK_BOOL */ + { 358, -2 }, /* (336) signed_literal ::= TIMESTAMP NK_STRING */ + { 358, -1 }, /* (337) signed_literal ::= duration_literal */ + { 358, -1 }, /* (338) signed_literal ::= NULL */ + { 358, -1 }, /* (339) signed_literal ::= literal_func */ + { 358, -1 }, /* (340) signed_literal ::= NK_QUESTION */ + { 399, -1 }, /* (341) literal_list ::= signed_literal */ + { 399, -3 }, /* (342) literal_list ::= literal_list NK_COMMA signed_literal */ + { 333, -1 }, /* (343) db_name ::= NK_ID */ + { 364, -1 }, /* (344) table_name ::= NK_ID */ + { 356, -1 }, /* (345) column_name ::= NK_ID */ + { 371, -1 }, /* (346) function_name ::= NK_ID */ + { 400, -1 }, /* (347) table_alias ::= NK_ID */ + { 379, -1 }, /* (348) column_alias ::= NK_ID */ + { 327, -1 }, /* (349) user_name ::= NK_ID */ + { 334, -1 }, /* (350) topic_name ::= NK_ID */ + { 391, -1 }, /* (351) stream_name ::= NK_ID */ + { 386, -1 }, /* (352) cgroup_name ::= NK_ID */ + { 401, -1 }, /* (353) expr_or_subquery ::= expression */ + { 394, -1 }, /* (354) expression ::= literal */ + { 394, -1 }, /* (355) expression ::= pseudo_column */ + { 394, -1 }, /* (356) expression ::= column_reference */ + { 394, -1 }, /* (357) expression ::= function_expression */ + { 394, -1 }, /* (358) expression ::= case_when_expression */ + { 394, -3 }, /* (359) expression ::= NK_LP expression NK_RP */ + { 394, -2 }, /* (360) expression ::= NK_PLUS expr_or_subquery */ + { 394, -2 }, /* (361) expression ::= NK_MINUS expr_or_subquery */ + { 394, -3 }, /* (362) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 394, -3 }, /* (363) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 394, -3 }, /* (364) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 394, -3 }, /* (365) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 394, -3 }, /* (366) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 394, -3 }, /* (367) expression ::= column_reference NK_ARROW NK_STRING */ + { 394, -3 }, /* (368) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 394, -3 }, /* (369) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 361, -1 }, /* (370) expression_list ::= expr_or_subquery */ + { 361, -3 }, /* (371) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 403, -1 }, /* (372) column_reference ::= column_name */ + { 403, -3 }, /* (373) column_reference ::= table_name NK_DOT column_name */ + { 402, -1 }, /* (374) pseudo_column ::= ROWTS */ + { 402, -1 }, /* (375) pseudo_column ::= TBNAME */ + { 402, -3 }, /* (376) pseudo_column ::= table_name NK_DOT TBNAME */ + { 402, -1 }, /* (377) pseudo_column ::= QSTART */ + { 402, -1 }, /* (378) pseudo_column ::= QEND */ + { 402, -1 }, /* (379) pseudo_column ::= QDURATION */ + { 402, -1 }, /* (380) pseudo_column ::= WSTART */ + { 402, -1 }, /* (381) pseudo_column ::= WEND */ + { 402, -1 }, /* (382) pseudo_column ::= WDURATION */ + { 402, -1 }, /* (383) pseudo_column ::= IROWTS */ + { 402, -1 }, /* (384) pseudo_column ::= QTAGS */ + { 404, -4 }, /* (385) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 404, -4 }, /* (386) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 404, -6 }, /* (387) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 404, -1 }, /* (388) function_expression ::= literal_func */ + { 398, -3 }, /* (389) literal_func ::= noarg_func NK_LP NK_RP */ + { 398, -1 }, /* (390) literal_func ::= NOW */ + { 408, -1 }, /* (391) noarg_func ::= NOW */ + { 408, -1 }, /* (392) noarg_func ::= TODAY */ + { 408, -1 }, /* (393) noarg_func ::= TIMEZONE */ + { 408, -1 }, /* (394) noarg_func ::= DATABASE */ + { 408, -1 }, /* (395) noarg_func ::= CLIENT_VERSION */ + { 408, -1 }, /* (396) noarg_func ::= SERVER_VERSION */ + { 408, -1 }, /* (397) noarg_func ::= SERVER_STATUS */ + { 408, -1 }, /* (398) noarg_func ::= CURRENT_USER */ + { 408, -1 }, /* (399) noarg_func ::= USER */ + { 406, -1 }, /* (400) star_func ::= COUNT */ + { 406, -1 }, /* (401) star_func ::= FIRST */ + { 406, -1 }, /* (402) star_func ::= LAST */ + { 406, -1 }, /* (403) star_func ::= LAST_ROW */ + { 407, -1 }, /* (404) star_func_para_list ::= NK_STAR */ + { 407, -1 }, /* (405) star_func_para_list ::= other_para_list */ + { 409, -1 }, /* (406) other_para_list ::= star_func_para */ + { 409, -3 }, /* (407) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 410, -1 }, /* (408) star_func_para ::= expr_or_subquery */ + { 410, -3 }, /* (409) star_func_para ::= table_name NK_DOT NK_STAR */ + { 405, -4 }, /* (410) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 405, -5 }, /* (411) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 411, -1 }, /* (412) when_then_list ::= when_then_expr */ + { 411, -2 }, /* (413) when_then_list ::= when_then_list when_then_expr */ + { 414, -4 }, /* (414) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 412, 0 }, /* (415) case_when_else_opt ::= */ + { 412, -2 }, /* (416) case_when_else_opt ::= ELSE common_expression */ + { 415, -3 }, /* (417) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 415, -5 }, /* (418) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 415, -6 }, /* (419) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 415, -3 }, /* (420) predicate ::= expr_or_subquery IS NULL */ + { 415, -4 }, /* (421) predicate ::= expr_or_subquery IS NOT NULL */ + { 415, -3 }, /* (422) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 416, -1 }, /* (423) compare_op ::= NK_LT */ + { 416, -1 }, /* (424) compare_op ::= NK_GT */ + { 416, -1 }, /* (425) compare_op ::= NK_LE */ + { 416, -1 }, /* (426) compare_op ::= NK_GE */ + { 416, -1 }, /* (427) compare_op ::= NK_NE */ + { 416, -1 }, /* (428) compare_op ::= NK_EQ */ + { 416, -1 }, /* (429) compare_op ::= LIKE */ + { 416, -2 }, /* (430) compare_op ::= NOT LIKE */ + { 416, -1 }, /* (431) compare_op ::= MATCH */ + { 416, -1 }, /* (432) compare_op ::= NMATCH */ + { 416, -1 }, /* (433) compare_op ::= CONTAINS */ + { 417, -1 }, /* (434) in_op ::= IN */ + { 417, -2 }, /* (435) in_op ::= NOT IN */ + { 418, -3 }, /* (436) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 419, -1 }, /* (437) boolean_value_expression ::= boolean_primary */ + { 419, -2 }, /* (438) boolean_value_expression ::= NOT boolean_primary */ + { 419, -3 }, /* (439) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 419, -3 }, /* (440) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 420, -1 }, /* (441) boolean_primary ::= predicate */ + { 420, -3 }, /* (442) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 413, -1 }, /* (443) common_expression ::= expr_or_subquery */ + { 413, -1 }, /* (444) common_expression ::= boolean_value_expression */ + { 421, 0 }, /* (445) from_clause_opt ::= */ + { 421, -2 }, /* (446) from_clause_opt ::= FROM table_reference_list */ + { 422, -1 }, /* (447) table_reference_list ::= table_reference */ + { 422, -3 }, /* (448) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 423, -1 }, /* (449) table_reference ::= table_primary */ + { 423, -1 }, /* (450) table_reference ::= joined_table */ + { 424, -2 }, /* (451) table_primary ::= table_name alias_opt */ + { 424, -4 }, /* (452) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 424, -2 }, /* (453) table_primary ::= subquery alias_opt */ + { 424, -1 }, /* (454) table_primary ::= parenthesized_joined_table */ + { 426, 0 }, /* (455) alias_opt ::= */ + { 426, -1 }, /* (456) alias_opt ::= table_alias */ + { 426, -2 }, /* (457) alias_opt ::= AS table_alias */ + { 428, -3 }, /* (458) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 428, -3 }, /* (459) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 425, -6 }, /* (460) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 429, 0 }, /* (461) join_type ::= */ + { 429, -1 }, /* (462) join_type ::= INNER */ + { 431, -12 }, /* (463) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 432, 0 }, /* (464) set_quantifier_opt ::= */ + { 432, -1 }, /* (465) set_quantifier_opt ::= DISTINCT */ + { 432, -1 }, /* (466) set_quantifier_opt ::= ALL */ + { 433, -1 }, /* (467) select_list ::= select_item */ + { 433, -3 }, /* (468) select_list ::= select_list NK_COMMA select_item */ + { 441, -1 }, /* (469) select_item ::= NK_STAR */ + { 441, -1 }, /* (470) select_item ::= common_expression */ + { 441, -2 }, /* (471) select_item ::= common_expression column_alias */ + { 441, -3 }, /* (472) select_item ::= common_expression AS column_alias */ + { 441, -3 }, /* (473) select_item ::= table_name NK_DOT NK_STAR */ + { 396, 0 }, /* (474) where_clause_opt ::= */ + { 396, -2 }, /* (475) where_clause_opt ::= WHERE search_condition */ + { 434, 0 }, /* (476) partition_by_clause_opt ::= */ + { 434, -3 }, /* (477) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 442, -1 }, /* (478) partition_list ::= partition_item */ + { 442, -3 }, /* (479) partition_list ::= partition_list NK_COMMA partition_item */ + { 443, -1 }, /* (480) partition_item ::= expr_or_subquery */ + { 443, -2 }, /* (481) partition_item ::= expr_or_subquery column_alias */ + { 443, -3 }, /* (482) partition_item ::= expr_or_subquery AS column_alias */ + { 438, 0 }, /* (483) twindow_clause_opt ::= */ + { 438, -6 }, /* (484) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 438, -4 }, /* (485) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 438, -6 }, /* (486) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 438, -8 }, /* (487) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 382, 0 }, /* (488) sliding_opt ::= */ + { 382, -4 }, /* (489) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 437, 0 }, /* (490) fill_opt ::= */ + { 437, -4 }, /* (491) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 437, -6 }, /* (492) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 444, -1 }, /* (493) fill_mode ::= NONE */ + { 444, -1 }, /* (494) fill_mode ::= PREV */ + { 444, -1 }, /* (495) fill_mode ::= NULL */ + { 444, -1 }, /* (496) fill_mode ::= LINEAR */ + { 444, -1 }, /* (497) fill_mode ::= NEXT */ + { 439, 0 }, /* (498) group_by_clause_opt ::= */ + { 439, -3 }, /* (499) group_by_clause_opt ::= GROUP BY group_by_list */ + { 445, -1 }, /* (500) group_by_list ::= expr_or_subquery */ + { 445, -3 }, /* (501) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 440, 0 }, /* (502) having_clause_opt ::= */ + { 440, -2 }, /* (503) having_clause_opt ::= HAVING search_condition */ + { 435, 0 }, /* (504) range_opt ::= */ + { 435, -6 }, /* (505) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 436, 0 }, /* (506) every_opt ::= */ + { 436, -4 }, /* (507) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 446, -4 }, /* (508) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 447, -1 }, /* (509) query_simple ::= query_specification */ + { 447, -1 }, /* (510) query_simple ::= union_query_expression */ + { 451, -4 }, /* (511) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 451, -3 }, /* (512) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 452, -1 }, /* (513) query_simple_or_subquery ::= query_simple */ + { 452, -1 }, /* (514) query_simple_or_subquery ::= subquery */ + { 385, -1 }, /* (515) query_or_subquery ::= query_expression */ + { 385, -1 }, /* (516) query_or_subquery ::= subquery */ + { 448, 0 }, /* (517) order_by_clause_opt ::= */ + { 448, -3 }, /* (518) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 449, 0 }, /* (519) slimit_clause_opt ::= */ + { 449, -2 }, /* (520) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 449, -4 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 449, -4 }, /* (522) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 450, 0 }, /* (523) limit_clause_opt ::= */ + { 450, -2 }, /* (524) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 450, -4 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 450, -4 }, /* (526) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 427, -3 }, /* (527) subquery ::= NK_LP query_expression NK_RP */ + { 427, -3 }, /* (528) subquery ::= NK_LP subquery NK_RP */ + { 430, -1 }, /* (529) search_condition ::= common_expression */ + { 453, -1 }, /* (530) sort_specification_list ::= sort_specification */ + { 453, -3 }, /* (531) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 454, -3 }, /* (532) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 455, 0 }, /* (533) ordering_specification_opt ::= */ + { 455, -1 }, /* (534) ordering_specification_opt ::= ASC */ + { 455, -1 }, /* (535) ordering_specification_opt ::= DESC */ + { 456, 0 }, /* (536) null_ordering_opt ::= */ + { 456, -2 }, /* (537) null_ordering_opt ::= NULLS FIRST */ + { 456, -2 }, /* (538) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3679,7 +3676,7 @@ static YYACTIONTYPE yy_reduce( yymsp[-2].minor.yy199 = yylhsminor.yy199; break; case 42: /* priv_level ::= topic_name */ - case 457: /* alias_opt ::= table_alias */ yytestcase(yyruleno==457); + case 456: /* alias_opt ::= table_alias */ yytestcase(yyruleno==456); { yylhsminor.yy199 = yymsp[0].minor.yy199; } yymsp[0].minor.yy199 = yylhsminor.yy199; break; @@ -3710,44 +3707,44 @@ static YYACTIONTYPE yy_reduce( case 51: /* dnode_endpoint ::= NK_STRING */ case 52: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==52); case 53: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==53); - case 344: /* db_name ::= NK_ID */ yytestcase(yyruleno==344); - case 345: /* table_name ::= NK_ID */ yytestcase(yyruleno==345); - case 346: /* column_name ::= NK_ID */ yytestcase(yyruleno==346); - case 347: /* function_name ::= NK_ID */ yytestcase(yyruleno==347); - case 348: /* table_alias ::= NK_ID */ yytestcase(yyruleno==348); - case 349: /* column_alias ::= NK_ID */ yytestcase(yyruleno==349); - case 350: /* user_name ::= NK_ID */ yytestcase(yyruleno==350); - case 351: /* topic_name ::= NK_ID */ yytestcase(yyruleno==351); - case 352: /* stream_name ::= NK_ID */ yytestcase(yyruleno==352); - case 353: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==353); - case 392: /* noarg_func ::= NOW */ yytestcase(yyruleno==392); - case 393: /* noarg_func ::= TODAY */ yytestcase(yyruleno==393); - case 394: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==394); - case 395: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==395); - case 396: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==396); - case 397: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==397); - case 398: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==398); - case 399: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==399); - case 400: /* noarg_func ::= USER */ yytestcase(yyruleno==400); - case 401: /* star_func ::= COUNT */ yytestcase(yyruleno==401); - case 402: /* star_func ::= FIRST */ yytestcase(yyruleno==402); - case 403: /* star_func ::= LAST */ yytestcase(yyruleno==403); - case 404: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==404); + case 343: /* db_name ::= NK_ID */ yytestcase(yyruleno==343); + case 344: /* table_name ::= NK_ID */ yytestcase(yyruleno==344); + case 345: /* column_name ::= NK_ID */ yytestcase(yyruleno==345); + case 346: /* function_name ::= NK_ID */ yytestcase(yyruleno==346); + case 347: /* table_alias ::= NK_ID */ yytestcase(yyruleno==347); + case 348: /* column_alias ::= NK_ID */ yytestcase(yyruleno==348); + case 349: /* user_name ::= NK_ID */ yytestcase(yyruleno==349); + case 350: /* topic_name ::= NK_ID */ yytestcase(yyruleno==350); + case 351: /* stream_name ::= NK_ID */ yytestcase(yyruleno==351); + case 352: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==352); + case 391: /* noarg_func ::= NOW */ yytestcase(yyruleno==391); + case 392: /* noarg_func ::= TODAY */ yytestcase(yyruleno==392); + case 393: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==393); + case 394: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==394); + case 395: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==395); + case 396: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==396); + case 397: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==397); + case 398: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==398); + case 399: /* noarg_func ::= USER */ yytestcase(yyruleno==399); + case 400: /* star_func ::= COUNT */ yytestcase(yyruleno==400); + case 401: /* star_func ::= FIRST */ yytestcase(yyruleno==401); + case 402: /* star_func ::= LAST */ yytestcase(yyruleno==402); + case 403: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==403); { yylhsminor.yy199 = yymsp[0].minor.yy0; } yymsp[0].minor.yy199 = yylhsminor.yy199; break; case 54: /* force_opt ::= */ case 73: /* not_exists_opt ::= */ yytestcase(yyruleno==73); case 75: /* exists_opt ::= */ yytestcase(yyruleno==75); - case 284: /* analyze_opt ::= */ yytestcase(yyruleno==284); - case 291: /* agg_func_opt ::= */ yytestcase(yyruleno==291); - case 465: /* set_quantifier_opt ::= */ yytestcase(yyruleno==465); + case 283: /* analyze_opt ::= */ yytestcase(yyruleno==283); + case 290: /* agg_func_opt ::= */ yytestcase(yyruleno==290); + case 464: /* set_quantifier_opt ::= */ yytestcase(yyruleno==464); { yymsp[1].minor.yy397 = false; } break; case 55: /* force_opt ::= FORCE */ - case 285: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==285); - case 292: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==292); - case 466: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==466); + case 284: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==284); + case 291: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==291); + case 465: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==465); { yymsp[0].minor.yy397 = true; } break; case 56: /* cmd ::= ALTER LOCAL NK_STRING */ @@ -3963,685 +3960,682 @@ static YYACTIONTYPE yy_reduce( case 117: /* alter_db_option ::= REPLICA NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 118: /* alter_db_option ::= STRICT NK_STRING */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_STRICT; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 119: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ + case 118: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_WAL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 120: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ + case 119: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 121: /* integer_list ::= NK_INTEGER */ + case 120: /* integer_list ::= NK_INTEGER */ { yylhsminor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 122: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 314: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==314); + case 121: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 313: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==313); { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 123: /* variable_list ::= NK_VARIABLE */ + case 122: /* variable_list ::= NK_VARIABLE */ { yylhsminor.yy404 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 124: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + case 123: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 125: /* retention_list ::= retention */ - case 147: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==147); - case 150: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==150); - case 157: /* column_def_list ::= column_def */ yytestcase(yyruleno==157); - case 201: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==201); - case 206: /* col_name_list ::= col_name */ yytestcase(yyruleno==206); - case 255: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==255); - case 266: /* func_list ::= func */ yytestcase(yyruleno==266); - case 342: /* literal_list ::= signed_literal */ yytestcase(yyruleno==342); - case 407: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==407); - case 413: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==413); - case 468: /* select_list ::= select_item */ yytestcase(yyruleno==468); - case 479: /* partition_list ::= partition_item */ yytestcase(yyruleno==479); - case 531: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==531); + case 124: /* retention_list ::= retention */ + case 146: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==146); + case 149: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==149); + case 156: /* column_def_list ::= column_def */ yytestcase(yyruleno==156); + case 200: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==200); + case 205: /* col_name_list ::= col_name */ yytestcase(yyruleno==205); + case 254: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==254); + case 265: /* func_list ::= func */ yytestcase(yyruleno==265); + case 341: /* literal_list ::= signed_literal */ yytestcase(yyruleno==341); + case 406: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==406); + case 412: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==412); + case 467: /* select_list ::= select_item */ yytestcase(yyruleno==467); + case 478: /* partition_list ::= partition_item */ yytestcase(yyruleno==478); + case 530: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==530); { yylhsminor.yy404 = createNodeList(pCxt, yymsp[0].minor.yy148); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 126: /* retention_list ::= retention_list NK_COMMA retention */ - case 158: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==158); - case 202: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==202); - case 207: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==207); - case 256: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==256); - case 267: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==267); - case 343: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==343); - case 408: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==408); - case 469: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==469); - case 480: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==480); - case 532: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==532); + case 125: /* retention_list ::= retention_list NK_COMMA retention */ + case 157: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==157); + case 201: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==201); + case 206: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==206); + case 255: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==255); + case 266: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==266); + case 342: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==342); + case 407: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==407); + case 468: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==468); + case 479: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==479); + case 531: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==531); { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 127: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + case 126: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ { yylhsminor.yy148 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 128: /* speed_opt ::= */ - case 293: /* bufsize_opt ::= */ yytestcase(yyruleno==293); + case 127: /* speed_opt ::= */ + case 292: /* bufsize_opt ::= */ yytestcase(yyruleno==292); { yymsp[1].minor.yy706 = 0; } break; - case 129: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 294: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==294); + case 128: /* speed_opt ::= MAX_SPEED NK_INTEGER */ + case 293: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==293); { yymsp[-1].minor.yy706 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 130: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 132: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==132); + case 129: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 131: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==131); { pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-5].minor.yy148, yymsp[-3].minor.yy404, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } break; - case 131: /* cmd ::= CREATE TABLE multi_create_clause */ + case 130: /* cmd ::= CREATE TABLE multi_create_clause */ { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy404); } break; - case 133: /* cmd ::= DROP TABLE multi_drop_clause */ + case 132: /* cmd ::= DROP TABLE multi_drop_clause */ { pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy404); } break; - case 134: /* cmd ::= DROP STABLE exists_opt full_table_name */ + case 133: /* cmd ::= DROP STABLE exists_opt full_table_name */ { pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } break; - case 135: /* cmd ::= ALTER TABLE alter_table_clause */ - case 316: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==316); + case 134: /* cmd ::= ALTER TABLE alter_table_clause */ + case 315: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==315); { pCxt->pRootNode = yymsp[0].minor.yy148; } break; - case 136: /* cmd ::= ALTER STABLE alter_table_clause */ + case 135: /* cmd ::= ALTER STABLE alter_table_clause */ { pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy148); } break; - case 137: /* alter_table_clause ::= full_table_name alter_table_options */ + case 136: /* alter_table_clause ::= full_table_name alter_table_options */ { yylhsminor.yy148 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 138: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + case 137: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ { yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 139: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ + case 138: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ { yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy199); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 140: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + case 139: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ { yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 141: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + case 140: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ { yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 142: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + case 141: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ { yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 143: /* alter_table_clause ::= full_table_name DROP TAG column_name */ + case 142: /* alter_table_clause ::= full_table_name DROP TAG column_name */ { yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy199); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 144: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + case 143: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ { yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 145: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + case 144: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ { yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 146: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + case 145: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ { yylhsminor.yy148 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy148, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 148: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 151: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==151); - case 414: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==414); + case 147: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 150: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==150); + case 413: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==413); { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } yymsp[-1].minor.yy404 = yylhsminor.yy404; break; - case 149: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + case 148: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ { yylhsminor.yy148 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy397, yymsp[-8].minor.yy148, yymsp[-6].minor.yy148, yymsp[-5].minor.yy404, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } yymsp[-9].minor.yy148 = yylhsminor.yy148; break; - case 152: /* drop_table_clause ::= exists_opt full_table_name */ + case 151: /* drop_table_clause ::= exists_opt full_table_name */ { yylhsminor.yy148 = createDropTableClause(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 153: /* specific_cols_opt ::= */ - case 184: /* tags_def_opt ::= */ yytestcase(yyruleno==184); - case 254: /* tag_list_opt ::= */ yytestcase(yyruleno==254); - case 477: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==477); - case 499: /* group_by_clause_opt ::= */ yytestcase(yyruleno==499); - case 518: /* order_by_clause_opt ::= */ yytestcase(yyruleno==518); + case 152: /* specific_cols_opt ::= */ + case 183: /* tags_def_opt ::= */ yytestcase(yyruleno==183); + case 253: /* tag_list_opt ::= */ yytestcase(yyruleno==253); + case 476: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==476); + case 498: /* group_by_clause_opt ::= */ yytestcase(yyruleno==498); + case 517: /* order_by_clause_opt ::= */ yytestcase(yyruleno==517); { yymsp[1].minor.yy404 = NULL; } break; - case 154: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ + case 153: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ { yymsp[-2].minor.yy404 = yymsp[-1].minor.yy404; } break; - case 155: /* full_table_name ::= table_name */ + case 154: /* full_table_name ::= table_name */ { yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy199, NULL); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 156: /* full_table_name ::= db_name NK_DOT table_name */ + case 155: /* full_table_name ::= db_name NK_DOT table_name */ { yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, NULL); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 159: /* column_def ::= column_name type_name */ + case 158: /* column_def ::= column_name type_name */ { yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530, NULL); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 160: /* column_def ::= column_name type_name COMMENT NK_STRING */ + case 159: /* column_def ::= column_name type_name COMMENT NK_STRING */ { yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-2].minor.yy530, &yymsp[0].minor.yy0); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 161: /* type_name ::= BOOL */ + case 160: /* type_name ::= BOOL */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 162: /* type_name ::= TINYINT */ + case 161: /* type_name ::= TINYINT */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 163: /* type_name ::= SMALLINT */ + case 162: /* type_name ::= SMALLINT */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 164: /* type_name ::= INT */ - case 165: /* type_name ::= INTEGER */ yytestcase(yyruleno==165); + case 163: /* type_name ::= INT */ + case 164: /* type_name ::= INTEGER */ yytestcase(yyruleno==164); { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 166: /* type_name ::= BIGINT */ + case 165: /* type_name ::= BIGINT */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 167: /* type_name ::= FLOAT */ + case 166: /* type_name ::= FLOAT */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 168: /* type_name ::= DOUBLE */ + case 167: /* type_name ::= DOUBLE */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 169: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + case 168: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 170: /* type_name ::= TIMESTAMP */ + case 169: /* type_name ::= TIMESTAMP */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 171: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + case 170: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 172: /* type_name ::= TINYINT UNSIGNED */ + case 171: /* type_name ::= TINYINT UNSIGNED */ { yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 173: /* type_name ::= SMALLINT UNSIGNED */ + case 172: /* type_name ::= SMALLINT UNSIGNED */ { yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 174: /* type_name ::= INT UNSIGNED */ + case 173: /* type_name ::= INT UNSIGNED */ { yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 175: /* type_name ::= BIGINT UNSIGNED */ + case 174: /* type_name ::= BIGINT UNSIGNED */ { yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 176: /* type_name ::= JSON */ + case 175: /* type_name ::= JSON */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 177: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + case 176: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 178: /* type_name ::= MEDIUMBLOB */ + case 177: /* type_name ::= MEDIUMBLOB */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 179: /* type_name ::= BLOB */ + case 178: /* type_name ::= BLOB */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 180: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + case 179: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 181: /* type_name ::= DECIMAL */ + case 180: /* type_name ::= DECIMAL */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 183: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ { yymsp[-5].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 185: /* tags_def_opt ::= tags_def */ - case 406: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==406); + case 184: /* tags_def_opt ::= tags_def */ + case 405: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==405); { yylhsminor.yy404 = yymsp[0].minor.yy404; } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 186: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ + case 185: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ { yymsp[-3].minor.yy404 = yymsp[-1].minor.yy404; } break; - case 187: /* table_options ::= */ + case 186: /* table_options ::= */ { yymsp[1].minor.yy148 = createDefaultTableOptions(pCxt); } break; - case 188: /* table_options ::= table_options COMMENT NK_STRING */ + case 187: /* table_options ::= table_options COMMENT NK_STRING */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 189: /* table_options ::= table_options MAX_DELAY duration_list */ + case 188: /* table_options ::= table_options MAX_DELAY duration_list */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy404); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 190: /* table_options ::= table_options WATERMARK duration_list */ + case 189: /* table_options ::= table_options WATERMARK duration_list */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy404); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 191: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + case 190: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy404); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 192: /* table_options ::= table_options TTL NK_INTEGER */ + case 191: /* table_options ::= table_options TTL NK_INTEGER */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 193: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + case 192: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_SMA, yymsp[-1].minor.yy404); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 194: /* table_options ::= table_options DELETE_MARK duration_list */ + case 193: /* table_options ::= table_options DELETE_MARK duration_list */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy404); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 195: /* alter_table_options ::= alter_table_option */ + case 194: /* alter_table_options ::= alter_table_option */ { yylhsminor.yy148 = createAlterTableOptions(pCxt); yylhsminor.yy148 = setTableOption(pCxt, yylhsminor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 196: /* alter_table_options ::= alter_table_options alter_table_option */ + case 195: /* alter_table_options ::= alter_table_options alter_table_option */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 197: /* alter_table_option ::= COMMENT NK_STRING */ + case 196: /* alter_table_option ::= COMMENT NK_STRING */ { yymsp[-1].minor.yy123.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 198: /* alter_table_option ::= TTL NK_INTEGER */ + case 197: /* alter_table_option ::= TTL NK_INTEGER */ { yymsp[-1].minor.yy123.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 199: /* duration_list ::= duration_literal */ - case 371: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==371); + case 198: /* duration_list ::= duration_literal */ + case 370: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==370); { yylhsminor.yy404 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 200: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 372: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==372); + case 199: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 371: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==371); { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 203: /* rollup_func_name ::= function_name */ + case 202: /* rollup_func_name ::= function_name */ { yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy199, NULL); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 204: /* rollup_func_name ::= FIRST */ - case 205: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==205); - case 258: /* tag_item ::= QTAGS */ yytestcase(yyruleno==258); + case 203: /* rollup_func_name ::= FIRST */ + case 204: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==204); + case 257: /* tag_item ::= QTAGS */ yytestcase(yyruleno==257); { yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 208: /* col_name ::= column_name */ - case 259: /* tag_item ::= column_name */ yytestcase(yyruleno==259); + case 207: /* col_name ::= column_name */ + case 258: /* tag_item ::= column_name */ yytestcase(yyruleno==258); { yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 209: /* cmd ::= SHOW DNODES */ + case 208: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 210: /* cmd ::= SHOW USERS */ + case 209: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 211: /* cmd ::= SHOW USER PRIVILEGES */ + case 210: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 212: /* cmd ::= SHOW DATABASES */ + case 211: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 213: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + case 212: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } break; - case 214: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + case 213: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } break; - case 215: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ + case 214: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy148, NULL, OP_TYPE_LIKE); } break; - case 216: /* cmd ::= SHOW MNODES */ + case 215: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 217: /* cmd ::= SHOW QNODES */ + case 216: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 218: /* cmd ::= SHOW FUNCTIONS */ + case 217: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 219: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + case 218: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } break; - case 220: /* cmd ::= SHOW STREAMS */ + case 219: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 221: /* cmd ::= SHOW ACCOUNTS */ + case 220: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 222: /* cmd ::= SHOW APPS */ + case 221: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 223: /* cmd ::= SHOW CONNECTIONS */ + case 222: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 224: /* cmd ::= SHOW LICENCES */ - case 225: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==225); + case 223: /* cmd ::= SHOW LICENCES */ + case 224: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==224); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 226: /* cmd ::= SHOW CREATE DATABASE db_name */ + case 225: /* cmd ::= SHOW CREATE DATABASE db_name */ { pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } break; - case 227: /* cmd ::= SHOW CREATE TABLE full_table_name */ + case 226: /* cmd ::= SHOW CREATE TABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy148); } break; - case 228: /* cmd ::= SHOW CREATE STABLE full_table_name */ + case 227: /* cmd ::= SHOW CREATE STABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy148); } break; - case 229: /* cmd ::= SHOW QUERIES */ + case 228: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 230: /* cmd ::= SHOW SCORES */ + case 229: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 231: /* cmd ::= SHOW TOPICS */ + case 230: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 232: /* cmd ::= SHOW VARIABLES */ - case 233: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==233); + case 231: /* cmd ::= SHOW VARIABLES */ + case 232: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==232); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 234: /* cmd ::= SHOW LOCAL VARIABLES */ + case 233: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 235: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + case 234: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ { pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy148); } break; - case 236: /* cmd ::= SHOW BNODES */ + case 235: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 237: /* cmd ::= SHOW SNODES */ + case 236: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 238: /* cmd ::= SHOW CLUSTER */ + case 237: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 239: /* cmd ::= SHOW TRANSACTIONS */ + case 238: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 240: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + case 239: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ { pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy148); } break; - case 241: /* cmd ::= SHOW CONSUMERS */ + case 240: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 242: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 241: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 243: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + case 242: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } break; - case 244: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + case 243: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148, yymsp[-3].minor.yy404); } break; - case 245: /* cmd ::= SHOW VNODES NK_INTEGER */ + case 244: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 246: /* cmd ::= SHOW VNODES NK_STRING */ + case 245: /* cmd ::= SHOW VNODES NK_STRING */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 247: /* db_name_cond_opt ::= */ - case 252: /* from_db_opt ::= */ yytestcase(yyruleno==252); + case 246: /* db_name_cond_opt ::= */ + case 251: /* from_db_opt ::= */ yytestcase(yyruleno==251); { yymsp[1].minor.yy148 = createDefaultDatabaseCondValue(pCxt); } break; - case 248: /* db_name_cond_opt ::= db_name NK_DOT */ + case 247: /* db_name_cond_opt ::= db_name NK_DOT */ { yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 249: /* like_pattern_opt ::= */ - case 304: /* subtable_opt ::= */ yytestcase(yyruleno==304); - case 416: /* case_when_else_opt ::= */ yytestcase(yyruleno==416); - case 446: /* from_clause_opt ::= */ yytestcase(yyruleno==446); - case 475: /* where_clause_opt ::= */ yytestcase(yyruleno==475); - case 484: /* twindow_clause_opt ::= */ yytestcase(yyruleno==484); - case 489: /* sliding_opt ::= */ yytestcase(yyruleno==489); - case 491: /* fill_opt ::= */ yytestcase(yyruleno==491); - case 503: /* having_clause_opt ::= */ yytestcase(yyruleno==503); - case 505: /* range_opt ::= */ yytestcase(yyruleno==505); - case 507: /* every_opt ::= */ yytestcase(yyruleno==507); - case 520: /* slimit_clause_opt ::= */ yytestcase(yyruleno==520); - case 524: /* limit_clause_opt ::= */ yytestcase(yyruleno==524); + case 248: /* like_pattern_opt ::= */ + case 303: /* subtable_opt ::= */ yytestcase(yyruleno==303); + case 415: /* case_when_else_opt ::= */ yytestcase(yyruleno==415); + case 445: /* from_clause_opt ::= */ yytestcase(yyruleno==445); + case 474: /* where_clause_opt ::= */ yytestcase(yyruleno==474); + case 483: /* twindow_clause_opt ::= */ yytestcase(yyruleno==483); + case 488: /* sliding_opt ::= */ yytestcase(yyruleno==488); + case 490: /* fill_opt ::= */ yytestcase(yyruleno==490); + case 502: /* having_clause_opt ::= */ yytestcase(yyruleno==502); + case 504: /* range_opt ::= */ yytestcase(yyruleno==504); + case 506: /* every_opt ::= */ yytestcase(yyruleno==506); + case 519: /* slimit_clause_opt ::= */ yytestcase(yyruleno==519); + case 523: /* limit_clause_opt ::= */ yytestcase(yyruleno==523); { yymsp[1].minor.yy148 = NULL; } break; - case 250: /* like_pattern_opt ::= LIKE NK_STRING */ + case 249: /* like_pattern_opt ::= LIKE NK_STRING */ { yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 251: /* table_name_cond ::= table_name */ + case 250: /* table_name_cond ::= table_name */ { yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 253: /* from_db_opt ::= FROM db_name */ + case 252: /* from_db_opt ::= FROM db_name */ { yymsp[-1].minor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } break; - case 257: /* tag_item ::= TBNAME */ + case 256: /* tag_item ::= TBNAME */ { yylhsminor.yy148 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 260: /* tag_item ::= column_name column_alias */ + case 259: /* tag_item ::= column_name column_alias */ { yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy199), &yymsp[0].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 261: /* tag_item ::= column_name AS column_alias */ + case 260: /* tag_item ::= column_name AS column_alias */ { yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy199), &yymsp[0].minor.yy199); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 262: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + case 261: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy397, yymsp[-3].minor.yy148, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } break; - case 263: /* cmd ::= DROP INDEX exists_opt full_table_name */ + case 262: /* cmd ::= DROP INDEX exists_opt full_table_name */ { pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } break; - case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + case 263: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ { yymsp[-9].minor.yy148 = createIndexOption(pCxt, yymsp[-7].minor.yy404, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 265: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ { yymsp[-11].minor.yy148 = createIndexOption(pCxt, yymsp[-9].minor.yy404, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 268: /* func ::= function_name NK_LP expression_list NK_RP */ + case 267: /* func ::= function_name NK_LP expression_list NK_RP */ { yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 269: /* sma_stream_opt ::= */ - case 297: /* stream_options ::= */ yytestcase(yyruleno==297); + case 268: /* sma_stream_opt ::= */ + case 296: /* stream_options ::= */ yytestcase(yyruleno==296); { yymsp[1].minor.yy148 = createStreamOptions(pCxt); } break; - case 270: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - case 301: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==301); + case 269: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + case 300: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==300); { ((SStreamOptions*)yymsp[-2].minor.yy148)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 271: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + case 270: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 272: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + case 271: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + case 272: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ { pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } break; - case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy199, false); } break; - case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[0].minor.yy199, true); } break; - case 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, yymsp[0].minor.yy148, false); } break; - case 277: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + case 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, yymsp[0].minor.yy148, true); } break; - case 278: /* cmd ::= DROP TOPIC exists_opt topic_name */ + case 277: /* cmd ::= DROP TOPIC exists_opt topic_name */ { pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 279: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + case 278: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ { pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } break; - case 280: /* cmd ::= DESC full_table_name */ - case 281: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==281); + case 279: /* cmd ::= DESC full_table_name */ + case 280: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==280); { pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy148); } break; - case 282: /* cmd ::= RESET QUERY CACHE */ + case 281: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 283: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 282: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ { pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy397, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 286: /* explain_options ::= */ + case 285: /* explain_options ::= */ { yymsp[1].minor.yy148 = createDefaultExplainOptions(pCxt); } break; - case 287: /* explain_options ::= explain_options VERBOSE NK_BOOL */ + case 286: /* explain_options ::= explain_options VERBOSE NK_BOOL */ { yylhsminor.yy148 = setExplainVerbose(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 288: /* explain_options ::= explain_options RATIO NK_FLOAT */ + case 287: /* explain_options ::= explain_options RATIO NK_FLOAT */ { yylhsminor.yy148 = setExplainRatio(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 289: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + case 288: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ { pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-8].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy530, yymsp[0].minor.yy706); } break; - case 290: /* cmd ::= DROP FUNCTION exists_opt function_name */ + case 289: /* cmd ::= DROP FUNCTION exists_opt function_name */ { pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 295: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + case 294: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ { pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy397, &yymsp[-7].minor.yy199, yymsp[-4].minor.yy148, yymsp[-6].minor.yy148, yymsp[-3].minor.yy404, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } break; - case 296: /* cmd ::= DROP STREAM exists_opt stream_name */ + case 295: /* cmd ::= DROP STREAM exists_opt stream_name */ { pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 298: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 297: /* stream_options ::= stream_options TRIGGER AT_ONCE */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 299: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + case 298: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 300: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + case 299: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ { ((SStreamOptions*)yymsp[-3].minor.yy148)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-3].minor.yy148; } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 302: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + case 301: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ { ((SStreamOptions*)yymsp[-3].minor.yy148)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-3].minor.yy148; } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 303: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + case 302: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 305: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 490: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==490); - case 508: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==508); + case 304: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 489: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==489); + case 507: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==507); { yymsp[-3].minor.yy148 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy148); } break; - case 306: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 305: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 307: /* cmd ::= KILL QUERY NK_STRING */ + case 306: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 308: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 307: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 309: /* cmd ::= BALANCE VGROUP */ + case 308: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 310: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 309: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 311: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + case 310: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ { pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy404); } break; - case 312: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 311: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 313: /* dnode_list ::= DNODE NK_INTEGER */ + case 312: /* dnode_list ::= DNODE NK_INTEGER */ { yymsp[-1].minor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 315: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ + case 314: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ { pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 317: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + case 316: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ { pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy148, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } break; - case 318: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ + case 317: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ { pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } break; - case 319: /* literal ::= NK_INTEGER */ + case 318: /* literal ::= NK_INTEGER */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 320: /* literal ::= NK_FLOAT */ + case 319: /* literal ::= NK_FLOAT */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 321: /* literal ::= NK_STRING */ + case 320: /* literal ::= NK_STRING */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 322: /* literal ::= NK_BOOL */ + case 321: /* literal ::= NK_BOOL */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 323: /* literal ::= TIMESTAMP NK_STRING */ + case 322: /* literal ::= TIMESTAMP NK_STRING */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 324: /* literal ::= duration_literal */ - case 334: /* signed_literal ::= signed */ yytestcase(yyruleno==334); - case 354: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==354); - case 355: /* expression ::= literal */ yytestcase(yyruleno==355); - case 356: /* expression ::= pseudo_column */ yytestcase(yyruleno==356); - case 357: /* expression ::= column_reference */ yytestcase(yyruleno==357); - case 358: /* expression ::= function_expression */ yytestcase(yyruleno==358); - case 359: /* expression ::= case_when_expression */ yytestcase(yyruleno==359); - case 389: /* function_expression ::= literal_func */ yytestcase(yyruleno==389); - case 438: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==438); - case 442: /* boolean_primary ::= predicate */ yytestcase(yyruleno==442); - case 444: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==444); - case 445: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==445); - case 448: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==448); - case 450: /* table_reference ::= table_primary */ yytestcase(yyruleno==450); - case 451: /* table_reference ::= joined_table */ yytestcase(yyruleno==451); - case 455: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==455); - case 510: /* query_simple ::= query_specification */ yytestcase(yyruleno==510); - case 511: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==511); - case 514: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==514); - case 516: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==516); + case 323: /* literal ::= duration_literal */ + case 333: /* signed_literal ::= signed */ yytestcase(yyruleno==333); + case 353: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==353); + case 354: /* expression ::= literal */ yytestcase(yyruleno==354); + case 355: /* expression ::= pseudo_column */ yytestcase(yyruleno==355); + case 356: /* expression ::= column_reference */ yytestcase(yyruleno==356); + case 357: /* expression ::= function_expression */ yytestcase(yyruleno==357); + case 358: /* expression ::= case_when_expression */ yytestcase(yyruleno==358); + case 388: /* function_expression ::= literal_func */ yytestcase(yyruleno==388); + case 437: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==437); + case 441: /* boolean_primary ::= predicate */ yytestcase(yyruleno==441); + case 443: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==443); + case 444: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==444); + case 447: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==447); + case 449: /* table_reference ::= table_primary */ yytestcase(yyruleno==449); + case 450: /* table_reference ::= joined_table */ yytestcase(yyruleno==450); + case 454: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==454); + case 509: /* query_simple ::= query_specification */ yytestcase(yyruleno==509); + case 510: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==510); + case 513: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==513); + case 515: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==515); { yylhsminor.yy148 = yymsp[0].minor.yy148; } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 325: /* literal ::= NULL */ + case 324: /* literal ::= NULL */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 326: /* literal ::= NK_QUESTION */ + case 325: /* literal ::= NK_QUESTION */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 327: /* duration_literal ::= NK_VARIABLE */ + case 326: /* duration_literal ::= NK_VARIABLE */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 328: /* signed ::= NK_INTEGER */ + case 327: /* signed ::= NK_INTEGER */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 329: /* signed ::= NK_PLUS NK_INTEGER */ + case 328: /* signed ::= NK_PLUS NK_INTEGER */ { yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 330: /* signed ::= NK_MINUS NK_INTEGER */ + case 329: /* 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; @@ -4649,14 +4643,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 331: /* signed ::= NK_FLOAT */ + case 330: /* signed ::= NK_FLOAT */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 332: /* signed ::= NK_PLUS NK_FLOAT */ + case 331: /* signed ::= NK_PLUS NK_FLOAT */ { yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 333: /* signed ::= NK_MINUS NK_FLOAT */ + case 332: /* 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; @@ -4664,57 +4658,57 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 335: /* signed_literal ::= NK_STRING */ + case 334: /* signed_literal ::= NK_STRING */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 336: /* signed_literal ::= NK_BOOL */ + case 335: /* signed_literal ::= NK_BOOL */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 337: /* signed_literal ::= TIMESTAMP NK_STRING */ + case 336: /* signed_literal ::= TIMESTAMP NK_STRING */ { yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 338: /* signed_literal ::= duration_literal */ - case 340: /* signed_literal ::= literal_func */ yytestcase(yyruleno==340); - case 409: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==409); - case 471: /* select_item ::= common_expression */ yytestcase(yyruleno==471); - case 481: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==481); - case 515: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==515); - case 517: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==517); - case 530: /* search_condition ::= common_expression */ yytestcase(yyruleno==530); + case 337: /* signed_literal ::= duration_literal */ + case 339: /* signed_literal ::= literal_func */ yytestcase(yyruleno==339); + case 408: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==408); + case 470: /* select_item ::= common_expression */ yytestcase(yyruleno==470); + case 480: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==480); + case 514: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==514); + case 516: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==516); + case 529: /* search_condition ::= common_expression */ yytestcase(yyruleno==529); { yylhsminor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 339: /* signed_literal ::= NULL */ + case 338: /* signed_literal ::= NULL */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 341: /* signed_literal ::= NK_QUESTION */ + case 340: /* signed_literal ::= NK_QUESTION */ { yylhsminor.yy148 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 360: /* expression ::= NK_LP expression NK_RP */ - case 443: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==443); - case 529: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==529); + case 359: /* expression ::= NK_LP expression NK_RP */ + case 442: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==442); + case 528: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==528); { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 361: /* expression ::= NK_PLUS expr_or_subquery */ + case 360: /* expression ::= NK_PLUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 362: /* expression ::= NK_MINUS expr_or_subquery */ + case 361: /* expression ::= NK_MINUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 363: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 362: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4722,7 +4716,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 364: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 363: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4730,7 +4724,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 365: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 364: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4738,7 +4732,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 366: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 365: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4746,7 +4740,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 367: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 366: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4754,14 +4748,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 368: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 367: /* expression ::= column_reference NK_ARROW NK_STRING */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 369: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 368: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4769,7 +4763,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 370: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 369: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4777,70 +4771,70 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 373: /* column_reference ::= column_name */ + case 372: /* column_reference ::= column_name */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy199, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 374: /* column_reference ::= table_name NK_DOT column_name */ + case 373: /* column_reference ::= table_name NK_DOT column_name */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 375: /* pseudo_column ::= ROWTS */ - case 376: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==376); - case 378: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==378); - case 379: /* pseudo_column ::= QEND */ yytestcase(yyruleno==379); - case 380: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==380); - case 381: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==381); - case 382: /* pseudo_column ::= WEND */ yytestcase(yyruleno==382); - case 383: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==383); - case 384: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==384); - case 385: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==385); - case 391: /* literal_func ::= NOW */ yytestcase(yyruleno==391); + case 374: /* pseudo_column ::= ROWTS */ + case 375: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==375); + case 377: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==377); + case 378: /* pseudo_column ::= QEND */ yytestcase(yyruleno==378); + case 379: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==379); + case 380: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==380); + case 381: /* pseudo_column ::= WEND */ yytestcase(yyruleno==381); + case 382: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==382); + case 383: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==383); + case 384: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==384); + case 390: /* literal_func ::= NOW */ yytestcase(yyruleno==390); { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 377: /* pseudo_column ::= table_name NK_DOT TBNAME */ + case 376: /* pseudo_column ::= table_name NK_DOT TBNAME */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy199)))); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 386: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 387: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==387); + case 385: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 386: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==386); { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404)); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 388: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + case 387: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy530)); } yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 390: /* literal_func ::= noarg_func NK_LP NK_RP */ + case 389: /* literal_func ::= noarg_func NK_LP NK_RP */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy199, NULL)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 405: /* star_func_para_list ::= NK_STAR */ + case 404: /* star_func_para_list ::= NK_STAR */ { yylhsminor.yy404 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 410: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 474: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==474); + case 409: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 473: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==473); { yylhsminor.yy148 = createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 411: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ + case 410: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 412: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + case 411: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 415: /* when_then_expr ::= WHEN common_expression THEN common_expression */ + case 414: /* when_then_expr ::= WHEN common_expression THEN common_expression */ { yymsp[-3].minor.yy148 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } break; - case 417: /* case_when_else_opt ::= ELSE common_expression */ + case 416: /* case_when_else_opt ::= ELSE common_expression */ { yymsp[-1].minor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } break; - case 418: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 423: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==423); + case 417: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 422: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==422); { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4848,7 +4842,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 419: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 418: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4856,7 +4850,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 420: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 419: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4864,71 +4858,71 @@ static YYACTIONTYPE yy_reduce( } yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 421: /* predicate ::= expr_or_subquery IS NULL */ + case 420: /* predicate ::= expr_or_subquery IS NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), NULL)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 422: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 421: /* predicate ::= expr_or_subquery IS NOT NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL)); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 424: /* compare_op ::= NK_LT */ + case 423: /* compare_op ::= NK_LT */ { yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; } break; - case 425: /* compare_op ::= NK_GT */ + case 424: /* compare_op ::= NK_GT */ { yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; } break; - case 426: /* compare_op ::= NK_LE */ + case 425: /* compare_op ::= NK_LE */ { yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; } break; - case 427: /* compare_op ::= NK_GE */ + case 426: /* compare_op ::= NK_GE */ { yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; } break; - case 428: /* compare_op ::= NK_NE */ + case 427: /* compare_op ::= NK_NE */ { yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; } break; - case 429: /* compare_op ::= NK_EQ */ + case 428: /* compare_op ::= NK_EQ */ { yymsp[0].minor.yy20 = OP_TYPE_EQUAL; } break; - case 430: /* compare_op ::= LIKE */ + case 429: /* compare_op ::= LIKE */ { yymsp[0].minor.yy20 = OP_TYPE_LIKE; } break; - case 431: /* compare_op ::= NOT LIKE */ + case 430: /* compare_op ::= NOT LIKE */ { yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; } break; - case 432: /* compare_op ::= MATCH */ + case 431: /* compare_op ::= MATCH */ { yymsp[0].minor.yy20 = OP_TYPE_MATCH; } break; - case 433: /* compare_op ::= NMATCH */ + case 432: /* compare_op ::= NMATCH */ { yymsp[0].minor.yy20 = OP_TYPE_NMATCH; } break; - case 434: /* compare_op ::= CONTAINS */ + case 433: /* compare_op ::= CONTAINS */ { yymsp[0].minor.yy20 = OP_TYPE_JSON_CONTAINS; } break; - case 435: /* in_op ::= IN */ + case 434: /* in_op ::= IN */ { yymsp[0].minor.yy20 = OP_TYPE_IN; } break; - case 436: /* in_op ::= NOT IN */ + case 435: /* in_op ::= NOT IN */ { yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; } break; - case 437: /* in_predicate_value ::= NK_LP literal_list NK_RP */ + case 436: /* in_predicate_value ::= NK_LP literal_list NK_RP */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 439: /* boolean_value_expression ::= NOT boolean_primary */ + case 438: /* boolean_value_expression ::= NOT boolean_primary */ { SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 440: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 439: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4936,7 +4930,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 441: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 440: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4944,48 +4938,48 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 447: /* from_clause_opt ::= FROM table_reference_list */ - case 476: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==476); - case 504: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==504); + case 446: /* from_clause_opt ::= FROM table_reference_list */ + case 475: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==475); + case 503: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==503); { yymsp[-1].minor.yy148 = yymsp[0].minor.yy148; } break; - case 449: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ + case 448: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ { yylhsminor.yy148 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, NULL); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 452: /* table_primary ::= table_name alias_opt */ + case 451: /* table_primary ::= table_name alias_opt */ { yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 453: /* table_primary ::= db_name NK_DOT table_name alias_opt */ + case 452: /* table_primary ::= db_name NK_DOT table_name alias_opt */ { yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-3].minor.yy199, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 454: /* table_primary ::= subquery alias_opt */ + case 453: /* table_primary ::= subquery alias_opt */ { yylhsminor.yy148 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 456: /* alias_opt ::= */ + case 455: /* alias_opt ::= */ { yymsp[1].minor.yy199 = nil_token; } break; - case 458: /* alias_opt ::= AS table_alias */ + case 457: /* alias_opt ::= AS table_alias */ { yymsp[-1].minor.yy199 = yymsp[0].minor.yy199; } break; - case 459: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 460: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==460); + case 458: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 459: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==459); { yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148; } break; - case 461: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + case 460: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ { yylhsminor.yy148 = createJoinTableNode(pCxt, yymsp[-4].minor.yy470, yymsp[-5].minor.yy148, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 462: /* join_type ::= */ + case 461: /* join_type ::= */ { yymsp[1].minor.yy470 = JOIN_TYPE_INNER; } break; - case 463: /* join_type ::= INNER */ + case 462: /* join_type ::= INNER */ { yymsp[0].minor.yy470 = JOIN_TYPE_INNER; } break; - case 464: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 463: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { yymsp[-11].minor.yy148 = createSelectStmt(pCxt, yymsp[-10].minor.yy397, yymsp[-9].minor.yy404, yymsp[-8].minor.yy148); yymsp[-11].minor.yy148 = addWhereClause(pCxt, yymsp[-11].minor.yy148, yymsp[-7].minor.yy148); @@ -4998,73 +4992,73 @@ static YYACTIONTYPE yy_reduce( yymsp[-11].minor.yy148 = addFillClause(pCxt, yymsp[-11].minor.yy148, yymsp[-3].minor.yy148); } break; - case 467: /* set_quantifier_opt ::= ALL */ + case 466: /* set_quantifier_opt ::= ALL */ { yymsp[0].minor.yy397 = false; } break; - case 470: /* select_item ::= NK_STAR */ + case 469: /* select_item ::= NK_STAR */ { yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 472: /* select_item ::= common_expression column_alias */ - case 482: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==482); + case 471: /* select_item ::= common_expression column_alias */ + case 481: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==481); { yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 473: /* select_item ::= common_expression AS column_alias */ - case 483: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==483); + case 472: /* select_item ::= common_expression AS column_alias */ + case 482: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==482); { yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), &yymsp[0].minor.yy199); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 478: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 500: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==500); - case 519: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==519); + case 477: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 499: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==499); + case 518: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==518); { yymsp[-2].minor.yy404 = yymsp[0].minor.yy404; } break; - case 485: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + case 484: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ { yymsp[-5].minor.yy148 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 486: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + case 485: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ { yymsp[-3].minor.yy148 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 487: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + case 486: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-5].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 488: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + case 487: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-7].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 492: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ + case 491: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ { yymsp[-3].minor.yy148 = createFillNode(pCxt, yymsp[-1].minor.yy334, NULL); } break; - case 493: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + case 492: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ { yymsp[-5].minor.yy148 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } break; - case 494: /* fill_mode ::= NONE */ + case 493: /* fill_mode ::= NONE */ { yymsp[0].minor.yy334 = FILL_MODE_NONE; } break; - case 495: /* fill_mode ::= PREV */ + case 494: /* fill_mode ::= PREV */ { yymsp[0].minor.yy334 = FILL_MODE_PREV; } break; - case 496: /* fill_mode ::= NULL */ + case 495: /* fill_mode ::= NULL */ { yymsp[0].minor.yy334 = FILL_MODE_NULL; } break; - case 497: /* fill_mode ::= LINEAR */ + case 496: /* fill_mode ::= LINEAR */ { yymsp[0].minor.yy334 = FILL_MODE_LINEAR; } break; - case 498: /* fill_mode ::= NEXT */ + case 497: /* fill_mode ::= NEXT */ { yymsp[0].minor.yy334 = FILL_MODE_NEXT; } break; - case 501: /* group_by_list ::= expr_or_subquery */ + case 500: /* group_by_list ::= expr_or_subquery */ { yylhsminor.yy404 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 502: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + case 501: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 506: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + case 505: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ { yymsp[-5].minor.yy148 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 509: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 508: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { yylhsminor.yy148 = addOrderByClause(pCxt, yymsp[-3].minor.yy148, yymsp[-2].minor.yy404); yylhsminor.yy148 = addSlimitClause(pCxt, yylhsminor.yy148, yymsp[-1].minor.yy148); @@ -5072,50 +5066,50 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 512: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + case 511: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ { yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy148, yymsp[0].minor.yy148); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 513: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + case 512: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ { yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==525); + case 520: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 524: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==524); { yymsp[-1].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 522: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 526: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==526); + case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==525); { yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 523: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 527: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==527); + case 522: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 526: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==526); { yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 528: /* subquery ::= NK_LP query_expression NK_RP */ + case 527: /* subquery ::= NK_LP query_expression NK_RP */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy148); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 533: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + case 532: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ { yylhsminor.yy148 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), yymsp[-1].minor.yy898, yymsp[0].minor.yy499); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 534: /* ordering_specification_opt ::= */ + case 533: /* ordering_specification_opt ::= */ { yymsp[1].minor.yy898 = ORDER_ASC; } break; - case 535: /* ordering_specification_opt ::= ASC */ + case 534: /* ordering_specification_opt ::= ASC */ { yymsp[0].minor.yy898 = ORDER_ASC; } break; - case 536: /* ordering_specification_opt ::= DESC */ + case 535: /* ordering_specification_opt ::= DESC */ { yymsp[0].minor.yy898 = ORDER_DESC; } break; - case 537: /* null_ordering_opt ::= */ + case 536: /* null_ordering_opt ::= */ { yymsp[1].minor.yy499 = NULL_ORDER_DEFAULT; } break; - case 538: /* null_ordering_opt ::= NULLS FIRST */ + case 537: /* null_ordering_opt ::= NULLS FIRST */ { yymsp[-1].minor.yy499 = NULL_ORDER_FIRST; } break; - case 539: /* null_ordering_opt ::= NULLS LAST */ + case 538: /* null_ordering_opt ::= NULLS LAST */ { yymsp[-1].minor.yy499 = NULL_ORDER_LAST; } break; default: From ba50a7c30dc0dca158f2d6e4b1388457cc4387e0 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 12 Dec 2022 14:25:26 +0800 Subject: [PATCH 25/74] refactor(query): add additional attribute to denote if current block has already loaded data. --- include/common/tcommon.h | 1 + source/common/src/tdatablock.c | 8 +++++--- source/dnode/vnode/src/tsdb/tsdbRead.c | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 6ec3d5db10..f74795a250 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -195,6 +195,7 @@ typedef struct SDataBlockInfo { uint32_t capacity; SBlockID id; int16_t hasVarCol; + int16_t dataLoad; // denote if the data is loaded or not // TODO: optimize and remove following int64_t version; // used for stream, and need serialization diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index dfd0b68039..0e89ecdd68 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -358,7 +358,7 @@ size_t blockDataGetNumOfCols(const SSDataBlock* pBlock) { return taosArrayGetSiz size_t blockDataGetNumOfRows(const SSDataBlock* pBlock) { return pBlock->info.rows; } int32_t blockDataUpdateTsWindow(SSDataBlock* pDataBlock, int32_t tsColumnIndex) { - if (pDataBlock == NULL || pDataBlock->info.rows <= 0) { + if (pDataBlock == NULL || pDataBlock->info.rows <= 0 || pDataBlock->info.dataLoad == 0) { return 0; } @@ -1157,13 +1157,14 @@ void blockDataEmpty(SSDataBlock* pDataBlock) { } pInfo->rows = 0; + pInfo->dataLoad = 0; pInfo->window.ekey = 0; pInfo->window.skey = 0; } // todo temporarily disable it static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* pBlockInfo, uint32_t numOfRows, bool clearPayload) { - ASSERT(numOfRows > 0 /*&& pBlockInfo->capacity >= pBlockInfo->rows*/); + ASSERT(numOfRows > 0); if (numOfRows <= pBlockInfo->capacity) { return TSDB_CODE_SUCCESS; } @@ -1220,7 +1221,7 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* return TSDB_CODE_SUCCESS; } -void colInfoDataCleanup(SColumnInfoData* pColumn, uint32_t numOfRows) { +void colInfoDataCleanup(SColumnInfoData* pColumn, uint32_t numOfRows) { pColumn->hasNull = false; if (IS_VAR_DATA_TYPE(pColumn->info.type)) { @@ -2427,6 +2428,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) { pStart += colLen[i]; } + pBlock->info.dataLoad = 1; pBlock->info.rows = numOfRows; ASSERT(pStart - pData == dataLen); return pStart; diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index a0334684a3..e38f9401ac 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -1143,6 +1143,7 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn i += 1; } + pResBlock->info.dataLoad = 1; pResBlock->info.rows = dumpedRows; pDumpInfo->rowIndex += step * dumpedRows; @@ -2538,6 +2539,7 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { _end: pResBlock->info.id.uid = (pBlockScanInfo != NULL) ? pBlockScanInfo->uid : 0; + pResBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pResBlock, pReader->suppInfo.slotId[0]); setComposedBlockFlag(pReader, true); @@ -3622,6 +3624,7 @@ int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, STSRow* i += 1; } + pBlock->info.dataLoad = 1; pBlock->info.rows += 1; pScanInfo->lastKey = pTSRow->ts; return TSDB_CODE_SUCCESS; @@ -3669,6 +3672,7 @@ int32_t doAppendRowFromFileBlock(SSDataBlock* pResBlock, STsdbReader* pReader, S i += 1; } + pResBlock->info.dataLoad = 1; pResBlock->info.rows += 1; return TSDB_CODE_SUCCESS; } From 1d9514d6d8e582cee34e3f0f3a9b0195f013d7cb Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 12 Dec 2022 14:28:08 +0800 Subject: [PATCH 26/74] refactor(query): add an assert. --- source/libs/executor/src/timewindowoperator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 30b7f6b8fb..b2ace0fbc0 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1027,9 +1027,10 @@ SResultRowPosition addToOpenWindowList(SResultRowInfo* pResultRowInfo, const SRe int64_t* extractTsCol(SSDataBlock* pBlock, const SIntervalAggOperatorInfo* pInfo) { TSKEY* tsCols = NULL; - if (pBlock->pDataBlock != NULL) { + if (pBlock->pDataBlock != NULL && pBlock->info.dataLoad == 1) { SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, pInfo->primaryTsIndex); tsCols = (int64_t*)pColDataInfo->pData; + ASSERT(tsCols[0] != 0); // no data in primary ts if (tsCols[0] == 0 && tsCols[pBlock->info.rows - 1] == 0) { From 2bf21e6a176623c8276ba6266f1d27d6ea391858 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 12 Dec 2022 14:33:39 +0800 Subject: [PATCH 27/74] fix(query): set flag for merged block. --- source/libs/executor/src/sortoperator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c index 005b794f0b..7c7ff9be86 100644 --- a/source/libs/executor/src/sortoperator.c +++ b/source/libs/executor/src/sortoperator.c @@ -105,6 +105,7 @@ void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHandle) { } } + pBlock->info.dataLoad = 1; pBlock->info.rows += 1; } From c31f36d84104f988069bccbe156f4eb9c5bb55d6 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 12 Dec 2022 15:06:40 +0800 Subject: [PATCH 28/74] fix(query): set data load flag for multi-way merge . --- source/libs/executor/src/sortoperator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c index 7c7ff9be86..7ac007b7cb 100644 --- a/source/libs/executor/src/sortoperator.c +++ b/source/libs/executor/src/sortoperator.c @@ -699,6 +699,7 @@ SSDataBlock* getMultiwaySortedBlockData(SSortHandle* pHandle, SSDataBlock* pData pInfo->limitInfo.numOfOutputRows += p->info.rows; pDataBlock->info.rows = p->info.rows; pDataBlock->info.id.groupId = pInfo->groupId; + pDataBlock->info.dataLoad = 1; } qDebug("%s get sorted block, groupId:0x%" PRIx64 " rows:%d", GET_TASKID(pTaskInfo), pDataBlock->info.id.groupId, From 903804883d1bf35d7f11c1dbec66df95cc5d699b Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Mon, 12 Dec 2022 15:35:50 +0800 Subject: [PATCH 29/74] fix: create stream error --- source/libs/parser/src/parTranslater.c | 48 ++++++++++++++++++++------ 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 10e45901e5..c0c9d01bf3 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -2837,7 +2837,7 @@ static int32_t rewriteProjectAlias(SNodeList* pProjectionList) { return TSDB_CODE_SUCCESS; } -static int32_t checkProjectAlias(STranslateContext* pCxt, SNodeList* pProjectionList) { +static int32_t checkProjectAlias(STranslateContext* pCxt, SNodeList* pProjectionList, SHashObj** pOutput) { SHashObj* pUserAliasSet = taosHashInit(LIST_LENGTH(pProjectionList), taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); SNode* pProject = NULL; @@ -2849,13 +2849,17 @@ static int32_t checkProjectAlias(STranslateContext* pCxt, SNodeList* pProjection } taosHashPut(pUserAliasSet, pExpr->userAlias, strlen(pExpr->userAlias), &pExpr, POINTER_BYTES); } - taosHashCleanup(pUserAliasSet); + if (NULL == pOutput) { + taosHashCleanup(pUserAliasSet); + } else { + *pOutput = pUserAliasSet; + } return TSDB_CODE_SUCCESS; } static int32_t translateProjectionList(STranslateContext* pCxt, SSelectStmt* pSelect) { if (pSelect->isSubquery) { - return checkProjectAlias(pCxt, pSelect->pProjectionList); + return checkProjectAlias(pCxt, pSelect->pProjectionList, NULL); } return rewriteProjectAlias(pSelect->pProjectionList); } @@ -3888,8 +3892,7 @@ static int32_t checkDbKeepOption(STranslateContext* pCxt, SDatabaseOptions* pOpt pOptions->keep[0] > tsdbMaxKeep || pOptions->keep[1] > tsdbMaxKeep || pOptions->keep[2] > tsdbMaxKeep) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, "Invalid option keep: %" PRId64 ", %" PRId64 ", %" PRId64 " valid range: [%dm, %dm]", - pOptions->keep[0], pOptions->keep[1], pOptions->keep[2], TSDB_MIN_KEEP, - tsdbMaxKeep); + pOptions->keep[0], pOptions->keep[1], pOptions->keep[2], TSDB_MIN_KEEP, tsdbMaxKeep); } if (!((pOptions->keep[0] <= pOptions->keep[1]) && (pOptions->keep[1] <= pOptions->keep[2]))) { @@ -4044,7 +4047,7 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName code = checkDbPrecisionOption(pCxt, pOptions); } if (TSDB_CODE_SUCCESS == code) { - code = checkDbKeepOption(pCxt, pOptions); // use precision + code = checkDbKeepOption(pCxt, pOptions); // use precision } if (TSDB_CODE_SUCCESS == code) { code = checkDbRangeOption(pCxt, "pages", pOptions->pages, TSDB_MIN_PAGES_PER_VNODE, TSDB_MAX_PAGES_PER_VNODE); @@ -5504,9 +5507,21 @@ static void getSourceDatabase(SNode* pStmt, int32_t acctId, char* pDbFName) { tNameGetFullDbName(&name, pDbFName); } -static int32_t addWstartTsToCreateStreamQuery(SNode* pStmt) { - SSelectStmt* pSelect = (SSelectStmt*)pStmt; - SNode* pProj = nodesListGetNode(pSelect->pProjectionList, 0); +static void getStreamQueryFirstProjectAliasName(SHashObj* pUserAliasSet, char* aliasName, int32_t len) { + if (NULL == taosHashGet(pUserAliasSet, "_wstart", strlen("_wstart"))) { + snprintf(aliasName, len, "%s", "_wstart"); + return; + } + if (NULL == taosHashGet(pUserAliasSet, "ts", strlen("ts"))) { + snprintf(aliasName, len, "%s", "ts"); + return; + } + taosRandStr(aliasName, len); + return; +} + +static int32_t addWstartTsToCreateStreamQueryImpl(SSelectStmt* pSelect, SHashObj* pUserAliasSet) { + SNode* pProj = nodesListGetNode(pSelect->pProjectionList, 0); if (NULL == pSelect->pWindow || (QUERY_NODE_FUNCTION == nodeType(pProj) && 0 == strcmp("_wstart", ((SFunctionNode*)pProj)->functionName))) { return TSDB_CODE_SUCCESS; @@ -5516,7 +5531,7 @@ static int32_t addWstartTsToCreateStreamQuery(SNode* pStmt) { return TSDB_CODE_OUT_OF_MEMORY; } strcpy(pFunc->functionName, "_wstart"); - strcpy(pFunc->node.aliasName, pFunc->functionName); + getStreamQueryFirstProjectAliasName(pUserAliasSet, pFunc->node.aliasName, sizeof(pFunc->node.aliasName)); int32_t code = nodesListPushFront(pSelect->pProjectionList, (SNode*)pFunc); if (TSDB_CODE_SUCCESS != code) { nodesDestroyNode((SNode*)pFunc); @@ -5524,6 +5539,17 @@ static int32_t addWstartTsToCreateStreamQuery(SNode* pStmt) { return code; } +static int32_t addWstartTsToCreateStreamQuery(STranslateContext* pCxt, SNode* pStmt) { + SSelectStmt* pSelect = (SSelectStmt*)pStmt; + SHashObj* pUserAliasSet = NULL; + int32_t code = checkProjectAlias(pCxt, pSelect->pProjectionList, &pUserAliasSet); + if (TSDB_CODE_SUCCESS == code) { + code = addWstartTsToCreateStreamQueryImpl(pSelect, pUserAliasSet); + } + taosHashCleanup(pUserAliasSet); + return code; +} + static int32_t addTagsToCreateStreamQuery(STranslateContext* pCxt, SCreateStreamStmt* pStmt, SSelectStmt* pSelect) { if (NULL == pStmt->pTags) { return TSDB_CODE_SUCCESS; @@ -5626,7 +5652,7 @@ static int32_t checkStreamQuery(STranslateContext* pCxt, SSelectStmt* pSelect) { static int32_t buildCreateStreamQuery(STranslateContext* pCxt, SCreateStreamStmt* pStmt, SCMCreateStreamReq* pReq) { pCxt->createStream = true; - int32_t code = addWstartTsToCreateStreamQuery(pStmt->pQuery); + int32_t code = addWstartTsToCreateStreamQuery(pCxt, pStmt->pQuery); if (TSDB_CODE_SUCCESS == code) { code = addSubtableInfoToCreateStreamQuery(pCxt, pStmt); } From 55fd615de841685490009edff5ab0296dc39c50c Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 12 Dec 2022 16:19:04 +0800 Subject: [PATCH 30/74] fix: disk full recovery issue --- source/dnode/mgmt/node_mgmt/src/dmNodes.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmNodes.c b/source/dnode/mgmt/node_mgmt/src/dmNodes.c index 6893e486bb..981797834a 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmNodes.c +++ b/source/dnode/mgmt/node_mgmt/src/dmNodes.c @@ -149,10 +149,13 @@ int32_t dmRunDnode(SDnode *pDnode) { return 0; } - if (count == 0) osUpdate(); - - count %= 10; - count++; + if (count == 10) { + osUpdate(); + count = 0; + } else { + count++; + } + taosMsleep(100); } } From 6d2823218967d7fb893d05a3378a0bddf1c6aad6 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Mon, 12 Dec 2022 17:14:08 +0800 Subject: [PATCH 31/74] fix: create stream error --- source/libs/parser/src/parTranslater.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index c0c9d01bf3..d4feef6cb4 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -5516,7 +5516,10 @@ static void getStreamQueryFirstProjectAliasName(SHashObj* pUserAliasSet, char* a snprintf(aliasName, len, "%s", "ts"); return; } - taosRandStr(aliasName, len); + do { + taosRandStr(aliasName, len - 1); + aliasName[len - 1] = '\0'; + } while (NULL != taosHashGet(pUserAliasSet, aliasName, strlen(aliasName))); return; } From 159088267b0afb6905cd85cad03338350c7b25c2 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Mon, 12 Dec 2022 17:23:53 +0800 Subject: [PATCH 32/74] fix: fix error in getting pageIdList from group page hash map --- source/libs/function/src/tpercentile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index 9c3e1f5604..27d029aaa5 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -497,15 +497,15 @@ double getPercentileImpl(tMemBucket *pMemBucket, int32_t count, double fraction) resetSlotInfo(pMemBucket); int32_t groupId = getGroupId(pMemBucket->numOfSlots, i, pMemBucket->times - 1); - SArray* list = taosHashGet(pMemBucket->groupPagesMap, &groupId, sizeof(groupId)); + SArray* list = *(SArray **)taosHashGet(pMemBucket->groupPagesMap, &groupId, sizeof(groupId)); ASSERT(list != NULL && list->size > 0); for (int32_t f = 0; f < list->size; ++f) { - SPageInfo *pgInfo = *(SPageInfo **)taosArrayGet(list, f); - SFilePage *pg = getBufPage(pMemBucket->pBuffer, getPageId(pgInfo)); + int32_t *pageId = taosArrayGet(list, f); + SFilePage *pg = getBufPage(pMemBucket->pBuffer, *pageId); tMemBucketPut(pMemBucket, pg->data, (int32_t)pg->num); - releaseBufPageInfo(pMemBucket->pBuffer, pgInfo); + releaseBufPage(pMemBucket->pBuffer, pg); } return getPercentileImpl(pMemBucket, count - num, fraction); From 71587df60347ff76ee29b5aa74ef31f73df9a195 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 12 Dec 2022 17:34:32 +0800 Subject: [PATCH 33/74] enh: topic privilege --- source/dnode/mnode/impl/src/mndConsumer.c | 8 -- tests/parallel_test/cases.task | 1 + tests/script/tsim/user/privilege_topic.sim | 156 +++++++++++++++++++++ 3 files changed, 157 insertions(+), 8 deletions(-) create mode 100644 tests/script/tsim/user/privilege_topic.sim diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index 8e2b17a963..37e2c35225 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -554,14 +554,6 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) { goto SUBSCRIBE_OVER; } - // check topic only -#if 0 - if (mndCheckDbPrivilegeByName(pMnode, pMsg->info.conn.user, MND_OPER_READ_DB, pTopic->db) != 0) { - mndReleaseTopic(pMnode, pTopic); - goto SUBSCRIBE_OVER; - } -#endif - if (mndCheckTopicPrivilege(pMnode, pMsg->info.conn.user, MND_OPER_SUBSCRIBE, pTopic) != 0) { mndReleaseTopic(pMnode, pTopic); goto SUBSCRIBE_OVER; diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 154eebb4de..4cbba106ba 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -10,6 +10,7 @@ ,,y,script,./test.sh -f tsim/user/password.sim ,,y,script,./test.sh -f tsim/user/privilege_db.sim ,,y,script,./test.sh -f tsim/user/privilege_sysinfo.sim +,,y,script,./test.sh -f tsim/user/privilege_topic.sim ,,y,script,./test.sh -f tsim/db/alter_option.sim ,,y,script,./test.sh -f tsim/db/alter_replica_13.sim ,,y,script,./test.sh -f tsim/db/alter_replica_31.sim diff --git a/tests/script/tsim/user/privilege_topic.sim b/tests/script/tsim/user/privilege_topic.sim new file mode 100644 index 0000000000..9ce5bebec3 --- /dev/null +++ b/tests/script/tsim/user/privilege_topic.sim @@ -0,0 +1,156 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print =============== create db +sql create database root_d1 vgroups 1; +sql create database root_d2 vgroups 1; +sql create database root_d3 vgroups 1; + +sql show user privileges +if $rows != 1 then + return -1 +endi +if $data(root)[1] != all then + return -1 +endi +if $data(root)[2] != all then + return -1 +endi + +print =============== create users +sql create user user1 PASS 'taosdata' +sql create user user2 PASS 'taosdata' +sql create user user3 PASS 'taosdata' +sql create user user4 PASS 'taosdata' +sql create user user5 PASS 'taosdata' +sql create user user6 PASS 'taosdata' +sql alter user user1 sysinfo 0 + +sql select * from information_schema.ins_users +if $rows != 7 then + return -1 +endi + +sql GRANT read ON root_d1.* to user1; +sql GRANT write ON root_d2.* to user2; +sql GRANT read ON root_d3.* to user3; +sql GRANT write ON root_d3.* to user3; + +sql show user privileges +if $rows != 5 then + return -1 +endi +if $data(user1)[1] != read then + return -1 +endi +if $data(user1)[2] != root_d1 then + return -1 +endi +if $data(user2)[1] != write then + return -1 +endi +if $data(user2)[2] != root_d2 then + return -1 +endi + +print =============== create topis +sql use root_d1 +sql create table root_d1_stb (ts timestamp, i int) tags (j int) +sql create topic root_d1_topic1 as select ts, i from root_d1_stb +sql create topic root_d1_topic2 as select ts, i from root_d1_stb +sql create topic root_d1_topic3 as select ts, i from root_d1_stb +sql create topic root_d1_topic4 as select ts, i from root_d1_stb + +sql show user privileges +if $rows != 5 then + return -1 +endi + +sql GRANT subscribe ON root_d1_topic1 TO user4 +sql GRANT subscribe ON root_d1_topic2 TO user5 +sql GRANT subscribe ON root_d1_topic3 TO user6 +sql show user privileges +if $rows != 8 then + return -1 +endi + +if $data(user4)[1] != subscribe then + return -1 +endi +if $data(user4)[2] != root_d1_topic1 then + return -1 +endi +if $data(user5)[1] != subscribe then + return -1 +endi +if $data(user5)[2] != root_d1_topic2 then + return -1 +endi +if $data(user6)[1] != subscribe then + return -1 +endi +if $data(user6)[2] != root_d1_topic3 then + return -1 +endi + +sql REVOKE subscribe ON root_d1_topic3 from user6 +sql show user privileges +if $rows != 7 then + return -1 +endi +if $data(user4)[1] != subscribe then + return -1 +endi +if $data(user4)[2] != root_d1_topic1 then + return -1 +endi +if $data(user5)[1] != subscribe then + return -1 +endi +if $data(user5)[2] != root_d1_topic2 then + return -1 +endi + +print =============== repeat revoke/grant or invalid revoke/grant +sql GRANT subscribe ON root_d1_topic1 to user4 +sql GRANT subscribe ON root_d1_topic2 to user4 +sql GRANT subscribe ON root_d1_topic3 to user4 +sql GRANT subscribe ON root_d1_topic1 to user5 +sql GRANT subscribe ON root_d1_topic2 to user5 +sql GRANT subscribe ON root_d1_topic3 to user5 +sql GRANT subscribe ON root_d1_topic1 to user6 +sql GRANT subscribe ON root_d1_topic2 to user6 +sql GRANT subscribe ON root_d1_topic3 to user6 +sql REVOKE subscribe ON root_d1_topic1 from user4 +sql REVOKE subscribe ON root_d1_topic2 from user4 +sql REVOKE subscribe ON root_d1_topic3 from user4 +sql REVOKE subscribe ON root_d1_topic1 from user5 +sql REVOKE subscribe ON root_d1_topic2 from user5 +sql REVOKE subscribe ON root_d1_topic3 from user5 +sql REVOKE subscribe ON root_d1_topic1 from user6 +sql REVOKE subscribe ON root_d1_topic2 from user6 +sql REVOKE subscribe ON root_d1_topic3 from user6 + +print =============== invalid revoke/grant +sql_error GRANT subscribe ON root_d1_topicx from user5 +sql_error REVOKE subscribe ON root_d1_topicx from user5 + +print =============== check +sql GRANT subscribe ON root_d1_topic1 TO user4 +sql GRANT subscribe ON root_d1_topic2 TO user5 +sql GRANT subscribe ON root_d1_topic3 TO user6 +sql show user privileges +if $rows != 8 then + return -1 +endi + +print =============== re connect +print user u1 login +sql close +sql connect user1 + +sql_error show user privileges + +system sh/exec.sh -n dnode1 -s stop -x SIGINT From 8f02297890f8585950b74f8dff07cf48c4800e9f Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 12 Dec 2022 17:53:04 +0800 Subject: [PATCH 34/74] refactor: do some internal refactor. --- include/os/osEnv.h | 2 +- source/common/src/tglobal.c | 2 +- source/libs/function/src/detail/tavgfunction.c | 2 +- source/libs/function/src/detail/tminmax.c | 10 +++++----- source/os/src/osEnv.c | 2 +- source/os/src/osSysinfo.c | 10 +++++----- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/os/osEnv.h b/include/os/osEnv.h index a3bd209693..533d989ffc 100644 --- a/include/os/osEnv.h +++ b/include/os/osEnv.h @@ -36,7 +36,7 @@ extern int64_t tsStreamMax; extern float tsNumOfCores; extern int64_t tsTotalMemoryKB; extern char *tsProcPath; -extern char tsSIMDEnable; +extern char tsSIMDBuiltins; extern char tsSSE42Enable; extern char tsAVXEnable; extern char tsAVX2Enable; diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 3bcfddb8b2..552d7335f5 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -340,7 +340,7 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) { if (cfgAddBool(pCfg, "AVX", tsAVXEnable, 0) != 0) return -1; if (cfgAddBool(pCfg, "AVX2", tsAVX2Enable, 0) != 0) return -1; if (cfgAddBool(pCfg, "FMA", tsFMAEnable, 0) != 0) return -1; - if (cfgAddBool(pCfg, "SIMD-Supported", tsSIMDEnable, 0) != 0) return -1; + if (cfgAddBool(pCfg, "SIMD-builtins", tsSIMDBuiltins, 0) != 0) return -1; if (cfgAddInt64(pCfg, "openMax", tsOpenMax, 0, INT64_MAX, 1) != 0) return -1; if (cfgAddInt64(pCfg, "streamMax", tsStreamMax, 0, INT64_MAX, 1) != 0) return -1; diff --git a/source/libs/function/src/detail/tavgfunction.c b/source/libs/function/src/detail/tavgfunction.c index 1c74d22a82..60bf30d8ed 100644 --- a/source/libs/function/src/detail/tavgfunction.c +++ b/source/libs/function/src/detail/tavgfunction.c @@ -514,7 +514,7 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) { numOfElem = pInput->numOfRows; pAvgRes->count += pInput->numOfRows; - bool simdAvailable = tsAVXEnable && tsSIMDEnable && (numOfRows > THRESHOLD_SIZE); + bool simdAvailable = tsAVXEnable && tsSIMDBuiltins && (numOfRows > THRESHOLD_SIZE); switch(type) { case TSDB_DATA_TYPE_UTINYINT: diff --git a/source/libs/function/src/detail/tminmax.c b/source/libs/function/src/detail/tminmax.c index b2cb36cba0..cb5cea3cc8 100644 --- a/source/libs/function/src/detail/tminmax.c +++ b/source/libs/function/src/detail/tminmax.c @@ -369,7 +369,7 @@ static int32_t findFirstValPosition(const SColumnInfoData* pCol, int32_t start, static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { // AVX2 version to speedup the loop - if (tsAVX2Enable && tsSIMDEnable) { + if (tsAVX2Enable && tsSIMDBuiltins) { pBuf->v = i8VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); } else { if (!pBuf->assign) { @@ -403,7 +403,7 @@ static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SM static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { // AVX2 version to speedup the loop - if (tsAVX2Enable && tsSIMDEnable) { + if (tsAVX2Enable && tsSIMDBuiltins) { pBuf->v = i16VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); } else { if (!pBuf->assign) { @@ -437,7 +437,7 @@ static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, S static void handleInt32Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { // AVX2 version to speedup the loop - if (tsAVX2Enable && tsSIMDEnable) { + if (tsAVX2Enable && tsSIMDBuiltins) { pBuf->v = i32VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); } else { if (!pBuf->assign) { @@ -500,7 +500,7 @@ static void handleFloatCol(SColumnInfoData* pCol, int32_t start, int32_t numOfRo float* val = (float*)&pBuf->v; // AVX version to speedup the loop - if (tsAVXEnable && tsSIMDEnable) { + if (tsAVXEnable && tsSIMDBuiltins) { *val = floatVectorCmpAVX(pData, numOfRows, isMinFunc); } else { if (!pBuf->assign) { @@ -530,7 +530,7 @@ static void handleDoubleCol(SColumnInfoData* pCol, int32_t start, int32_t numOfR double* val = (double*)&pBuf->v; // AVX version to speedup the loop - if (tsAVXEnable && tsSIMDEnable) { + if (tsAVXEnable && tsSIMDBuiltins) { *val = (double)doubleVectorCmpAVX(pData, numOfRows, isMinFunc); } else { if (!pBuf->assign) { diff --git a/source/os/src/osEnv.c b/source/os/src/osEnv.c index 7063d1f574..c4627ffb75 100644 --- a/source/os/src/osEnv.c +++ b/source/os/src/osEnv.c @@ -37,7 +37,7 @@ float tsNumOfCores = 0; int64_t tsTotalMemoryKB = 0; char *tsProcPath = NULL; -char tsSIMDEnable = 0; +char tsSIMDBuiltins = 0; char tsSSE42Enable = 0; char tsAVXEnable = 0; char tsAVX2Enable = 0; diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 7ec1da0530..35f4566a06 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -484,11 +484,11 @@ int32_t taosGetCpuInstructions(char* sse42, char* avx, char* avx2, char* fma) { #ifdef _TD_X86_ // Since the compiler is not support avx/avx2 instructions, the global variables always need to be // set to be false -#if __AVX__ || __AVX2__ - tsSIMDEnable = true; -#else - tsSIMDEnable = false; -#endif +//#if __AVX__ || __AVX2__ +// tsSIMDBuiltins = true; +//#else +// tsSIMDBuiltins = false; +//#endif uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0; From 8cc54650fc8dece63b318cab0cbf33d2b8e290be Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Mon, 12 Dec 2022 18:14:54 +0800 Subject: [PATCH 35/74] set compressMsg range --- source/libs/transport/src/trans.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c index 0eac12f7c5..e026d98091 100644 --- a/source/libs/transport/src/trans.c +++ b/source/libs/transport/src/trans.c @@ -47,6 +47,10 @@ void* rpcOpen(const SRpcInit* pInit) { } pRpc->compressSize = pInit->compressSize; + if (pRpc->compressSize < 0) { + pRpc->compressSize = -1; + } + pRpc->encryption = pInit->encryption; pRpc->retryLimit = pInit->retryLimit; pRpc->retryInterval = pInit->retryInterval; From d7edcfd207b50c9ce5b6481384e8c306ea37387d Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 12 Dec 2022 18:33:44 +0800 Subject: [PATCH 36/74] fix(query): set dataload flag. --- source/libs/executor/src/executorimpl.c | 2 +- source/libs/executor/src/joinoperator.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 043cc396b5..41e3d890cd 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1080,7 +1080,7 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprS qDebug("%s result generated, rows:%d, groupId:%" PRIu64, GET_TASKID(pTaskInfo), pBlock->info.rows, pBlock->info.id.groupId); - + pBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pBlock, 0); return 0; } diff --git a/source/libs/executor/src/joinoperator.c b/source/libs/executor/src/joinoperator.c index d460af971c..8a097a23ce 100644 --- a/source/libs/executor/src/joinoperator.c +++ b/source/libs/executor/src/joinoperator.c @@ -87,11 +87,11 @@ SOperatorInfo* createMergeJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t } int32_t numOfCols = 0; - SSDataBlock* pResBlock = createDataBlockFromDescNode(pJoinNode->node.pOutputDataBlockDesc); + pInfo->pRes = createDataBlockFromDescNode(pJoinNode->node.pOutputDataBlockDesc); + SExprInfo* pExprInfo = createExprInfo(pJoinNode->pTargets, NULL, &numOfCols); initResultSizeInfo(&pOperator->resultInfo, 4096); - - pInfo->pRes = pResBlock; + blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); setOperatorInfo(pOperator, "MergeJoinOperator", QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN, false, OP_NOT_OPENED, pInfo, pTaskInfo); pOperator->exprSupp.pExprInfo = pExprInfo; @@ -401,6 +401,7 @@ static void doMergeJoinImpl(struct SOperatorInfo* pOperator, SSDataBlock* pRes) // the pDataBlock are always the same one, no need to call this again pRes->info.rows = nrows; + pRes->info.dataLoad = 1; if (pRes->info.rows >= pOperator->resultInfo.threshold) { break; } @@ -412,7 +413,7 @@ SSDataBlock* doMergeJoin(struct SOperatorInfo* pOperator) { SSDataBlock* pRes = pJoinInfo->pRes; blockDataCleanup(pRes); - blockDataEnsureCapacity(pRes, 4096); + while (true) { int32_t numOfRowsBefore = pRes->info.rows; doMergeJoinImpl(pOperator, pRes); From 113355e45e38e785ebb76e676280d041ad0c589f Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Mon, 12 Dec 2022 19:10:40 +0800 Subject: [PATCH 37/74] release unused handle --- source/libs/transport/src/transCli.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 03e3fb52c4..7b1d7a62aa 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -604,6 +604,7 @@ static int32_t allocConnRef(SCliConn* conn, bool update) { static int32_t specifyConnRef(SCliConn* conn, bool update, int64_t handle) { if (update) { + transReleaseExHandle(transGetRefMgt(), conn->refId); transRemoveExHandle(transGetRefMgt(), conn->refId); conn->refId = -1; } From 190fbe849e7979bfae51e78d2c6c97e32eba4f0d Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Mon, 12 Dec 2022 20:20:24 +0800 Subject: [PATCH 38/74] fix: udfd pipe can close before sending response --- source/libs/function/src/udfd.c | 115 ++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 43 deletions(-) diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 2ab1e8b64c..9ee9c787ee 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -28,39 +28,46 @@ #include "tmsg.h" #include "trpc.h" #include "tmisce.h" -// clang-foramt on +// clang-format on typedef struct SUdfdContext { - uv_loop_t * loop; + uv_loop_t *loop; uv_pipe_t ctrlPipe; uv_signal_t intrSignal; char listenPipeName[PATH_MAX + UDF_LISTEN_PIPE_NAME_LEN + 2]; uv_pipe_t listeningPipe; - void * clientRpc; + void *clientRpc; SCorEpSet mgmtEp; uv_mutex_t udfsMutex; - SHashObj * udfsHash; + SHashObj *udfsHash; - SArray* residentFuncs; + SArray *residentFuncs; bool printVersion; } SUdfdContext; SUdfdContext global; +struct SUdfdUvConn; +struct SUvUdfWork; + typedef struct SUdfdUvConn { uv_stream_t *client; - char * inputBuf; + char *inputBuf; int32_t inputLen; int32_t inputCap; int32_t inputTotal; + + struct SUvUdfWork *pWorkList; // head of work list } SUdfdUvConn; typedef struct SUvUdfWork { - uv_stream_t *client; + SUdfdUvConn *conn; uv_buf_t input; uv_buf_t output; + + struct SUvUdfWork *pWorkNext; } SUvUdfWork; typedef enum { UDF_STATE_INIT = 0, UDF_STATE_LOADING, UDF_STATE_READY, UDF_STATE_UNLOADING } EUdfState; @@ -70,7 +77,7 @@ typedef struct SUdf { EUdfState state; uv_mutex_t lock; uv_cond_t condReady; - bool resident; + bool resident; char name[TSDB_FUNC_NAME_LEN + 1]; int8_t funcType; @@ -107,7 +114,7 @@ typedef enum EUdfdRpcReqRspType { typedef struct SUdfdRpcSendRecvInfo { EUdfdRpcReqRspType rpcType; int32_t code; - void * param; + void *param; uv_sem_t resultSem; } SUdfdRpcSendRecvInfo; @@ -178,7 +185,7 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { fnInfo("setup request. seq num: %" PRId64 ", udf name: %s", request->seqNum, request->setup.udfName); SUdfSetupRequest *setup = &request->setup; int32_t code = TSDB_CODE_SUCCESS; - SUdf * udf = NULL; + SUdf *udf = NULL; uv_mutex_lock(&global.udfsMutex); SUdf **udfInHash = taosHashGet(global.udfsHash, request->setup.udfName, strlen(request->setup.udfName)); if (udfInHash) { @@ -193,7 +200,7 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { uv_cond_init(&udfNew->condReady); udf = udfNew; - SUdf** pUdf = &udf; + SUdf **pUdf = &udf; taosHashPut(global.udfsHash, request->setup.udfName, strlen(request->setup.udfName), pUdf, POINTER_BYTES); uv_mutex_unlock(&global.udfsMutex); } @@ -207,7 +214,7 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { } udf->resident = false; for (int32_t i = 0; i < taosArrayGetSize(global.residentFuncs); ++i) { - char* funcName = taosArrayGet(global.residentFuncs, i); + char *funcName = taosArrayGet(global.residentFuncs, i); if (strcmp(setup->udfName, funcName) == 0) { udf->resident = true; break; @@ -248,11 +255,12 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { SUdfCallRequest *call = &request->call; - fnDebug("call request. call type %d, handle: %" PRIx64 ", seq num %" PRId64 , call->callType, call->udfHandle, request->seqNum); - SUdfcFuncHandle * handle = (SUdfcFuncHandle *)(call->udfHandle); - SUdf * udf = handle->udf; + fnDebug("call request. call type %d, handle: %" PRIx64 ", seq num %" PRId64, call->callType, call->udfHandle, + request->seqNum); + SUdfcFuncHandle *handle = (SUdfcFuncHandle *)(call->udfHandle); + SUdf *udf = handle->udf; SUdfResponse response = {0}; - SUdfResponse * rsp = &response; + SUdfResponse *rsp = &response; SUdfCallResponse *subRsp = &rsp->callRsp; int32_t code = TSDB_CODE_SUCCESS; @@ -352,7 +360,7 @@ void udfdProcessTeardownRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { SUdfTeardownRequest *teardown = &request->teardown; fnInfo("teardown. seq number: %" PRId64 ", handle:%" PRIx64, request->seqNum, teardown->udfHandle); SUdfcFuncHandle *handle = (SUdfcFuncHandle *)(teardown->udfHandle); - SUdf * udf = handle->udf; + SUdf *udf = handle->udf; bool unloadUdf = false; int32_t code = TSDB_CODE_SUCCESS; @@ -409,15 +417,14 @@ void udfdProcessRpcRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) { if (msgInfo->rpcType == UDFD_RPC_MNODE_CONNECT) { SConnectRsp connectRsp = {0}; tDeserializeSConnectRsp(pMsg->pCont, pMsg->contLen, &connectRsp); - + int32_t now = taosGetTimestampSec(); int32_t delta = abs(now - connectRsp.svrTimestamp); if (delta > 900) { msgInfo->code = TSDB_CODE_TIME_UNSYNCED; goto _return; } - - + if (connectRsp.epSet.numOfEps == 0) { msgInfo->code = TSDB_CODE_APP_ERROR; goto _return; @@ -434,7 +441,7 @@ void udfdProcessRpcRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) { goto _return; } SFuncInfo *pFuncInfo = (SFuncInfo *)taosArrayGet(retrieveRsp.pFuncInfos, 0); - SUdf * udf = msgInfo->param; + SUdf *udf = msgInfo->param; udf->funcType = pFuncInfo->funcType; udf->scriptType = pFuncInfo->scriptType; udf->outputType = pFuncInfo->outputType; @@ -487,7 +494,7 @@ int32_t udfdFillUdfInfoFromMNode(void *clientRpc, char *udfName, SUdf *udf) { taosArrayPush(retrieveReq.pFuncNames, udfName); int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq); - void * pReq = rpcMallocCont(contLen); + void *pReq = rpcMallocCont(contLen); tSerializeSRetrieveFuncReq(pReq, contLen, &retrieveReq); taosArrayDestroy(retrieveReq.pFuncNames); @@ -522,7 +529,7 @@ int32_t udfdConnectToMnode() { connReq.startTime = taosGetTimestampMs(); int32_t contLen = tSerializeSConnectReq(NULL, 0, &connReq); - void * pReq = rpcMallocCont(contLen); + void *pReq = rpcMallocCont(contLen); tSerializeSConnectReq(pReq, contLen, &connReq); SUdfdRpcSendRecvInfo *msgInfo = taosMemoryCalloc(1, sizeof(SUdfdRpcSendRecvInfo)); @@ -589,7 +596,7 @@ int32_t udfdLoadUdf(char *udfName, SUdf *udf) { strncpy(finishFuncName, processFuncName, sizeof(finishFuncName)); strncat(finishFuncName, finishSuffix, strlen(finishSuffix)); uv_dlsym(&udf->lib, finishFuncName, (void **)(&udf->aggFinishFunc)); - char mergeFuncName[TSDB_FUNC_NAME_LEN + 6] = {0}; + char mergeFuncName[TSDB_FUNC_NAME_LEN + 6] = {0}; char *mergeSuffix = "_merge"; strncpy(mergeFuncName, processFuncName, sizeof(mergeFuncName)); strncat(mergeFuncName, mergeSuffix, strlen(mergeSuffix)); @@ -601,9 +608,10 @@ static bool udfdRpcRfp(int32_t code, tmsg_t msgType) { if (code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_RPC_BROKEN_LINK || code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_SYN_RESTORING || code == TSDB_CODE_MNODE_NOT_FOUND || code == TSDB_CODE_APP_IS_STARTING || code == TSDB_CODE_APP_IS_STOPPING) { - if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH || msgType == TDMT_SCH_MERGE_FETCH) { + if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH || + msgType == TDMT_SCH_MERGE_FETCH) { return false; - } + } return true; } else { return false; @@ -663,7 +671,7 @@ int32_t udfdOpenClientRpc() { rpcInit.parent = &global; rpcInit.rfp = udfdRpcRfp; rpcInit.compressSize = tsCompressMsgSize; - + global.clientRpc = rpcOpen(&rpcInit); if (global.clientRpc == NULL) { fnError("failed to init dnode rpc client"); @@ -684,6 +692,17 @@ void udfdOnWrite(uv_write_t *req, int status) { if (status < 0) { fnError("udfd send response error, length: %zu code: %s", work->output.len, uv_err_name(status)); } + // remove work from the connection work list + if (work->conn != NULL) { + SUvUdfWork **ppWork; + for (ppWork = &work->conn->pWorkList; *ppWork && (*ppWork != work); ppWork = &((*ppWork)->pWorkNext)) { + } + if (*ppWork == work) { + *ppWork = work->pWorkNext; + } else { + fnError("work not in conn any more"); + } + } taosMemoryFree(work->output.base); taosMemoryFree(work); taosMemoryFree(req); @@ -692,10 +711,11 @@ void udfdOnWrite(uv_write_t *req, int status) { void udfdSendResponse(uv_work_t *work, int status) { SUvUdfWork *udfWork = (SUvUdfWork *)(work->data); - uv_write_t *write_req = taosMemoryMalloc(sizeof(uv_write_t)); - write_req->data = udfWork; - uv_write(write_req, udfWork->client, &udfWork->output, 1, udfdOnWrite); - + if (udfWork->conn != NULL) { + uv_write_t *write_req = taosMemoryMalloc(sizeof(uv_write_t)); + write_req->data = udfWork; + uv_write(write_req, udfWork->conn->client, &udfWork->output, 1, udfdOnWrite); + } taosMemoryFree(work); } @@ -716,8 +736,8 @@ void udfdAllocBuffer(uv_handle_t *handle, size_t suggestedSize, uv_buf_t *buf) { buf->len = 0; } } else if (ctx->inputTotal == -1 && ctx->inputLen < msgHeadSize) { - buf->base = ctx->inputBuf + ctx->inputLen; - buf->len = msgHeadSize - ctx->inputLen; + buf->base = ctx->inputBuf + ctx->inputLen; + buf->len = msgHeadSize - ctx->inputLen; } else { ctx->inputCap = ctx->inputTotal > ctx->inputCap ? ctx->inputTotal : ctx->inputCap; void *inputBuf = taosMemoryRealloc(ctx->inputBuf, ctx->inputCap); @@ -744,14 +764,16 @@ bool isUdfdUvMsgComplete(SUdfdUvConn *pipe) { } void udfdHandleRequest(SUdfdUvConn *conn) { - char* inputBuf = taosMemoryMalloc(conn->inputLen); + char *inputBuf = taosMemoryMalloc(conn->inputLen); memcpy(inputBuf, conn->inputBuf, conn->inputLen); int32_t inputLen = conn->inputLen; taosMemoryFree(conn->inputBuf); - uv_work_t * work = taosMemoryMalloc(sizeof(uv_work_t)); + uv_work_t *work = taosMemoryMalloc(sizeof(uv_work_t)); SUvUdfWork *udfWork = taosMemoryMalloc(sizeof(SUvUdfWork)); - udfWork->client = conn->client; + udfWork->conn = conn; + udfWork->pWorkNext = conn->pWorkList; + conn->pWorkList = udfWork; udfWork->input = uv_buf_init(inputBuf, inputLen); conn->inputBuf = NULL; conn->inputLen = 0; @@ -763,6 +785,12 @@ void udfdHandleRequest(SUdfdUvConn *conn) { void udfdPipeCloseCb(uv_handle_t *pipe) { SUdfdUvConn *conn = pipe->data; + SUvUdfWork* pWork = conn->pWorkList; + while (pWork != NULL) { + pWork->conn = NULL; + pWork = pWork->pWorkNext; + } + taosMemoryFree(conn->client); taosMemoryFree(conn->inputBuf); taosMemoryFree(conn); @@ -804,6 +832,7 @@ void udfdOnNewConnection(uv_stream_t *server, int status) { uv_pipe_init(global.loop, client, 0); if (uv_accept(server, (uv_stream_t *)client) == 0) { SUdfdUvConn *ctx = taosMemoryMalloc(sizeof(SUdfdUvConn)); + ctx->pWorkList = NULL; ctx->client = (uv_stream_t *)client; ctx->inputBuf = 0; ctx->inputLen = 0; @@ -896,7 +925,7 @@ static int32_t udfdUvInit() { } global.loop = loop; - if (tsStartUdfd) { // udfd is started by taosd, which shall exit when taosd exit + if (tsStartUdfd) { // udfd is started by taosd, which shall exit when taosd exit uv_pipe_init(global.loop, &global.ctrlPipe, 1); uv_pipe_open(&global.ctrlPipe, 0); uv_read_start((uv_stream_t *)&global.ctrlPipe, udfdCtrlAllocBufCb, udfdCtrlReadCb); @@ -971,10 +1000,10 @@ int32_t udfdInitResidentFuncs() { } global.residentFuncs = taosArrayInit(2, TSDB_FUNC_NAME_LEN); - char* pSave = tsUdfdResFuncs; - char* token; + char *pSave = tsUdfdResFuncs; + char *token; while ((token = strtok_r(pSave, ",", &pSave)) != NULL) { - char func[TSDB_FUNC_NAME_LEN+1] = {0}; + char func[TSDB_FUNC_NAME_LEN + 1] = {0}; strncpy(func, token, TSDB_FUNC_NAME_LEN); fnInfo("udfd add resident function %s", func); taosArrayPush(global.residentFuncs, func); @@ -985,10 +1014,10 @@ int32_t udfdInitResidentFuncs() { int32_t udfdDeinitResidentFuncs() { for (int32_t i = 0; i < taosArrayGetSize(global.residentFuncs); ++i) { - char* funcName = taosArrayGet(global.residentFuncs, i); - SUdf** udfInHash = taosHashGet(global.udfsHash, funcName, strlen(funcName)); + char *funcName = taosArrayGet(global.residentFuncs, i); + SUdf **udfInHash = taosHashGet(global.udfsHash, funcName, strlen(funcName)); if (udfInHash) { - SUdf* udf = *udfInHash; + SUdf *udf = *udfInHash; if (udf->destroyFunc) { (udf->destroyFunc)(); } From d19103597c07b14ccd334f24db7ab9db96540ec7 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 12 Dec 2022 20:52:18 +0800 Subject: [PATCH 39/74] fix: should not check dnode status in follower --- source/dnode/mnode/impl/src/mndMain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index eb6742a564..237d45bc38 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -213,6 +213,8 @@ static void mndSetVgroupOffline(SMnode *pMnode, int32_t dnodeId, int64_t curMs) } static void mndCheckDnodeOffline(SMnode *pMnode) { + if (mndAcquireRpc(pMnode) != 0) return; + SSdb *pSdb = pMnode->pSdb; int64_t curMs = taosGetTimestampMs(); @@ -230,6 +232,8 @@ static void mndCheckDnodeOffline(SMnode *pMnode) { sdbRelease(pSdb, pDnode); } + + mndReleaseRpc(pMnode); } static void *mndThreadFp(void *param) { From 63f546e5d620d0525440d01762415cc4c81aa3ec Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Mon, 12 Dec 2022 21:47:19 +0800 Subject: [PATCH 40/74] release unused handle --- source/libs/transport/src/transCli.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 7b1d7a62aa..0736b763a5 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -957,7 +957,6 @@ static void cliHandleRelease(SCliMsg* pMsg, SCliThrd* pThrd) { SCliConn* conn = exh->handle; transReleaseExHandle(transGetRefMgt(), refId); - tDebug("%s conn %p start to release to inst", CONN_GET_INST_LABEL(conn), conn); if (T_REF_VAL_GET(conn) == 2) { @@ -1575,6 +1574,9 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { pCtx->retryStep = 0; pCtx->retryInit = true; pCtx->retryCode = TSDB_CODE_SUCCESS; + + // already retry, not use handle specified by app; + pMsg->msg.info.handle = 0; } if (-1 != pCtx->retryMaxTimeout && taosGetTimestampMs() - pCtx->retryInitTimestamp >= pCtx->retryMaxTimeout) { From 3aa13025c2e2b68741033498626f5fa7e32c5062 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Mon, 12 Dec 2022 21:57:52 +0800 Subject: [PATCH 41/74] fix: udfd without copy buf again and udfd read eof not log with error --- source/libs/function/src/udfd.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 9ee9c787ee..af0c27a89f 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -764,10 +764,8 @@ bool isUdfdUvMsgComplete(SUdfdUvConn *pipe) { } void udfdHandleRequest(SUdfdUvConn *conn) { - char *inputBuf = taosMemoryMalloc(conn->inputLen); - memcpy(inputBuf, conn->inputBuf, conn->inputLen); + char *inputBuf = conn->inputBuf; int32_t inputLen = conn->inputLen; - taosMemoryFree(conn->inputBuf); uv_work_t *work = taosMemoryMalloc(sizeof(uv_work_t)); SUvUdfWork *udfWork = taosMemoryMalloc(sizeof(SUvUdfWork)); @@ -797,7 +795,7 @@ void udfdPipeCloseCb(uv_handle_t *pipe) { } void udfdPipeRead(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { - fnDebug("udf read %zd bytes from client", nread); + fnDebug("udfd read %zd bytes from client", nread); if (nread == 0) return; SUdfdUvConn *conn = client->data; @@ -813,10 +811,10 @@ void udfdPipeRead(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { } if (nread < 0) { - fnError("Receive error %s", uv_err_name(nread)); if (nread == UV_EOF) { - // TODO check more when close + fnError("udfd read EOF"); } else { + fnError("Receive error %s", uv_err_name(nread)); } udfdUvHandleError(conn); } From e3e42cdfbdfdc19c948524e696d944ddcd6e6598 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 13 Dec 2022 00:16:40 +0800 Subject: [PATCH 42/74] fix(query): set update ts flag for stream. --- source/common/src/tdatablock.c | 4 ++++ source/dnode/vnode/src/tq/tqRead.c | 1 + source/libs/executor/src/exchangeoperator.c | 1 + source/libs/executor/src/executorimpl.c | 2 ++ source/libs/executor/src/scanoperator.c | 5 +++++ 5 files changed, 13 insertions(+) diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 0e89ecdd68..aeea9b2681 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -358,6 +358,10 @@ size_t blockDataGetNumOfCols(const SSDataBlock* pBlock) { return taosArrayGetSiz size_t blockDataGetNumOfRows(const SSDataBlock* pBlock) { return pBlock->info.rows; } int32_t blockDataUpdateTsWindow(SSDataBlock* pDataBlock, int32_t tsColumnIndex) { + if (pDataBlock->info.rows > 0) { + ASSERT(pDataBlock->info.dataLoad == 1); + } + if (pDataBlock == NULL || pDataBlock->info.rows <= 0 || pDataBlock->info.dataLoad == 0) { return 0; } diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index c3a4cefc66..46b31bc5b0 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -533,6 +533,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) { pBlock->info.id.uid = pReader->msgIter.uid; pBlock->info.rows = pReader->msgIter.numOfRows; pBlock->info.version = pReader->pMsg->version; + pBlock->info.dataLoad = 1; while ((row = tGetSubmitBlkNext(&pReader->blkIter)) != NULL) { tdSTSRowIterReset(&iter, row); diff --git a/source/libs/executor/src/exchangeoperator.c b/source/libs/executor/src/exchangeoperator.c index 8423b77906..4103ca82dc 100644 --- a/source/libs/executor/src/exchangeoperator.c +++ b/source/libs/executor/src/exchangeoperator.c @@ -510,6 +510,7 @@ int32_t extractDataBlockFromFetchRsp(SSDataBlock* pRes, char* pData, SArray* pCo blockDataEnsureCapacity(pRes, pBlock->info.rows); // data from mnode + pRes->info.dataLoad = 1; pRes->info.rows = pBlock->info.rows; relocateColumnData(pRes, pColList, pBlock->pDataBlock, false); blockDataDestroy(pBlock); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 41e3d890cd..1c80eff685 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -2546,6 +2546,7 @@ int32_t buildDataBlockFromGroupRes(SOperatorInfo* pOperator, SStreamState* pStat pBlock->info.rows += pRow->numOfRows; releaseOutputBuf(pState, &key, pRow); } + pBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pBlock, 0); return TSDB_CODE_SUCCESS; } @@ -2635,6 +2636,7 @@ int32_t buildSessionResultDataBlock(SOperatorInfo* pOperator, SStreamState* pSta } } + pBlock->info.dataLoad = 1; pBlock->info.rows += pRow->numOfRows; // saveSessionDiscBuf(pState, pKey, pVal, size); releaseOutputBuf(pState, NULL, pRow); diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index d5239b340c..018e969b35 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1313,6 +1313,7 @@ static int32_t generateScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSrcBlock, } pDestBlock->info.type = STREAM_CLEAR; pDestBlock->info.version = pSrcBlock->info.version; + pDestBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pDestBlock, 0); return code; } @@ -1421,6 +1422,7 @@ static void checkUpdateData(SStreamScanInfo* pInfo, bool invertible, SSDataBlock } if (out && pInfo->pUpdateDataRes->info.rows > 0) { pInfo->pUpdateDataRes->info.version = pBlock->info.version; + pInfo->pUpdateDataRes->info.dataLoad = 1; blockDataUpdateTsWindow(pInfo->pUpdateDataRes, 0); pInfo->pUpdateDataRes->info.type = pInfo->partitionSup.needCalc ? STREAM_DELETE_DATA : STREAM_CLEAR; } @@ -1483,6 +1485,7 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock doFilter(pInfo->pRes, pOperator->exprSupp.pFilterInfo, NULL); } + pInfo->pRes->info.dataLoad = 1; blockDataUpdateTsWindow(pInfo->pRes, pInfo->primaryTsIndex); blockDataFreeRes((SSDataBlock*)pBlock); @@ -1771,6 +1774,7 @@ FETCH_NEXT_BLOCK: // TODO move into scan pBlock->info.calWin.skey = INT64_MIN; pBlock->info.calWin.ekey = INT64_MAX; + pBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pBlock, 0); switch (pBlock->info.type) { case STREAM_NORMAL: @@ -1948,6 +1952,7 @@ FETCH_NEXT_BLOCK: } doFilter(pInfo->pRes, pOperator->exprSupp.pFilterInfo, NULL); + pInfo->pRes->info.dataLoad = 1; blockDataUpdateTsWindow(pInfo->pRes, pInfo->primaryTsIndex); if (pBlockInfo->rows > 0 || pInfo->pUpdateDataRes->info.rows > 0) { From e4ad9890705d387acd05dc3b510ddabf15f3313d Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 13 Dec 2022 00:17:11 +0800 Subject: [PATCH 43/74] fix(query): disable assert. --- source/common/src/tdatablock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index aeea9b2681..339a73efee 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -359,7 +359,7 @@ size_t blockDataGetNumOfRows(const SSDataBlock* pBlock) { return pBlock->info.ro int32_t blockDataUpdateTsWindow(SSDataBlock* pDataBlock, int32_t tsColumnIndex) { if (pDataBlock->info.rows > 0) { - ASSERT(pDataBlock->info.dataLoad == 1); +// ASSERT(pDataBlock->info.dataLoad == 1); } if (pDataBlock == NULL || pDataBlock->info.rows <= 0 || pDataBlock->info.dataLoad == 0) { From 9afdee5fd3bb699d041d052526a0761c91883610 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 13 Dec 2022 01:30:10 +0800 Subject: [PATCH 44/74] fix(query): set data load flag. --- source/libs/executor/src/groupoperator.c | 2 ++ source/libs/executor/src/projectoperator.c | 1 + 2 files changed, 3 insertions(+) diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 2cd1bd7dec..22db8c21b5 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -951,6 +951,8 @@ static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) { } taosArrayDestroy(pParInfo->rowIds); pParInfo->rowIds = NULL; + pDest->info.dataLoad = 1; + blockDataUpdateTsWindow(pDest, pInfo->tsColIndex); pDest->info.id.groupId = pParInfo->groupId; pOperator->resultInfo.totalRows += pDest->info.rows; diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index 65bb40b195..8e81a00098 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -654,6 +654,7 @@ static void setPseudoOutputColInfo(SSDataBlock* pResult, SqlFunctionCtx* pCtx, S int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBlock* pSrcBlock, SqlFunctionCtx* pCtx, int32_t numOfOutput, SArray* pPseudoList) { setPseudoOutputColInfo(pResult, pCtx, pPseudoList); + pResult->info.dataLoad = 1; if (pSrcBlock == NULL) { for (int32_t k = 0; k < numOfOutput; ++k) { From 9f3fabc7f5eaad62bebd259b4faee1a388780508 Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao@163.com> Date: Tue, 13 Dec 2022 09:30:34 +0800 Subject: [PATCH 45/74] ci:add some test for stream --- tests/script/tsim/stream/basic1.sim | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/script/tsim/stream/basic1.sim b/tests/script/tsim/stream/basic1.sim index bb2ea42383..7bf10df637 100644 --- a/tests/script/tsim/stream/basic1.sim +++ b/tests/script/tsim/stream/basic1.sim @@ -792,4 +792,46 @@ if $rows != 1 then goto loop17 endi +#for TS-2242 +sql create database test5 vgroups 1; +sql use test5; +sql create stable st(ts timestamp, a int, b int , c int) tags(ta int,tb int,tc int); +sql create table ts1 using st tags(1,1,1); +sql create stream streams5 trigger at_once into streamt5 as select count(*), _wstart, _wend, max(a) from ts1 interval(10s) ; +sql create stream streams6 trigger at_once into streamt6 as select count(*), _wstart, _wend, max(a), _wstart as ts from ts1 interval(10s) ; + +sql_error create stream streams7 trigger at_once into streamt7 as select _wstart, count(*), _wstart, _wend, max(a) from ts1 interval(10s) ; +sql_error create stream streams8 trigger at_once into streamt8 as select count(*), _wstart, _wstart, _wend, max(a) from ts1 interval(10s) ; +sql_error create stream streams9 trigger at_once into streamt9 as select _wstart as ts, count(*), _wstart as ts, _wend, max(a) from ts1 interval(10s) ; + +sql insert into ts1 values(1648791211000,1,2,3); + +print ====== test _wstart + +$loop_count = 0 + +loop17: + +sleep 200 +sql select * from streamt5; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 1 then + print =====rows=$rows + goto loop17 +endi + +sql select * from streamt6; + +if $rows != 1 then + print =====rows=$rows + goto loop17 +endi + +print ====== test _wstart end + system sh/exec.sh -n dnode1 -s stop -x SIGINT From b69725adaacc4e76e83a2ceae11efacb3508a2f9 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 13 Dec 2022 10:00:24 +0800 Subject: [PATCH 46/74] enh: shielding database option 'strict' --- include/common/ttokendef.h | 472 +- include/util/tdef.h | 2 +- source/libs/parser/inc/sql.y | 6 +- source/libs/parser/src/sql.c | 4673 ++++++++++--------- source/libs/parser/test/parInitialCTest.cpp | 6 +- 5 files changed, 2598 insertions(+), 2561 deletions(-) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index fc630cfdc0..0192bbf486 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -94,242 +94,242 @@ #define TK_TSDB_PAGESIZE 76 #define TK_PRECISION 77 #define TK_REPLICA 78 -#define TK_STRICT 79 -#define TK_VGROUPS 80 -#define TK_SINGLE_STABLE 81 -#define TK_RETENTIONS 82 -#define TK_SCHEMALESS 83 -#define TK_WAL_LEVEL 84 -#define TK_WAL_FSYNC_PERIOD 85 -#define TK_WAL_RETENTION_PERIOD 86 -#define TK_WAL_RETENTION_SIZE 87 -#define TK_WAL_ROLL_PERIOD 88 -#define TK_WAL_SEGMENT_SIZE 89 -#define TK_STT_TRIGGER 90 -#define TK_TABLE_PREFIX 91 -#define TK_TABLE_SUFFIX 92 -#define TK_NK_COLON 93 -#define TK_MAX_SPEED 94 -#define TK_TABLE 95 -#define TK_NK_LP 96 -#define TK_NK_RP 97 -#define TK_STABLE 98 -#define TK_ADD 99 -#define TK_COLUMN 100 -#define TK_MODIFY 101 -#define TK_RENAME 102 -#define TK_TAG 103 -#define TK_SET 104 -#define TK_NK_EQ 105 -#define TK_USING 106 -#define TK_TAGS 107 -#define TK_COMMENT 108 -#define TK_BOOL 109 -#define TK_TINYINT 110 -#define TK_SMALLINT 111 -#define TK_INT 112 -#define TK_INTEGER 113 -#define TK_BIGINT 114 -#define TK_FLOAT 115 -#define TK_DOUBLE 116 -#define TK_BINARY 117 -#define TK_TIMESTAMP 118 -#define TK_NCHAR 119 -#define TK_UNSIGNED 120 -#define TK_JSON 121 -#define TK_VARCHAR 122 -#define TK_MEDIUMBLOB 123 -#define TK_BLOB 124 -#define TK_VARBINARY 125 -#define TK_DECIMAL 126 -#define TK_MAX_DELAY 127 -#define TK_WATERMARK 128 -#define TK_ROLLUP 129 -#define TK_TTL 130 -#define TK_SMA 131 -#define TK_DELETE_MARK 132 -#define TK_FIRST 133 -#define TK_LAST 134 -#define TK_SHOW 135 -#define TK_PRIVILEGES 136 -#define TK_DATABASES 137 -#define TK_TABLES 138 -#define TK_STABLES 139 -#define TK_MNODES 140 -#define TK_QNODES 141 -#define TK_FUNCTIONS 142 -#define TK_INDEXES 143 -#define TK_ACCOUNTS 144 -#define TK_APPS 145 -#define TK_CONNECTIONS 146 -#define TK_LICENCES 147 -#define TK_GRANTS 148 -#define TK_QUERIES 149 -#define TK_SCORES 150 -#define TK_TOPICS 151 -#define TK_VARIABLES 152 -#define TK_CLUSTER 153 -#define TK_BNODES 154 -#define TK_SNODES 155 -#define TK_TRANSACTIONS 156 -#define TK_DISTRIBUTED 157 -#define TK_CONSUMERS 158 -#define TK_SUBSCRIPTIONS 159 -#define TK_VNODES 160 -#define TK_LIKE 161 -#define TK_TBNAME 162 -#define TK_QTAGS 163 -#define TK_AS 164 -#define TK_INDEX 165 -#define TK_FUNCTION 166 -#define TK_INTERVAL 167 -#define TK_TOPIC 168 -#define TK_WITH 169 -#define TK_META 170 -#define TK_CONSUMER 171 -#define TK_GROUP 172 -#define TK_DESC 173 -#define TK_DESCRIBE 174 -#define TK_RESET 175 -#define TK_QUERY 176 -#define TK_CACHE 177 -#define TK_EXPLAIN 178 -#define TK_ANALYZE 179 -#define TK_VERBOSE 180 -#define TK_NK_BOOL 181 -#define TK_RATIO 182 -#define TK_NK_FLOAT 183 -#define TK_OUTPUTTYPE 184 -#define TK_AGGREGATE 185 -#define TK_BUFSIZE 186 -#define TK_STREAM 187 -#define TK_INTO 188 -#define TK_TRIGGER 189 -#define TK_AT_ONCE 190 -#define TK_WINDOW_CLOSE 191 -#define TK_IGNORE 192 -#define TK_EXPIRED 193 -#define TK_FILL_HISTORY 194 -#define TK_SUBTABLE 195 -#define TK_KILL 196 -#define TK_CONNECTION 197 -#define TK_TRANSACTION 198 -#define TK_BALANCE 199 -#define TK_VGROUP 200 -#define TK_MERGE 201 -#define TK_REDISTRIBUTE 202 -#define TK_SPLIT 203 -#define TK_DELETE 204 -#define TK_INSERT 205 -#define TK_NULL 206 -#define TK_NK_QUESTION 207 -#define TK_NK_ARROW 208 -#define TK_ROWTS 209 -#define TK_QSTART 210 -#define TK_QEND 211 -#define TK_QDURATION 212 -#define TK_WSTART 213 -#define TK_WEND 214 -#define TK_WDURATION 215 -#define TK_IROWTS 216 -#define TK_CAST 217 -#define TK_NOW 218 -#define TK_TODAY 219 -#define TK_TIMEZONE 220 -#define TK_CLIENT_VERSION 221 -#define TK_SERVER_VERSION 222 -#define TK_SERVER_STATUS 223 -#define TK_CURRENT_USER 224 -#define TK_COUNT 225 -#define TK_LAST_ROW 226 -#define TK_CASE 227 -#define TK_END 228 -#define TK_WHEN 229 -#define TK_THEN 230 -#define TK_ELSE 231 -#define TK_BETWEEN 232 -#define TK_IS 233 -#define TK_NK_LT 234 -#define TK_NK_GT 235 -#define TK_NK_LE 236 -#define TK_NK_GE 237 -#define TK_NK_NE 238 -#define TK_MATCH 239 -#define TK_NMATCH 240 -#define TK_CONTAINS 241 -#define TK_IN 242 -#define TK_JOIN 243 -#define TK_INNER 244 -#define TK_SELECT 245 -#define TK_DISTINCT 246 -#define TK_WHERE 247 -#define TK_PARTITION 248 -#define TK_BY 249 -#define TK_SESSION 250 -#define TK_STATE_WINDOW 251 -#define TK_SLIDING 252 -#define TK_FILL 253 -#define TK_VALUE 254 -#define TK_NONE 255 -#define TK_PREV 256 -#define TK_LINEAR 257 -#define TK_NEXT 258 -#define TK_HAVING 259 -#define TK_RANGE 260 -#define TK_EVERY 261 -#define TK_ORDER 262 -#define TK_SLIMIT 263 -#define TK_SOFFSET 264 -#define TK_LIMIT 265 -#define TK_OFFSET 266 -#define TK_ASC 267 -#define TK_NULLS 268 -#define TK_ABORT 269 -#define TK_AFTER 270 -#define TK_ATTACH 271 -#define TK_BEFORE 272 -#define TK_BEGIN 273 -#define TK_BITAND 274 -#define TK_BITNOT 275 -#define TK_BITOR 276 -#define TK_BLOCKS 277 -#define TK_CHANGE 278 -#define TK_COMMA 279 -#define TK_COMPACT 280 -#define TK_CONCAT 281 -#define TK_CONFLICT 282 -#define TK_COPY 283 -#define TK_DEFERRED 284 -#define TK_DELIMITERS 285 -#define TK_DETACH 286 -#define TK_DIVIDE 287 -#define TK_DOT 288 -#define TK_EACH 289 -#define TK_FAIL 290 -#define TK_FILE 291 -#define TK_FOR 292 -#define TK_GLOB 293 -#define TK_ID 294 -#define TK_IMMEDIATE 295 -#define TK_IMPORT 296 -#define TK_INITIALLY 297 -#define TK_INSTEAD 298 -#define TK_ISNULL 299 -#define TK_KEY 300 -#define TK_MODULES 301 -#define TK_NK_BITNOT 302 -#define TK_NK_SEMI 303 -#define TK_NOTNULL 304 -#define TK_OF 305 -#define TK_PLUS 306 -#define TK_PRIVILEGE 307 -#define TK_RAISE 308 -#define TK_REPLACE 309 -#define TK_RESTRICT 310 -#define TK_ROW 311 -#define TK_SEMI 312 -#define TK_STAR 313 -#define TK_STATEMENT 314 +#define TK_VGROUPS 79 +#define TK_SINGLE_STABLE 80 +#define TK_RETENTIONS 81 +#define TK_SCHEMALESS 82 +#define TK_WAL_LEVEL 83 +#define TK_WAL_FSYNC_PERIOD 84 +#define TK_WAL_RETENTION_PERIOD 85 +#define TK_WAL_RETENTION_SIZE 86 +#define TK_WAL_ROLL_PERIOD 87 +#define TK_WAL_SEGMENT_SIZE 88 +#define TK_STT_TRIGGER 89 +#define TK_TABLE_PREFIX 90 +#define TK_TABLE_SUFFIX 91 +#define TK_NK_COLON 92 +#define TK_MAX_SPEED 93 +#define TK_TABLE 94 +#define TK_NK_LP 95 +#define TK_NK_RP 96 +#define TK_STABLE 97 +#define TK_ADD 98 +#define TK_COLUMN 99 +#define TK_MODIFY 100 +#define TK_RENAME 101 +#define TK_TAG 102 +#define TK_SET 103 +#define TK_NK_EQ 104 +#define TK_USING 105 +#define TK_TAGS 106 +#define TK_COMMENT 107 +#define TK_BOOL 108 +#define TK_TINYINT 109 +#define TK_SMALLINT 110 +#define TK_INT 111 +#define TK_INTEGER 112 +#define TK_BIGINT 113 +#define TK_FLOAT 114 +#define TK_DOUBLE 115 +#define TK_BINARY 116 +#define TK_TIMESTAMP 117 +#define TK_NCHAR 118 +#define TK_UNSIGNED 119 +#define TK_JSON 120 +#define TK_VARCHAR 121 +#define TK_MEDIUMBLOB 122 +#define TK_BLOB 123 +#define TK_VARBINARY 124 +#define TK_DECIMAL 125 +#define TK_MAX_DELAY 126 +#define TK_WATERMARK 127 +#define TK_ROLLUP 128 +#define TK_TTL 129 +#define TK_SMA 130 +#define TK_DELETE_MARK 131 +#define TK_FIRST 132 +#define TK_LAST 133 +#define TK_SHOW 134 +#define TK_PRIVILEGES 135 +#define TK_DATABASES 136 +#define TK_TABLES 137 +#define TK_STABLES 138 +#define TK_MNODES 139 +#define TK_QNODES 140 +#define TK_FUNCTIONS 141 +#define TK_INDEXES 142 +#define TK_ACCOUNTS 143 +#define TK_APPS 144 +#define TK_CONNECTIONS 145 +#define TK_LICENCES 146 +#define TK_GRANTS 147 +#define TK_QUERIES 148 +#define TK_SCORES 149 +#define TK_TOPICS 150 +#define TK_VARIABLES 151 +#define TK_CLUSTER 152 +#define TK_BNODES 153 +#define TK_SNODES 154 +#define TK_TRANSACTIONS 155 +#define TK_DISTRIBUTED 156 +#define TK_CONSUMERS 157 +#define TK_SUBSCRIPTIONS 158 +#define TK_VNODES 159 +#define TK_LIKE 160 +#define TK_TBNAME 161 +#define TK_QTAGS 162 +#define TK_AS 163 +#define TK_INDEX 164 +#define TK_FUNCTION 165 +#define TK_INTERVAL 166 +#define TK_TOPIC 167 +#define TK_WITH 168 +#define TK_META 169 +#define TK_CONSUMER 170 +#define TK_GROUP 171 +#define TK_DESC 172 +#define TK_DESCRIBE 173 +#define TK_RESET 174 +#define TK_QUERY 175 +#define TK_CACHE 176 +#define TK_EXPLAIN 177 +#define TK_ANALYZE 178 +#define TK_VERBOSE 179 +#define TK_NK_BOOL 180 +#define TK_RATIO 181 +#define TK_NK_FLOAT 182 +#define TK_OUTPUTTYPE 183 +#define TK_AGGREGATE 184 +#define TK_BUFSIZE 185 +#define TK_STREAM 186 +#define TK_INTO 187 +#define TK_TRIGGER 188 +#define TK_AT_ONCE 189 +#define TK_WINDOW_CLOSE 190 +#define TK_IGNORE 191 +#define TK_EXPIRED 192 +#define TK_FILL_HISTORY 193 +#define TK_SUBTABLE 194 +#define TK_KILL 195 +#define TK_CONNECTION 196 +#define TK_TRANSACTION 197 +#define TK_BALANCE 198 +#define TK_VGROUP 199 +#define TK_MERGE 200 +#define TK_REDISTRIBUTE 201 +#define TK_SPLIT 202 +#define TK_DELETE 203 +#define TK_INSERT 204 +#define TK_NULL 205 +#define TK_NK_QUESTION 206 +#define TK_NK_ARROW 207 +#define TK_ROWTS 208 +#define TK_QSTART 209 +#define TK_QEND 210 +#define TK_QDURATION 211 +#define TK_WSTART 212 +#define TK_WEND 213 +#define TK_WDURATION 214 +#define TK_IROWTS 215 +#define TK_CAST 216 +#define TK_NOW 217 +#define TK_TODAY 218 +#define TK_TIMEZONE 219 +#define TK_CLIENT_VERSION 220 +#define TK_SERVER_VERSION 221 +#define TK_SERVER_STATUS 222 +#define TK_CURRENT_USER 223 +#define TK_COUNT 224 +#define TK_LAST_ROW 225 +#define TK_CASE 226 +#define TK_END 227 +#define TK_WHEN 228 +#define TK_THEN 229 +#define TK_ELSE 230 +#define TK_BETWEEN 231 +#define TK_IS 232 +#define TK_NK_LT 233 +#define TK_NK_GT 234 +#define TK_NK_LE 235 +#define TK_NK_GE 236 +#define TK_NK_NE 237 +#define TK_MATCH 238 +#define TK_NMATCH 239 +#define TK_CONTAINS 240 +#define TK_IN 241 +#define TK_JOIN 242 +#define TK_INNER 243 +#define TK_SELECT 244 +#define TK_DISTINCT 245 +#define TK_WHERE 246 +#define TK_PARTITION 247 +#define TK_BY 248 +#define TK_SESSION 249 +#define TK_STATE_WINDOW 250 +#define TK_SLIDING 251 +#define TK_FILL 252 +#define TK_VALUE 253 +#define TK_NONE 254 +#define TK_PREV 255 +#define TK_LINEAR 256 +#define TK_NEXT 257 +#define TK_HAVING 258 +#define TK_RANGE 259 +#define TK_EVERY 260 +#define TK_ORDER 261 +#define TK_SLIMIT 262 +#define TK_SOFFSET 263 +#define TK_LIMIT 264 +#define TK_OFFSET 265 +#define TK_ASC 266 +#define TK_NULLS 267 +#define TK_ABORT 268 +#define TK_AFTER 269 +#define TK_ATTACH 270 +#define TK_BEFORE 271 +#define TK_BEGIN 272 +#define TK_BITAND 273 +#define TK_BITNOT 274 +#define TK_BITOR 275 +#define TK_BLOCKS 276 +#define TK_CHANGE 277 +#define TK_COMMA 278 +#define TK_COMPACT 279 +#define TK_CONCAT 280 +#define TK_CONFLICT 281 +#define TK_COPY 282 +#define TK_DEFERRED 283 +#define TK_DELIMITERS 284 +#define TK_DETACH 285 +#define TK_DIVIDE 286 +#define TK_DOT 287 +#define TK_EACH 288 +#define TK_FAIL 289 +#define TK_FILE 290 +#define TK_FOR 291 +#define TK_GLOB 292 +#define TK_ID 293 +#define TK_IMMEDIATE 294 +#define TK_IMPORT 295 +#define TK_INITIALLY 296 +#define TK_INSTEAD 297 +#define TK_ISNULL 298 +#define TK_KEY 299 +#define TK_MODULES 300 +#define TK_NK_BITNOT 301 +#define TK_NK_SEMI 302 +#define TK_NOTNULL 303 +#define TK_OF 304 +#define TK_PLUS 305 +#define TK_PRIVILEGE 306 +#define TK_RAISE 307 +#define TK_REPLACE 308 +#define TK_RESTRICT 309 +#define TK_ROW 310 +#define TK_SEMI 311 +#define TK_STAR 312 +#define TK_STATEMENT 313 +#define TK_STRICT 314 #define TK_STRING 315 #define TK_TIMES 316 #define TK_UPDATE 317 diff --git a/include/util/tdef.h b/include/util/tdef.h index e0089014aa..8d1fccfa11 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -337,7 +337,7 @@ typedef enum ELogicConditionType { #define TSDB_DB_STRICT_ON_STR "on" #define TSDB_DB_STRICT_OFF 0 #define TSDB_DB_STRICT_ON 1 -#define TSDB_DEFAULT_DB_STRICT TSDB_DB_STRICT_OFF +#define TSDB_DEFAULT_DB_STRICT TSDB_DB_STRICT_ON #define TSDB_CACHE_MODEL_STR_LEN sizeof(TSDB_CACHE_MODEL_LAST_VALUE_STR) #define TSDB_CACHE_MODEL_NONE_STR "none" #define TSDB_CACHE_MODEL_LAST_ROW_STR "last_row" diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index c85759446a..212a1c92b5 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -194,7 +194,7 @@ db_options(A) ::= db_options(B) PAGESIZE NK_INTEGER(C). db_options(A) ::= db_options(B) TSDB_PAGESIZE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_TSDB_PAGESIZE, &C); } db_options(A) ::= db_options(B) PRECISION NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_PRECISION, &C); } db_options(A) ::= db_options(B) REPLICA NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_REPLICA, &C); } -db_options(A) ::= db_options(B) STRICT NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_STRICT, &C); } +//db_options(A) ::= db_options(B) STRICT NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_STRICT, &C); } db_options(A) ::= db_options(B) VGROUPS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_VGROUPS, &C); } db_options(A) ::= db_options(B) SINGLE_STABLE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_SINGLE_STABLE, &C); } db_options(A) ::= db_options(B) RETENTIONS retention_list(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_RETENTIONS, C); } @@ -1067,5 +1067,5 @@ null_ordering_opt(A) ::= NULLS FIRST. null_ordering_opt(A) ::= NULLS LAST. { A = NULL_ORDER_LAST; } %fallback ABORT AFTER ATTACH BEFORE BEGIN BITAND BITNOT BITOR BLOCKS CHANGE COMMA COMPACT CONCAT CONFLICT COPY DEFERRED DELIMITERS DETACH DIVIDE DOT EACH END FAIL - FILE FOR GLOB ID IMMEDIATE IMPORT INITIALLY INSTEAD ISNULL KEY MODULES NK_BITNOT NK_SEMI NOTNULL OF PLUS PRIVILEGE RAISE REPLACE RESTRICT ROW SEMI STAR STATEMENT STRING - TIMES UPDATE VALUES VARIABLE VIEW WAL. + FILE FOR GLOB ID IMMEDIATE IMPORT INITIALLY INSTEAD ISNULL KEY MODULES NK_BITNOT NK_SEMI NOTNULL OF PLUS PRIVILEGE RAISE REPLACE RESTRICT ROW SEMI STAR STATEMENT + STRICT STRING TIMES UPDATE VALUES VARIABLE VIEW WAL. diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index a83f85696a..a1ebe0ac32 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 709 -#define YYNRULE 539 +#define YYNSTATE 708 +#define YYNRULE 538 #define YYNTOKEN 322 -#define YY_MAX_SHIFT 708 -#define YY_MIN_SHIFTREDUCE 1050 -#define YY_MAX_SHIFTREDUCE 1588 -#define YY_ERROR_ACTION 1589 -#define YY_ACCEPT_ACTION 1590 -#define YY_NO_ACTION 1591 -#define YY_MIN_REDUCE 1592 -#define YY_MAX_REDUCE 2130 +#define YY_MAX_SHIFT 707 +#define YY_MIN_SHIFTREDUCE 1048 +#define YY_MAX_SHIFTREDUCE 1585 +#define YY_ERROR_ACTION 1586 +#define YY_ACCEPT_ACTION 1587 +#define YY_NO_ACTION 1588 +#define YY_MIN_REDUCE 1589 +#define YY_MAX_REDUCE 2126 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,693 +216,736 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2410) +#define YY_ACTTAB_COUNT (2706) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1946, 458, 1735, 459, 1628, 565, 584, 33, 274, 2101, - /* 10 */ 158, 1799, 43, 41, 1519, 1700, 351, 2106, 329, 1857, - /* 20 */ 360, 2101, 1370, 1592, 564, 173, 597, 1797, 352, 2102, - /* 30 */ 566, 1964, 464, 1449, 167, 1368, 155, 2105, 460, 580, - /* 40 */ 52, 2102, 2104, 399, 1915, 1748, 613, 122, 121, 120, - /* 50 */ 119, 118, 117, 116, 115, 114, 1847, 1746, 1444, 227, - /* 60 */ 36, 35, 1776, 16, 42, 40, 39, 38, 37, 1945, - /* 70 */ 1376, 1799, 467, 1980, 459, 1628, 100, 1947, 617, 1949, - /* 80 */ 1950, 612, 565, 607, 596, 545, 2101, 1798, 170, 2101, - /* 90 */ 2033, 1615, 1737, 167, 354, 2029, 12, 58, 597, 1946, - /* 100 */ 1933, 564, 173, 1929, 2107, 173, 2102, 566, 175, 2102, - /* 110 */ 566, 1929, 123, 47, 332, 1846, 2059, 113, 705, 497, - /* 120 */ 112, 111, 110, 109, 108, 107, 106, 105, 104, 1746, - /* 130 */ 1964, 1925, 1931, 1451, 1452, 1915, 1590, 1799, 614, 1925, - /* 140 */ 1931, 343, 607, 1915, 353, 613, 43, 41, 476, 1555, - /* 150 */ 607, 62, 97, 1797, 360, 1723, 1370, 1396, 596, 1946, - /* 160 */ 46, 365, 1425, 1434, 1792, 1794, 132, 1449, 1945, 1368, - /* 170 */ 597, 1102, 1980, 1101, 1738, 100, 1947, 617, 1949, 1950, - /* 180 */ 612, 1371, 607, 1369, 178, 134, 210, 141, 2004, 2033, - /* 190 */ 1964, 258, 1444, 354, 2029, 1793, 1794, 16, 580, 375, - /* 200 */ 596, 1746, 1103, 1915, 1376, 613, 1374, 1375, 405, 1424, - /* 210 */ 1427, 1428, 1429, 1430, 1431, 1432, 1433, 609, 605, 1442, - /* 220 */ 1443, 1445, 1446, 1447, 1448, 1450, 1453, 2, 1945, 58, - /* 230 */ 12, 85, 1980, 1946, 225, 100, 1947, 617, 1949, 1950, - /* 240 */ 612, 545, 607, 58, 1395, 2101, 176, 170, 318, 2033, - /* 250 */ 1083, 80, 705, 354, 2029, 42, 40, 39, 38, 37, - /* 260 */ 2107, 173, 176, 649, 1964, 2102, 566, 1451, 1452, 560, - /* 270 */ 1253, 1254, 614, 1170, 1742, 2060, 46, 1915, 1395, 613, - /* 280 */ 43, 41, 146, 145, 646, 645, 644, 143, 360, 1085, - /* 290 */ 1370, 1088, 1089, 1946, 82, 320, 1425, 1434, 530, 577, - /* 300 */ 528, 1449, 1945, 1368, 597, 1102, 1980, 1101, 1172, 100, - /* 310 */ 1947, 617, 1949, 1950, 612, 1371, 607, 1369, 123, 58, - /* 320 */ 58, 2008, 1397, 2033, 1964, 502, 1444, 354, 2029, 169, - /* 330 */ 131, 16, 614, 1614, 1396, 1746, 1103, 1915, 1376, 613, - /* 340 */ 1374, 1375, 1786, 1424, 1427, 1428, 1429, 1430, 1431, 1432, - /* 350 */ 1433, 609, 605, 1442, 1443, 1445, 1446, 1447, 1448, 1450, - /* 360 */ 1453, 2, 1945, 9, 12, 1946, 1980, 526, 441, 100, - /* 370 */ 1947, 617, 1949, 1950, 612, 2106, 607, 1915, 176, 2101, - /* 380 */ 524, 2121, 522, 2033, 1613, 91, 705, 354, 2029, 255, - /* 390 */ 2041, 576, 176, 124, 575, 2105, 1964, 2101, 2067, 2102, - /* 400 */ 2103, 1451, 1452, 398, 611, 397, 2106, 1739, 157, 1915, - /* 410 */ 1604, 613, 564, 173, 43, 41, 1454, 2102, 566, 1395, - /* 420 */ 1306, 1307, 360, 1397, 1370, 176, 189, 188, 1915, 457, - /* 430 */ 1425, 1434, 462, 1634, 1945, 1449, 577, 1368, 1980, 1661, - /* 440 */ 597, 310, 1947, 617, 1949, 1950, 612, 2048, 607, 1371, - /* 450 */ 1999, 1369, 466, 1612, 403, 462, 1634, 36, 35, 1545, - /* 460 */ 1444, 42, 40, 39, 38, 37, 257, 131, 176, 176, - /* 470 */ 1611, 1746, 1376, 2045, 1374, 1375, 583, 1424, 1427, 1428, - /* 480 */ 1429, 1430, 1431, 1432, 1433, 609, 605, 1442, 1443, 1445, - /* 490 */ 1446, 1447, 1448, 1450, 1453, 2, 133, 1915, 44, 2004, - /* 500 */ 1578, 1946, 1370, 555, 512, 511, 510, 552, 1543, 1544, - /* 510 */ 1546, 1547, 128, 506, 1915, 1368, 651, 505, 545, 1610, - /* 520 */ 705, 1398, 2101, 504, 509, 579, 171, 2041, 2042, 503, - /* 530 */ 129, 2046, 1964, 508, 507, 1451, 1452, 2107, 173, 226, - /* 540 */ 614, 597, 2102, 566, 1799, 1915, 1535, 613, 43, 41, - /* 550 */ 1376, 364, 80, 676, 674, 404, 360, 1609, 1370, 597, - /* 560 */ 1797, 1946, 597, 1915, 1425, 1434, 127, 257, 1394, 1449, - /* 570 */ 1945, 1368, 1746, 413, 1980, 1741, 427, 100, 1947, 617, - /* 580 */ 1949, 1950, 612, 1371, 607, 1369, 561, 556, 642, 2006, - /* 590 */ 1746, 2033, 1964, 1746, 1444, 354, 2029, 1480, 705, 1842, - /* 600 */ 614, 1915, 1347, 1348, 9, 1915, 1376, 613, 1374, 1375, - /* 610 */ 181, 1424, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 609, - /* 620 */ 605, 1442, 1443, 1445, 1446, 1447, 1448, 1450, 1453, 2, - /* 630 */ 1945, 517, 44, 597, 1980, 144, 597, 100, 1947, 617, - /* 640 */ 1949, 1950, 612, 597, 607, 597, 527, 428, 597, 2121, - /* 650 */ 474, 2033, 1608, 1902, 705, 354, 2029, 475, 1946, 1743, - /* 660 */ 224, 1371, 139, 1369, 1746, 182, 2095, 1746, 30, 1451, - /* 670 */ 1452, 1724, 1607, 1964, 1746, 520, 1746, 597, 1485, 1746, - /* 680 */ 514, 559, 43, 41, 185, 223, 1374, 1375, 51, 1964, - /* 690 */ 360, 541, 1370, 1376, 1523, 597, 1915, 614, 1425, 1434, - /* 700 */ 1395, 382, 1915, 1449, 613, 1368, 36, 35, 1746, 581, - /* 710 */ 42, 40, 39, 38, 37, 363, 1915, 1371, 1398, 1369, - /* 720 */ 558, 77, 64, 155, 76, 63, 1746, 1945, 1444, 663, - /* 730 */ 1606, 1980, 1748, 476, 159, 1947, 617, 1949, 1950, 612, - /* 740 */ 1376, 607, 1374, 1375, 1731, 1424, 1427, 1428, 1429, 1430, - /* 750 */ 1431, 1432, 1433, 609, 605, 1442, 1443, 1445, 1446, 1447, - /* 760 */ 1448, 1450, 1453, 2, 36, 35, 12, 1946, 42, 40, - /* 770 */ 39, 38, 37, 366, 1915, 546, 2070, 597, 265, 266, - /* 780 */ 317, 155, 1393, 264, 599, 597, 2005, 501, 705, 435, - /* 790 */ 1748, 269, 448, 1593, 9, 447, 7, 1603, 1964, 592, - /* 800 */ 25, 1722, 288, 1451, 1452, 1776, 614, 649, 1746, 500, - /* 810 */ 419, 1915, 449, 613, 113, 421, 1746, 112, 111, 110, - /* 820 */ 109, 108, 107, 106, 105, 104, 146, 145, 646, 645, - /* 830 */ 644, 143, 1425, 1434, 394, 597, 531, 39, 38, 37, - /* 840 */ 1980, 1915, 1426, 306, 1947, 617, 1949, 1950, 612, 594, - /* 850 */ 607, 1371, 1733, 1369, 1602, 396, 392, 333, 1658, 1459, - /* 860 */ 2105, 29, 235, 651, 1729, 1395, 1746, 36, 35, 409, - /* 870 */ 230, 42, 40, 39, 38, 37, 1374, 1375, 608, 1424, - /* 880 */ 1427, 1428, 1429, 1430, 1431, 1432, 1433, 609, 605, 1442, - /* 890 */ 1443, 1445, 1446, 1447, 1448, 1450, 1453, 2, 1915, 445, - /* 900 */ 1088, 1089, 440, 439, 438, 437, 434, 433, 432, 431, - /* 910 */ 430, 426, 425, 424, 423, 334, 416, 415, 414, 1516, - /* 920 */ 411, 410, 331, 682, 681, 680, 679, 370, 1601, 678, - /* 930 */ 677, 135, 672, 671, 670, 669, 668, 667, 666, 665, - /* 940 */ 148, 661, 660, 659, 369, 368, 656, 655, 654, 653, - /* 950 */ 652, 156, 597, 1600, 641, 584, 294, 36, 35, 357, - /* 960 */ 356, 42, 40, 39, 38, 37, 595, 1946, 1858, 1384, - /* 970 */ 292, 66, 1915, 597, 65, 6, 512, 511, 510, 601, - /* 980 */ 1449, 2005, 1377, 1746, 128, 506, 1721, 275, 2048, 505, - /* 990 */ 2048, 155, 193, 454, 452, 504, 509, 1915, 1964, 1934, - /* 1000 */ 1749, 503, 337, 1398, 1746, 1444, 614, 1426, 11, 10, - /* 1010 */ 1929, 1915, 325, 613, 2044, 1599, 2043, 1376, 1210, 639, - /* 1020 */ 638, 637, 1214, 636, 1216, 1217, 635, 1219, 632, 58, - /* 1030 */ 1225, 629, 1227, 1228, 626, 623, 1945, 572, 1925, 1931, - /* 1040 */ 1980, 569, 1598, 100, 1947, 617, 1949, 1950, 612, 607, - /* 1050 */ 607, 540, 1597, 1596, 1478, 2121, 597, 2033, 1829, 1915, - /* 1060 */ 211, 354, 2029, 708, 338, 603, 336, 335, 99, 499, - /* 1070 */ 367, 643, 2052, 501, 1790, 162, 1595, 281, 1842, 1842, - /* 1080 */ 1395, 493, 489, 485, 481, 208, 1915, 1746, 647, 183, - /* 1090 */ 187, 1790, 166, 1605, 649, 500, 1915, 1915, 698, 694, - /* 1100 */ 690, 686, 279, 664, 1492, 1716, 74, 73, 402, 648, - /* 1110 */ 1479, 180, 1790, 146, 145, 646, 645, 644, 143, 568, - /* 1120 */ 1915, 48, 81, 3, 67, 206, 2053, 1512, 1385, 316, - /* 1130 */ 1380, 1701, 390, 406, 388, 384, 380, 377, 374, 98, - /* 1140 */ 1648, 137, 272, 125, 2073, 31, 407, 234, 577, 1587, - /* 1150 */ 1588, 36, 35, 1388, 1390, 42, 40, 39, 38, 37, - /* 1160 */ 60, 1515, 513, 11, 10, 605, 1442, 1443, 1445, 1446, - /* 1170 */ 1447, 1448, 1641, 216, 75, 593, 214, 1946, 176, 131, - /* 1180 */ 1512, 32, 358, 1473, 1474, 1475, 1476, 1477, 1481, 1482, - /* 1190 */ 1483, 1484, 205, 199, 515, 204, 36, 35, 472, 239, - /* 1200 */ 42, 40, 39, 38, 37, 1946, 218, 252, 1964, 217, - /* 1210 */ 422, 1639, 260, 1542, 197, 220, 614, 222, 219, 1379, - /* 1220 */ 221, 1915, 1426, 613, 233, 50, 1378, 553, 209, 1341, - /* 1230 */ 544, 229, 604, 518, 1131, 96, 1964, 45, 172, 2041, - /* 1240 */ 2042, 246, 129, 2046, 614, 93, 1945, 373, 1946, 1915, - /* 1250 */ 1980, 613, 241, 100, 1947, 617, 1949, 1950, 612, 573, - /* 1260 */ 607, 570, 1936, 262, 83, 600, 1965, 2033, 1851, 1132, - /* 1270 */ 140, 354, 2029, 371, 1945, 1629, 1946, 45, 1980, 1964, - /* 1280 */ 1787, 101, 1947, 617, 1949, 1950, 612, 614, 607, 545, - /* 1290 */ 1317, 142, 1915, 2101, 613, 2033, 657, 36, 35, 2032, - /* 1300 */ 2029, 42, 40, 39, 38, 37, 2063, 1964, 2107, 173, - /* 1310 */ 578, 1938, 254, 2102, 566, 614, 267, 1945, 1151, 1946, - /* 1320 */ 1915, 1980, 613, 589, 101, 1947, 617, 1949, 1950, 612, - /* 1330 */ 1435, 607, 144, 1, 60, 1635, 45, 1946, 2033, 251, - /* 1340 */ 658, 4, 602, 2029, 271, 615, 577, 381, 376, 1980, - /* 1350 */ 1964, 330, 101, 1947, 617, 1949, 1950, 612, 611, 607, - /* 1360 */ 1334, 1585, 1149, 1915, 282, 613, 2033, 1382, 1964, 1398, - /* 1370 */ 324, 2029, 621, 186, 1381, 1470, 614, 131, 408, 1852, - /* 1380 */ 1946, 1915, 1933, 613, 700, 1203, 412, 1486, 1945, 287, - /* 1390 */ 142, 144, 1980, 1929, 417, 310, 1947, 617, 1949, 1950, - /* 1400 */ 612, 610, 607, 598, 1998, 443, 1945, 1393, 429, 1844, - /* 1410 */ 1980, 1964, 436, 160, 1947, 617, 1949, 1950, 612, 614, - /* 1420 */ 607, 1925, 1931, 355, 1915, 1231, 613, 126, 142, 451, - /* 1430 */ 442, 444, 607, 1946, 450, 190, 174, 2041, 2042, 1399, - /* 1440 */ 129, 2046, 1401, 1235, 1242, 453, 455, 456, 465, 1945, - /* 1450 */ 468, 469, 1400, 1980, 1946, 1584, 101, 1947, 617, 1949, - /* 1460 */ 1950, 612, 196, 607, 1964, 567, 2122, 198, 470, 1402, - /* 1470 */ 2033, 471, 614, 1105, 201, 2030, 473, 1915, 496, 613, - /* 1480 */ 1240, 147, 477, 203, 78, 1964, 79, 207, 494, 495, - /* 1490 */ 103, 1892, 498, 614, 372, 1891, 532, 1736, 1915, 535, - /* 1500 */ 613, 319, 1945, 534, 228, 283, 1980, 549, 1946, 159, - /* 1510 */ 1947, 617, 1949, 1950, 612, 213, 607, 1732, 542, 215, - /* 1520 */ 149, 150, 536, 1945, 1734, 539, 1730, 1980, 554, 151, - /* 1530 */ 304, 1947, 617, 1949, 1950, 612, 545, 607, 152, 1964, - /* 1540 */ 2101, 231, 2079, 587, 551, 5, 563, 614, 344, 557, - /* 1550 */ 2064, 2071, 1915, 548, 613, 2107, 173, 2074, 237, 240, - /* 1560 */ 2102, 566, 1946, 36, 35, 2055, 245, 42, 40, 39, - /* 1570 */ 38, 37, 550, 247, 562, 345, 1512, 1945, 547, 1946, - /* 1580 */ 2124, 1980, 574, 2078, 160, 1947, 617, 1949, 1950, 612, - /* 1590 */ 249, 607, 250, 1964, 130, 163, 571, 1397, 349, 582, - /* 1600 */ 2100, 614, 2049, 348, 259, 1946, 1915, 284, 613, 253, - /* 1610 */ 1964, 585, 586, 285, 1863, 359, 590, 1862, 614, 1861, - /* 1620 */ 350, 248, 88, 1915, 286, 613, 591, 1747, 57, 92, - /* 1630 */ 2014, 1945, 90, 1946, 619, 1980, 1964, 2123, 311, 1947, - /* 1640 */ 617, 1949, 1950, 612, 614, 607, 1791, 289, 1945, 1915, - /* 1650 */ 1717, 613, 1980, 278, 701, 311, 1947, 617, 1949, 1950, - /* 1660 */ 612, 704, 607, 313, 1964, 702, 49, 321, 298, 361, - /* 1670 */ 322, 312, 614, 302, 1945, 293, 1946, 1915, 1980, 613, - /* 1680 */ 291, 295, 1947, 617, 1949, 1950, 612, 1909, 607, 1908, - /* 1690 */ 71, 1907, 1946, 1906, 72, 1903, 378, 379, 1362, 1363, - /* 1700 */ 179, 383, 1945, 1901, 385, 386, 1980, 1964, 387, 311, - /* 1710 */ 1947, 617, 1949, 1950, 612, 614, 607, 1900, 389, 154, - /* 1720 */ 1915, 1899, 613, 1964, 1898, 391, 393, 1897, 1337, 395, - /* 1730 */ 1336, 614, 1874, 1873, 400, 533, 1915, 401, 613, 1872, - /* 1740 */ 1871, 1837, 1836, 1946, 1297, 1945, 1834, 136, 1833, 1980, - /* 1750 */ 1832, 1835, 296, 1947, 617, 1949, 1950, 612, 1831, 607, - /* 1760 */ 1830, 1945, 1828, 1827, 1826, 1980, 184, 1825, 297, 1947, - /* 1770 */ 617, 1949, 1950, 612, 1964, 607, 420, 545, 418, 1824, - /* 1780 */ 1823, 2101, 614, 1822, 1821, 1820, 1946, 1915, 1819, 613, - /* 1790 */ 1818, 1817, 1816, 1815, 1814, 1813, 2107, 173, 1812, 1811, - /* 1800 */ 1810, 2102, 566, 1946, 1809, 1808, 1807, 138, 1806, 1805, - /* 1810 */ 1804, 1299, 1945, 1803, 1802, 446, 1980, 1964, 1801, 303, - /* 1820 */ 1947, 617, 1949, 1950, 612, 614, 607, 1800, 1663, 191, - /* 1830 */ 1915, 1178, 613, 1662, 1964, 192, 1660, 1624, 1091, 194, - /* 1840 */ 69, 1623, 614, 1090, 1887, 1881, 168, 1915, 1870, 613, - /* 1850 */ 1935, 1869, 195, 202, 461, 1945, 1946, 1854, 463, 1980, - /* 1860 */ 70, 200, 307, 1947, 617, 1949, 1950, 612, 1725, 607, - /* 1870 */ 1659, 1657, 1945, 1946, 478, 1655, 1980, 480, 479, 299, - /* 1880 */ 1947, 617, 1949, 1950, 612, 482, 607, 1964, 483, 1124, - /* 1890 */ 1653, 484, 488, 486, 487, 614, 1651, 490, 492, 1638, - /* 1900 */ 1915, 1637, 613, 491, 1964, 1620, 1727, 1247, 1246, 1726, - /* 1910 */ 673, 1169, 614, 1168, 1167, 1161, 1166, 1915, 675, 613, - /* 1920 */ 59, 1649, 212, 1163, 1946, 1945, 1162, 1160, 1642, 1980, - /* 1930 */ 339, 1640, 308, 1947, 617, 1949, 1950, 612, 340, 607, - /* 1940 */ 341, 1946, 1945, 1619, 516, 519, 1980, 521, 1618, 300, - /* 1950 */ 1947, 617, 1949, 1950, 612, 1964, 607, 523, 1617, 525, - /* 1960 */ 102, 1352, 1351, 614, 1354, 529, 1886, 1946, 1915, 24, - /* 1970 */ 613, 1343, 1964, 1880, 537, 1868, 1866, 2106, 17, 14, - /* 1980 */ 614, 53, 232, 26, 1946, 1915, 1557, 613, 56, 243, - /* 1990 */ 538, 236, 61, 1945, 238, 342, 161, 1980, 1964, 1541, - /* 2000 */ 309, 1947, 617, 1949, 1950, 612, 614, 607, 1534, 242, - /* 2010 */ 1945, 1915, 543, 613, 1980, 1964, 153, 301, 1947, 617, - /* 2020 */ 1949, 1950, 612, 614, 607, 27, 244, 1936, 1915, 28, - /* 2030 */ 613, 84, 19, 1572, 1571, 1946, 1945, 346, 1577, 1578, - /* 2040 */ 1980, 1576, 1575, 314, 1947, 617, 1949, 1950, 612, 347, - /* 2050 */ 607, 1509, 1508, 1945, 55, 256, 164, 1980, 1867, 1865, - /* 2060 */ 315, 1947, 617, 1949, 1950, 612, 1964, 607, 1864, 261, - /* 2070 */ 588, 1853, 18, 20, 614, 1539, 87, 263, 1946, 1915, - /* 2080 */ 268, 613, 86, 15, 270, 273, 54, 89, 93, 21, - /* 2090 */ 8, 10, 1461, 1460, 1946, 1386, 1983, 165, 177, 1417, - /* 2100 */ 1439, 606, 618, 1224, 1945, 620, 616, 34, 1980, 1964, - /* 2110 */ 1471, 1958, 1947, 617, 1949, 1950, 612, 614, 607, 1437, - /* 2120 */ 1436, 13, 1915, 22, 613, 1964, 1409, 23, 362, 1232, - /* 2130 */ 622, 624, 1229, 614, 627, 625, 630, 1226, 1915, 628, - /* 2140 */ 613, 1220, 631, 633, 1218, 1946, 1223, 1945, 634, 1209, - /* 2150 */ 1222, 1980, 94, 1221, 1957, 1947, 617, 1949, 1950, 612, - /* 2160 */ 276, 607, 640, 1945, 1241, 95, 1237, 1980, 68, 1122, - /* 2170 */ 1956, 1947, 617, 1949, 1950, 612, 1964, 607, 650, 1176, - /* 2180 */ 1157, 1156, 1155, 1154, 614, 1153, 1152, 1150, 1946, 1915, - /* 2190 */ 1148, 613, 1147, 1146, 1144, 662, 1143, 277, 1142, 1141, - /* 2200 */ 1140, 1139, 1138, 1137, 1173, 1946, 1171, 1134, 1133, 1130, - /* 2210 */ 1129, 1128, 1127, 1656, 1945, 683, 1654, 684, 1980, 1964, - /* 2220 */ 685, 326, 1947, 617, 1949, 1950, 612, 614, 607, 687, - /* 2230 */ 688, 689, 1915, 1652, 613, 691, 1964, 693, 692, 1650, - /* 2240 */ 695, 696, 697, 1636, 614, 699, 1080, 1616, 280, 1915, - /* 2250 */ 703, 613, 1372, 290, 1591, 706, 707, 1945, 1946, 1591, - /* 2260 */ 1591, 1980, 1591, 1591, 327, 1947, 617, 1949, 1950, 612, - /* 2270 */ 1591, 607, 1591, 1591, 1945, 1946, 1591, 1591, 1980, 1591, - /* 2280 */ 1591, 323, 1947, 617, 1949, 1950, 612, 1591, 607, 1964, - /* 2290 */ 1591, 1591, 1591, 1591, 1591, 1591, 1591, 614, 1591, 1591, - /* 2300 */ 1591, 1591, 1915, 1591, 613, 1591, 1964, 1591, 1591, 1591, - /* 2310 */ 1591, 1591, 1591, 1591, 614, 1591, 1591, 1591, 1591, 1915, - /* 2320 */ 1591, 613, 1591, 1591, 1591, 1591, 1946, 1945, 1591, 1591, - /* 2330 */ 1591, 1980, 1591, 1591, 328, 1947, 617, 1949, 1950, 612, - /* 2340 */ 1591, 607, 1591, 1591, 615, 1591, 1591, 1591, 1980, 1591, - /* 2350 */ 1591, 306, 1947, 617, 1949, 1950, 612, 1964, 607, 1591, - /* 2360 */ 1591, 1591, 1591, 1591, 1591, 614, 1591, 1591, 1591, 1591, - /* 2370 */ 1915, 1591, 613, 1591, 1591, 1591, 1591, 1591, 1591, 1591, - /* 2380 */ 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591, - /* 2390 */ 1591, 1591, 1591, 1591, 1591, 1945, 1591, 1591, 1591, 1980, - /* 2400 */ 1591, 1591, 305, 1947, 617, 1949, 1950, 612, 1591, 607, + /* 0 */ 458, 1795, 459, 1625, 1838, 1733, 1587, 467, 353, 459, + /* 10 */ 1625, 1632, 43, 41, 1516, 181, 1925, 1793, 1731, 399, + /* 20 */ 360, 62, 1367, 36, 35, 1081, 1960, 42, 40, 39, + /* 30 */ 38, 37, 167, 1446, 559, 1365, 1658, 42, 40, 39, + /* 40 */ 38, 37, 36, 35, 1921, 1927, 42, 40, 39, 38, + /* 50 */ 37, 33, 274, 332, 1842, 607, 464, 577, 1441, 25, + /* 60 */ 699, 545, 460, 16, 1083, 2097, 1086, 1087, 597, 375, + /* 70 */ 1373, 365, 596, 558, 1788, 1790, 597, 1942, 97, 1373, + /* 80 */ 2103, 173, 123, 43, 41, 2098, 566, 1929, 131, 497, + /* 90 */ 52, 360, 132, 1367, 596, 12, 560, 325, 1925, 1742, + /* 100 */ 1734, 512, 511, 510, 1446, 352, 1365, 1742, 1960, 128, + /* 110 */ 506, 545, 58, 155, 505, 2097, 580, 704, 1392, 504, + /* 120 */ 509, 1911, 1744, 613, 405, 503, 1921, 1927, 343, 1441, + /* 130 */ 2103, 173, 1448, 1449, 16, 2098, 566, 607, 1475, 457, + /* 140 */ 158, 1373, 462, 1631, 577, 1696, 1941, 172, 2037, 2038, + /* 150 */ 1976, 129, 2042, 100, 1943, 617, 1945, 1946, 612, 565, + /* 160 */ 607, 1422, 1431, 2097, 318, 170, 12, 2029, 476, 46, + /* 170 */ 466, 354, 2025, 462, 1631, 131, 265, 266, 564, 173, + /* 180 */ 1368, 264, 1366, 2098, 566, 175, 337, 526, 704, 1393, + /* 190 */ 1929, 36, 35, 2055, 1476, 42, 40, 39, 38, 37, + /* 200 */ 524, 1925, 522, 1448, 1449, 1371, 1372, 1513, 1421, 1424, + /* 210 */ 1425, 1426, 1427, 1428, 1429, 1430, 609, 605, 1439, 1440, + /* 220 */ 1442, 1443, 1444, 1445, 1447, 1450, 2, 58, 58, 1921, + /* 230 */ 1927, 355, 1422, 1431, 255, 2037, 576, 2101, 124, 575, + /* 240 */ 607, 80, 2097, 1789, 1790, 596, 47, 338, 1392, 336, + /* 250 */ 335, 1368, 499, 1366, 1542, 127, 501, 564, 173, 1303, + /* 260 */ 1304, 176, 2098, 566, 1737, 32, 358, 1470, 1471, 1472, + /* 270 */ 1473, 1474, 1478, 1479, 1480, 1481, 1371, 1372, 500, 1421, + /* 280 */ 1424, 1425, 1426, 1427, 1428, 1429, 1430, 609, 605, 1439, + /* 290 */ 1440, 1442, 1443, 1444, 1445, 1447, 1450, 2, 1612, 9, + /* 300 */ 43, 41, 552, 1540, 1541, 1543, 1544, 1838, 360, 584, + /* 310 */ 1367, 398, 1393, 397, 1100, 157, 1099, 1601, 183, 351, + /* 320 */ 46, 1446, 1853, 1365, 1207, 639, 638, 637, 1211, 636, + /* 330 */ 1213, 1214, 635, 1216, 632, 1590, 1222, 629, 1224, 1225, + /* 340 */ 626, 623, 1911, 1520, 169, 1101, 1441, 1086, 1087, 1392, + /* 350 */ 2102, 16, 2044, 555, 2097, 597, 113, 1782, 1373, 112, + /* 360 */ 111, 110, 109, 108, 107, 106, 105, 104, 394, 178, + /* 370 */ 2101, 43, 41, 1451, 2098, 2100, 176, 176, 2041, 360, + /* 380 */ 185, 1367, 1589, 12, 1942, 9, 1742, 7, 226, 396, + /* 390 */ 392, 577, 1446, 113, 1365, 176, 112, 111, 110, 109, + /* 400 */ 108, 107, 106, 105, 104, 704, 122, 121, 120, 119, + /* 410 */ 118, 117, 116, 115, 114, 1960, 77, 1441, 363, 76, + /* 420 */ 1448, 1449, 131, 614, 1250, 1251, 155, 1611, 1911, 1373, + /* 430 */ 613, 39, 38, 37, 1391, 1744, 561, 556, 227, 36, + /* 440 */ 35, 1772, 597, 42, 40, 39, 38, 37, 1512, 1422, + /* 450 */ 1431, 1344, 1345, 1941, 44, 167, 403, 1976, 225, 1795, + /* 460 */ 100, 1943, 617, 1945, 1946, 612, 329, 607, 1368, 176, + /* 470 */ 1366, 1911, 2117, 1742, 2029, 1793, 704, 1843, 354, 2025, + /* 480 */ 1167, 174, 2037, 2038, 441, 129, 2042, 233, 1610, 2063, + /* 490 */ 1423, 1448, 1449, 1371, 1372, 568, 1421, 1424, 1425, 1426, + /* 500 */ 1427, 1428, 1429, 1430, 609, 605, 1439, 1440, 1442, 1443, + /* 510 */ 1444, 1445, 1447, 1450, 2, 1169, 651, 597, 82, 320, + /* 520 */ 1422, 1431, 530, 707, 528, 91, 83, 512, 511, 510, + /* 530 */ 565, 123, 1911, 642, 2097, 128, 506, 281, 502, 1368, + /* 540 */ 505, 1366, 189, 188, 9, 504, 509, 1735, 1742, 564, + /* 550 */ 173, 503, 166, 1720, 2098, 566, 11, 10, 697, 693, + /* 560 */ 689, 685, 279, 663, 1371, 1372, 80, 1421, 1424, 1425, + /* 570 */ 1426, 1427, 1428, 1429, 1430, 609, 605, 1439, 1440, 1442, + /* 580 */ 1443, 1444, 1445, 1447, 1450, 2, 43, 41, 2102, 1738, + /* 590 */ 133, 1930, 2097, 2000, 360, 211, 1367, 1392, 98, 1609, + /* 600 */ 1718, 272, 1925, 1582, 649, 1727, 1942, 1446, 2101, 1365, + /* 610 */ 162, 1608, 2098, 2099, 572, 476, 493, 489, 485, 481, + /* 620 */ 208, 2044, 577, 146, 145, 646, 645, 644, 143, 258, + /* 630 */ 1921, 1927, 1441, 1795, 593, 508, 507, 1960, 675, 673, + /* 640 */ 364, 607, 1729, 1911, 1373, 614, 1100, 2040, 1099, 1793, + /* 650 */ 1911, 1489, 613, 131, 155, 1911, 81, 43, 41, 206, + /* 660 */ 1367, 210, 651, 1745, 2102, 360, 58, 1367, 85, 44, + /* 670 */ 1725, 260, 58, 1365, 230, 1941, 583, 1101, 1446, 1976, + /* 680 */ 1365, 1394, 100, 1943, 617, 1945, 1946, 612, 1338, 607, + /* 690 */ 229, 704, 134, 608, 141, 2000, 2029, 1581, 1456, 2044, + /* 700 */ 354, 2025, 569, 1441, 1392, 1394, 1448, 1449, 1373, 1838, + /* 710 */ 597, 579, 171, 2037, 2038, 1373, 129, 2042, 545, 540, + /* 720 */ 187, 1607, 2097, 641, 404, 2039, 205, 199, 1606, 204, + /* 730 */ 597, 1392, 472, 1477, 584, 1422, 1431, 2103, 173, 29, + /* 740 */ 12, 1742, 2098, 566, 413, 36, 35, 1854, 197, 42, + /* 750 */ 40, 39, 38, 37, 1368, 704, 1366, 1575, 1605, 2069, + /* 760 */ 144, 1742, 704, 36, 35, 1911, 1602, 42, 40, 39, + /* 770 */ 38, 37, 1911, 1604, 599, 1395, 2001, 1448, 1449, 1371, + /* 780 */ 1372, 1898, 1421, 1424, 1425, 1426, 1427, 1428, 1429, 1430, + /* 790 */ 609, 605, 1439, 1440, 1442, 1443, 1444, 1445, 1447, 1450, + /* 800 */ 2, 317, 1911, 1390, 30, 1603, 1422, 1431, 597, 597, + /* 810 */ 435, 366, 51, 448, 1482, 176, 447, 1911, 1368, 155, + /* 820 */ 1366, 176, 427, 428, 257, 1368, 1655, 1366, 1744, 382, + /* 830 */ 1600, 419, 1599, 449, 1598, 573, 421, 1597, 1596, 1742, + /* 840 */ 1742, 2049, 1509, 1371, 1372, 1423, 1595, 1395, 257, 1911, + /* 850 */ 1371, 1372, 553, 1421, 1424, 1425, 1426, 1427, 1428, 1429, + /* 860 */ 1430, 609, 605, 1439, 1440, 1442, 1443, 1444, 1445, 1447, + /* 870 */ 1450, 2, 1423, 601, 1911, 2001, 1911, 333, 1911, 36, + /* 880 */ 35, 1911, 1911, 42, 40, 39, 38, 37, 1719, 409, + /* 890 */ 1911, 681, 680, 679, 678, 370, 1697, 677, 676, 135, + /* 900 */ 671, 670, 669, 668, 667, 666, 665, 148, 661, 660, + /* 910 */ 659, 369, 368, 656, 655, 654, 653, 652, 235, 445, + /* 920 */ 1594, 570, 440, 439, 438, 437, 434, 433, 432, 431, + /* 930 */ 430, 426, 425, 424, 423, 334, 416, 415, 414, 517, + /* 940 */ 411, 410, 331, 156, 643, 36, 35, 1786, 294, 42, + /* 950 */ 40, 39, 38, 37, 527, 1717, 597, 1593, 1942, 6, + /* 960 */ 597, 252, 292, 66, 1911, 31, 65, 1552, 224, 209, + /* 970 */ 474, 36, 35, 1395, 475, 42, 40, 39, 38, 37, + /* 980 */ 597, 1592, 597, 520, 193, 454, 452, 1742, 514, 1960, + /* 990 */ 182, 1742, 597, 223, 1739, 649, 139, 580, 664, 501, + /* 1000 */ 1712, 1911, 1911, 373, 613, 246, 541, 647, 1795, 1825, + /* 1010 */ 1786, 1742, 597, 1742, 146, 145, 646, 645, 644, 143, + /* 1020 */ 58, 500, 67, 1742, 1794, 1911, 581, 1941, 48, 64, + /* 1030 */ 3, 1976, 63, 1532, 100, 1943, 617, 1945, 1946, 612, + /* 1040 */ 137, 607, 125, 1742, 648, 545, 170, 1786, 2029, 2097, + /* 1050 */ 36, 35, 354, 2025, 42, 40, 39, 38, 37, 99, + /* 1060 */ 406, 1942, 649, 597, 2103, 173, 357, 356, 288, 2098, + /* 1070 */ 566, 1772, 75, 407, 2056, 216, 1381, 269, 214, 597, + /* 1080 */ 1376, 146, 145, 646, 645, 644, 143, 1446, 218, 1374, + /* 1090 */ 1375, 217, 1960, 592, 1742, 1645, 1638, 74, 73, 402, + /* 1100 */ 614, 597, 180, 220, 1942, 1911, 219, 613, 1961, 60, + /* 1110 */ 1742, 222, 1441, 239, 221, 594, 234, 513, 515, 1932, + /* 1120 */ 316, 604, 597, 390, 1373, 388, 384, 380, 377, 374, + /* 1130 */ 1941, 371, 1742, 597, 1976, 1960, 595, 100, 1943, 617, + /* 1140 */ 1945, 1946, 612, 614, 607, 597, 1636, 275, 1911, 2117, + /* 1150 */ 613, 2029, 45, 1742, 372, 354, 2025, 1584, 1585, 367, + /* 1160 */ 422, 1539, 1942, 1509, 1742, 241, 2091, 1934, 518, 176, + /* 1170 */ 50, 603, 262, 1941, 140, 544, 1742, 1976, 142, 1626, + /* 1180 */ 100, 1943, 617, 1945, 1946, 612, 1847, 607, 657, 11, + /* 1190 */ 10, 658, 2117, 1960, 2029, 144, 545, 60, 354, 2025, + /* 1200 */ 2097, 614, 2059, 45, 1314, 154, 1911, 96, 613, 2048, + /* 1210 */ 1148, 1783, 45, 1146, 621, 2103, 173, 93, 142, 533, + /* 1220 */ 2098, 566, 578, 1942, 267, 254, 589, 1379, 4, 251, + /* 1230 */ 271, 1941, 376, 1129, 1382, 1976, 1377, 1378, 100, 1943, + /* 1240 */ 617, 1945, 1946, 612, 381, 607, 144, 1200, 1, 1483, + /* 1250 */ 2004, 1942, 2029, 126, 1960, 1432, 354, 2025, 330, 1385, + /* 1260 */ 1387, 545, 614, 1467, 287, 2097, 1228, 1911, 1130, 613, + /* 1270 */ 1232, 605, 1439, 1440, 1442, 1443, 1444, 1445, 1331, 186, + /* 1280 */ 2103, 173, 1960, 142, 282, 2098, 566, 408, 1395, 1848, + /* 1290 */ 614, 412, 1941, 443, 1390, 1911, 1976, 613, 1239, 100, + /* 1300 */ 1943, 617, 1945, 1946, 612, 1237, 607, 417, 429, 450, + /* 1310 */ 1840, 2002, 1942, 2029, 436, 442, 444, 354, 2025, 451, + /* 1320 */ 1941, 190, 1396, 453, 1976, 455, 456, 100, 1943, 617, + /* 1330 */ 1945, 1946, 612, 465, 607, 147, 1398, 468, 469, 600, + /* 1340 */ 196, 2029, 198, 1960, 1397, 354, 2025, 470, 1399, 201, + /* 1350 */ 471, 614, 473, 203, 78, 79, 1911, 477, 613, 207, + /* 1360 */ 1103, 496, 494, 495, 498, 1942, 103, 1732, 535, 1888, + /* 1370 */ 319, 1887, 534, 213, 532, 1728, 283, 215, 149, 150, + /* 1380 */ 542, 1941, 2075, 228, 1730, 1976, 1726, 151, 101, 1943, + /* 1390 */ 617, 1945, 1946, 612, 231, 607, 1960, 152, 2074, 554, + /* 1400 */ 587, 5, 2029, 539, 614, 2051, 2028, 2025, 549, 1911, + /* 1410 */ 245, 613, 563, 548, 2060, 2070, 550, 551, 1942, 536, + /* 1420 */ 344, 557, 345, 547, 2120, 574, 237, 571, 163, 247, + /* 1430 */ 248, 240, 253, 250, 1941, 1509, 1394, 130, 1976, 249, + /* 1440 */ 582, 101, 1943, 617, 1945, 1946, 612, 2096, 607, 1960, + /* 1450 */ 2045, 348, 259, 284, 585, 2029, 586, 614, 1859, 602, + /* 1460 */ 2025, 1942, 1911, 1858, 613, 285, 1857, 350, 590, 88, + /* 1470 */ 591, 286, 90, 1743, 57, 92, 619, 2010, 289, 1787, + /* 1480 */ 700, 278, 321, 1713, 313, 701, 322, 615, 298, 703, + /* 1490 */ 49, 1976, 1960, 1905, 101, 1943, 617, 1945, 1946, 612, + /* 1500 */ 611, 607, 312, 1904, 291, 1911, 71, 613, 2029, 293, + /* 1510 */ 302, 1903, 324, 2025, 1902, 72, 1899, 378, 1942, 379, + /* 1520 */ 1359, 1360, 179, 1897, 383, 385, 386, 1896, 387, 389, + /* 1530 */ 1941, 1895, 1894, 391, 1976, 1942, 1893, 310, 1943, 617, + /* 1540 */ 1945, 1946, 612, 610, 607, 598, 1994, 393, 1334, 1960, + /* 1550 */ 395, 1333, 1870, 1869, 400, 1868, 401, 614, 1867, 1294, + /* 1560 */ 1833, 1942, 1911, 1832, 613, 1830, 1960, 191, 136, 1829, + /* 1570 */ 1828, 1831, 1827, 1826, 614, 1824, 1823, 1822, 184, 1911, + /* 1580 */ 418, 613, 1821, 420, 1820, 1819, 1818, 1941, 138, 1805, + /* 1590 */ 1804, 1976, 1960, 1817, 159, 1943, 617, 1945, 1946, 612, + /* 1600 */ 614, 607, 1816, 1815, 1941, 1911, 1814, 613, 1976, 1813, + /* 1610 */ 1812, 160, 1943, 617, 1945, 1946, 612, 1811, 607, 1810, + /* 1620 */ 1809, 1942, 1808, 1807, 1806, 1803, 1802, 1801, 1800, 1296, + /* 1630 */ 1941, 446, 1797, 1796, 1976, 546, 2066, 101, 1943, 617, + /* 1640 */ 1945, 1946, 612, 1942, 607, 1799, 1798, 1175, 1660, 1659, + /* 1650 */ 192, 2029, 1960, 1657, 1621, 194, 2026, 69, 168, 1620, + /* 1660 */ 614, 1089, 1931, 567, 2118, 1911, 1883, 613, 461, 1088, + /* 1670 */ 195, 1877, 1866, 70, 1960, 200, 463, 202, 1865, 1850, + /* 1680 */ 1721, 1656, 614, 1654, 1652, 478, 479, 1911, 483, 613, + /* 1690 */ 1941, 1650, 482, 486, 1976, 480, 1648, 159, 1943, 617, + /* 1700 */ 1945, 1946, 612, 1122, 607, 1635, 484, 1942, 487, 488, + /* 1710 */ 490, 491, 1941, 492, 1634, 1617, 1976, 1723, 212, 304, + /* 1720 */ 1943, 617, 1945, 1946, 612, 1244, 607, 1722, 1942, 1243, + /* 1730 */ 672, 674, 1166, 1165, 1164, 1163, 1160, 1159, 1960, 2067, + /* 1740 */ 1158, 59, 1646, 1157, 339, 1639, 614, 340, 1637, 1616, + /* 1750 */ 341, 1911, 1615, 613, 516, 519, 521, 1614, 523, 1960, + /* 1760 */ 525, 102, 1882, 562, 349, 1349, 1348, 614, 53, 1351, + /* 1770 */ 529, 1942, 1911, 1876, 613, 1340, 1941, 24, 153, 1864, + /* 1780 */ 1976, 537, 1862, 160, 1943, 617, 1945, 1946, 612, 2102, + /* 1790 */ 607, 17, 14, 244, 56, 243, 18, 1941, 538, 1554, + /* 1800 */ 1932, 1976, 1960, 61, 311, 1943, 617, 1945, 1946, 612, + /* 1810 */ 611, 607, 543, 28, 26, 1911, 232, 613, 19, 236, + /* 1820 */ 1569, 161, 1942, 1568, 342, 238, 346, 15, 1538, 242, + /* 1830 */ 27, 1573, 1531, 1574, 84, 1863, 2119, 1572, 1942, 1575, + /* 1840 */ 1941, 347, 256, 54, 1976, 55, 164, 310, 1943, 617, + /* 1850 */ 1945, 1946, 612, 1960, 607, 1861, 1995, 1506, 359, 1505, + /* 1860 */ 1860, 614, 20, 1849, 261, 263, 1911, 1536, 613, 1960, + /* 1870 */ 268, 86, 588, 87, 361, 270, 89, 614, 273, 10, + /* 1880 */ 21, 1468, 1911, 93, 613, 1979, 1383, 165, 1436, 1458, + /* 1890 */ 1434, 1941, 1942, 8, 177, 1976, 1457, 1414, 311, 1943, + /* 1900 */ 617, 1945, 1946, 612, 606, 607, 34, 1941, 1433, 13, + /* 1910 */ 22, 1976, 1406, 1942, 311, 1943, 617, 1945, 1946, 612, + /* 1920 */ 23, 607, 1229, 1960, 618, 620, 362, 622, 624, 1226, + /* 1930 */ 627, 614, 625, 630, 1223, 1217, 1911, 628, 613, 631, + /* 1940 */ 616, 1215, 633, 634, 1960, 1206, 1221, 1220, 1219, 1218, + /* 1950 */ 640, 94, 614, 276, 1238, 1234, 1942, 1911, 1120, 613, + /* 1960 */ 95, 531, 68, 650, 1154, 1976, 1153, 1152, 306, 1943, + /* 1970 */ 617, 1945, 1946, 612, 1151, 607, 1150, 1942, 1149, 1147, + /* 1980 */ 1173, 1145, 1941, 1144, 1143, 1141, 1976, 1960, 662, 295, + /* 1990 */ 1943, 617, 1945, 1946, 612, 614, 607, 277, 1140, 1139, + /* 2000 */ 1911, 1138, 613, 1137, 1136, 1135, 1170, 1168, 1960, 1132, + /* 2010 */ 1131, 1128, 1127, 1126, 1653, 1125, 614, 682, 1651, 683, + /* 2020 */ 1942, 1911, 684, 613, 686, 1941, 687, 1649, 690, 1976, + /* 2030 */ 1647, 688, 296, 1943, 617, 1945, 1946, 612, 1942, 607, + /* 2040 */ 692, 694, 691, 695, 696, 1633, 1941, 698, 1078, 1613, + /* 2050 */ 1976, 1960, 702, 297, 1943, 617, 1945, 1946, 612, 614, + /* 2060 */ 607, 280, 1369, 290, 1911, 705, 613, 1588, 706, 1960, + /* 2070 */ 1588, 1588, 1588, 1588, 1588, 1588, 1588, 614, 1588, 1588, + /* 2080 */ 1588, 1588, 1911, 1588, 613, 1588, 1588, 1588, 1588, 1941, + /* 2090 */ 1588, 1588, 1588, 1976, 1588, 1588, 303, 1943, 617, 1945, + /* 2100 */ 1946, 612, 1942, 607, 1588, 1588, 1588, 1941, 1588, 1588, + /* 2110 */ 1588, 1976, 1588, 1588, 307, 1943, 617, 1945, 1946, 612, + /* 2120 */ 1588, 607, 1588, 1942, 1588, 1588, 1588, 1588, 1588, 1588, + /* 2130 */ 1588, 1588, 1588, 1960, 1588, 1588, 1588, 1588, 1588, 1588, + /* 2140 */ 1588, 614, 1588, 1588, 1588, 1588, 1911, 1588, 613, 1588, + /* 2150 */ 1588, 1588, 1588, 1588, 1960, 1588, 1588, 1588, 1588, 1588, + /* 2160 */ 1588, 1588, 614, 1588, 1588, 1588, 1942, 1911, 1588, 613, + /* 2170 */ 1588, 1941, 1588, 1588, 1588, 1976, 1588, 1588, 299, 1943, + /* 2180 */ 617, 1945, 1946, 612, 1942, 607, 1588, 1588, 1588, 1588, + /* 2190 */ 1588, 1588, 1941, 1588, 1588, 1588, 1976, 1960, 1588, 308, + /* 2200 */ 1943, 617, 1945, 1946, 612, 614, 607, 1588, 1588, 1588, + /* 2210 */ 1911, 1588, 613, 1588, 1588, 1960, 1588, 1588, 1588, 1588, + /* 2220 */ 1588, 1588, 1588, 614, 1588, 1588, 1588, 1942, 1911, 1588, + /* 2230 */ 613, 1588, 1588, 1588, 1588, 1941, 1588, 1588, 1588, 1976, + /* 2240 */ 1588, 1588, 300, 1943, 617, 1945, 1946, 612, 1588, 607, + /* 2250 */ 1588, 1588, 1588, 1941, 1588, 1588, 1588, 1976, 1960, 1588, + /* 2260 */ 309, 1943, 617, 1945, 1946, 612, 614, 607, 1588, 1588, + /* 2270 */ 1942, 1911, 1588, 613, 1588, 1588, 1588, 1588, 1588, 1588, + /* 2280 */ 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1942, 1588, 1588, + /* 2290 */ 1588, 1588, 1588, 1588, 1588, 1588, 1941, 1588, 1588, 1588, + /* 2300 */ 1976, 1960, 1588, 301, 1943, 617, 1945, 1946, 612, 614, + /* 2310 */ 607, 1588, 1588, 1942, 1911, 1588, 613, 1588, 1960, 1588, + /* 2320 */ 1588, 1588, 1588, 1588, 1588, 1588, 614, 1588, 1588, 1588, + /* 2330 */ 1588, 1911, 1588, 613, 1588, 1588, 1588, 1588, 1588, 1941, + /* 2340 */ 1588, 1588, 1588, 1976, 1960, 1588, 314, 1943, 617, 1945, + /* 2350 */ 1946, 612, 614, 607, 1588, 1588, 1941, 1911, 1588, 613, + /* 2360 */ 1976, 1588, 1588, 315, 1943, 617, 1945, 1946, 612, 1588, + /* 2370 */ 607, 1588, 1942, 1588, 1588, 1588, 1588, 1588, 1588, 1588, + /* 2380 */ 1588, 1588, 1941, 1588, 1588, 1588, 1976, 1588, 1588, 1954, + /* 2390 */ 1943, 617, 1945, 1946, 612, 1588, 607, 1588, 1588, 1588, + /* 2400 */ 1588, 1588, 1588, 1960, 1588, 1588, 1588, 1588, 1588, 1588, + /* 2410 */ 1588, 614, 1588, 1588, 1588, 1942, 1911, 1588, 613, 1588, + /* 2420 */ 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, + /* 2430 */ 1588, 1588, 1588, 1942, 1588, 1588, 1588, 1588, 1588, 1588, + /* 2440 */ 1588, 1941, 1588, 1588, 1588, 1976, 1960, 1588, 1953, 1943, + /* 2450 */ 617, 1945, 1946, 612, 614, 607, 1588, 1588, 1588, 1911, + /* 2460 */ 1588, 613, 1588, 1588, 1960, 1588, 1588, 1588, 1588, 1588, + /* 2470 */ 1588, 1588, 614, 1588, 1588, 1588, 1588, 1911, 1588, 613, + /* 2480 */ 1588, 1588, 1588, 1588, 1941, 1588, 1588, 1588, 1976, 1588, + /* 2490 */ 1588, 1952, 1943, 617, 1945, 1946, 612, 1942, 607, 1588, + /* 2500 */ 1588, 1588, 1941, 1588, 1588, 1588, 1976, 1588, 1588, 326, + /* 2510 */ 1943, 617, 1945, 1946, 612, 1588, 607, 1588, 1942, 1588, + /* 2520 */ 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1960, 1588, + /* 2530 */ 1588, 1588, 1588, 1588, 1588, 1588, 614, 1588, 1588, 1588, + /* 2540 */ 1588, 1911, 1588, 613, 1588, 1588, 1588, 1588, 1588, 1960, + /* 2550 */ 1588, 1588, 1588, 1588, 1588, 1588, 1588, 614, 1588, 1588, + /* 2560 */ 1588, 1942, 1911, 1588, 613, 1588, 1941, 1588, 1588, 1588, + /* 2570 */ 1976, 1588, 1588, 327, 1943, 617, 1945, 1946, 612, 1942, + /* 2580 */ 607, 1588, 1588, 1588, 1588, 1588, 1588, 1941, 1588, 1588, + /* 2590 */ 1588, 1976, 1960, 1588, 323, 1943, 617, 1945, 1946, 612, + /* 2600 */ 614, 607, 1588, 1588, 1588, 1911, 1588, 613, 1588, 1588, + /* 2610 */ 1960, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 614, 1588, + /* 2620 */ 1588, 1588, 1942, 1911, 1588, 613, 1588, 1588, 1588, 1588, + /* 2630 */ 1941, 1588, 1588, 1588, 1976, 1588, 1588, 328, 1943, 617, + /* 2640 */ 1945, 1946, 612, 1588, 607, 1588, 1588, 1588, 615, 1588, + /* 2650 */ 1588, 1588, 1976, 1960, 1588, 306, 1943, 617, 1945, 1946, + /* 2660 */ 612, 614, 607, 1588, 1588, 1588, 1911, 1588, 613, 1588, + /* 2670 */ 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, + /* 2680 */ 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, + /* 2690 */ 1588, 1941, 1588, 1588, 1588, 1976, 1588, 1588, 305, 1943, + /* 2700 */ 617, 1945, 1946, 612, 1588, 607, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 325, 329, 357, 331, 332, 427, 371, 416, 417, 431, - /* 10 */ 340, 356, 12, 13, 14, 345, 381, 427, 363, 384, - /* 20 */ 20, 431, 22, 0, 446, 447, 333, 372, 348, 451, - /* 30 */ 452, 356, 14, 33, 356, 35, 356, 447, 20, 364, - /* 40 */ 347, 451, 452, 385, 369, 365, 371, 24, 25, 26, - /* 50 */ 27, 28, 29, 30, 31, 32, 378, 364, 58, 349, - /* 60 */ 8, 9, 352, 63, 12, 13, 14, 15, 16, 394, - /* 70 */ 70, 356, 329, 398, 331, 332, 401, 402, 403, 404, - /* 80 */ 405, 406, 427, 408, 20, 427, 431, 372, 413, 431, - /* 90 */ 415, 325, 358, 356, 419, 420, 96, 96, 333, 325, - /* 100 */ 358, 446, 447, 369, 446, 447, 451, 452, 433, 451, - /* 110 */ 452, 369, 347, 96, 377, 378, 441, 21, 118, 354, - /* 120 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 364, - /* 130 */ 356, 397, 398, 133, 134, 369, 322, 356, 364, 397, - /* 140 */ 398, 399, 408, 369, 363, 371, 12, 13, 62, 97, - /* 150 */ 408, 4, 337, 372, 20, 0, 22, 20, 20, 325, - /* 160 */ 96, 367, 162, 163, 370, 371, 351, 33, 394, 35, - /* 170 */ 333, 20, 398, 22, 359, 401, 402, 403, 404, 405, - /* 180 */ 406, 181, 408, 183, 347, 411, 35, 413, 414, 415, - /* 190 */ 356, 58, 58, 419, 420, 370, 371, 63, 364, 385, - /* 200 */ 20, 364, 51, 369, 70, 371, 206, 207, 333, 209, + /* 0 */ 329, 356, 331, 332, 364, 358, 322, 329, 363, 331, + /* 10 */ 332, 0, 12, 13, 14, 375, 369, 372, 357, 385, + /* 20 */ 20, 4, 22, 8, 9, 4, 356, 12, 13, 14, + /* 30 */ 15, 16, 356, 33, 364, 35, 0, 12, 13, 14, + /* 40 */ 15, 16, 8, 9, 397, 398, 12, 13, 14, 15, + /* 50 */ 16, 416, 417, 377, 378, 408, 14, 333, 58, 44, + /* 60 */ 49, 427, 20, 63, 43, 431, 45, 46, 333, 385, + /* 70 */ 70, 367, 20, 403, 370, 371, 333, 325, 337, 70, + /* 80 */ 446, 447, 347, 12, 13, 451, 452, 358, 364, 354, + /* 90 */ 347, 20, 351, 22, 20, 95, 20, 63, 369, 364, + /* 100 */ 359, 65, 66, 67, 33, 348, 35, 364, 356, 73, + /* 110 */ 74, 427, 95, 356, 78, 431, 364, 117, 20, 83, + /* 120 */ 84, 369, 365, 371, 333, 89, 397, 398, 399, 58, + /* 130 */ 446, 447, 132, 133, 63, 451, 452, 408, 104, 330, + /* 140 */ 340, 70, 333, 334, 333, 345, 394, 423, 424, 425, + /* 150 */ 398, 427, 428, 401, 402, 403, 404, 405, 406, 427, + /* 160 */ 408, 161, 162, 431, 373, 413, 95, 415, 62, 95, + /* 170 */ 330, 419, 420, 333, 334, 364, 126, 127, 446, 447, + /* 180 */ 180, 131, 182, 451, 452, 433, 37, 21, 117, 20, + /* 190 */ 358, 8, 9, 441, 160, 12, 13, 14, 15, 16, + /* 200 */ 34, 369, 36, 132, 133, 205, 206, 4, 208, 209, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 394, 96, - /* 230 */ 96, 98, 398, 325, 128, 401, 402, 403, 404, 405, - /* 240 */ 406, 427, 408, 96, 20, 431, 245, 413, 373, 415, - /* 250 */ 4, 339, 118, 419, 420, 12, 13, 14, 15, 16, - /* 260 */ 446, 447, 245, 108, 356, 451, 452, 133, 134, 20, - /* 270 */ 133, 134, 364, 35, 362, 441, 96, 369, 20, 371, - /* 280 */ 12, 13, 127, 128, 129, 130, 131, 132, 20, 43, - /* 290 */ 22, 45, 46, 325, 188, 189, 162, 163, 192, 333, - /* 300 */ 194, 33, 394, 35, 333, 20, 398, 22, 70, 401, - /* 310 */ 402, 403, 404, 405, 406, 181, 408, 183, 347, 96, - /* 320 */ 96, 413, 20, 415, 356, 354, 58, 419, 420, 355, - /* 330 */ 364, 63, 364, 325, 20, 364, 51, 369, 70, 371, - /* 340 */ 206, 207, 368, 209, 210, 211, 212, 213, 214, 215, - /* 350 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - /* 360 */ 226, 227, 394, 229, 96, 325, 398, 21, 80, 401, - /* 370 */ 402, 403, 404, 405, 406, 427, 408, 369, 245, 431, - /* 380 */ 34, 413, 36, 415, 325, 337, 118, 419, 420, 423, - /* 390 */ 424, 425, 245, 427, 428, 447, 356, 431, 430, 451, - /* 400 */ 452, 133, 134, 180, 364, 182, 3, 359, 324, 369, - /* 410 */ 326, 371, 446, 447, 12, 13, 14, 451, 452, 20, - /* 420 */ 162, 163, 20, 20, 22, 245, 138, 139, 369, 330, - /* 430 */ 162, 163, 333, 334, 394, 33, 333, 35, 398, 0, - /* 440 */ 333, 401, 402, 403, 404, 405, 406, 400, 408, 181, - /* 450 */ 410, 183, 330, 325, 347, 333, 334, 8, 9, 206, - /* 460 */ 58, 12, 13, 14, 15, 16, 164, 364, 245, 245, - /* 470 */ 325, 364, 70, 426, 206, 207, 385, 209, 210, 211, - /* 480 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 490 */ 222, 223, 224, 225, 226, 227, 411, 369, 96, 414, - /* 500 */ 97, 325, 22, 167, 65, 66, 67, 254, 255, 256, - /* 510 */ 257, 258, 73, 74, 369, 35, 62, 78, 427, 325, - /* 520 */ 118, 20, 431, 84, 85, 422, 423, 424, 425, 90, - /* 530 */ 427, 428, 356, 342, 343, 133, 134, 446, 447, 127, - /* 540 */ 364, 333, 451, 452, 356, 369, 97, 371, 12, 13, - /* 550 */ 70, 363, 339, 342, 343, 347, 20, 325, 22, 333, - /* 560 */ 372, 325, 333, 369, 162, 163, 353, 164, 20, 33, - /* 570 */ 394, 35, 364, 347, 398, 362, 347, 401, 402, 403, - /* 580 */ 404, 405, 406, 181, 408, 183, 250, 251, 107, 413, - /* 590 */ 364, 415, 356, 364, 58, 419, 420, 161, 118, 364, - /* 600 */ 364, 369, 190, 191, 229, 369, 70, 371, 206, 207, - /* 610 */ 375, 209, 210, 211, 212, 213, 214, 215, 216, 217, - /* 620 */ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - /* 630 */ 394, 4, 96, 333, 398, 44, 333, 401, 402, 403, - /* 640 */ 404, 405, 406, 333, 408, 333, 19, 347, 333, 413, - /* 650 */ 347, 415, 325, 0, 118, 419, 420, 347, 325, 347, - /* 660 */ 33, 181, 347, 183, 364, 164, 430, 364, 232, 133, - /* 670 */ 134, 0, 325, 356, 364, 48, 364, 333, 242, 364, - /* 680 */ 53, 364, 12, 13, 58, 58, 206, 207, 97, 356, - /* 690 */ 20, 347, 22, 70, 14, 333, 369, 364, 162, 163, - /* 700 */ 20, 48, 369, 33, 371, 35, 8, 9, 364, 347, - /* 710 */ 12, 13, 14, 15, 16, 348, 369, 181, 20, 183, - /* 720 */ 403, 95, 95, 356, 98, 98, 364, 394, 58, 70, - /* 730 */ 325, 398, 365, 62, 401, 402, 403, 404, 405, 406, - /* 740 */ 70, 408, 206, 207, 357, 209, 210, 211, 212, 213, - /* 750 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - /* 760 */ 224, 225, 226, 227, 8, 9, 96, 325, 12, 13, - /* 770 */ 14, 15, 16, 348, 369, 442, 443, 333, 127, 128, - /* 780 */ 18, 356, 20, 132, 412, 333, 414, 108, 118, 27, - /* 790 */ 365, 347, 30, 0, 229, 33, 231, 325, 356, 347, - /* 800 */ 44, 0, 349, 133, 134, 352, 364, 108, 364, 130, - /* 810 */ 48, 369, 50, 371, 21, 53, 364, 24, 25, 26, - /* 820 */ 27, 28, 29, 30, 31, 32, 127, 128, 129, 130, - /* 830 */ 131, 132, 162, 163, 176, 333, 394, 14, 15, 16, - /* 840 */ 398, 369, 162, 401, 402, 403, 404, 405, 406, 347, - /* 850 */ 408, 181, 357, 183, 325, 197, 198, 95, 0, 14, - /* 860 */ 3, 2, 164, 62, 357, 20, 364, 8, 9, 107, - /* 870 */ 357, 12, 13, 14, 15, 16, 206, 207, 357, 209, - /* 880 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 890 */ 220, 221, 222, 223, 224, 225, 226, 227, 369, 137, - /* 900 */ 45, 46, 140, 141, 142, 143, 144, 145, 146, 147, - /* 910 */ 148, 149, 150, 151, 152, 153, 154, 155, 156, 4, - /* 920 */ 158, 159, 160, 65, 66, 67, 68, 69, 325, 71, - /* 930 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - /* 940 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - /* 950 */ 92, 18, 333, 325, 357, 371, 23, 8, 9, 12, - /* 960 */ 13, 12, 13, 14, 15, 16, 347, 325, 384, 22, - /* 970 */ 37, 38, 369, 333, 41, 39, 65, 66, 67, 412, - /* 980 */ 33, 414, 35, 364, 73, 74, 0, 347, 400, 78, - /* 990 */ 400, 356, 59, 60, 61, 84, 85, 369, 356, 358, - /* 1000 */ 365, 90, 37, 20, 364, 58, 364, 162, 1, 2, - /* 1010 */ 369, 369, 63, 371, 426, 325, 426, 70, 109, 110, - /* 1020 */ 111, 112, 113, 114, 115, 116, 117, 118, 119, 96, - /* 1030 */ 121, 122, 123, 124, 125, 126, 394, 44, 397, 398, - /* 1040 */ 398, 44, 325, 401, 402, 403, 404, 405, 406, 408, - /* 1050 */ 408, 389, 325, 325, 105, 413, 333, 415, 0, 369, - /* 1060 */ 33, 419, 420, 19, 99, 118, 101, 102, 135, 104, - /* 1070 */ 347, 366, 430, 108, 369, 48, 325, 33, 364, 364, - /* 1080 */ 20, 54, 55, 56, 57, 58, 369, 364, 366, 375, - /* 1090 */ 375, 369, 48, 326, 108, 130, 369, 369, 54, 55, - /* 1100 */ 56, 57, 58, 344, 97, 346, 173, 174, 175, 366, - /* 1110 */ 161, 178, 369, 127, 128, 129, 130, 131, 132, 262, - /* 1120 */ 369, 42, 95, 44, 107, 98, 243, 244, 181, 196, - /* 1130 */ 183, 345, 199, 22, 201, 202, 203, 204, 205, 95, - /* 1140 */ 0, 42, 98, 44, 379, 2, 35, 164, 333, 133, - /* 1150 */ 134, 8, 9, 206, 207, 12, 13, 14, 15, 16, - /* 1160 */ 44, 246, 22, 1, 2, 218, 219, 220, 221, 222, - /* 1170 */ 223, 224, 0, 100, 157, 131, 103, 325, 245, 364, - /* 1180 */ 244, 232, 233, 234, 235, 236, 237, 238, 239, 240, - /* 1190 */ 241, 242, 165, 166, 22, 168, 8, 9, 171, 44, - /* 1200 */ 12, 13, 14, 15, 16, 325, 100, 455, 356, 103, - /* 1210 */ 152, 0, 168, 97, 187, 100, 364, 100, 103, 35, - /* 1220 */ 103, 369, 162, 371, 58, 164, 35, 444, 335, 185, - /* 1230 */ 169, 187, 63, 22, 35, 96, 356, 44, 423, 424, - /* 1240 */ 425, 438, 427, 428, 364, 106, 394, 385, 325, 369, - /* 1250 */ 398, 371, 97, 401, 402, 403, 404, 405, 406, 266, - /* 1260 */ 408, 264, 47, 44, 98, 413, 356, 415, 379, 70, - /* 1270 */ 44, 419, 420, 335, 394, 332, 325, 44, 398, 356, - /* 1280 */ 368, 401, 402, 403, 404, 405, 406, 364, 408, 427, - /* 1290 */ 97, 44, 369, 431, 371, 415, 13, 8, 9, 419, - /* 1300 */ 420, 12, 13, 14, 15, 16, 379, 356, 446, 447, - /* 1310 */ 429, 96, 448, 451, 452, 364, 97, 394, 35, 325, - /* 1320 */ 369, 398, 371, 97, 401, 402, 403, 404, 405, 406, - /* 1330 */ 97, 408, 44, 432, 44, 0, 44, 325, 415, 421, - /* 1340 */ 13, 247, 419, 420, 97, 394, 333, 48, 396, 398, - /* 1350 */ 356, 395, 401, 402, 403, 404, 405, 406, 364, 408, - /* 1360 */ 179, 173, 35, 369, 387, 371, 415, 183, 356, 20, - /* 1370 */ 419, 420, 44, 42, 183, 206, 364, 364, 376, 379, - /* 1380 */ 325, 369, 358, 371, 49, 97, 376, 97, 394, 97, - /* 1390 */ 44, 44, 398, 369, 374, 401, 402, 403, 404, 405, - /* 1400 */ 406, 407, 408, 409, 410, 161, 394, 20, 333, 333, - /* 1410 */ 398, 356, 376, 401, 402, 403, 404, 405, 406, 364, - /* 1420 */ 408, 397, 398, 399, 369, 97, 371, 44, 44, 341, - /* 1430 */ 374, 374, 408, 325, 94, 333, 423, 424, 425, 20, - /* 1440 */ 427, 428, 20, 97, 97, 333, 333, 327, 327, 394, - /* 1450 */ 391, 371, 20, 398, 325, 267, 401, 402, 403, 404, - /* 1460 */ 405, 406, 339, 408, 356, 453, 454, 339, 334, 20, - /* 1470 */ 415, 386, 364, 52, 339, 420, 334, 369, 327, 371, - /* 1480 */ 97, 97, 333, 339, 339, 356, 339, 339, 336, 336, - /* 1490 */ 333, 369, 356, 364, 385, 369, 195, 356, 369, 186, - /* 1500 */ 371, 327, 394, 393, 337, 391, 398, 369, 325, 401, - /* 1510 */ 402, 403, 404, 405, 406, 356, 408, 356, 333, 356, - /* 1520 */ 356, 356, 390, 394, 356, 371, 356, 398, 253, 356, - /* 1530 */ 401, 402, 403, 404, 405, 406, 427, 408, 356, 356, - /* 1540 */ 431, 337, 437, 252, 369, 259, 172, 364, 369, 369, - /* 1550 */ 379, 443, 369, 260, 371, 446, 447, 379, 382, 382, - /* 1560 */ 451, 452, 325, 8, 9, 440, 439, 12, 13, 14, - /* 1570 */ 15, 16, 261, 436, 445, 268, 244, 394, 248, 325, - /* 1580 */ 456, 398, 265, 437, 401, 402, 403, 404, 405, 406, - /* 1590 */ 434, 408, 396, 356, 364, 437, 263, 20, 361, 333, - /* 1600 */ 450, 364, 400, 334, 337, 325, 369, 382, 371, 449, - /* 1610 */ 356, 369, 369, 382, 369, 361, 166, 369, 364, 369, - /* 1620 */ 369, 435, 337, 369, 352, 371, 380, 364, 96, 96, - /* 1630 */ 418, 394, 337, 325, 360, 398, 356, 454, 401, 402, - /* 1640 */ 403, 404, 405, 406, 364, 408, 369, 333, 394, 369, - /* 1650 */ 346, 371, 398, 337, 36, 401, 402, 403, 404, 405, - /* 1660 */ 406, 327, 408, 392, 356, 328, 388, 383, 350, 361, - /* 1670 */ 383, 350, 364, 350, 394, 323, 325, 369, 398, 371, - /* 1680 */ 338, 401, 402, 403, 404, 405, 406, 0, 408, 0, - /* 1690 */ 188, 0, 325, 0, 42, 0, 35, 200, 35, 35, - /* 1700 */ 35, 200, 394, 0, 35, 35, 398, 356, 200, 401, - /* 1710 */ 402, 403, 404, 405, 406, 364, 408, 0, 200, 164, - /* 1720 */ 369, 0, 371, 356, 0, 35, 22, 0, 183, 35, - /* 1730 */ 181, 364, 0, 0, 177, 385, 369, 176, 371, 0, - /* 1740 */ 0, 0, 0, 325, 47, 394, 0, 42, 0, 398, - /* 1750 */ 0, 0, 401, 402, 403, 404, 405, 406, 0, 408, - /* 1760 */ 0, 394, 0, 0, 0, 398, 152, 0, 401, 402, - /* 1770 */ 403, 404, 405, 406, 356, 408, 152, 427, 35, 0, - /* 1780 */ 0, 431, 364, 0, 0, 0, 325, 369, 0, 371, - /* 1790 */ 0, 0, 0, 0, 0, 0, 446, 447, 0, 0, - /* 1800 */ 0, 451, 452, 325, 0, 0, 0, 42, 0, 0, - /* 1810 */ 0, 22, 394, 0, 0, 136, 398, 356, 0, 401, - /* 1820 */ 402, 403, 404, 405, 406, 364, 408, 0, 0, 58, - /* 1830 */ 369, 35, 371, 0, 356, 58, 0, 0, 14, 42, - /* 1840 */ 39, 0, 364, 14, 0, 0, 44, 369, 0, 371, - /* 1850 */ 47, 0, 40, 172, 47, 394, 325, 0, 47, 398, - /* 1860 */ 39, 39, 401, 402, 403, 404, 405, 406, 0, 408, - /* 1870 */ 0, 0, 394, 325, 35, 0, 398, 39, 48, 401, - /* 1880 */ 402, 403, 404, 405, 406, 35, 408, 356, 48, 64, - /* 1890 */ 0, 39, 39, 35, 48, 364, 0, 35, 39, 0, - /* 1900 */ 369, 0, 371, 48, 356, 0, 0, 35, 22, 0, - /* 1910 */ 44, 35, 364, 35, 35, 22, 35, 369, 44, 371, - /* 1920 */ 105, 0, 103, 35, 325, 394, 35, 35, 0, 398, - /* 1930 */ 22, 0, 401, 402, 403, 404, 405, 406, 22, 408, - /* 1940 */ 22, 325, 394, 0, 50, 35, 398, 35, 0, 401, - /* 1950 */ 402, 403, 404, 405, 406, 356, 408, 35, 0, 22, - /* 1960 */ 20, 35, 35, 364, 97, 193, 0, 325, 369, 96, - /* 1970 */ 371, 35, 356, 0, 22, 0, 0, 3, 44, 249, - /* 1980 */ 364, 164, 166, 96, 325, 369, 97, 371, 44, 44, - /* 1990 */ 164, 96, 3, 394, 97, 164, 96, 398, 356, 97, - /* 2000 */ 401, 402, 403, 404, 405, 406, 364, 408, 97, 96, - /* 2010 */ 394, 369, 170, 371, 398, 356, 184, 401, 402, 403, - /* 2020 */ 404, 405, 406, 364, 408, 96, 47, 47, 369, 44, - /* 2030 */ 371, 96, 44, 35, 35, 325, 394, 35, 97, 97, - /* 2040 */ 398, 35, 35, 401, 402, 403, 404, 405, 406, 35, - /* 2050 */ 408, 97, 97, 394, 44, 47, 47, 398, 0, 0, - /* 2060 */ 401, 402, 403, 404, 405, 406, 356, 408, 0, 97, - /* 2070 */ 167, 0, 249, 96, 364, 97, 39, 96, 325, 369, - /* 2080 */ 96, 371, 96, 249, 165, 47, 243, 96, 106, 44, - /* 2090 */ 230, 2, 228, 228, 325, 22, 96, 47, 47, 22, - /* 2100 */ 97, 96, 107, 120, 394, 35, 208, 96, 398, 356, - /* 2110 */ 206, 401, 402, 403, 404, 405, 406, 364, 408, 97, - /* 2120 */ 97, 96, 369, 96, 371, 356, 97, 96, 35, 97, - /* 2130 */ 96, 35, 97, 364, 35, 96, 35, 97, 369, 96, - /* 2140 */ 371, 97, 96, 35, 97, 325, 120, 394, 96, 22, - /* 2150 */ 120, 398, 96, 120, 401, 402, 403, 404, 405, 406, - /* 2160 */ 44, 408, 108, 394, 35, 96, 22, 398, 96, 64, - /* 2170 */ 401, 402, 403, 404, 405, 406, 356, 408, 63, 70, - /* 2180 */ 35, 35, 35, 35, 364, 35, 35, 35, 325, 369, - /* 2190 */ 35, 371, 35, 35, 35, 93, 35, 44, 22, 35, - /* 2200 */ 22, 35, 35, 35, 70, 325, 35, 35, 35, 35, - /* 2210 */ 35, 22, 35, 0, 394, 35, 0, 48, 398, 356, - /* 2220 */ 39, 401, 402, 403, 404, 405, 406, 364, 408, 35, - /* 2230 */ 48, 39, 369, 0, 371, 35, 356, 39, 48, 0, - /* 2240 */ 35, 48, 39, 0, 364, 35, 35, 0, 22, 369, - /* 2250 */ 21, 371, 22, 22, 457, 21, 20, 394, 325, 457, - /* 2260 */ 457, 398, 457, 457, 401, 402, 403, 404, 405, 406, - /* 2270 */ 457, 408, 457, 457, 394, 325, 457, 457, 398, 457, - /* 2280 */ 457, 401, 402, 403, 404, 405, 406, 457, 408, 356, - /* 2290 */ 457, 457, 457, 457, 457, 457, 457, 364, 457, 457, - /* 2300 */ 457, 457, 369, 457, 371, 457, 356, 457, 457, 457, - /* 2310 */ 457, 457, 457, 457, 364, 457, 457, 457, 457, 369, - /* 2320 */ 457, 371, 457, 457, 457, 457, 325, 394, 457, 457, - /* 2330 */ 457, 398, 457, 457, 401, 402, 403, 404, 405, 406, - /* 2340 */ 457, 408, 457, 457, 394, 457, 457, 457, 398, 457, - /* 2350 */ 457, 401, 402, 403, 404, 405, 406, 356, 408, 457, - /* 2360 */ 457, 457, 457, 457, 457, 364, 457, 457, 457, 457, - /* 2370 */ 369, 457, 371, 457, 457, 457, 457, 457, 457, 457, - /* 2380 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2390 */ 457, 457, 457, 457, 457, 394, 457, 457, 457, 398, - /* 2400 */ 457, 457, 401, 402, 403, 404, 405, 406, 457, 408, - /* 2410 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 220 */ 220, 221, 222, 223, 224, 225, 226, 95, 95, 397, + /* 230 */ 398, 399, 161, 162, 423, 424, 425, 3, 427, 428, + /* 240 */ 408, 339, 431, 370, 371, 20, 95, 98, 20, 100, + /* 250 */ 101, 180, 103, 182, 205, 353, 107, 446, 447, 161, + /* 260 */ 162, 244, 451, 452, 362, 231, 232, 233, 234, 235, + /* 270 */ 236, 237, 238, 239, 240, 241, 205, 206, 129, 208, + /* 280 */ 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + /* 290 */ 219, 220, 221, 222, 223, 224, 225, 226, 325, 228, + /* 300 */ 12, 13, 253, 254, 255, 256, 257, 364, 20, 371, + /* 310 */ 22, 179, 20, 181, 20, 324, 22, 326, 375, 381, + /* 320 */ 95, 33, 384, 35, 108, 109, 110, 111, 112, 113, + /* 330 */ 114, 115, 116, 117, 118, 0, 120, 121, 122, 123, + /* 340 */ 124, 125, 369, 14, 355, 51, 58, 45, 46, 20, + /* 350 */ 427, 63, 400, 166, 431, 333, 21, 368, 70, 24, + /* 360 */ 25, 26, 27, 28, 29, 30, 31, 32, 175, 347, + /* 370 */ 447, 12, 13, 14, 451, 452, 244, 244, 426, 20, + /* 380 */ 58, 22, 0, 95, 325, 228, 364, 230, 126, 196, + /* 390 */ 197, 333, 33, 21, 35, 244, 24, 25, 26, 27, + /* 400 */ 28, 29, 30, 31, 32, 117, 24, 25, 26, 27, + /* 410 */ 28, 29, 30, 31, 32, 356, 94, 58, 348, 97, + /* 420 */ 132, 133, 364, 364, 132, 133, 356, 325, 369, 70, + /* 430 */ 371, 14, 15, 16, 20, 365, 249, 250, 349, 8, + /* 440 */ 9, 352, 333, 12, 13, 14, 15, 16, 245, 161, + /* 450 */ 162, 189, 190, 394, 95, 356, 347, 398, 127, 356, + /* 460 */ 401, 402, 403, 404, 405, 406, 363, 408, 180, 244, + /* 470 */ 182, 369, 413, 364, 415, 372, 117, 378, 419, 420, + /* 480 */ 35, 423, 424, 425, 79, 427, 428, 58, 325, 430, + /* 490 */ 161, 132, 133, 205, 206, 261, 208, 209, 210, 211, + /* 500 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + /* 510 */ 222, 223, 224, 225, 226, 70, 62, 333, 187, 188, + /* 520 */ 161, 162, 191, 19, 193, 337, 97, 65, 66, 67, + /* 530 */ 427, 347, 369, 106, 431, 73, 74, 33, 354, 180, + /* 540 */ 78, 182, 137, 138, 228, 83, 84, 359, 364, 446, + /* 550 */ 447, 89, 48, 0, 451, 452, 1, 2, 54, 55, + /* 560 */ 56, 57, 58, 70, 205, 206, 339, 208, 209, 210, + /* 570 */ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + /* 580 */ 221, 222, 223, 224, 225, 226, 12, 13, 427, 362, + /* 590 */ 411, 358, 431, 414, 20, 33, 22, 20, 94, 325, + /* 600 */ 0, 97, 369, 172, 107, 357, 325, 33, 447, 35, + /* 610 */ 48, 325, 451, 452, 44, 62, 54, 55, 56, 57, + /* 620 */ 58, 400, 333, 126, 127, 128, 129, 130, 131, 58, + /* 630 */ 397, 398, 58, 356, 130, 342, 343, 356, 342, 343, + /* 640 */ 363, 408, 357, 369, 70, 364, 20, 426, 22, 372, + /* 650 */ 369, 96, 371, 364, 356, 369, 94, 12, 13, 97, + /* 660 */ 22, 35, 62, 365, 3, 20, 95, 22, 97, 95, + /* 670 */ 357, 167, 95, 35, 357, 394, 385, 51, 33, 398, + /* 680 */ 35, 20, 401, 402, 403, 404, 405, 406, 184, 408, + /* 690 */ 186, 117, 411, 357, 413, 414, 415, 266, 14, 400, + /* 700 */ 419, 420, 44, 58, 20, 20, 132, 133, 70, 364, + /* 710 */ 333, 422, 423, 424, 425, 70, 427, 428, 427, 389, + /* 720 */ 375, 325, 431, 357, 347, 426, 164, 165, 325, 167, + /* 730 */ 333, 20, 170, 160, 371, 161, 162, 446, 447, 2, + /* 740 */ 95, 364, 451, 452, 347, 8, 9, 384, 186, 12, + /* 750 */ 13, 14, 15, 16, 180, 117, 182, 96, 325, 379, + /* 760 */ 44, 364, 117, 8, 9, 369, 326, 12, 13, 14, + /* 770 */ 15, 16, 369, 325, 412, 20, 414, 132, 133, 205, + /* 780 */ 206, 0, 208, 209, 210, 211, 212, 213, 214, 215, + /* 790 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + /* 800 */ 226, 18, 369, 20, 231, 325, 161, 162, 333, 333, + /* 810 */ 27, 348, 96, 30, 241, 244, 33, 369, 180, 356, + /* 820 */ 182, 244, 347, 347, 163, 180, 0, 182, 365, 48, + /* 830 */ 325, 48, 325, 50, 325, 265, 53, 325, 325, 364, + /* 840 */ 364, 242, 243, 205, 206, 161, 325, 20, 163, 369, + /* 850 */ 205, 206, 444, 208, 209, 210, 211, 212, 213, 214, + /* 860 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + /* 870 */ 225, 226, 161, 412, 369, 414, 369, 94, 369, 8, + /* 880 */ 9, 369, 369, 12, 13, 14, 15, 16, 0, 106, + /* 890 */ 369, 65, 66, 67, 68, 69, 345, 71, 72, 73, + /* 900 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + /* 910 */ 84, 85, 86, 87, 88, 89, 90, 91, 163, 136, + /* 920 */ 325, 263, 139, 140, 141, 142, 143, 144, 145, 146, + /* 930 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 4, + /* 940 */ 157, 158, 159, 18, 366, 8, 9, 369, 23, 12, + /* 950 */ 13, 14, 15, 16, 19, 0, 333, 325, 325, 39, + /* 960 */ 333, 455, 37, 38, 369, 2, 41, 96, 33, 335, + /* 970 */ 347, 8, 9, 20, 347, 12, 13, 14, 15, 16, + /* 980 */ 333, 325, 333, 48, 59, 60, 61, 364, 53, 356, + /* 990 */ 163, 364, 333, 58, 347, 107, 347, 364, 344, 107, + /* 1000 */ 346, 369, 369, 385, 371, 438, 347, 366, 356, 0, + /* 1010 */ 369, 364, 333, 364, 126, 127, 128, 129, 130, 131, + /* 1020 */ 95, 129, 106, 364, 372, 369, 347, 394, 42, 94, + /* 1030 */ 44, 398, 97, 96, 401, 402, 403, 404, 405, 406, + /* 1040 */ 42, 408, 44, 364, 366, 427, 413, 369, 415, 431, + /* 1050 */ 8, 9, 419, 420, 12, 13, 14, 15, 16, 134, + /* 1060 */ 22, 325, 107, 333, 446, 447, 12, 13, 349, 451, + /* 1070 */ 452, 352, 156, 35, 441, 99, 22, 347, 102, 333, + /* 1080 */ 35, 126, 127, 128, 129, 130, 131, 33, 99, 35, + /* 1090 */ 35, 102, 356, 347, 364, 0, 0, 172, 173, 174, + /* 1100 */ 364, 333, 177, 99, 325, 369, 102, 371, 356, 44, + /* 1110 */ 364, 99, 58, 44, 102, 347, 163, 22, 22, 47, + /* 1120 */ 195, 63, 333, 198, 70, 200, 201, 202, 203, 204, + /* 1130 */ 394, 335, 364, 333, 398, 356, 347, 401, 402, 403, + /* 1140 */ 404, 405, 406, 364, 408, 333, 0, 347, 369, 413, + /* 1150 */ 371, 415, 44, 364, 385, 419, 420, 132, 133, 347, + /* 1160 */ 151, 96, 325, 243, 364, 96, 430, 95, 22, 244, + /* 1170 */ 163, 117, 44, 394, 44, 168, 364, 398, 44, 332, + /* 1180 */ 401, 402, 403, 404, 405, 406, 379, 408, 13, 1, + /* 1190 */ 2, 13, 413, 356, 415, 44, 427, 44, 419, 420, + /* 1200 */ 431, 364, 379, 44, 96, 163, 369, 95, 371, 430, + /* 1210 */ 35, 368, 44, 35, 44, 446, 447, 105, 44, 385, + /* 1220 */ 451, 452, 429, 325, 96, 448, 96, 182, 246, 421, + /* 1230 */ 96, 394, 396, 35, 180, 398, 182, 182, 401, 402, + /* 1240 */ 403, 404, 405, 406, 48, 408, 44, 96, 432, 96, + /* 1250 */ 413, 325, 415, 44, 356, 96, 419, 420, 395, 205, + /* 1260 */ 206, 427, 364, 205, 96, 431, 96, 369, 70, 371, + /* 1270 */ 96, 217, 218, 219, 220, 221, 222, 223, 178, 42, + /* 1280 */ 446, 447, 356, 44, 387, 451, 452, 376, 20, 379, + /* 1290 */ 364, 376, 394, 160, 20, 369, 398, 371, 96, 401, + /* 1300 */ 402, 403, 404, 405, 406, 96, 408, 374, 333, 93, + /* 1310 */ 333, 413, 325, 415, 376, 374, 374, 419, 420, 341, + /* 1320 */ 394, 333, 20, 333, 398, 333, 327, 401, 402, 403, + /* 1330 */ 404, 405, 406, 327, 408, 96, 20, 391, 371, 413, + /* 1340 */ 339, 415, 339, 356, 20, 419, 420, 334, 20, 339, + /* 1350 */ 386, 364, 334, 339, 339, 339, 369, 333, 371, 339, + /* 1360 */ 52, 327, 336, 336, 356, 325, 333, 356, 185, 369, + /* 1370 */ 327, 369, 393, 356, 194, 356, 391, 356, 356, 356, + /* 1380 */ 333, 394, 437, 337, 356, 398, 356, 356, 401, 402, + /* 1390 */ 403, 404, 405, 406, 337, 408, 356, 356, 437, 252, + /* 1400 */ 251, 258, 415, 371, 364, 440, 419, 420, 369, 369, + /* 1410 */ 439, 371, 171, 259, 379, 379, 260, 369, 325, 390, + /* 1420 */ 369, 369, 267, 247, 456, 264, 382, 262, 437, 436, + /* 1430 */ 435, 382, 449, 396, 394, 243, 20, 364, 398, 434, + /* 1440 */ 333, 401, 402, 403, 404, 405, 406, 450, 408, 356, + /* 1450 */ 400, 334, 337, 382, 369, 415, 369, 364, 369, 419, + /* 1460 */ 420, 325, 369, 369, 371, 382, 369, 369, 165, 337, + /* 1470 */ 380, 352, 337, 364, 95, 95, 360, 418, 333, 369, + /* 1480 */ 36, 337, 383, 346, 392, 328, 383, 394, 350, 327, + /* 1490 */ 388, 398, 356, 0, 401, 402, 403, 404, 405, 406, + /* 1500 */ 364, 408, 350, 0, 338, 369, 187, 371, 415, 323, + /* 1510 */ 350, 0, 419, 420, 0, 42, 0, 35, 325, 199, + /* 1520 */ 35, 35, 35, 0, 199, 35, 35, 0, 199, 199, + /* 1530 */ 394, 0, 0, 35, 398, 325, 0, 401, 402, 403, + /* 1540 */ 404, 405, 406, 407, 408, 409, 410, 22, 182, 356, + /* 1550 */ 35, 180, 0, 0, 176, 0, 175, 364, 0, 47, + /* 1560 */ 0, 325, 369, 0, 371, 0, 356, 58, 42, 0, + /* 1570 */ 0, 0, 0, 0, 364, 0, 0, 0, 151, 369, + /* 1580 */ 35, 371, 0, 151, 0, 0, 0, 394, 42, 0, + /* 1590 */ 0, 398, 356, 0, 401, 402, 403, 404, 405, 406, + /* 1600 */ 364, 408, 0, 0, 394, 369, 0, 371, 398, 0, + /* 1610 */ 0, 401, 402, 403, 404, 405, 406, 0, 408, 0, + /* 1620 */ 0, 325, 0, 0, 0, 0, 0, 0, 0, 22, + /* 1630 */ 394, 135, 0, 0, 398, 442, 443, 401, 402, 403, + /* 1640 */ 404, 405, 406, 325, 408, 0, 0, 35, 0, 0, + /* 1650 */ 58, 415, 356, 0, 0, 42, 420, 39, 44, 0, + /* 1660 */ 364, 14, 47, 453, 454, 369, 0, 371, 47, 14, + /* 1670 */ 40, 0, 0, 39, 356, 39, 47, 171, 0, 0, + /* 1680 */ 0, 0, 364, 0, 0, 35, 48, 369, 48, 371, + /* 1690 */ 394, 0, 35, 35, 398, 39, 0, 401, 402, 403, + /* 1700 */ 404, 405, 406, 64, 408, 0, 39, 325, 48, 39, + /* 1710 */ 35, 48, 394, 39, 0, 0, 398, 0, 102, 401, + /* 1720 */ 402, 403, 404, 405, 406, 35, 408, 0, 325, 22, + /* 1730 */ 44, 44, 35, 35, 35, 35, 35, 35, 356, 443, + /* 1740 */ 22, 104, 0, 35, 22, 0, 364, 22, 0, 0, + /* 1750 */ 22, 369, 0, 371, 50, 35, 35, 0, 35, 356, + /* 1760 */ 22, 20, 0, 445, 361, 35, 35, 364, 163, 96, + /* 1770 */ 192, 325, 369, 0, 371, 35, 394, 95, 183, 0, + /* 1780 */ 398, 22, 0, 401, 402, 403, 404, 405, 406, 3, + /* 1790 */ 408, 44, 248, 47, 44, 44, 248, 394, 163, 96, + /* 1800 */ 47, 398, 356, 3, 401, 402, 403, 404, 405, 406, + /* 1810 */ 364, 408, 169, 44, 95, 369, 165, 371, 44, 95, + /* 1820 */ 35, 95, 325, 35, 163, 96, 35, 248, 96, 95, + /* 1830 */ 95, 35, 96, 96, 95, 0, 454, 35, 325, 96, + /* 1840 */ 394, 35, 47, 242, 398, 44, 47, 401, 402, 403, + /* 1850 */ 404, 405, 406, 356, 408, 0, 410, 96, 361, 96, + /* 1860 */ 0, 364, 95, 0, 96, 95, 369, 96, 371, 356, + /* 1870 */ 95, 95, 166, 39, 361, 164, 95, 364, 47, 2, + /* 1880 */ 44, 205, 369, 105, 371, 95, 22, 47, 96, 227, + /* 1890 */ 96, 394, 325, 229, 47, 398, 227, 22, 401, 402, + /* 1900 */ 403, 404, 405, 406, 95, 408, 95, 394, 96, 95, + /* 1910 */ 95, 398, 96, 325, 401, 402, 403, 404, 405, 406, + /* 1920 */ 95, 408, 96, 356, 106, 35, 35, 95, 35, 96, + /* 1930 */ 35, 364, 95, 35, 96, 96, 369, 95, 371, 95, + /* 1940 */ 207, 96, 35, 95, 356, 22, 119, 119, 119, 119, + /* 1950 */ 107, 95, 364, 44, 35, 22, 325, 369, 64, 371, + /* 1960 */ 95, 394, 95, 63, 35, 398, 35, 35, 401, 402, + /* 1970 */ 403, 404, 405, 406, 35, 408, 35, 325, 35, 35, + /* 1980 */ 70, 35, 394, 35, 35, 35, 398, 356, 92, 401, + /* 1990 */ 402, 403, 404, 405, 406, 364, 408, 44, 35, 35, + /* 2000 */ 369, 22, 371, 35, 35, 35, 70, 35, 356, 35, + /* 2010 */ 35, 35, 35, 22, 0, 35, 364, 35, 0, 48, + /* 2020 */ 325, 369, 39, 371, 35, 394, 48, 0, 35, 398, + /* 2030 */ 0, 39, 401, 402, 403, 404, 405, 406, 325, 408, + /* 2040 */ 39, 35, 48, 48, 39, 0, 394, 35, 35, 0, + /* 2050 */ 398, 356, 21, 401, 402, 403, 404, 405, 406, 364, + /* 2060 */ 408, 22, 22, 22, 369, 21, 371, 457, 20, 356, + /* 2070 */ 457, 457, 457, 457, 457, 457, 457, 364, 457, 457, + /* 2080 */ 457, 457, 369, 457, 371, 457, 457, 457, 457, 394, + /* 2090 */ 457, 457, 457, 398, 457, 457, 401, 402, 403, 404, + /* 2100 */ 405, 406, 325, 408, 457, 457, 457, 394, 457, 457, + /* 2110 */ 457, 398, 457, 457, 401, 402, 403, 404, 405, 406, + /* 2120 */ 457, 408, 457, 325, 457, 457, 457, 457, 457, 457, + /* 2130 */ 457, 457, 457, 356, 457, 457, 457, 457, 457, 457, + /* 2140 */ 457, 364, 457, 457, 457, 457, 369, 457, 371, 457, + /* 2150 */ 457, 457, 457, 457, 356, 457, 457, 457, 457, 457, + /* 2160 */ 457, 457, 364, 457, 457, 457, 325, 369, 457, 371, + /* 2170 */ 457, 394, 457, 457, 457, 398, 457, 457, 401, 402, + /* 2180 */ 403, 404, 405, 406, 325, 408, 457, 457, 457, 457, + /* 2190 */ 457, 457, 394, 457, 457, 457, 398, 356, 457, 401, + /* 2200 */ 402, 403, 404, 405, 406, 364, 408, 457, 457, 457, + /* 2210 */ 369, 457, 371, 457, 457, 356, 457, 457, 457, 457, + /* 2220 */ 457, 457, 457, 364, 457, 457, 457, 325, 369, 457, + /* 2230 */ 371, 457, 457, 457, 457, 394, 457, 457, 457, 398, + /* 2240 */ 457, 457, 401, 402, 403, 404, 405, 406, 457, 408, + /* 2250 */ 457, 457, 457, 394, 457, 457, 457, 398, 356, 457, + /* 2260 */ 401, 402, 403, 404, 405, 406, 364, 408, 457, 457, + /* 2270 */ 325, 369, 457, 371, 457, 457, 457, 457, 457, 457, + /* 2280 */ 457, 457, 457, 457, 457, 457, 457, 325, 457, 457, + /* 2290 */ 457, 457, 457, 457, 457, 457, 394, 457, 457, 457, + /* 2300 */ 398, 356, 457, 401, 402, 403, 404, 405, 406, 364, + /* 2310 */ 408, 457, 457, 325, 369, 457, 371, 457, 356, 457, + /* 2320 */ 457, 457, 457, 457, 457, 457, 364, 457, 457, 457, + /* 2330 */ 457, 369, 457, 371, 457, 457, 457, 457, 457, 394, + /* 2340 */ 457, 457, 457, 398, 356, 457, 401, 402, 403, 404, + /* 2350 */ 405, 406, 364, 408, 457, 457, 394, 369, 457, 371, + /* 2360 */ 398, 457, 457, 401, 402, 403, 404, 405, 406, 457, + /* 2370 */ 408, 457, 325, 457, 457, 457, 457, 457, 457, 457, + /* 2380 */ 457, 457, 394, 457, 457, 457, 398, 457, 457, 401, + /* 2390 */ 402, 403, 404, 405, 406, 457, 408, 457, 457, 457, + /* 2400 */ 457, 457, 457, 356, 457, 457, 457, 457, 457, 457, + /* 2410 */ 457, 364, 457, 457, 457, 325, 369, 457, 371, 457, /* 2420 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2430 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2440 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2450 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2460 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2470 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2480 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2490 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2500 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2510 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2520 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2530 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2540 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2550 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2560 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2570 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2430 */ 457, 457, 457, 325, 457, 457, 457, 457, 457, 457, + /* 2440 */ 457, 394, 457, 457, 457, 398, 356, 457, 401, 402, + /* 2450 */ 403, 404, 405, 406, 364, 408, 457, 457, 457, 369, + /* 2460 */ 457, 371, 457, 457, 356, 457, 457, 457, 457, 457, + /* 2470 */ 457, 457, 364, 457, 457, 457, 457, 369, 457, 371, + /* 2480 */ 457, 457, 457, 457, 394, 457, 457, 457, 398, 457, + /* 2490 */ 457, 401, 402, 403, 404, 405, 406, 325, 408, 457, + /* 2500 */ 457, 457, 394, 457, 457, 457, 398, 457, 457, 401, + /* 2510 */ 402, 403, 404, 405, 406, 457, 408, 457, 325, 457, + /* 2520 */ 457, 457, 457, 457, 457, 457, 457, 457, 356, 457, + /* 2530 */ 457, 457, 457, 457, 457, 457, 364, 457, 457, 457, + /* 2540 */ 457, 369, 457, 371, 457, 457, 457, 457, 457, 356, + /* 2550 */ 457, 457, 457, 457, 457, 457, 457, 364, 457, 457, + /* 2560 */ 457, 325, 369, 457, 371, 457, 394, 457, 457, 457, + /* 2570 */ 398, 457, 457, 401, 402, 403, 404, 405, 406, 325, + /* 2580 */ 408, 457, 457, 457, 457, 457, 457, 394, 457, 457, + /* 2590 */ 457, 398, 356, 457, 401, 402, 403, 404, 405, 406, + /* 2600 */ 364, 408, 457, 457, 457, 369, 457, 371, 457, 457, + /* 2610 */ 356, 457, 457, 457, 457, 457, 457, 457, 364, 457, + /* 2620 */ 457, 457, 325, 369, 457, 371, 457, 457, 457, 457, + /* 2630 */ 394, 457, 457, 457, 398, 457, 457, 401, 402, 403, + /* 2640 */ 404, 405, 406, 457, 408, 457, 457, 457, 394, 457, + /* 2650 */ 457, 457, 398, 356, 457, 401, 402, 403, 404, 405, + /* 2660 */ 406, 364, 408, 457, 457, 457, 369, 457, 371, 457, + /* 2670 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2680 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2690 */ 457, 394, 457, 457, 457, 398, 457, 457, 401, 402, + /* 2700 */ 403, 404, 405, 406, 457, 408, }; -#define YY_SHIFT_COUNT (708) +#define YY_SHIFT_COUNT (707) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2247) +#define YY_SHIFT_MAX (2049) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 933, 0, 134, 0, 268, 268, 268, 268, 268, 268, - /* 10 */ 268, 268, 268, 402, 536, 536, 670, 536, 536, 536, - /* 20 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, - /* 30 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, - /* 40 */ 536, 536, 536, 536, 536, 536, 180, 224, 64, 223, - /* 50 */ 133, 1, 17, 1, 64, 64, 947, 947, 1, 947, - /* 60 */ 947, 147, 1, 138, 138, 246, 246, 258, 137, 18, - /* 70 */ 18, 138, 138, 138, 138, 138, 138, 138, 138, 138, - /* 80 */ 138, 86, 138, 138, 249, 138, 314, 138, 138, 399, - /* 90 */ 138, 138, 399, 138, 399, 399, 399, 138, 454, 762, - /* 100 */ 949, 949, 96, 911, 480, 480, 480, 480, 480, 480, - /* 110 */ 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - /* 120 */ 480, 480, 480, 965, 403, 258, 137, 671, 238, 302, - /* 130 */ 302, 302, 801, 565, 565, 238, 548, 548, 548, 481, - /* 140 */ 314, 375, 399, 623, 399, 623, 623, 481, 659, 909, - /* 150 */ 909, 909, 909, 909, 909, 909, 1044, 793, 439, 698, - /* 160 */ 1188, 253, 151, 336, 680, 845, 285, 501, 855, 679, - /* 170 */ 983, 883, 936, 857, 883, 1079, 915, 1060, 1094, 1299, - /* 180 */ 1181, 1331, 1349, 1331, 1244, 1387, 1387, 1331, 1244, 1244, - /* 190 */ 1340, 1387, 1387, 1387, 1419, 1419, 1422, 86, 314, 86, - /* 200 */ 1432, 1449, 86, 1432, 86, 86, 86, 1387, 86, 1421, - /* 210 */ 1421, 1419, 399, 399, 399, 399, 399, 399, 399, 399, - /* 220 */ 399, 399, 399, 1387, 1419, 623, 623, 1301, 1422, 454, - /* 230 */ 1313, 314, 454, 1387, 1349, 1349, 623, 1275, 1291, 623, - /* 240 */ 1275, 1291, 623, 623, 399, 1286, 1374, 1275, 1311, 1293, - /* 250 */ 1330, 1094, 1307, 1317, 1333, 1332, 548, 1577, 1387, 1432, - /* 260 */ 454, 1291, 623, 623, 623, 623, 623, 1291, 623, 1450, - /* 270 */ 454, 481, 454, 548, 1532, 1533, 623, 659, 1387, 454, - /* 280 */ 1618, 1419, 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410, - /* 290 */ 2410, 858, 1027, 23, 627, 52, 756, 449, 155, 859, - /* 300 */ 1143, 1555, 986, 1289, 1289, 1289, 1289, 1289, 1289, 1289, - /* 310 */ 1289, 1289, 699, 106, 243, 243, 658, 626, 288, 346, - /* 320 */ 412, 651, 651, 823, 1007, 436, 823, 823, 823, 591, - /* 330 */ 653, 1111, 1099, 1017, 1058, 1073, 1106, 1115, 1117, 1140, - /* 340 */ 1172, 1211, 1166, 1116, 1155, 1016, 997, 993, 1061, 1193, - /* 350 */ 1219, 1226, 1247, 1288, 1162, 1290, 1184, 1191, 1169, 1233, - /* 360 */ 1215, 1292, 1328, 1346, 1347, 1383, 1384, 1139, 1283, 1327, - /* 370 */ 1199, 1335, 1687, 1689, 1502, 1691, 1693, 1652, 1695, 1661, - /* 380 */ 1497, 1663, 1664, 1665, 1501, 1703, 1669, 1670, 1508, 1717, - /* 390 */ 1518, 1721, 1690, 1724, 1704, 1727, 1694, 1545, 1549, 1732, - /* 400 */ 1733, 1557, 1561, 1739, 1740, 1697, 1741, 1742, 1746, 1705, - /* 410 */ 1748, 1750, 1751, 1758, 1760, 1762, 1763, 1764, 1614, 1743, - /* 420 */ 1767, 1624, 1779, 1780, 1783, 1784, 1785, 1788, 1790, 1791, - /* 430 */ 1792, 1793, 1794, 1795, 1798, 1799, 1800, 1765, 1804, 1805, - /* 440 */ 1806, 1808, 1809, 1789, 1810, 1813, 1814, 1679, 1818, 1827, - /* 450 */ 1796, 1828, 1771, 1833, 1777, 1836, 1837, 1797, 1801, 1802, - /* 460 */ 1803, 1824, 1807, 1829, 1811, 1841, 1812, 1821, 1844, 1845, - /* 470 */ 1848, 1822, 1681, 1851, 1857, 1868, 1825, 1870, 1871, 1839, - /* 480 */ 1830, 1838, 1875, 1850, 1840, 1852, 1890, 1858, 1846, 1853, - /* 490 */ 1896, 1862, 1855, 1859, 1899, 1901, 1905, 1906, 1815, 1819, - /* 500 */ 1872, 1886, 1909, 1876, 1878, 1879, 1881, 1866, 1874, 1888, - /* 510 */ 1891, 1893, 1892, 1921, 1908, 1928, 1916, 1894, 1931, 1918, - /* 520 */ 1910, 1943, 1912, 1948, 1922, 1958, 1937, 1940, 1926, 1927, - /* 530 */ 1772, 1867, 1873, 1966, 1817, 1936, 1973, 1832, 1952, 1826, - /* 540 */ 1816, 1975, 1976, 1831, 1842, 1974, 1934, 1730, 1887, 1889, - /* 550 */ 1895, 1897, 1944, 1902, 1900, 1913, 1929, 1911, 1945, 1979, - /* 560 */ 1980, 1935, 1985, 1823, 1941, 1942, 1989, 1988, 1834, 1998, - /* 570 */ 1999, 2002, 2006, 2007, 2014, 1954, 1955, 2008, 1843, 2010, - /* 580 */ 2009, 2058, 2059, 2068, 1977, 1972, 1978, 1981, 1984, 1903, - /* 590 */ 1986, 2071, 2037, 1919, 1991, 1982, 1803, 2038, 2045, 1864, - /* 600 */ 1860, 1865, 2089, 2073, 1904, 2000, 2003, 2005, 2022, 2011, - /* 610 */ 2023, 2050, 2025, 2027, 2051, 2029, 2077, 1898, 2031, 1995, - /* 620 */ 2032, 2070, 2093, 2034, 2035, 2096, 2039, 2040, 2099, 2043, - /* 630 */ 2044, 2101, 2046, 2047, 2108, 2052, 1983, 2026, 2030, 2033, - /* 640 */ 2127, 2054, 2056, 2116, 2069, 2129, 2072, 2116, 2116, 2144, - /* 650 */ 2105, 2115, 2145, 2146, 2147, 2148, 2150, 2151, 2152, 2155, - /* 660 */ 2157, 2158, 2109, 2102, 2153, 2159, 2161, 2176, 2164, 2178, - /* 670 */ 2166, 2167, 2168, 2134, 1866, 2171, 1874, 2172, 2173, 2174, - /* 680 */ 2175, 2189, 2177, 2213, 2180, 2169, 2181, 2216, 2194, 2182, - /* 690 */ 2192, 2233, 2200, 2190, 2198, 2239, 2205, 2193, 2203, 2243, - /* 700 */ 2210, 2211, 2247, 2226, 2229, 2230, 2231, 2234, 2236, + /* 0 */ 925, 0, 71, 0, 288, 288, 288, 288, 288, 288, + /* 10 */ 288, 288, 288, 359, 574, 574, 645, 574, 574, 574, + /* 20 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, + /* 30 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, + /* 40 */ 574, 574, 574, 574, 574, 574, 225, 577, 74, 132, + /* 50 */ 571, 133, 151, 133, 74, 74, 1054, 1054, 133, 1054, + /* 60 */ 1054, 17, 133, 52, 52, 21, 21, 98, 292, 42, + /* 70 */ 42, 52, 52, 52, 52, 52, 52, 52, 52, 52, + /* 80 */ 52, 106, 52, 52, 76, 52, 169, 52, 52, 228, + /* 90 */ 52, 52, 228, 52, 228, 228, 228, 52, 454, 783, + /* 100 */ 34, 34, 372, 462, 638, 638, 638, 638, 638, 638, + /* 110 */ 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, + /* 120 */ 638, 638, 638, 149, 661, 98, 292, 553, 445, 685, + /* 130 */ 685, 685, 600, 157, 157, 445, 414, 414, 414, 427, + /* 140 */ 169, 316, 228, 9, 228, 9, 9, 427, 493, 216, + /* 150 */ 216, 216, 216, 216, 216, 216, 504, 335, 36, 755, + /* 160 */ 431, 49, 626, 187, 329, 684, 294, 827, 302, 892, + /* 170 */ 953, 599, 920, 234, 599, 986, 203, 711, 982, 1196, + /* 180 */ 1100, 1237, 1268, 1237, 1133, 1274, 1274, 1237, 1133, 1133, + /* 190 */ 1216, 1274, 1274, 1274, 1302, 1302, 1316, 106, 169, 106, + /* 200 */ 1324, 1328, 106, 1324, 106, 106, 106, 1274, 106, 1308, + /* 210 */ 1308, 1302, 228, 228, 228, 228, 228, 228, 228, 228, + /* 220 */ 228, 228, 228, 1274, 1302, 9, 9, 1180, 1316, 454, + /* 230 */ 1183, 169, 454, 1274, 1268, 1268, 9, 1147, 1149, 9, + /* 240 */ 1147, 1149, 9, 9, 228, 1143, 1241, 1147, 1156, 1154, + /* 250 */ 1176, 982, 1155, 1161, 1165, 1192, 414, 1416, 1274, 1324, + /* 260 */ 454, 1149, 9, 9, 9, 9, 9, 1149, 9, 1303, + /* 270 */ 454, 427, 454, 414, 1379, 1380, 9, 493, 1274, 454, + /* 280 */ 1444, 1302, 2706, 2706, 2706, 2706, 2706, 2706, 2706, 2706, + /* 290 */ 2706, 826, 562, 382, 935, 871, 15, 937, 888, 737, + /* 300 */ 963, 1042, 955, 183, 183, 183, 183, 183, 183, 183, + /* 310 */ 183, 183, 497, 331, 25, 25, 193, 322, 405, 166, + /* 320 */ 262, 50, 50, 417, 555, 573, 417, 417, 417, 716, + /* 330 */ 781, 1038, 998, 916, 1009, 976, 989, 1004, 1012, 1095, + /* 340 */ 1096, 1146, 429, 1065, 1069, 1025, 658, 570, 1007, 1108, + /* 350 */ 1128, 1130, 1134, 1151, 1188, 1153, 1045, 1055, 1058, 1159, + /* 360 */ 1072, 1168, 1170, 1174, 1202, 1209, 1239, 1112, 1175, 1178, + /* 370 */ 1198, 11, 1493, 1503, 1319, 1511, 1514, 1473, 1516, 1482, + /* 380 */ 1320, 1485, 1486, 1487, 1325, 1523, 1490, 1491, 1329, 1527, + /* 390 */ 1330, 1531, 1498, 1532, 1525, 1536, 1515, 1366, 1371, 1552, + /* 400 */ 1553, 1378, 1381, 1555, 1558, 1512, 1560, 1563, 1565, 1526, + /* 410 */ 1569, 1570, 1571, 1572, 1573, 1575, 1576, 1577, 1427, 1545, + /* 420 */ 1582, 1432, 1584, 1585, 1586, 1593, 1602, 1603, 1606, 1609, + /* 430 */ 1610, 1617, 1619, 1620, 1622, 1623, 1624, 1546, 1589, 1590, + /* 440 */ 1625, 1626, 1627, 1607, 1628, 1645, 1646, 1496, 1632, 1633, + /* 450 */ 1612, 1648, 1509, 1649, 1592, 1653, 1654, 1613, 1618, 1614, + /* 460 */ 1615, 1647, 1621, 1655, 1629, 1659, 1630, 1634, 1666, 1671, + /* 470 */ 1672, 1636, 1506, 1678, 1679, 1680, 1639, 1681, 1683, 1650, + /* 480 */ 1638, 1656, 1684, 1657, 1640, 1667, 1691, 1658, 1660, 1670, + /* 490 */ 1696, 1675, 1663, 1674, 1705, 1714, 1715, 1717, 1637, 1616, + /* 500 */ 1690, 1707, 1727, 1697, 1698, 1699, 1700, 1686, 1687, 1701, + /* 510 */ 1702, 1718, 1708, 1742, 1722, 1745, 1725, 1704, 1748, 1728, + /* 520 */ 1720, 1749, 1721, 1752, 1723, 1757, 1738, 1741, 1730, 1731, + /* 530 */ 1578, 1673, 1682, 1762, 1605, 1740, 1773, 1595, 1759, 1635, + /* 540 */ 1651, 1779, 1782, 1661, 1643, 1786, 1747, 1544, 1719, 1703, + /* 550 */ 1724, 1729, 1750, 1732, 1726, 1734, 1735, 1736, 1751, 1746, + /* 560 */ 1753, 1739, 1769, 1548, 1737, 1743, 1800, 1774, 1579, 1785, + /* 570 */ 1788, 1791, 1796, 1802, 1806, 1761, 1763, 1795, 1601, 1801, + /* 580 */ 1799, 1835, 1855, 1860, 1767, 1768, 1771, 1770, 1775, 1706, + /* 590 */ 1776, 1863, 1834, 1711, 1781, 1778, 1615, 1831, 1836, 1662, + /* 600 */ 1664, 1669, 1877, 1864, 1676, 1790, 1792, 1809, 1794, 1811, + /* 610 */ 1812, 1840, 1814, 1815, 1847, 1816, 1875, 1733, 1825, 1818, + /* 620 */ 1826, 1890, 1891, 1832, 1833, 1893, 1837, 1838, 1895, 1842, + /* 630 */ 1839, 1898, 1844, 1845, 1907, 1848, 1827, 1828, 1829, 1830, + /* 640 */ 1923, 1843, 1856, 1909, 1865, 1919, 1867, 1909, 1909, 1933, + /* 650 */ 1894, 1900, 1929, 1931, 1932, 1939, 1941, 1943, 1944, 1946, + /* 660 */ 1948, 1949, 1910, 1896, 1953, 1950, 1963, 1964, 1979, 1968, + /* 670 */ 1969, 1970, 1936, 1686, 1972, 1687, 1974, 1975, 1976, 1977, + /* 680 */ 1991, 1980, 2014, 1982, 1971, 1983, 2018, 1989, 1978, 1992, + /* 690 */ 2027, 1993, 1994, 2001, 2030, 2006, 1995, 2005, 2045, 2012, + /* 700 */ 2013, 2049, 2039, 2031, 2040, 2041, 2044, 2048, }; #define YY_REDUCE_COUNT (290) -#define YY_REDUCE_MIN (-422) -#define YY_REDUCE_MAX (2001) +#define YY_REDUCE_MIN (-366) +#define YY_REDUCE_MAX (2297) static const short yy_reduce_ofst[] = { - /* 0 */ -186, -325, -226, -166, -32, 236, 642, -92, 176, 852, - /* 10 */ 880, 923, 951, 994, 333, 1012, 1055, 1108, 1129, 1183, - /* 20 */ 1237, 40, 1254, 1308, 442, 1280, 1351, 1367, 1418, 1461, - /* 30 */ 1478, 1531, 1548, 1599, 1616, 1642, 1659, 1710, 1753, 1769, - /* 40 */ 1820, 1863, 1880, 1933, 1950, 2001, -34, -345, 103, -342, - /* 50 */ 91, 862, 1109, 1350, 815, 1013, -258, 1024, -422, -266, - /* 60 */ 641, -410, -52, -235, -29, -328, -257, -263, -206, 99, - /* 70 */ 122, -307, -163, 107, 208, 226, 229, 300, 303, 310, - /* 80 */ 312, 213, 315, 344, 317, 362, -365, 444, 452, -320, - /* 90 */ 502, 619, -219, 640, 367, 188, 425, 723, -185, -125, - /* 100 */ -409, -409, 84, -330, -234, 8, 59, 128, 145, 194, - /* 110 */ 232, 327, 347, 405, 472, 529, 603, 628, 690, 717, - /* 120 */ 727, 728, 751, -26, 47, -322, -175, -88, 191, 47, - /* 130 */ 588, 590, 48, 372, 567, 211, 235, 714, 715, -290, - /* 140 */ 584, 85, 635, 705, -285, 722, 743, 453, 759, -355, - /* 150 */ 387, 495, 507, 513, 521, 597, 662, 767, 786, 765, - /* 160 */ 752, 783, 893, 803, 910, 910, 938, 889, 943, 912, - /* 170 */ 927, 881, 881, 864, 881, 918, 901, 910, 952, 956, - /* 180 */ 977, 1002, 1000, 1010, 1020, 1075, 1076, 1036, 1056, 1057, - /* 190 */ 1088, 1102, 1112, 1113, 1120, 1121, 1059, 1123, 1080, 1128, - /* 200 */ 1134, 1085, 1135, 1142, 1144, 1145, 1147, 1149, 1148, 1152, - /* 210 */ 1153, 1151, 1136, 1141, 1159, 1161, 1163, 1164, 1165, 1168, - /* 220 */ 1170, 1173, 1182, 1157, 1174, 1122, 1126, 1110, 1114, 1167, - /* 230 */ 1132, 1154, 1204, 1185, 1171, 1178, 1138, 1105, 1176, 1175, - /* 240 */ 1146, 1177, 1179, 1180, 910, 1125, 1127, 1158, 1137, 1186, - /* 250 */ 1156, 1196, 1124, 1150, 1160, 881, 1230, 1202, 1266, 1269, - /* 260 */ 1267, 1225, 1242, 1243, 1245, 1248, 1250, 1231, 1251, 1246, - /* 270 */ 1285, 1272, 1295, 1263, 1212, 1274, 1277, 1304, 1314, 1316, - /* 280 */ 1337, 1334, 1278, 1271, 1284, 1287, 1318, 1321, 1323, 1342, - /* 290 */ 1352, + /* 0 */ -316, -248, 281, 633, 59, 736, 779, 837, 898, 926, + /* 10 */ 987, 1040, 1093, 1136, 1193, 1210, 1236, 1296, 1318, 1382, + /* 20 */ 1403, 1446, 1497, 1513, 1567, 1588, 1631, 1652, 1695, 1713, + /* 30 */ 1777, 1798, 1841, 1859, 1902, 1945, 1962, 1988, 2047, 2090, + /* 40 */ 2108, 2172, 2193, 2236, 2254, 2297, -189, 103, 289, -366, + /* 50 */ 291, 618, 769, 834, -276, 58, -271, -168, -268, -353, + /* 60 */ 233, -77, 161, -265, 184, -329, -322, -324, -296, -191, + /* 70 */ -160, -257, 22, 109, 377, 397, 475, 476, 623, 627, + /* 80 */ 647, -98, 649, 659, -330, 679, -62, 730, 746, -243, + /* 90 */ 768, 789, -355, 800, 70, 277, 463, 812, -259, -209, + /* 100 */ -365, -365, -9, -200, -27, 102, 163, 274, 286, 396, + /* 110 */ 403, 433, 448, 480, 505, 507, 509, 512, 513, 521, + /* 120 */ 595, 632, 656, -11, -48, 99, -127, 227, 293, -48, + /* 130 */ 221, 299, 188, 362, 461, 296, -360, -57, 345, 89, + /* 140 */ 363, 179, 298, 578, 652, 641, 678, 719, 654, -339, + /* 150 */ 248, 285, 313, 317, 336, 366, 330, 440, 551, 380, + /* 160 */ 506, 408, 634, 567, 752, 752, 796, 807, 847, 843, + /* 170 */ 823, 793, 793, 777, 793, 808, 816, 752, 836, 863, + /* 180 */ 897, 911, 910, 915, 933, 975, 977, 938, 941, 942, + /* 190 */ 978, 988, 990, 992, 999, 1006, 946, 1001, 967, 1003, + /* 200 */ 1013, 964, 1010, 1018, 1014, 1015, 1016, 1024, 1020, 1026, + /* 210 */ 1027, 1034, 1008, 1011, 1017, 1019, 1021, 1022, 1023, 1028, + /* 220 */ 1030, 1031, 1041, 1033, 1043, 1000, 1002, 979, 985, 1046, + /* 230 */ 1029, 1032, 1057, 1047, 1035, 1036, 1039, 945, 1044, 1048, + /* 240 */ 961, 1049, 1051, 1052, 752, 965, 971, 991, 993, 995, + /* 250 */ 1005, 1037, 968, 997, 983, 793, 1073, 1050, 1107, 1117, + /* 260 */ 1115, 1071, 1085, 1087, 1089, 1094, 1097, 1083, 1098, 1090, + /* 270 */ 1132, 1119, 1135, 1109, 1059, 1116, 1110, 1137, 1145, 1144, + /* 280 */ 1157, 1162, 1102, 1092, 1099, 1103, 1138, 1152, 1160, 1166, + /* 290 */ 1186, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 10 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 20 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 30 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 40 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 50 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 60 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1845, 1589, 1589, - /* 70 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 80 */ 1589, 1667, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 90 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1665, 1838, - /* 100 */ 2035, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 110 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 120 */ 1589, 1589, 1589, 1589, 2047, 1589, 1589, 1667, 1589, 2047, - /* 130 */ 2047, 2047, 1665, 2007, 2007, 1589, 1589, 1589, 1589, 1775, - /* 140 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1775, 1589, 1589, - /* 150 */ 1589, 1589, 1589, 1589, 1589, 1589, 1882, 1589, 1589, 2072, - /* 160 */ 2125, 1589, 1589, 2075, 1589, 1589, 1589, 1850, 1589, 1728, - /* 170 */ 2062, 2039, 2053, 2109, 2040, 2037, 2056, 1589, 2066, 1589, - /* 180 */ 1875, 1843, 1589, 1843, 1840, 1589, 1589, 1843, 1840, 1840, - /* 190 */ 1719, 1589, 1589, 1589, 1589, 1589, 1589, 1667, 1589, 1667, - /* 200 */ 1589, 1589, 1667, 1589, 1667, 1667, 1667, 1589, 1667, 1646, - /* 210 */ 1646, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 220 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1895, 1589, 1665, - /* 230 */ 1884, 1589, 1665, 1589, 1589, 1589, 1589, 2082, 2080, 1589, - /* 240 */ 2082, 2080, 1589, 1589, 1589, 2094, 2090, 2082, 2098, 2096, - /* 250 */ 2068, 2066, 2128, 2115, 2111, 2053, 1589, 1589, 1589, 1589, - /* 260 */ 1665, 2080, 1589, 1589, 1589, 1589, 1589, 2080, 1589, 1589, - /* 270 */ 1665, 1589, 1665, 1589, 1589, 1744, 1589, 1589, 1589, 1665, - /* 280 */ 1621, 1589, 1877, 1888, 1860, 1860, 1778, 1778, 1778, 1668, - /* 290 */ 1594, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 300 */ 1589, 1589, 1589, 2093, 2092, 1963, 1589, 2011, 2010, 2009, - /* 310 */ 2000, 1962, 1740, 1589, 1961, 1960, 1589, 1589, 1589, 1589, - /* 320 */ 1589, 1856, 1855, 1954, 1589, 1589, 1955, 1953, 1952, 1589, - /* 330 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 340 */ 1589, 1589, 1589, 1589, 1589, 1589, 2112, 2116, 1589, 1589, - /* 350 */ 1589, 1589, 1589, 1589, 2036, 1589, 1589, 1589, 1589, 1589, - /* 360 */ 1937, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 370 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 380 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 390 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 400 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 410 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 420 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 430 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 440 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 450 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1626, - /* 460 */ 1942, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 470 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 480 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 490 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 500 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1707, 1706, 1589, - /* 510 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 520 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 530 */ 1589, 1945, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 540 */ 1589, 1589, 1589, 1589, 1589, 2108, 2069, 1589, 1589, 1589, - /* 550 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 560 */ 1937, 1589, 2091, 1589, 1589, 2106, 1589, 2110, 1589, 1589, - /* 570 */ 1589, 1589, 1589, 1589, 1589, 2046, 2042, 1589, 1589, 2038, - /* 580 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 590 */ 1589, 1589, 1589, 1589, 1589, 1589, 1936, 1589, 1997, 1589, - /* 600 */ 1589, 1589, 2031, 1589, 1589, 1982, 1589, 1589, 1589, 1589, - /* 610 */ 1589, 1589, 1589, 1589, 1589, 1945, 1589, 1948, 1589, 1589, - /* 620 */ 1589, 1589, 1589, 1772, 1589, 1589, 1589, 1589, 1589, 1589, - /* 630 */ 1589, 1589, 1589, 1589, 1589, 1589, 1757, 1755, 1754, 1753, - /* 640 */ 1589, 1750, 1589, 1785, 1589, 1589, 1589, 1781, 1780, 1589, - /* 650 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 660 */ 1589, 1589, 1589, 1589, 1687, 1589, 1589, 1589, 1589, 1589, - /* 670 */ 1589, 1589, 1589, 1589, 1678, 1589, 1677, 1589, 1589, 1589, - /* 680 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 690 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 700 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + /* 0 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 10 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 20 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 30 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 40 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 50 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 60 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1841, 1586, 1586, + /* 70 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 80 */ 1586, 1664, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 90 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1662, 1834, + /* 100 */ 2031, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 110 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 120 */ 1586, 1586, 1586, 1586, 2043, 1586, 1586, 1664, 1586, 2043, + /* 130 */ 2043, 2043, 1662, 2003, 2003, 1586, 1586, 1586, 1586, 1771, + /* 140 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1771, 1586, 1586, + /* 150 */ 1586, 1586, 1586, 1586, 1586, 1586, 1878, 1586, 1586, 2068, + /* 160 */ 2121, 1586, 1586, 2071, 1586, 1586, 1586, 1846, 1586, 1724, + /* 170 */ 2058, 2035, 2049, 2105, 2036, 2033, 2052, 1586, 2062, 1586, + /* 180 */ 1871, 1839, 1586, 1839, 1836, 1586, 1586, 1839, 1836, 1836, + /* 190 */ 1715, 1586, 1586, 1586, 1586, 1586, 1586, 1664, 1586, 1664, + /* 200 */ 1586, 1586, 1664, 1586, 1664, 1664, 1664, 1586, 1664, 1643, + /* 210 */ 1643, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 220 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1891, 1586, 1662, + /* 230 */ 1880, 1586, 1662, 1586, 1586, 1586, 1586, 2078, 2076, 1586, + /* 240 */ 2078, 2076, 1586, 1586, 1586, 2090, 2086, 2078, 2094, 2092, + /* 250 */ 2064, 2062, 2124, 2111, 2107, 2049, 1586, 1586, 1586, 1586, + /* 260 */ 1662, 2076, 1586, 1586, 1586, 1586, 1586, 2076, 1586, 1586, + /* 270 */ 1662, 1586, 1662, 1586, 1586, 1740, 1586, 1586, 1586, 1662, + /* 280 */ 1618, 1586, 1873, 1884, 1856, 1856, 1774, 1774, 1774, 1665, + /* 290 */ 1591, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 300 */ 1586, 1586, 1586, 2089, 2088, 1959, 1586, 2007, 2006, 2005, + /* 310 */ 1996, 1958, 1736, 1586, 1957, 1956, 1586, 1586, 1586, 1586, + /* 320 */ 1586, 1852, 1851, 1950, 1586, 1586, 1951, 1949, 1948, 1586, + /* 330 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 340 */ 1586, 1586, 1586, 1586, 1586, 1586, 2108, 2112, 1586, 1586, + /* 350 */ 1586, 1586, 1586, 1586, 2032, 1586, 1586, 1586, 1586, 1586, + /* 360 */ 1933, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 370 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 380 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 390 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 400 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 410 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 420 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 430 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 440 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 450 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1623, + /* 460 */ 1938, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 470 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 480 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 490 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 500 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1703, 1702, 1586, + /* 510 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 520 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 530 */ 1586, 1941, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 540 */ 1586, 1586, 1586, 1586, 1586, 2104, 2065, 1586, 1586, 1586, + /* 550 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 560 */ 1933, 1586, 2087, 1586, 1586, 2102, 1586, 2106, 1586, 1586, + /* 570 */ 1586, 1586, 1586, 1586, 1586, 2042, 2038, 1586, 1586, 2034, + /* 580 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 590 */ 1586, 1586, 1586, 1586, 1586, 1586, 1932, 1586, 1993, 1586, + /* 600 */ 1586, 1586, 2027, 1586, 1586, 1978, 1586, 1586, 1586, 1586, + /* 610 */ 1586, 1586, 1586, 1586, 1586, 1941, 1586, 1944, 1586, 1586, + /* 620 */ 1586, 1586, 1586, 1768, 1586, 1586, 1586, 1586, 1586, 1586, + /* 630 */ 1586, 1586, 1586, 1586, 1586, 1586, 1753, 1751, 1750, 1749, + /* 640 */ 1586, 1746, 1586, 1781, 1586, 1586, 1586, 1777, 1776, 1586, + /* 650 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 660 */ 1586, 1586, 1586, 1586, 1683, 1586, 1586, 1586, 1586, 1586, + /* 670 */ 1586, 1586, 1586, 1675, 1586, 1674, 1586, 1586, 1586, 1586, + /* 680 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 690 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, + /* 700 */ 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1001,7 +1044,6 @@ static const YYCODETYPE yyFallback[] = { 0, /* TSDB_PAGESIZE => nothing */ 0, /* PRECISION => nothing */ 0, /* REPLICA => nothing */ - 0, /* STRICT => nothing */ 0, /* VGROUPS => nothing */ 0, /* SINGLE_STABLE => nothing */ 0, /* RETENTIONS => nothing */ @@ -1150,7 +1192,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* COUNT => nothing */ 0, /* LAST_ROW => nothing */ 0, /* CASE => nothing */ - 269, /* END => ABORT */ + 268, /* END => ABORT */ 0, /* WHEN => nothing */ 0, /* THEN => nothing */ 0, /* ELSE => nothing */ @@ -1192,58 +1234,59 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 269, /* AFTER => ABORT */ - 269, /* ATTACH => ABORT */ - 269, /* BEFORE => ABORT */ - 269, /* BEGIN => ABORT */ - 269, /* BITAND => ABORT */ - 269, /* BITNOT => ABORT */ - 269, /* BITOR => ABORT */ - 269, /* BLOCKS => ABORT */ - 269, /* CHANGE => ABORT */ - 269, /* COMMA => ABORT */ - 269, /* COMPACT => ABORT */ - 269, /* CONCAT => ABORT */ - 269, /* CONFLICT => ABORT */ - 269, /* COPY => ABORT */ - 269, /* DEFERRED => ABORT */ - 269, /* DELIMITERS => ABORT */ - 269, /* DETACH => ABORT */ - 269, /* DIVIDE => ABORT */ - 269, /* DOT => ABORT */ - 269, /* EACH => ABORT */ - 269, /* FAIL => ABORT */ - 269, /* FILE => ABORT */ - 269, /* FOR => ABORT */ - 269, /* GLOB => ABORT */ - 269, /* ID => ABORT */ - 269, /* IMMEDIATE => ABORT */ - 269, /* IMPORT => ABORT */ - 269, /* INITIALLY => ABORT */ - 269, /* INSTEAD => ABORT */ - 269, /* ISNULL => ABORT */ - 269, /* KEY => ABORT */ - 269, /* MODULES => ABORT */ - 269, /* NK_BITNOT => ABORT */ - 269, /* NK_SEMI => ABORT */ - 269, /* NOTNULL => ABORT */ - 269, /* OF => ABORT */ - 269, /* PLUS => ABORT */ - 269, /* PRIVILEGE => ABORT */ - 269, /* RAISE => ABORT */ - 269, /* REPLACE => ABORT */ - 269, /* RESTRICT => ABORT */ - 269, /* ROW => ABORT */ - 269, /* SEMI => ABORT */ - 269, /* STAR => ABORT */ - 269, /* STATEMENT => ABORT */ - 269, /* STRING => ABORT */ - 269, /* TIMES => ABORT */ - 269, /* UPDATE => ABORT */ - 269, /* VALUES => ABORT */ - 269, /* VARIABLE => ABORT */ - 269, /* VIEW => ABORT */ - 269, /* WAL => ABORT */ + 268, /* AFTER => ABORT */ + 268, /* ATTACH => ABORT */ + 268, /* BEFORE => ABORT */ + 268, /* BEGIN => ABORT */ + 268, /* BITAND => ABORT */ + 268, /* BITNOT => ABORT */ + 268, /* BITOR => ABORT */ + 268, /* BLOCKS => ABORT */ + 268, /* CHANGE => ABORT */ + 268, /* COMMA => ABORT */ + 268, /* COMPACT => ABORT */ + 268, /* CONCAT => ABORT */ + 268, /* CONFLICT => ABORT */ + 268, /* COPY => ABORT */ + 268, /* DEFERRED => ABORT */ + 268, /* DELIMITERS => ABORT */ + 268, /* DETACH => ABORT */ + 268, /* DIVIDE => ABORT */ + 268, /* DOT => ABORT */ + 268, /* EACH => ABORT */ + 268, /* FAIL => ABORT */ + 268, /* FILE => ABORT */ + 268, /* FOR => ABORT */ + 268, /* GLOB => ABORT */ + 268, /* ID => ABORT */ + 268, /* IMMEDIATE => ABORT */ + 268, /* IMPORT => ABORT */ + 268, /* INITIALLY => ABORT */ + 268, /* INSTEAD => ABORT */ + 268, /* ISNULL => ABORT */ + 268, /* KEY => ABORT */ + 268, /* MODULES => ABORT */ + 268, /* NK_BITNOT => ABORT */ + 268, /* NK_SEMI => ABORT */ + 268, /* NOTNULL => ABORT */ + 268, /* OF => ABORT */ + 268, /* PLUS => ABORT */ + 268, /* PRIVILEGE => ABORT */ + 268, /* RAISE => ABORT */ + 268, /* REPLACE => ABORT */ + 268, /* RESTRICT => ABORT */ + 268, /* ROW => ABORT */ + 268, /* SEMI => ABORT */ + 268, /* STAR => ABORT */ + 268, /* STATEMENT => ABORT */ + 268, /* STRICT => ABORT */ + 268, /* STRING => ABORT */ + 268, /* TIMES => ABORT */ + 268, /* UPDATE => ABORT */ + 268, /* VALUES => ABORT */ + 268, /* VARIABLE => ABORT */ + 268, /* VIEW => ABORT */ + 268, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1410,242 +1453,242 @@ static const char *const yyTokenName[] = { /* 76 */ "TSDB_PAGESIZE", /* 77 */ "PRECISION", /* 78 */ "REPLICA", - /* 79 */ "STRICT", - /* 80 */ "VGROUPS", - /* 81 */ "SINGLE_STABLE", - /* 82 */ "RETENTIONS", - /* 83 */ "SCHEMALESS", - /* 84 */ "WAL_LEVEL", - /* 85 */ "WAL_FSYNC_PERIOD", - /* 86 */ "WAL_RETENTION_PERIOD", - /* 87 */ "WAL_RETENTION_SIZE", - /* 88 */ "WAL_ROLL_PERIOD", - /* 89 */ "WAL_SEGMENT_SIZE", - /* 90 */ "STT_TRIGGER", - /* 91 */ "TABLE_PREFIX", - /* 92 */ "TABLE_SUFFIX", - /* 93 */ "NK_COLON", - /* 94 */ "MAX_SPEED", - /* 95 */ "TABLE", - /* 96 */ "NK_LP", - /* 97 */ "NK_RP", - /* 98 */ "STABLE", - /* 99 */ "ADD", - /* 100 */ "COLUMN", - /* 101 */ "MODIFY", - /* 102 */ "RENAME", - /* 103 */ "TAG", - /* 104 */ "SET", - /* 105 */ "NK_EQ", - /* 106 */ "USING", - /* 107 */ "TAGS", - /* 108 */ "COMMENT", - /* 109 */ "BOOL", - /* 110 */ "TINYINT", - /* 111 */ "SMALLINT", - /* 112 */ "INT", - /* 113 */ "INTEGER", - /* 114 */ "BIGINT", - /* 115 */ "FLOAT", - /* 116 */ "DOUBLE", - /* 117 */ "BINARY", - /* 118 */ "TIMESTAMP", - /* 119 */ "NCHAR", - /* 120 */ "UNSIGNED", - /* 121 */ "JSON", - /* 122 */ "VARCHAR", - /* 123 */ "MEDIUMBLOB", - /* 124 */ "BLOB", - /* 125 */ "VARBINARY", - /* 126 */ "DECIMAL", - /* 127 */ "MAX_DELAY", - /* 128 */ "WATERMARK", - /* 129 */ "ROLLUP", - /* 130 */ "TTL", - /* 131 */ "SMA", - /* 132 */ "DELETE_MARK", - /* 133 */ "FIRST", - /* 134 */ "LAST", - /* 135 */ "SHOW", - /* 136 */ "PRIVILEGES", - /* 137 */ "DATABASES", - /* 138 */ "TABLES", - /* 139 */ "STABLES", - /* 140 */ "MNODES", - /* 141 */ "QNODES", - /* 142 */ "FUNCTIONS", - /* 143 */ "INDEXES", - /* 144 */ "ACCOUNTS", - /* 145 */ "APPS", - /* 146 */ "CONNECTIONS", - /* 147 */ "LICENCES", - /* 148 */ "GRANTS", - /* 149 */ "QUERIES", - /* 150 */ "SCORES", - /* 151 */ "TOPICS", - /* 152 */ "VARIABLES", - /* 153 */ "CLUSTER", - /* 154 */ "BNODES", - /* 155 */ "SNODES", - /* 156 */ "TRANSACTIONS", - /* 157 */ "DISTRIBUTED", - /* 158 */ "CONSUMERS", - /* 159 */ "SUBSCRIPTIONS", - /* 160 */ "VNODES", - /* 161 */ "LIKE", - /* 162 */ "TBNAME", - /* 163 */ "QTAGS", - /* 164 */ "AS", - /* 165 */ "INDEX", - /* 166 */ "FUNCTION", - /* 167 */ "INTERVAL", - /* 168 */ "TOPIC", - /* 169 */ "WITH", - /* 170 */ "META", - /* 171 */ "CONSUMER", - /* 172 */ "GROUP", - /* 173 */ "DESC", - /* 174 */ "DESCRIBE", - /* 175 */ "RESET", - /* 176 */ "QUERY", - /* 177 */ "CACHE", - /* 178 */ "EXPLAIN", - /* 179 */ "ANALYZE", - /* 180 */ "VERBOSE", - /* 181 */ "NK_BOOL", - /* 182 */ "RATIO", - /* 183 */ "NK_FLOAT", - /* 184 */ "OUTPUTTYPE", - /* 185 */ "AGGREGATE", - /* 186 */ "BUFSIZE", - /* 187 */ "STREAM", - /* 188 */ "INTO", - /* 189 */ "TRIGGER", - /* 190 */ "AT_ONCE", - /* 191 */ "WINDOW_CLOSE", - /* 192 */ "IGNORE", - /* 193 */ "EXPIRED", - /* 194 */ "FILL_HISTORY", - /* 195 */ "SUBTABLE", - /* 196 */ "KILL", - /* 197 */ "CONNECTION", - /* 198 */ "TRANSACTION", - /* 199 */ "BALANCE", - /* 200 */ "VGROUP", - /* 201 */ "MERGE", - /* 202 */ "REDISTRIBUTE", - /* 203 */ "SPLIT", - /* 204 */ "DELETE", - /* 205 */ "INSERT", - /* 206 */ "NULL", - /* 207 */ "NK_QUESTION", - /* 208 */ "NK_ARROW", - /* 209 */ "ROWTS", - /* 210 */ "QSTART", - /* 211 */ "QEND", - /* 212 */ "QDURATION", - /* 213 */ "WSTART", - /* 214 */ "WEND", - /* 215 */ "WDURATION", - /* 216 */ "IROWTS", - /* 217 */ "CAST", - /* 218 */ "NOW", - /* 219 */ "TODAY", - /* 220 */ "TIMEZONE", - /* 221 */ "CLIENT_VERSION", - /* 222 */ "SERVER_VERSION", - /* 223 */ "SERVER_STATUS", - /* 224 */ "CURRENT_USER", - /* 225 */ "COUNT", - /* 226 */ "LAST_ROW", - /* 227 */ "CASE", - /* 228 */ "END", - /* 229 */ "WHEN", - /* 230 */ "THEN", - /* 231 */ "ELSE", - /* 232 */ "BETWEEN", - /* 233 */ "IS", - /* 234 */ "NK_LT", - /* 235 */ "NK_GT", - /* 236 */ "NK_LE", - /* 237 */ "NK_GE", - /* 238 */ "NK_NE", - /* 239 */ "MATCH", - /* 240 */ "NMATCH", - /* 241 */ "CONTAINS", - /* 242 */ "IN", - /* 243 */ "JOIN", - /* 244 */ "INNER", - /* 245 */ "SELECT", - /* 246 */ "DISTINCT", - /* 247 */ "WHERE", - /* 248 */ "PARTITION", - /* 249 */ "BY", - /* 250 */ "SESSION", - /* 251 */ "STATE_WINDOW", - /* 252 */ "SLIDING", - /* 253 */ "FILL", - /* 254 */ "VALUE", - /* 255 */ "NONE", - /* 256 */ "PREV", - /* 257 */ "LINEAR", - /* 258 */ "NEXT", - /* 259 */ "HAVING", - /* 260 */ "RANGE", - /* 261 */ "EVERY", - /* 262 */ "ORDER", - /* 263 */ "SLIMIT", - /* 264 */ "SOFFSET", - /* 265 */ "LIMIT", - /* 266 */ "OFFSET", - /* 267 */ "ASC", - /* 268 */ "NULLS", - /* 269 */ "ABORT", - /* 270 */ "AFTER", - /* 271 */ "ATTACH", - /* 272 */ "BEFORE", - /* 273 */ "BEGIN", - /* 274 */ "BITAND", - /* 275 */ "BITNOT", - /* 276 */ "BITOR", - /* 277 */ "BLOCKS", - /* 278 */ "CHANGE", - /* 279 */ "COMMA", - /* 280 */ "COMPACT", - /* 281 */ "CONCAT", - /* 282 */ "CONFLICT", - /* 283 */ "COPY", - /* 284 */ "DEFERRED", - /* 285 */ "DELIMITERS", - /* 286 */ "DETACH", - /* 287 */ "DIVIDE", - /* 288 */ "DOT", - /* 289 */ "EACH", - /* 290 */ "FAIL", - /* 291 */ "FILE", - /* 292 */ "FOR", - /* 293 */ "GLOB", - /* 294 */ "ID", - /* 295 */ "IMMEDIATE", - /* 296 */ "IMPORT", - /* 297 */ "INITIALLY", - /* 298 */ "INSTEAD", - /* 299 */ "ISNULL", - /* 300 */ "KEY", - /* 301 */ "MODULES", - /* 302 */ "NK_BITNOT", - /* 303 */ "NK_SEMI", - /* 304 */ "NOTNULL", - /* 305 */ "OF", - /* 306 */ "PLUS", - /* 307 */ "PRIVILEGE", - /* 308 */ "RAISE", - /* 309 */ "REPLACE", - /* 310 */ "RESTRICT", - /* 311 */ "ROW", - /* 312 */ "SEMI", - /* 313 */ "STAR", - /* 314 */ "STATEMENT", + /* 79 */ "VGROUPS", + /* 80 */ "SINGLE_STABLE", + /* 81 */ "RETENTIONS", + /* 82 */ "SCHEMALESS", + /* 83 */ "WAL_LEVEL", + /* 84 */ "WAL_FSYNC_PERIOD", + /* 85 */ "WAL_RETENTION_PERIOD", + /* 86 */ "WAL_RETENTION_SIZE", + /* 87 */ "WAL_ROLL_PERIOD", + /* 88 */ "WAL_SEGMENT_SIZE", + /* 89 */ "STT_TRIGGER", + /* 90 */ "TABLE_PREFIX", + /* 91 */ "TABLE_SUFFIX", + /* 92 */ "NK_COLON", + /* 93 */ "MAX_SPEED", + /* 94 */ "TABLE", + /* 95 */ "NK_LP", + /* 96 */ "NK_RP", + /* 97 */ "STABLE", + /* 98 */ "ADD", + /* 99 */ "COLUMN", + /* 100 */ "MODIFY", + /* 101 */ "RENAME", + /* 102 */ "TAG", + /* 103 */ "SET", + /* 104 */ "NK_EQ", + /* 105 */ "USING", + /* 106 */ "TAGS", + /* 107 */ "COMMENT", + /* 108 */ "BOOL", + /* 109 */ "TINYINT", + /* 110 */ "SMALLINT", + /* 111 */ "INT", + /* 112 */ "INTEGER", + /* 113 */ "BIGINT", + /* 114 */ "FLOAT", + /* 115 */ "DOUBLE", + /* 116 */ "BINARY", + /* 117 */ "TIMESTAMP", + /* 118 */ "NCHAR", + /* 119 */ "UNSIGNED", + /* 120 */ "JSON", + /* 121 */ "VARCHAR", + /* 122 */ "MEDIUMBLOB", + /* 123 */ "BLOB", + /* 124 */ "VARBINARY", + /* 125 */ "DECIMAL", + /* 126 */ "MAX_DELAY", + /* 127 */ "WATERMARK", + /* 128 */ "ROLLUP", + /* 129 */ "TTL", + /* 130 */ "SMA", + /* 131 */ "DELETE_MARK", + /* 132 */ "FIRST", + /* 133 */ "LAST", + /* 134 */ "SHOW", + /* 135 */ "PRIVILEGES", + /* 136 */ "DATABASES", + /* 137 */ "TABLES", + /* 138 */ "STABLES", + /* 139 */ "MNODES", + /* 140 */ "QNODES", + /* 141 */ "FUNCTIONS", + /* 142 */ "INDEXES", + /* 143 */ "ACCOUNTS", + /* 144 */ "APPS", + /* 145 */ "CONNECTIONS", + /* 146 */ "LICENCES", + /* 147 */ "GRANTS", + /* 148 */ "QUERIES", + /* 149 */ "SCORES", + /* 150 */ "TOPICS", + /* 151 */ "VARIABLES", + /* 152 */ "CLUSTER", + /* 153 */ "BNODES", + /* 154 */ "SNODES", + /* 155 */ "TRANSACTIONS", + /* 156 */ "DISTRIBUTED", + /* 157 */ "CONSUMERS", + /* 158 */ "SUBSCRIPTIONS", + /* 159 */ "VNODES", + /* 160 */ "LIKE", + /* 161 */ "TBNAME", + /* 162 */ "QTAGS", + /* 163 */ "AS", + /* 164 */ "INDEX", + /* 165 */ "FUNCTION", + /* 166 */ "INTERVAL", + /* 167 */ "TOPIC", + /* 168 */ "WITH", + /* 169 */ "META", + /* 170 */ "CONSUMER", + /* 171 */ "GROUP", + /* 172 */ "DESC", + /* 173 */ "DESCRIBE", + /* 174 */ "RESET", + /* 175 */ "QUERY", + /* 176 */ "CACHE", + /* 177 */ "EXPLAIN", + /* 178 */ "ANALYZE", + /* 179 */ "VERBOSE", + /* 180 */ "NK_BOOL", + /* 181 */ "RATIO", + /* 182 */ "NK_FLOAT", + /* 183 */ "OUTPUTTYPE", + /* 184 */ "AGGREGATE", + /* 185 */ "BUFSIZE", + /* 186 */ "STREAM", + /* 187 */ "INTO", + /* 188 */ "TRIGGER", + /* 189 */ "AT_ONCE", + /* 190 */ "WINDOW_CLOSE", + /* 191 */ "IGNORE", + /* 192 */ "EXPIRED", + /* 193 */ "FILL_HISTORY", + /* 194 */ "SUBTABLE", + /* 195 */ "KILL", + /* 196 */ "CONNECTION", + /* 197 */ "TRANSACTION", + /* 198 */ "BALANCE", + /* 199 */ "VGROUP", + /* 200 */ "MERGE", + /* 201 */ "REDISTRIBUTE", + /* 202 */ "SPLIT", + /* 203 */ "DELETE", + /* 204 */ "INSERT", + /* 205 */ "NULL", + /* 206 */ "NK_QUESTION", + /* 207 */ "NK_ARROW", + /* 208 */ "ROWTS", + /* 209 */ "QSTART", + /* 210 */ "QEND", + /* 211 */ "QDURATION", + /* 212 */ "WSTART", + /* 213 */ "WEND", + /* 214 */ "WDURATION", + /* 215 */ "IROWTS", + /* 216 */ "CAST", + /* 217 */ "NOW", + /* 218 */ "TODAY", + /* 219 */ "TIMEZONE", + /* 220 */ "CLIENT_VERSION", + /* 221 */ "SERVER_VERSION", + /* 222 */ "SERVER_STATUS", + /* 223 */ "CURRENT_USER", + /* 224 */ "COUNT", + /* 225 */ "LAST_ROW", + /* 226 */ "CASE", + /* 227 */ "END", + /* 228 */ "WHEN", + /* 229 */ "THEN", + /* 230 */ "ELSE", + /* 231 */ "BETWEEN", + /* 232 */ "IS", + /* 233 */ "NK_LT", + /* 234 */ "NK_GT", + /* 235 */ "NK_LE", + /* 236 */ "NK_GE", + /* 237 */ "NK_NE", + /* 238 */ "MATCH", + /* 239 */ "NMATCH", + /* 240 */ "CONTAINS", + /* 241 */ "IN", + /* 242 */ "JOIN", + /* 243 */ "INNER", + /* 244 */ "SELECT", + /* 245 */ "DISTINCT", + /* 246 */ "WHERE", + /* 247 */ "PARTITION", + /* 248 */ "BY", + /* 249 */ "SESSION", + /* 250 */ "STATE_WINDOW", + /* 251 */ "SLIDING", + /* 252 */ "FILL", + /* 253 */ "VALUE", + /* 254 */ "NONE", + /* 255 */ "PREV", + /* 256 */ "LINEAR", + /* 257 */ "NEXT", + /* 258 */ "HAVING", + /* 259 */ "RANGE", + /* 260 */ "EVERY", + /* 261 */ "ORDER", + /* 262 */ "SLIMIT", + /* 263 */ "SOFFSET", + /* 264 */ "LIMIT", + /* 265 */ "OFFSET", + /* 266 */ "ASC", + /* 267 */ "NULLS", + /* 268 */ "ABORT", + /* 269 */ "AFTER", + /* 270 */ "ATTACH", + /* 271 */ "BEFORE", + /* 272 */ "BEGIN", + /* 273 */ "BITAND", + /* 274 */ "BITNOT", + /* 275 */ "BITOR", + /* 276 */ "BLOCKS", + /* 277 */ "CHANGE", + /* 278 */ "COMMA", + /* 279 */ "COMPACT", + /* 280 */ "CONCAT", + /* 281 */ "CONFLICT", + /* 282 */ "COPY", + /* 283 */ "DEFERRED", + /* 284 */ "DELIMITERS", + /* 285 */ "DETACH", + /* 286 */ "DIVIDE", + /* 287 */ "DOT", + /* 288 */ "EACH", + /* 289 */ "FAIL", + /* 290 */ "FILE", + /* 291 */ "FOR", + /* 292 */ "GLOB", + /* 293 */ "ID", + /* 294 */ "IMMEDIATE", + /* 295 */ "IMPORT", + /* 296 */ "INITIALLY", + /* 297 */ "INSTEAD", + /* 298 */ "ISNULL", + /* 299 */ "KEY", + /* 300 */ "MODULES", + /* 301 */ "NK_BITNOT", + /* 302 */ "NK_SEMI", + /* 303 */ "NOTNULL", + /* 304 */ "OF", + /* 305 */ "PLUS", + /* 306 */ "PRIVILEGE", + /* 307 */ "RAISE", + /* 308 */ "REPLACE", + /* 309 */ "RESTRICT", + /* 310 */ "ROW", + /* 311 */ "SEMI", + /* 312 */ "STAR", + /* 313 */ "STATEMENT", + /* 314 */ "STRICT", /* 315 */ "STRING", /* 316 */ "TIMES", /* 317 */ "UPDATE", @@ -1887,453 +1930,452 @@ static const char *const yyRuleName[] = { /* 89 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", /* 90 */ "db_options ::= db_options PRECISION NK_STRING", /* 91 */ "db_options ::= db_options REPLICA NK_INTEGER", - /* 92 */ "db_options ::= db_options STRICT NK_STRING", - /* 93 */ "db_options ::= db_options VGROUPS NK_INTEGER", - /* 94 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", - /* 95 */ "db_options ::= db_options RETENTIONS retention_list", - /* 96 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", - /* 97 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", - /* 98 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", - /* 99 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", - /* 100 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 101 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", - /* 102 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 103 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", - /* 104 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", - /* 105 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", - /* 106 */ "db_options ::= db_options TABLE_PREFIX NK_INTEGER", - /* 107 */ "db_options ::= db_options TABLE_SUFFIX NK_INTEGER", - /* 108 */ "alter_db_options ::= alter_db_option", - /* 109 */ "alter_db_options ::= alter_db_options alter_db_option", - /* 110 */ "alter_db_option ::= BUFFER NK_INTEGER", - /* 111 */ "alter_db_option ::= CACHEMODEL NK_STRING", - /* 112 */ "alter_db_option ::= CACHESIZE NK_INTEGER", - /* 113 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", - /* 114 */ "alter_db_option ::= KEEP integer_list", - /* 115 */ "alter_db_option ::= KEEP variable_list", - /* 116 */ "alter_db_option ::= PAGES NK_INTEGER", - /* 117 */ "alter_db_option ::= REPLICA NK_INTEGER", - /* 118 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 119 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 120 */ "integer_list ::= NK_INTEGER", - /* 121 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 122 */ "variable_list ::= NK_VARIABLE", - /* 123 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 124 */ "retention_list ::= retention", - /* 125 */ "retention_list ::= retention_list NK_COMMA retention", - /* 126 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 127 */ "speed_opt ::=", - /* 128 */ "speed_opt ::= MAX_SPEED NK_INTEGER", - /* 129 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 130 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 131 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 132 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 133 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 134 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 135 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 136 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 137 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", - /* 138 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 139 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 140 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 141 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 142 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 143 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 144 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 145 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", - /* 146 */ "multi_create_clause ::= create_subtable_clause", - /* 147 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 148 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", - /* 149 */ "multi_drop_clause ::= drop_table_clause", - /* 150 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 151 */ "drop_table_clause ::= exists_opt full_table_name", - /* 152 */ "specific_cols_opt ::=", - /* 153 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 154 */ "full_table_name ::= table_name", - /* 155 */ "full_table_name ::= db_name NK_DOT table_name", - /* 156 */ "column_def_list ::= column_def", - /* 157 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 158 */ "column_def ::= column_name type_name", - /* 159 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 160 */ "type_name ::= BOOL", - /* 161 */ "type_name ::= TINYINT", - /* 162 */ "type_name ::= SMALLINT", - /* 163 */ "type_name ::= INT", - /* 164 */ "type_name ::= INTEGER", - /* 165 */ "type_name ::= BIGINT", - /* 166 */ "type_name ::= FLOAT", - /* 167 */ "type_name ::= DOUBLE", - /* 168 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 169 */ "type_name ::= TIMESTAMP", - /* 170 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 171 */ "type_name ::= TINYINT UNSIGNED", - /* 172 */ "type_name ::= SMALLINT UNSIGNED", - /* 173 */ "type_name ::= INT UNSIGNED", - /* 174 */ "type_name ::= BIGINT UNSIGNED", - /* 175 */ "type_name ::= JSON", - /* 176 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 177 */ "type_name ::= MEDIUMBLOB", - /* 178 */ "type_name ::= BLOB", - /* 179 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 180 */ "type_name ::= DECIMAL", - /* 181 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 182 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 183 */ "tags_def_opt ::=", - /* 184 */ "tags_def_opt ::= tags_def", - /* 185 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 186 */ "table_options ::=", - /* 187 */ "table_options ::= table_options COMMENT NK_STRING", - /* 188 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 189 */ "table_options ::= table_options WATERMARK duration_list", - /* 190 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 191 */ "table_options ::= table_options TTL NK_INTEGER", - /* 192 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 193 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 194 */ "alter_table_options ::= alter_table_option", - /* 195 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 196 */ "alter_table_option ::= COMMENT NK_STRING", - /* 197 */ "alter_table_option ::= TTL NK_INTEGER", - /* 198 */ "duration_list ::= duration_literal", - /* 199 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 200 */ "rollup_func_list ::= rollup_func_name", - /* 201 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 202 */ "rollup_func_name ::= function_name", - /* 203 */ "rollup_func_name ::= FIRST", - /* 204 */ "rollup_func_name ::= LAST", - /* 205 */ "col_name_list ::= col_name", - /* 206 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 207 */ "col_name ::= column_name", - /* 208 */ "cmd ::= SHOW DNODES", - /* 209 */ "cmd ::= SHOW USERS", - /* 210 */ "cmd ::= SHOW USER PRIVILEGES", - /* 211 */ "cmd ::= SHOW DATABASES", - /* 212 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 213 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 214 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 215 */ "cmd ::= SHOW MNODES", - /* 216 */ "cmd ::= SHOW QNODES", - /* 217 */ "cmd ::= SHOW FUNCTIONS", - /* 218 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 219 */ "cmd ::= SHOW STREAMS", - /* 220 */ "cmd ::= SHOW ACCOUNTS", - /* 221 */ "cmd ::= SHOW APPS", - /* 222 */ "cmd ::= SHOW CONNECTIONS", - /* 223 */ "cmd ::= SHOW LICENCES", - /* 224 */ "cmd ::= SHOW GRANTS", - /* 225 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 226 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 227 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 228 */ "cmd ::= SHOW QUERIES", - /* 229 */ "cmd ::= SHOW SCORES", - /* 230 */ "cmd ::= SHOW TOPICS", - /* 231 */ "cmd ::= SHOW VARIABLES", - /* 232 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 233 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 234 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 235 */ "cmd ::= SHOW BNODES", - /* 236 */ "cmd ::= SHOW SNODES", - /* 237 */ "cmd ::= SHOW CLUSTER", - /* 238 */ "cmd ::= SHOW TRANSACTIONS", - /* 239 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 240 */ "cmd ::= SHOW CONSUMERS", - /* 241 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 242 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 243 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 244 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 245 */ "cmd ::= SHOW VNODES NK_STRING", - /* 246 */ "db_name_cond_opt ::=", - /* 247 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 248 */ "like_pattern_opt ::=", - /* 249 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 250 */ "table_name_cond ::= table_name", - /* 251 */ "from_db_opt ::=", - /* 252 */ "from_db_opt ::= FROM db_name", - /* 253 */ "tag_list_opt ::=", - /* 254 */ "tag_list_opt ::= tag_item", - /* 255 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 256 */ "tag_item ::= TBNAME", - /* 257 */ "tag_item ::= QTAGS", - /* 258 */ "tag_item ::= column_name", - /* 259 */ "tag_item ::= column_name column_alias", - /* 260 */ "tag_item ::= column_name AS column_alias", - /* 261 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", - /* 262 */ "cmd ::= DROP INDEX exists_opt full_table_name", - /* 263 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 264 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", - /* 265 */ "func_list ::= func", - /* 266 */ "func_list ::= func_list NK_COMMA func", - /* 267 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 268 */ "sma_stream_opt ::=", - /* 269 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 270 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 271 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 272 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 277 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 278 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 279 */ "cmd ::= DESC full_table_name", - /* 280 */ "cmd ::= DESCRIBE full_table_name", - /* 281 */ "cmd ::= RESET QUERY CACHE", - /* 282 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 283 */ "analyze_opt ::=", - /* 284 */ "analyze_opt ::= ANALYZE", - /* 285 */ "explain_options ::=", - /* 286 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 287 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 288 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 289 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 290 */ "agg_func_opt ::=", - /* 291 */ "agg_func_opt ::= AGGREGATE", - /* 292 */ "bufsize_opt ::=", - /* 293 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 294 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", - /* 295 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 296 */ "stream_options ::=", - /* 297 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 298 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 299 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 300 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 301 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 302 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 303 */ "subtable_opt ::=", - /* 304 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 305 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 306 */ "cmd ::= KILL QUERY NK_STRING", - /* 307 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 308 */ "cmd ::= BALANCE VGROUP", - /* 309 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 310 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 311 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 312 */ "dnode_list ::= DNODE NK_INTEGER", - /* 313 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 314 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 315 */ "cmd ::= query_or_subquery", - /* 316 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 317 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 318 */ "literal ::= NK_INTEGER", - /* 319 */ "literal ::= NK_FLOAT", - /* 320 */ "literal ::= NK_STRING", - /* 321 */ "literal ::= NK_BOOL", - /* 322 */ "literal ::= TIMESTAMP NK_STRING", - /* 323 */ "literal ::= duration_literal", - /* 324 */ "literal ::= NULL", - /* 325 */ "literal ::= NK_QUESTION", - /* 326 */ "duration_literal ::= NK_VARIABLE", - /* 327 */ "signed ::= NK_INTEGER", - /* 328 */ "signed ::= NK_PLUS NK_INTEGER", - /* 329 */ "signed ::= NK_MINUS NK_INTEGER", - /* 330 */ "signed ::= NK_FLOAT", - /* 331 */ "signed ::= NK_PLUS NK_FLOAT", - /* 332 */ "signed ::= NK_MINUS NK_FLOAT", - /* 333 */ "signed_literal ::= signed", - /* 334 */ "signed_literal ::= NK_STRING", - /* 335 */ "signed_literal ::= NK_BOOL", - /* 336 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 337 */ "signed_literal ::= duration_literal", - /* 338 */ "signed_literal ::= NULL", - /* 339 */ "signed_literal ::= literal_func", - /* 340 */ "signed_literal ::= NK_QUESTION", - /* 341 */ "literal_list ::= signed_literal", - /* 342 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 343 */ "db_name ::= NK_ID", - /* 344 */ "table_name ::= NK_ID", - /* 345 */ "column_name ::= NK_ID", - /* 346 */ "function_name ::= NK_ID", - /* 347 */ "table_alias ::= NK_ID", - /* 348 */ "column_alias ::= NK_ID", - /* 349 */ "user_name ::= NK_ID", - /* 350 */ "topic_name ::= NK_ID", - /* 351 */ "stream_name ::= NK_ID", - /* 352 */ "cgroup_name ::= NK_ID", - /* 353 */ "expr_or_subquery ::= expression", - /* 354 */ "expression ::= literal", - /* 355 */ "expression ::= pseudo_column", - /* 356 */ "expression ::= column_reference", - /* 357 */ "expression ::= function_expression", - /* 358 */ "expression ::= case_when_expression", - /* 359 */ "expression ::= NK_LP expression NK_RP", - /* 360 */ "expression ::= NK_PLUS expr_or_subquery", - /* 361 */ "expression ::= NK_MINUS expr_or_subquery", - /* 362 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 363 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 364 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 365 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 366 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 367 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 368 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 369 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 370 */ "expression_list ::= expr_or_subquery", - /* 371 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 372 */ "column_reference ::= column_name", - /* 373 */ "column_reference ::= table_name NK_DOT column_name", - /* 374 */ "pseudo_column ::= ROWTS", - /* 375 */ "pseudo_column ::= TBNAME", - /* 376 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 377 */ "pseudo_column ::= QSTART", - /* 378 */ "pseudo_column ::= QEND", - /* 379 */ "pseudo_column ::= QDURATION", - /* 380 */ "pseudo_column ::= WSTART", - /* 381 */ "pseudo_column ::= WEND", - /* 382 */ "pseudo_column ::= WDURATION", - /* 383 */ "pseudo_column ::= IROWTS", - /* 384 */ "pseudo_column ::= QTAGS", - /* 385 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 386 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 387 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 388 */ "function_expression ::= literal_func", - /* 389 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 390 */ "literal_func ::= NOW", - /* 391 */ "noarg_func ::= NOW", - /* 392 */ "noarg_func ::= TODAY", - /* 393 */ "noarg_func ::= TIMEZONE", - /* 394 */ "noarg_func ::= DATABASE", - /* 395 */ "noarg_func ::= CLIENT_VERSION", - /* 396 */ "noarg_func ::= SERVER_VERSION", - /* 397 */ "noarg_func ::= SERVER_STATUS", - /* 398 */ "noarg_func ::= CURRENT_USER", - /* 399 */ "noarg_func ::= USER", - /* 400 */ "star_func ::= COUNT", - /* 401 */ "star_func ::= FIRST", - /* 402 */ "star_func ::= LAST", - /* 403 */ "star_func ::= LAST_ROW", - /* 404 */ "star_func_para_list ::= NK_STAR", - /* 405 */ "star_func_para_list ::= other_para_list", - /* 406 */ "other_para_list ::= star_func_para", - /* 407 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 408 */ "star_func_para ::= expr_or_subquery", - /* 409 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 410 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 411 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 412 */ "when_then_list ::= when_then_expr", - /* 413 */ "when_then_list ::= when_then_list when_then_expr", - /* 414 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 415 */ "case_when_else_opt ::=", - /* 416 */ "case_when_else_opt ::= ELSE common_expression", - /* 417 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 418 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 419 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 420 */ "predicate ::= expr_or_subquery IS NULL", - /* 421 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 422 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 423 */ "compare_op ::= NK_LT", - /* 424 */ "compare_op ::= NK_GT", - /* 425 */ "compare_op ::= NK_LE", - /* 426 */ "compare_op ::= NK_GE", - /* 427 */ "compare_op ::= NK_NE", - /* 428 */ "compare_op ::= NK_EQ", - /* 429 */ "compare_op ::= LIKE", - /* 430 */ "compare_op ::= NOT LIKE", - /* 431 */ "compare_op ::= MATCH", - /* 432 */ "compare_op ::= NMATCH", - /* 433 */ "compare_op ::= CONTAINS", - /* 434 */ "in_op ::= IN", - /* 435 */ "in_op ::= NOT IN", - /* 436 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 437 */ "boolean_value_expression ::= boolean_primary", - /* 438 */ "boolean_value_expression ::= NOT boolean_primary", - /* 439 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 440 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 441 */ "boolean_primary ::= predicate", - /* 442 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 443 */ "common_expression ::= expr_or_subquery", - /* 444 */ "common_expression ::= boolean_value_expression", - /* 445 */ "from_clause_opt ::=", - /* 446 */ "from_clause_opt ::= FROM table_reference_list", - /* 447 */ "table_reference_list ::= table_reference", - /* 448 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 449 */ "table_reference ::= table_primary", - /* 450 */ "table_reference ::= joined_table", - /* 451 */ "table_primary ::= table_name alias_opt", - /* 452 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 453 */ "table_primary ::= subquery alias_opt", - /* 454 */ "table_primary ::= parenthesized_joined_table", - /* 455 */ "alias_opt ::=", - /* 456 */ "alias_opt ::= table_alias", - /* 457 */ "alias_opt ::= AS table_alias", - /* 458 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 459 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 460 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 461 */ "join_type ::=", - /* 462 */ "join_type ::= INNER", - /* 463 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 464 */ "set_quantifier_opt ::=", - /* 465 */ "set_quantifier_opt ::= DISTINCT", - /* 466 */ "set_quantifier_opt ::= ALL", - /* 467 */ "select_list ::= select_item", - /* 468 */ "select_list ::= select_list NK_COMMA select_item", - /* 469 */ "select_item ::= NK_STAR", - /* 470 */ "select_item ::= common_expression", - /* 471 */ "select_item ::= common_expression column_alias", - /* 472 */ "select_item ::= common_expression AS column_alias", - /* 473 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 474 */ "where_clause_opt ::=", - /* 475 */ "where_clause_opt ::= WHERE search_condition", - /* 476 */ "partition_by_clause_opt ::=", - /* 477 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 478 */ "partition_list ::= partition_item", - /* 479 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 480 */ "partition_item ::= expr_or_subquery", - /* 481 */ "partition_item ::= expr_or_subquery column_alias", - /* 482 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 483 */ "twindow_clause_opt ::=", - /* 484 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 485 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 486 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 487 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 488 */ "sliding_opt ::=", - /* 489 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 490 */ "fill_opt ::=", - /* 491 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 492 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 493 */ "fill_mode ::= NONE", - /* 494 */ "fill_mode ::= PREV", - /* 495 */ "fill_mode ::= NULL", - /* 496 */ "fill_mode ::= LINEAR", - /* 497 */ "fill_mode ::= NEXT", - /* 498 */ "group_by_clause_opt ::=", - /* 499 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 500 */ "group_by_list ::= expr_or_subquery", - /* 501 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 502 */ "having_clause_opt ::=", - /* 503 */ "having_clause_opt ::= HAVING search_condition", - /* 504 */ "range_opt ::=", - /* 505 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 506 */ "every_opt ::=", - /* 507 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 508 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 509 */ "query_simple ::= query_specification", - /* 510 */ "query_simple ::= union_query_expression", - /* 511 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 512 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 513 */ "query_simple_or_subquery ::= query_simple", - /* 514 */ "query_simple_or_subquery ::= subquery", - /* 515 */ "query_or_subquery ::= query_expression", - /* 516 */ "query_or_subquery ::= subquery", - /* 517 */ "order_by_clause_opt ::=", - /* 518 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 519 */ "slimit_clause_opt ::=", - /* 520 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 522 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 523 */ "limit_clause_opt ::=", - /* 524 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 526 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 527 */ "subquery ::= NK_LP query_expression NK_RP", - /* 528 */ "subquery ::= NK_LP subquery NK_RP", - /* 529 */ "search_condition ::= common_expression", - /* 530 */ "sort_specification_list ::= sort_specification", - /* 531 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 532 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 533 */ "ordering_specification_opt ::=", - /* 534 */ "ordering_specification_opt ::= ASC", - /* 535 */ "ordering_specification_opt ::= DESC", - /* 536 */ "null_ordering_opt ::=", - /* 537 */ "null_ordering_opt ::= NULLS FIRST", - /* 538 */ "null_ordering_opt ::= NULLS LAST", + /* 92 */ "db_options ::= db_options VGROUPS NK_INTEGER", + /* 93 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", + /* 94 */ "db_options ::= db_options RETENTIONS retention_list", + /* 95 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", + /* 96 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", + /* 97 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", + /* 98 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", + /* 99 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 100 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", + /* 101 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 102 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", + /* 103 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", + /* 104 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", + /* 105 */ "db_options ::= db_options TABLE_PREFIX NK_INTEGER", + /* 106 */ "db_options ::= db_options TABLE_SUFFIX NK_INTEGER", + /* 107 */ "alter_db_options ::= alter_db_option", + /* 108 */ "alter_db_options ::= alter_db_options alter_db_option", + /* 109 */ "alter_db_option ::= BUFFER NK_INTEGER", + /* 110 */ "alter_db_option ::= CACHEMODEL NK_STRING", + /* 111 */ "alter_db_option ::= CACHESIZE NK_INTEGER", + /* 112 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", + /* 113 */ "alter_db_option ::= KEEP integer_list", + /* 114 */ "alter_db_option ::= KEEP variable_list", + /* 115 */ "alter_db_option ::= PAGES NK_INTEGER", + /* 116 */ "alter_db_option ::= REPLICA NK_INTEGER", + /* 117 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 118 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", + /* 119 */ "integer_list ::= NK_INTEGER", + /* 120 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 121 */ "variable_list ::= NK_VARIABLE", + /* 122 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 123 */ "retention_list ::= retention", + /* 124 */ "retention_list ::= retention_list NK_COMMA retention", + /* 125 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 126 */ "speed_opt ::=", + /* 127 */ "speed_opt ::= MAX_SPEED NK_INTEGER", + /* 128 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 129 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 130 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 131 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 132 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 133 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 134 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 135 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 136 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", + /* 137 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 138 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 139 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 140 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 141 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 142 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 143 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 144 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", + /* 145 */ "multi_create_clause ::= create_subtable_clause", + /* 146 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 147 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", + /* 148 */ "multi_drop_clause ::= drop_table_clause", + /* 149 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 150 */ "drop_table_clause ::= exists_opt full_table_name", + /* 151 */ "specific_cols_opt ::=", + /* 152 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 153 */ "full_table_name ::= table_name", + /* 154 */ "full_table_name ::= db_name NK_DOT table_name", + /* 155 */ "column_def_list ::= column_def", + /* 156 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 157 */ "column_def ::= column_name type_name", + /* 158 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 159 */ "type_name ::= BOOL", + /* 160 */ "type_name ::= TINYINT", + /* 161 */ "type_name ::= SMALLINT", + /* 162 */ "type_name ::= INT", + /* 163 */ "type_name ::= INTEGER", + /* 164 */ "type_name ::= BIGINT", + /* 165 */ "type_name ::= FLOAT", + /* 166 */ "type_name ::= DOUBLE", + /* 167 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 168 */ "type_name ::= TIMESTAMP", + /* 169 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 170 */ "type_name ::= TINYINT UNSIGNED", + /* 171 */ "type_name ::= SMALLINT UNSIGNED", + /* 172 */ "type_name ::= INT UNSIGNED", + /* 173 */ "type_name ::= BIGINT UNSIGNED", + /* 174 */ "type_name ::= JSON", + /* 175 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 176 */ "type_name ::= MEDIUMBLOB", + /* 177 */ "type_name ::= BLOB", + /* 178 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 179 */ "type_name ::= DECIMAL", + /* 180 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 181 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 182 */ "tags_def_opt ::=", + /* 183 */ "tags_def_opt ::= tags_def", + /* 184 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 185 */ "table_options ::=", + /* 186 */ "table_options ::= table_options COMMENT NK_STRING", + /* 187 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 188 */ "table_options ::= table_options WATERMARK duration_list", + /* 189 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 190 */ "table_options ::= table_options TTL NK_INTEGER", + /* 191 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 192 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 193 */ "alter_table_options ::= alter_table_option", + /* 194 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 195 */ "alter_table_option ::= COMMENT NK_STRING", + /* 196 */ "alter_table_option ::= TTL NK_INTEGER", + /* 197 */ "duration_list ::= duration_literal", + /* 198 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 199 */ "rollup_func_list ::= rollup_func_name", + /* 200 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 201 */ "rollup_func_name ::= function_name", + /* 202 */ "rollup_func_name ::= FIRST", + /* 203 */ "rollup_func_name ::= LAST", + /* 204 */ "col_name_list ::= col_name", + /* 205 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 206 */ "col_name ::= column_name", + /* 207 */ "cmd ::= SHOW DNODES", + /* 208 */ "cmd ::= SHOW USERS", + /* 209 */ "cmd ::= SHOW USER PRIVILEGES", + /* 210 */ "cmd ::= SHOW DATABASES", + /* 211 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 212 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 213 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 214 */ "cmd ::= SHOW MNODES", + /* 215 */ "cmd ::= SHOW QNODES", + /* 216 */ "cmd ::= SHOW FUNCTIONS", + /* 217 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 218 */ "cmd ::= SHOW STREAMS", + /* 219 */ "cmd ::= SHOW ACCOUNTS", + /* 220 */ "cmd ::= SHOW APPS", + /* 221 */ "cmd ::= SHOW CONNECTIONS", + /* 222 */ "cmd ::= SHOW LICENCES", + /* 223 */ "cmd ::= SHOW GRANTS", + /* 224 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 225 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 226 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 227 */ "cmd ::= SHOW QUERIES", + /* 228 */ "cmd ::= SHOW SCORES", + /* 229 */ "cmd ::= SHOW TOPICS", + /* 230 */ "cmd ::= SHOW VARIABLES", + /* 231 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 232 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 233 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 234 */ "cmd ::= SHOW BNODES", + /* 235 */ "cmd ::= SHOW SNODES", + /* 236 */ "cmd ::= SHOW CLUSTER", + /* 237 */ "cmd ::= SHOW TRANSACTIONS", + /* 238 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 239 */ "cmd ::= SHOW CONSUMERS", + /* 240 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 241 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 242 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 243 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 244 */ "cmd ::= SHOW VNODES NK_STRING", + /* 245 */ "db_name_cond_opt ::=", + /* 246 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 247 */ "like_pattern_opt ::=", + /* 248 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 249 */ "table_name_cond ::= table_name", + /* 250 */ "from_db_opt ::=", + /* 251 */ "from_db_opt ::= FROM db_name", + /* 252 */ "tag_list_opt ::=", + /* 253 */ "tag_list_opt ::= tag_item", + /* 254 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 255 */ "tag_item ::= TBNAME", + /* 256 */ "tag_item ::= QTAGS", + /* 257 */ "tag_item ::= column_name", + /* 258 */ "tag_item ::= column_name column_alias", + /* 259 */ "tag_item ::= column_name AS column_alias", + /* 260 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", + /* 261 */ "cmd ::= DROP INDEX exists_opt full_table_name", + /* 262 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 263 */ "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", + /* 264 */ "func_list ::= func", + /* 265 */ "func_list ::= func_list NK_COMMA func", + /* 266 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 267 */ "sma_stream_opt ::=", + /* 268 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 269 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 270 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 271 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 272 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 276 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 277 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 278 */ "cmd ::= DESC full_table_name", + /* 279 */ "cmd ::= DESCRIBE full_table_name", + /* 280 */ "cmd ::= RESET QUERY CACHE", + /* 281 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 282 */ "analyze_opt ::=", + /* 283 */ "analyze_opt ::= ANALYZE", + /* 284 */ "explain_options ::=", + /* 285 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 286 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 287 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 288 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 289 */ "agg_func_opt ::=", + /* 290 */ "agg_func_opt ::= AGGREGATE", + /* 291 */ "bufsize_opt ::=", + /* 292 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 293 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", + /* 294 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 295 */ "stream_options ::=", + /* 296 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 297 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 298 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 299 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 300 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 301 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 302 */ "subtable_opt ::=", + /* 303 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 304 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 305 */ "cmd ::= KILL QUERY NK_STRING", + /* 306 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 307 */ "cmd ::= BALANCE VGROUP", + /* 308 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 309 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 310 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 311 */ "dnode_list ::= DNODE NK_INTEGER", + /* 312 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 313 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 314 */ "cmd ::= query_or_subquery", + /* 315 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 316 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 317 */ "literal ::= NK_INTEGER", + /* 318 */ "literal ::= NK_FLOAT", + /* 319 */ "literal ::= NK_STRING", + /* 320 */ "literal ::= NK_BOOL", + /* 321 */ "literal ::= TIMESTAMP NK_STRING", + /* 322 */ "literal ::= duration_literal", + /* 323 */ "literal ::= NULL", + /* 324 */ "literal ::= NK_QUESTION", + /* 325 */ "duration_literal ::= NK_VARIABLE", + /* 326 */ "signed ::= NK_INTEGER", + /* 327 */ "signed ::= NK_PLUS NK_INTEGER", + /* 328 */ "signed ::= NK_MINUS NK_INTEGER", + /* 329 */ "signed ::= NK_FLOAT", + /* 330 */ "signed ::= NK_PLUS NK_FLOAT", + /* 331 */ "signed ::= NK_MINUS NK_FLOAT", + /* 332 */ "signed_literal ::= signed", + /* 333 */ "signed_literal ::= NK_STRING", + /* 334 */ "signed_literal ::= NK_BOOL", + /* 335 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 336 */ "signed_literal ::= duration_literal", + /* 337 */ "signed_literal ::= NULL", + /* 338 */ "signed_literal ::= literal_func", + /* 339 */ "signed_literal ::= NK_QUESTION", + /* 340 */ "literal_list ::= signed_literal", + /* 341 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 342 */ "db_name ::= NK_ID", + /* 343 */ "table_name ::= NK_ID", + /* 344 */ "column_name ::= NK_ID", + /* 345 */ "function_name ::= NK_ID", + /* 346 */ "table_alias ::= NK_ID", + /* 347 */ "column_alias ::= NK_ID", + /* 348 */ "user_name ::= NK_ID", + /* 349 */ "topic_name ::= NK_ID", + /* 350 */ "stream_name ::= NK_ID", + /* 351 */ "cgroup_name ::= NK_ID", + /* 352 */ "expr_or_subquery ::= expression", + /* 353 */ "expression ::= literal", + /* 354 */ "expression ::= pseudo_column", + /* 355 */ "expression ::= column_reference", + /* 356 */ "expression ::= function_expression", + /* 357 */ "expression ::= case_when_expression", + /* 358 */ "expression ::= NK_LP expression NK_RP", + /* 359 */ "expression ::= NK_PLUS expr_or_subquery", + /* 360 */ "expression ::= NK_MINUS expr_or_subquery", + /* 361 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 362 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 363 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 364 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 365 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 366 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 367 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 368 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 369 */ "expression_list ::= expr_or_subquery", + /* 370 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 371 */ "column_reference ::= column_name", + /* 372 */ "column_reference ::= table_name NK_DOT column_name", + /* 373 */ "pseudo_column ::= ROWTS", + /* 374 */ "pseudo_column ::= TBNAME", + /* 375 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 376 */ "pseudo_column ::= QSTART", + /* 377 */ "pseudo_column ::= QEND", + /* 378 */ "pseudo_column ::= QDURATION", + /* 379 */ "pseudo_column ::= WSTART", + /* 380 */ "pseudo_column ::= WEND", + /* 381 */ "pseudo_column ::= WDURATION", + /* 382 */ "pseudo_column ::= IROWTS", + /* 383 */ "pseudo_column ::= QTAGS", + /* 384 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 385 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 386 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 387 */ "function_expression ::= literal_func", + /* 388 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 389 */ "literal_func ::= NOW", + /* 390 */ "noarg_func ::= NOW", + /* 391 */ "noarg_func ::= TODAY", + /* 392 */ "noarg_func ::= TIMEZONE", + /* 393 */ "noarg_func ::= DATABASE", + /* 394 */ "noarg_func ::= CLIENT_VERSION", + /* 395 */ "noarg_func ::= SERVER_VERSION", + /* 396 */ "noarg_func ::= SERVER_STATUS", + /* 397 */ "noarg_func ::= CURRENT_USER", + /* 398 */ "noarg_func ::= USER", + /* 399 */ "star_func ::= COUNT", + /* 400 */ "star_func ::= FIRST", + /* 401 */ "star_func ::= LAST", + /* 402 */ "star_func ::= LAST_ROW", + /* 403 */ "star_func_para_list ::= NK_STAR", + /* 404 */ "star_func_para_list ::= other_para_list", + /* 405 */ "other_para_list ::= star_func_para", + /* 406 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 407 */ "star_func_para ::= expr_or_subquery", + /* 408 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 409 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 410 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 411 */ "when_then_list ::= when_then_expr", + /* 412 */ "when_then_list ::= when_then_list when_then_expr", + /* 413 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 414 */ "case_when_else_opt ::=", + /* 415 */ "case_when_else_opt ::= ELSE common_expression", + /* 416 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 417 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 418 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 419 */ "predicate ::= expr_or_subquery IS NULL", + /* 420 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 421 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 422 */ "compare_op ::= NK_LT", + /* 423 */ "compare_op ::= NK_GT", + /* 424 */ "compare_op ::= NK_LE", + /* 425 */ "compare_op ::= NK_GE", + /* 426 */ "compare_op ::= NK_NE", + /* 427 */ "compare_op ::= NK_EQ", + /* 428 */ "compare_op ::= LIKE", + /* 429 */ "compare_op ::= NOT LIKE", + /* 430 */ "compare_op ::= MATCH", + /* 431 */ "compare_op ::= NMATCH", + /* 432 */ "compare_op ::= CONTAINS", + /* 433 */ "in_op ::= IN", + /* 434 */ "in_op ::= NOT IN", + /* 435 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 436 */ "boolean_value_expression ::= boolean_primary", + /* 437 */ "boolean_value_expression ::= NOT boolean_primary", + /* 438 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 439 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 440 */ "boolean_primary ::= predicate", + /* 441 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 442 */ "common_expression ::= expr_or_subquery", + /* 443 */ "common_expression ::= boolean_value_expression", + /* 444 */ "from_clause_opt ::=", + /* 445 */ "from_clause_opt ::= FROM table_reference_list", + /* 446 */ "table_reference_list ::= table_reference", + /* 447 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 448 */ "table_reference ::= table_primary", + /* 449 */ "table_reference ::= joined_table", + /* 450 */ "table_primary ::= table_name alias_opt", + /* 451 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 452 */ "table_primary ::= subquery alias_opt", + /* 453 */ "table_primary ::= parenthesized_joined_table", + /* 454 */ "alias_opt ::=", + /* 455 */ "alias_opt ::= table_alias", + /* 456 */ "alias_opt ::= AS table_alias", + /* 457 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 458 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 459 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 460 */ "join_type ::=", + /* 461 */ "join_type ::= INNER", + /* 462 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 463 */ "set_quantifier_opt ::=", + /* 464 */ "set_quantifier_opt ::= DISTINCT", + /* 465 */ "set_quantifier_opt ::= ALL", + /* 466 */ "select_list ::= select_item", + /* 467 */ "select_list ::= select_list NK_COMMA select_item", + /* 468 */ "select_item ::= NK_STAR", + /* 469 */ "select_item ::= common_expression", + /* 470 */ "select_item ::= common_expression column_alias", + /* 471 */ "select_item ::= common_expression AS column_alias", + /* 472 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 473 */ "where_clause_opt ::=", + /* 474 */ "where_clause_opt ::= WHERE search_condition", + /* 475 */ "partition_by_clause_opt ::=", + /* 476 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 477 */ "partition_list ::= partition_item", + /* 478 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 479 */ "partition_item ::= expr_or_subquery", + /* 480 */ "partition_item ::= expr_or_subquery column_alias", + /* 481 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 482 */ "twindow_clause_opt ::=", + /* 483 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 484 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 485 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 486 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 487 */ "sliding_opt ::=", + /* 488 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 489 */ "fill_opt ::=", + /* 490 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 491 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 492 */ "fill_mode ::= NONE", + /* 493 */ "fill_mode ::= PREV", + /* 494 */ "fill_mode ::= NULL", + /* 495 */ "fill_mode ::= LINEAR", + /* 496 */ "fill_mode ::= NEXT", + /* 497 */ "group_by_clause_opt ::=", + /* 498 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 499 */ "group_by_list ::= expr_or_subquery", + /* 500 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 501 */ "having_clause_opt ::=", + /* 502 */ "having_clause_opt ::= HAVING search_condition", + /* 503 */ "range_opt ::=", + /* 504 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 505 */ "every_opt ::=", + /* 506 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 507 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 508 */ "query_simple ::= query_specification", + /* 509 */ "query_simple ::= union_query_expression", + /* 510 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 511 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 512 */ "query_simple_or_subquery ::= query_simple", + /* 513 */ "query_simple_or_subquery ::= subquery", + /* 514 */ "query_or_subquery ::= query_expression", + /* 515 */ "query_or_subquery ::= subquery", + /* 516 */ "order_by_clause_opt ::=", + /* 517 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 518 */ "slimit_clause_opt ::=", + /* 519 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 520 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 522 */ "limit_clause_opt ::=", + /* 523 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 524 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 526 */ "subquery ::= NK_LP query_expression NK_RP", + /* 527 */ "subquery ::= NK_LP subquery NK_RP", + /* 528 */ "search_condition ::= common_expression", + /* 529 */ "sort_specification_list ::= sort_specification", + /* 530 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 531 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 532 */ "ordering_specification_opt ::=", + /* 533 */ "ordering_specification_opt ::= ASC", + /* 534 */ "ordering_specification_opt ::= DESC", + /* 535 */ "null_ordering_opt ::=", + /* 536 */ "null_ordering_opt ::= NULLS FIRST", + /* 537 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -3037,453 +3079,452 @@ static const struct { { 338, -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ { 338, -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */ { 338, -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */ - { 338, -3 }, /* (92) db_options ::= db_options STRICT NK_STRING */ - { 338, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */ - { 338, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 338, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */ - { 338, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 338, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - { 338, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - { 338, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - { 338, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - { 338, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - { 338, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - { 338, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - { 338, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - { 338, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - { 338, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ - { 338, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ - { 340, -1 }, /* (108) alter_db_options ::= alter_db_option */ - { 340, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */ - { 345, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */ - { 345, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */ - { 345, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */ - { 345, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - { 345, -2 }, /* (114) alter_db_option ::= KEEP integer_list */ - { 345, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ - { 345, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ - { 345, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ - { 345, -2 }, /* (118) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 345, -2 }, /* (119) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - { 342, -1 }, /* (120) integer_list ::= NK_INTEGER */ - { 342, -3 }, /* (121) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 343, -1 }, /* (122) variable_list ::= NK_VARIABLE */ - { 343, -3 }, /* (123) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 344, -1 }, /* (124) retention_list ::= retention */ - { 344, -3 }, /* (125) retention_list ::= retention_list NK_COMMA retention */ - { 346, -3 }, /* (126) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 341, 0 }, /* (127) speed_opt ::= */ - { 341, -2 }, /* (128) speed_opt ::= MAX_SPEED NK_INTEGER */ - { 322, -9 }, /* (129) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 322, -3 }, /* (130) cmd ::= CREATE TABLE multi_create_clause */ - { 322, -9 }, /* (131) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 322, -3 }, /* (132) cmd ::= DROP TABLE multi_drop_clause */ - { 322, -4 }, /* (133) cmd ::= DROP STABLE exists_opt full_table_name */ - { 322, -3 }, /* (134) cmd ::= ALTER TABLE alter_table_clause */ - { 322, -3 }, /* (135) cmd ::= ALTER STABLE alter_table_clause */ - { 354, -2 }, /* (136) alter_table_clause ::= full_table_name alter_table_options */ - { 354, -5 }, /* (137) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 354, -4 }, /* (138) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 354, -5 }, /* (139) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 354, -5 }, /* (140) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 354, -5 }, /* (141) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 354, -4 }, /* (142) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 354, -5 }, /* (143) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 354, -5 }, /* (144) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 354, -6 }, /* (145) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 351, -1 }, /* (146) multi_create_clause ::= create_subtable_clause */ - { 351, -2 }, /* (147) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 359, -10 }, /* (148) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - { 353, -1 }, /* (149) multi_drop_clause ::= drop_table_clause */ - { 353, -2 }, /* (150) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 362, -2 }, /* (151) drop_table_clause ::= exists_opt full_table_name */ - { 360, 0 }, /* (152) specific_cols_opt ::= */ - { 360, -3 }, /* (153) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 347, -1 }, /* (154) full_table_name ::= table_name */ - { 347, -3 }, /* (155) full_table_name ::= db_name NK_DOT table_name */ - { 348, -1 }, /* (156) column_def_list ::= column_def */ - { 348, -3 }, /* (157) column_def_list ::= column_def_list NK_COMMA column_def */ - { 365, -2 }, /* (158) column_def ::= column_name type_name */ - { 365, -4 }, /* (159) column_def ::= column_name type_name COMMENT NK_STRING */ - { 357, -1 }, /* (160) type_name ::= BOOL */ - { 357, -1 }, /* (161) type_name ::= TINYINT */ - { 357, -1 }, /* (162) type_name ::= SMALLINT */ - { 357, -1 }, /* (163) type_name ::= INT */ - { 357, -1 }, /* (164) type_name ::= INTEGER */ - { 357, -1 }, /* (165) type_name ::= BIGINT */ - { 357, -1 }, /* (166) type_name ::= FLOAT */ - { 357, -1 }, /* (167) type_name ::= DOUBLE */ - { 357, -4 }, /* (168) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 357, -1 }, /* (169) type_name ::= TIMESTAMP */ - { 357, -4 }, /* (170) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 357, -2 }, /* (171) type_name ::= TINYINT UNSIGNED */ - { 357, -2 }, /* (172) type_name ::= SMALLINT UNSIGNED */ - { 357, -2 }, /* (173) type_name ::= INT UNSIGNED */ - { 357, -2 }, /* (174) type_name ::= BIGINT UNSIGNED */ - { 357, -1 }, /* (175) type_name ::= JSON */ - { 357, -4 }, /* (176) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 357, -1 }, /* (177) type_name ::= MEDIUMBLOB */ - { 357, -1 }, /* (178) type_name ::= BLOB */ - { 357, -4 }, /* (179) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 357, -1 }, /* (180) type_name ::= DECIMAL */ - { 357, -4 }, /* (181) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 357, -6 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 349, 0 }, /* (183) tags_def_opt ::= */ - { 349, -1 }, /* (184) tags_def_opt ::= tags_def */ - { 352, -4 }, /* (185) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 350, 0 }, /* (186) table_options ::= */ - { 350, -3 }, /* (187) table_options ::= table_options COMMENT NK_STRING */ - { 350, -3 }, /* (188) table_options ::= table_options MAX_DELAY duration_list */ - { 350, -3 }, /* (189) table_options ::= table_options WATERMARK duration_list */ - { 350, -5 }, /* (190) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 350, -3 }, /* (191) table_options ::= table_options TTL NK_INTEGER */ - { 350, -5 }, /* (192) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 350, -3 }, /* (193) table_options ::= table_options DELETE_MARK duration_list */ - { 355, -1 }, /* (194) alter_table_options ::= alter_table_option */ - { 355, -2 }, /* (195) alter_table_options ::= alter_table_options alter_table_option */ - { 368, -2 }, /* (196) alter_table_option ::= COMMENT NK_STRING */ - { 368, -2 }, /* (197) alter_table_option ::= TTL NK_INTEGER */ - { 366, -1 }, /* (198) duration_list ::= duration_literal */ - { 366, -3 }, /* (199) duration_list ::= duration_list NK_COMMA duration_literal */ - { 367, -1 }, /* (200) rollup_func_list ::= rollup_func_name */ - { 367, -3 }, /* (201) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 370, -1 }, /* (202) rollup_func_name ::= function_name */ - { 370, -1 }, /* (203) rollup_func_name ::= FIRST */ - { 370, -1 }, /* (204) rollup_func_name ::= LAST */ - { 363, -1 }, /* (205) col_name_list ::= col_name */ - { 363, -3 }, /* (206) col_name_list ::= col_name_list NK_COMMA col_name */ - { 372, -1 }, /* (207) col_name ::= column_name */ - { 322, -2 }, /* (208) cmd ::= SHOW DNODES */ - { 322, -2 }, /* (209) cmd ::= SHOW USERS */ - { 322, -3 }, /* (210) cmd ::= SHOW USER PRIVILEGES */ - { 322, -2 }, /* (211) cmd ::= SHOW DATABASES */ - { 322, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 322, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 322, -3 }, /* (214) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 322, -2 }, /* (215) cmd ::= SHOW MNODES */ - { 322, -2 }, /* (216) cmd ::= SHOW QNODES */ - { 322, -2 }, /* (217) cmd ::= SHOW FUNCTIONS */ - { 322, -5 }, /* (218) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 322, -2 }, /* (219) cmd ::= SHOW STREAMS */ - { 322, -2 }, /* (220) cmd ::= SHOW ACCOUNTS */ - { 322, -2 }, /* (221) cmd ::= SHOW APPS */ - { 322, -2 }, /* (222) cmd ::= SHOW CONNECTIONS */ - { 322, -2 }, /* (223) cmd ::= SHOW LICENCES */ - { 322, -2 }, /* (224) cmd ::= SHOW GRANTS */ - { 322, -4 }, /* (225) cmd ::= SHOW CREATE DATABASE db_name */ - { 322, -4 }, /* (226) cmd ::= SHOW CREATE TABLE full_table_name */ - { 322, -4 }, /* (227) cmd ::= SHOW CREATE STABLE full_table_name */ - { 322, -2 }, /* (228) cmd ::= SHOW QUERIES */ - { 322, -2 }, /* (229) cmd ::= SHOW SCORES */ - { 322, -2 }, /* (230) cmd ::= SHOW TOPICS */ - { 322, -2 }, /* (231) cmd ::= SHOW VARIABLES */ - { 322, -3 }, /* (232) cmd ::= SHOW CLUSTER VARIABLES */ - { 322, -3 }, /* (233) cmd ::= SHOW LOCAL VARIABLES */ - { 322, -5 }, /* (234) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - { 322, -2 }, /* (235) cmd ::= SHOW BNODES */ - { 322, -2 }, /* (236) cmd ::= SHOW SNODES */ - { 322, -2 }, /* (237) cmd ::= SHOW CLUSTER */ - { 322, -2 }, /* (238) cmd ::= SHOW TRANSACTIONS */ - { 322, -4 }, /* (239) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 322, -2 }, /* (240) cmd ::= SHOW CONSUMERS */ - { 322, -2 }, /* (241) cmd ::= SHOW SUBSCRIPTIONS */ - { 322, -5 }, /* (242) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 322, -7 }, /* (243) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - { 322, -3 }, /* (244) cmd ::= SHOW VNODES NK_INTEGER */ - { 322, -3 }, /* (245) cmd ::= SHOW VNODES NK_STRING */ - { 373, 0 }, /* (246) db_name_cond_opt ::= */ - { 373, -2 }, /* (247) db_name_cond_opt ::= db_name NK_DOT */ - { 374, 0 }, /* (248) like_pattern_opt ::= */ - { 374, -2 }, /* (249) like_pattern_opt ::= LIKE NK_STRING */ - { 375, -1 }, /* (250) table_name_cond ::= table_name */ - { 376, 0 }, /* (251) from_db_opt ::= */ - { 376, -2 }, /* (252) from_db_opt ::= FROM db_name */ - { 377, 0 }, /* (253) tag_list_opt ::= */ - { 377, -1 }, /* (254) tag_list_opt ::= tag_item */ - { 377, -3 }, /* (255) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - { 378, -1 }, /* (256) tag_item ::= TBNAME */ - { 378, -1 }, /* (257) tag_item ::= QTAGS */ - { 378, -1 }, /* (258) tag_item ::= column_name */ - { 378, -2 }, /* (259) tag_item ::= column_name column_alias */ - { 378, -3 }, /* (260) tag_item ::= column_name AS column_alias */ - { 322, -8 }, /* (261) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 322, -4 }, /* (262) cmd ::= DROP INDEX exists_opt full_table_name */ - { 380, -10 }, /* (263) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 380, -12 }, /* (264) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - { 381, -1 }, /* (265) func_list ::= func */ - { 381, -3 }, /* (266) func_list ::= func_list NK_COMMA func */ - { 384, -4 }, /* (267) func ::= function_name NK_LP expression_list NK_RP */ - { 383, 0 }, /* (268) sma_stream_opt ::= */ - { 383, -3 }, /* (269) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - { 383, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - { 383, -3 }, /* (271) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - { 322, -6 }, /* (272) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - { 322, -7 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 322, -9 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 322, -7 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 322, -9 }, /* (276) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 322, -4 }, /* (277) cmd ::= DROP TOPIC exists_opt topic_name */ - { 322, -7 }, /* (278) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 322, -2 }, /* (279) cmd ::= DESC full_table_name */ - { 322, -2 }, /* (280) cmd ::= DESCRIBE full_table_name */ - { 322, -3 }, /* (281) cmd ::= RESET QUERY CACHE */ - { 322, -4 }, /* (282) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - { 387, 0 }, /* (283) analyze_opt ::= */ - { 387, -1 }, /* (284) analyze_opt ::= ANALYZE */ - { 388, 0 }, /* (285) explain_options ::= */ - { 388, -3 }, /* (286) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 388, -3 }, /* (287) explain_options ::= explain_options RATIO NK_FLOAT */ - { 322, -10 }, /* (288) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 322, -4 }, /* (289) cmd ::= DROP FUNCTION exists_opt function_name */ - { 389, 0 }, /* (290) agg_func_opt ::= */ - { 389, -1 }, /* (291) agg_func_opt ::= AGGREGATE */ - { 390, 0 }, /* (292) bufsize_opt ::= */ - { 390, -2 }, /* (293) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 322, -11 }, /* (294) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ - { 322, -4 }, /* (295) cmd ::= DROP STREAM exists_opt stream_name */ - { 392, 0 }, /* (296) stream_options ::= */ - { 392, -3 }, /* (297) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 392, -3 }, /* (298) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 392, -4 }, /* (299) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 392, -3 }, /* (300) stream_options ::= stream_options WATERMARK duration_literal */ - { 392, -4 }, /* (301) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 392, -3 }, /* (302) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - { 393, 0 }, /* (303) subtable_opt ::= */ - { 393, -4 }, /* (304) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 322, -3 }, /* (305) cmd ::= KILL CONNECTION NK_INTEGER */ - { 322, -3 }, /* (306) cmd ::= KILL QUERY NK_STRING */ - { 322, -3 }, /* (307) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 322, -2 }, /* (308) cmd ::= BALANCE VGROUP */ - { 322, -4 }, /* (309) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 322, -4 }, /* (310) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 322, -3 }, /* (311) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 395, -2 }, /* (312) dnode_list ::= DNODE NK_INTEGER */ - { 395, -3 }, /* (313) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 322, -4 }, /* (314) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 322, -1 }, /* (315) cmd ::= query_or_subquery */ - { 322, -7 }, /* (316) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 322, -4 }, /* (317) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 325, -1 }, /* (318) literal ::= NK_INTEGER */ - { 325, -1 }, /* (319) literal ::= NK_FLOAT */ - { 325, -1 }, /* (320) literal ::= NK_STRING */ - { 325, -1 }, /* (321) literal ::= NK_BOOL */ - { 325, -2 }, /* (322) literal ::= TIMESTAMP NK_STRING */ - { 325, -1 }, /* (323) literal ::= duration_literal */ - { 325, -1 }, /* (324) literal ::= NULL */ - { 325, -1 }, /* (325) literal ::= NK_QUESTION */ - { 369, -1 }, /* (326) duration_literal ::= NK_VARIABLE */ - { 397, -1 }, /* (327) signed ::= NK_INTEGER */ - { 397, -2 }, /* (328) signed ::= NK_PLUS NK_INTEGER */ - { 397, -2 }, /* (329) signed ::= NK_MINUS NK_INTEGER */ - { 397, -1 }, /* (330) signed ::= NK_FLOAT */ - { 397, -2 }, /* (331) signed ::= NK_PLUS NK_FLOAT */ - { 397, -2 }, /* (332) signed ::= NK_MINUS NK_FLOAT */ - { 358, -1 }, /* (333) signed_literal ::= signed */ - { 358, -1 }, /* (334) signed_literal ::= NK_STRING */ - { 358, -1 }, /* (335) signed_literal ::= NK_BOOL */ - { 358, -2 }, /* (336) signed_literal ::= TIMESTAMP NK_STRING */ - { 358, -1 }, /* (337) signed_literal ::= duration_literal */ - { 358, -1 }, /* (338) signed_literal ::= NULL */ - { 358, -1 }, /* (339) signed_literal ::= literal_func */ - { 358, -1 }, /* (340) signed_literal ::= NK_QUESTION */ - { 399, -1 }, /* (341) literal_list ::= signed_literal */ - { 399, -3 }, /* (342) literal_list ::= literal_list NK_COMMA signed_literal */ - { 333, -1 }, /* (343) db_name ::= NK_ID */ - { 364, -1 }, /* (344) table_name ::= NK_ID */ - { 356, -1 }, /* (345) column_name ::= NK_ID */ - { 371, -1 }, /* (346) function_name ::= NK_ID */ - { 400, -1 }, /* (347) table_alias ::= NK_ID */ - { 379, -1 }, /* (348) column_alias ::= NK_ID */ - { 327, -1 }, /* (349) user_name ::= NK_ID */ - { 334, -1 }, /* (350) topic_name ::= NK_ID */ - { 391, -1 }, /* (351) stream_name ::= NK_ID */ - { 386, -1 }, /* (352) cgroup_name ::= NK_ID */ - { 401, -1 }, /* (353) expr_or_subquery ::= expression */ - { 394, -1 }, /* (354) expression ::= literal */ - { 394, -1 }, /* (355) expression ::= pseudo_column */ - { 394, -1 }, /* (356) expression ::= column_reference */ - { 394, -1 }, /* (357) expression ::= function_expression */ - { 394, -1 }, /* (358) expression ::= case_when_expression */ - { 394, -3 }, /* (359) expression ::= NK_LP expression NK_RP */ - { 394, -2 }, /* (360) expression ::= NK_PLUS expr_or_subquery */ - { 394, -2 }, /* (361) expression ::= NK_MINUS expr_or_subquery */ - { 394, -3 }, /* (362) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 394, -3 }, /* (363) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 394, -3 }, /* (364) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 394, -3 }, /* (365) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 394, -3 }, /* (366) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 394, -3 }, /* (367) expression ::= column_reference NK_ARROW NK_STRING */ - { 394, -3 }, /* (368) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 394, -3 }, /* (369) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 361, -1 }, /* (370) expression_list ::= expr_or_subquery */ - { 361, -3 }, /* (371) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 403, -1 }, /* (372) column_reference ::= column_name */ - { 403, -3 }, /* (373) column_reference ::= table_name NK_DOT column_name */ - { 402, -1 }, /* (374) pseudo_column ::= ROWTS */ - { 402, -1 }, /* (375) pseudo_column ::= TBNAME */ - { 402, -3 }, /* (376) pseudo_column ::= table_name NK_DOT TBNAME */ - { 402, -1 }, /* (377) pseudo_column ::= QSTART */ - { 402, -1 }, /* (378) pseudo_column ::= QEND */ - { 402, -1 }, /* (379) pseudo_column ::= QDURATION */ - { 402, -1 }, /* (380) pseudo_column ::= WSTART */ - { 402, -1 }, /* (381) pseudo_column ::= WEND */ - { 402, -1 }, /* (382) pseudo_column ::= WDURATION */ - { 402, -1 }, /* (383) pseudo_column ::= IROWTS */ - { 402, -1 }, /* (384) pseudo_column ::= QTAGS */ - { 404, -4 }, /* (385) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 404, -4 }, /* (386) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 404, -6 }, /* (387) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 404, -1 }, /* (388) function_expression ::= literal_func */ - { 398, -3 }, /* (389) literal_func ::= noarg_func NK_LP NK_RP */ - { 398, -1 }, /* (390) literal_func ::= NOW */ - { 408, -1 }, /* (391) noarg_func ::= NOW */ - { 408, -1 }, /* (392) noarg_func ::= TODAY */ - { 408, -1 }, /* (393) noarg_func ::= TIMEZONE */ - { 408, -1 }, /* (394) noarg_func ::= DATABASE */ - { 408, -1 }, /* (395) noarg_func ::= CLIENT_VERSION */ - { 408, -1 }, /* (396) noarg_func ::= SERVER_VERSION */ - { 408, -1 }, /* (397) noarg_func ::= SERVER_STATUS */ - { 408, -1 }, /* (398) noarg_func ::= CURRENT_USER */ - { 408, -1 }, /* (399) noarg_func ::= USER */ - { 406, -1 }, /* (400) star_func ::= COUNT */ - { 406, -1 }, /* (401) star_func ::= FIRST */ - { 406, -1 }, /* (402) star_func ::= LAST */ - { 406, -1 }, /* (403) star_func ::= LAST_ROW */ - { 407, -1 }, /* (404) star_func_para_list ::= NK_STAR */ - { 407, -1 }, /* (405) star_func_para_list ::= other_para_list */ - { 409, -1 }, /* (406) other_para_list ::= star_func_para */ - { 409, -3 }, /* (407) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 410, -1 }, /* (408) star_func_para ::= expr_or_subquery */ - { 410, -3 }, /* (409) star_func_para ::= table_name NK_DOT NK_STAR */ - { 405, -4 }, /* (410) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 405, -5 }, /* (411) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 411, -1 }, /* (412) when_then_list ::= when_then_expr */ - { 411, -2 }, /* (413) when_then_list ::= when_then_list when_then_expr */ - { 414, -4 }, /* (414) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 412, 0 }, /* (415) case_when_else_opt ::= */ - { 412, -2 }, /* (416) case_when_else_opt ::= ELSE common_expression */ - { 415, -3 }, /* (417) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 415, -5 }, /* (418) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 415, -6 }, /* (419) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 415, -3 }, /* (420) predicate ::= expr_or_subquery IS NULL */ - { 415, -4 }, /* (421) predicate ::= expr_or_subquery IS NOT NULL */ - { 415, -3 }, /* (422) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 416, -1 }, /* (423) compare_op ::= NK_LT */ - { 416, -1 }, /* (424) compare_op ::= NK_GT */ - { 416, -1 }, /* (425) compare_op ::= NK_LE */ - { 416, -1 }, /* (426) compare_op ::= NK_GE */ - { 416, -1 }, /* (427) compare_op ::= NK_NE */ - { 416, -1 }, /* (428) compare_op ::= NK_EQ */ - { 416, -1 }, /* (429) compare_op ::= LIKE */ - { 416, -2 }, /* (430) compare_op ::= NOT LIKE */ - { 416, -1 }, /* (431) compare_op ::= MATCH */ - { 416, -1 }, /* (432) compare_op ::= NMATCH */ - { 416, -1 }, /* (433) compare_op ::= CONTAINS */ - { 417, -1 }, /* (434) in_op ::= IN */ - { 417, -2 }, /* (435) in_op ::= NOT IN */ - { 418, -3 }, /* (436) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 419, -1 }, /* (437) boolean_value_expression ::= boolean_primary */ - { 419, -2 }, /* (438) boolean_value_expression ::= NOT boolean_primary */ - { 419, -3 }, /* (439) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 419, -3 }, /* (440) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 420, -1 }, /* (441) boolean_primary ::= predicate */ - { 420, -3 }, /* (442) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 413, -1 }, /* (443) common_expression ::= expr_or_subquery */ - { 413, -1 }, /* (444) common_expression ::= boolean_value_expression */ - { 421, 0 }, /* (445) from_clause_opt ::= */ - { 421, -2 }, /* (446) from_clause_opt ::= FROM table_reference_list */ - { 422, -1 }, /* (447) table_reference_list ::= table_reference */ - { 422, -3 }, /* (448) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 423, -1 }, /* (449) table_reference ::= table_primary */ - { 423, -1 }, /* (450) table_reference ::= joined_table */ - { 424, -2 }, /* (451) table_primary ::= table_name alias_opt */ - { 424, -4 }, /* (452) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 424, -2 }, /* (453) table_primary ::= subquery alias_opt */ - { 424, -1 }, /* (454) table_primary ::= parenthesized_joined_table */ - { 426, 0 }, /* (455) alias_opt ::= */ - { 426, -1 }, /* (456) alias_opt ::= table_alias */ - { 426, -2 }, /* (457) alias_opt ::= AS table_alias */ - { 428, -3 }, /* (458) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 428, -3 }, /* (459) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 425, -6 }, /* (460) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 429, 0 }, /* (461) join_type ::= */ - { 429, -1 }, /* (462) join_type ::= INNER */ - { 431, -12 }, /* (463) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 432, 0 }, /* (464) set_quantifier_opt ::= */ - { 432, -1 }, /* (465) set_quantifier_opt ::= DISTINCT */ - { 432, -1 }, /* (466) set_quantifier_opt ::= ALL */ - { 433, -1 }, /* (467) select_list ::= select_item */ - { 433, -3 }, /* (468) select_list ::= select_list NK_COMMA select_item */ - { 441, -1 }, /* (469) select_item ::= NK_STAR */ - { 441, -1 }, /* (470) select_item ::= common_expression */ - { 441, -2 }, /* (471) select_item ::= common_expression column_alias */ - { 441, -3 }, /* (472) select_item ::= common_expression AS column_alias */ - { 441, -3 }, /* (473) select_item ::= table_name NK_DOT NK_STAR */ - { 396, 0 }, /* (474) where_clause_opt ::= */ - { 396, -2 }, /* (475) where_clause_opt ::= WHERE search_condition */ - { 434, 0 }, /* (476) partition_by_clause_opt ::= */ - { 434, -3 }, /* (477) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 442, -1 }, /* (478) partition_list ::= partition_item */ - { 442, -3 }, /* (479) partition_list ::= partition_list NK_COMMA partition_item */ - { 443, -1 }, /* (480) partition_item ::= expr_or_subquery */ - { 443, -2 }, /* (481) partition_item ::= expr_or_subquery column_alias */ - { 443, -3 }, /* (482) partition_item ::= expr_or_subquery AS column_alias */ - { 438, 0 }, /* (483) twindow_clause_opt ::= */ - { 438, -6 }, /* (484) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 438, -4 }, /* (485) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 438, -6 }, /* (486) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 438, -8 }, /* (487) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 382, 0 }, /* (488) sliding_opt ::= */ - { 382, -4 }, /* (489) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 437, 0 }, /* (490) fill_opt ::= */ - { 437, -4 }, /* (491) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 437, -6 }, /* (492) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 444, -1 }, /* (493) fill_mode ::= NONE */ - { 444, -1 }, /* (494) fill_mode ::= PREV */ - { 444, -1 }, /* (495) fill_mode ::= NULL */ - { 444, -1 }, /* (496) fill_mode ::= LINEAR */ - { 444, -1 }, /* (497) fill_mode ::= NEXT */ - { 439, 0 }, /* (498) group_by_clause_opt ::= */ - { 439, -3 }, /* (499) group_by_clause_opt ::= GROUP BY group_by_list */ - { 445, -1 }, /* (500) group_by_list ::= expr_or_subquery */ - { 445, -3 }, /* (501) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 440, 0 }, /* (502) having_clause_opt ::= */ - { 440, -2 }, /* (503) having_clause_opt ::= HAVING search_condition */ - { 435, 0 }, /* (504) range_opt ::= */ - { 435, -6 }, /* (505) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 436, 0 }, /* (506) every_opt ::= */ - { 436, -4 }, /* (507) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 446, -4 }, /* (508) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 447, -1 }, /* (509) query_simple ::= query_specification */ - { 447, -1 }, /* (510) query_simple ::= union_query_expression */ - { 451, -4 }, /* (511) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 451, -3 }, /* (512) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 452, -1 }, /* (513) query_simple_or_subquery ::= query_simple */ - { 452, -1 }, /* (514) query_simple_or_subquery ::= subquery */ - { 385, -1 }, /* (515) query_or_subquery ::= query_expression */ - { 385, -1 }, /* (516) query_or_subquery ::= subquery */ - { 448, 0 }, /* (517) order_by_clause_opt ::= */ - { 448, -3 }, /* (518) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 449, 0 }, /* (519) slimit_clause_opt ::= */ - { 449, -2 }, /* (520) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 449, -4 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 449, -4 }, /* (522) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 450, 0 }, /* (523) limit_clause_opt ::= */ - { 450, -2 }, /* (524) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 450, -4 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 450, -4 }, /* (526) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 427, -3 }, /* (527) subquery ::= NK_LP query_expression NK_RP */ - { 427, -3 }, /* (528) subquery ::= NK_LP subquery NK_RP */ - { 430, -1 }, /* (529) search_condition ::= common_expression */ - { 453, -1 }, /* (530) sort_specification_list ::= sort_specification */ - { 453, -3 }, /* (531) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 454, -3 }, /* (532) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 455, 0 }, /* (533) ordering_specification_opt ::= */ - { 455, -1 }, /* (534) ordering_specification_opt ::= ASC */ - { 455, -1 }, /* (535) ordering_specification_opt ::= DESC */ - { 456, 0 }, /* (536) null_ordering_opt ::= */ - { 456, -2 }, /* (537) null_ordering_opt ::= NULLS FIRST */ - { 456, -2 }, /* (538) null_ordering_opt ::= NULLS LAST */ + { 338, -3 }, /* (92) db_options ::= db_options VGROUPS NK_INTEGER */ + { 338, -3 }, /* (93) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 338, -3 }, /* (94) db_options ::= db_options RETENTIONS retention_list */ + { 338, -3 }, /* (95) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 338, -3 }, /* (96) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + { 338, -3 }, /* (97) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + { 338, -3 }, /* (98) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + { 338, -4 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + { 338, -3 }, /* (100) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + { 338, -4 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + { 338, -3 }, /* (102) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + { 338, -3 }, /* (103) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + { 338, -3 }, /* (104) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + { 338, -3 }, /* (105) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ + { 338, -3 }, /* (106) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ + { 340, -1 }, /* (107) alter_db_options ::= alter_db_option */ + { 340, -2 }, /* (108) alter_db_options ::= alter_db_options alter_db_option */ + { 345, -2 }, /* (109) alter_db_option ::= BUFFER NK_INTEGER */ + { 345, -2 }, /* (110) alter_db_option ::= CACHEMODEL NK_STRING */ + { 345, -2 }, /* (111) alter_db_option ::= CACHESIZE NK_INTEGER */ + { 345, -2 }, /* (112) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + { 345, -2 }, /* (113) alter_db_option ::= KEEP integer_list */ + { 345, -2 }, /* (114) alter_db_option ::= KEEP variable_list */ + { 345, -2 }, /* (115) alter_db_option ::= PAGES NK_INTEGER */ + { 345, -2 }, /* (116) alter_db_option ::= REPLICA NK_INTEGER */ + { 345, -2 }, /* (117) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { 345, -2 }, /* (118) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + { 342, -1 }, /* (119) integer_list ::= NK_INTEGER */ + { 342, -3 }, /* (120) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 343, -1 }, /* (121) variable_list ::= NK_VARIABLE */ + { 343, -3 }, /* (122) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 344, -1 }, /* (123) retention_list ::= retention */ + { 344, -3 }, /* (124) retention_list ::= retention_list NK_COMMA retention */ + { 346, -3 }, /* (125) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 341, 0 }, /* (126) speed_opt ::= */ + { 341, -2 }, /* (127) speed_opt ::= MAX_SPEED NK_INTEGER */ + { 322, -9 }, /* (128) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 322, -3 }, /* (129) cmd ::= CREATE TABLE multi_create_clause */ + { 322, -9 }, /* (130) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 322, -3 }, /* (131) cmd ::= DROP TABLE multi_drop_clause */ + { 322, -4 }, /* (132) cmd ::= DROP STABLE exists_opt full_table_name */ + { 322, -3 }, /* (133) cmd ::= ALTER TABLE alter_table_clause */ + { 322, -3 }, /* (134) cmd ::= ALTER STABLE alter_table_clause */ + { 354, -2 }, /* (135) alter_table_clause ::= full_table_name alter_table_options */ + { 354, -5 }, /* (136) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 354, -4 }, /* (137) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 354, -5 }, /* (138) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 354, -5 }, /* (139) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 354, -5 }, /* (140) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 354, -4 }, /* (141) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 354, -5 }, /* (142) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 354, -5 }, /* (143) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 354, -6 }, /* (144) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 351, -1 }, /* (145) multi_create_clause ::= create_subtable_clause */ + { 351, -2 }, /* (146) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 359, -10 }, /* (147) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + { 353, -1 }, /* (148) multi_drop_clause ::= drop_table_clause */ + { 353, -2 }, /* (149) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 362, -2 }, /* (150) drop_table_clause ::= exists_opt full_table_name */ + { 360, 0 }, /* (151) specific_cols_opt ::= */ + { 360, -3 }, /* (152) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + { 347, -1 }, /* (153) full_table_name ::= table_name */ + { 347, -3 }, /* (154) full_table_name ::= db_name NK_DOT table_name */ + { 348, -1 }, /* (155) column_def_list ::= column_def */ + { 348, -3 }, /* (156) column_def_list ::= column_def_list NK_COMMA column_def */ + { 365, -2 }, /* (157) column_def ::= column_name type_name */ + { 365, -4 }, /* (158) column_def ::= column_name type_name COMMENT NK_STRING */ + { 357, -1 }, /* (159) type_name ::= BOOL */ + { 357, -1 }, /* (160) type_name ::= TINYINT */ + { 357, -1 }, /* (161) type_name ::= SMALLINT */ + { 357, -1 }, /* (162) type_name ::= INT */ + { 357, -1 }, /* (163) type_name ::= INTEGER */ + { 357, -1 }, /* (164) type_name ::= BIGINT */ + { 357, -1 }, /* (165) type_name ::= FLOAT */ + { 357, -1 }, /* (166) type_name ::= DOUBLE */ + { 357, -4 }, /* (167) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (168) type_name ::= TIMESTAMP */ + { 357, -4 }, /* (169) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 357, -2 }, /* (170) type_name ::= TINYINT UNSIGNED */ + { 357, -2 }, /* (171) type_name ::= SMALLINT UNSIGNED */ + { 357, -2 }, /* (172) type_name ::= INT UNSIGNED */ + { 357, -2 }, /* (173) type_name ::= BIGINT UNSIGNED */ + { 357, -1 }, /* (174) type_name ::= JSON */ + { 357, -4 }, /* (175) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (176) type_name ::= MEDIUMBLOB */ + { 357, -1 }, /* (177) type_name ::= BLOB */ + { 357, -4 }, /* (178) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (179) type_name ::= DECIMAL */ + { 357, -4 }, /* (180) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 357, -6 }, /* (181) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 349, 0 }, /* (182) tags_def_opt ::= */ + { 349, -1 }, /* (183) tags_def_opt ::= tags_def */ + { 352, -4 }, /* (184) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 350, 0 }, /* (185) table_options ::= */ + { 350, -3 }, /* (186) table_options ::= table_options COMMENT NK_STRING */ + { 350, -3 }, /* (187) table_options ::= table_options MAX_DELAY duration_list */ + { 350, -3 }, /* (188) table_options ::= table_options WATERMARK duration_list */ + { 350, -5 }, /* (189) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 350, -3 }, /* (190) table_options ::= table_options TTL NK_INTEGER */ + { 350, -5 }, /* (191) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 350, -3 }, /* (192) table_options ::= table_options DELETE_MARK duration_list */ + { 355, -1 }, /* (193) alter_table_options ::= alter_table_option */ + { 355, -2 }, /* (194) alter_table_options ::= alter_table_options alter_table_option */ + { 368, -2 }, /* (195) alter_table_option ::= COMMENT NK_STRING */ + { 368, -2 }, /* (196) alter_table_option ::= TTL NK_INTEGER */ + { 366, -1 }, /* (197) duration_list ::= duration_literal */ + { 366, -3 }, /* (198) duration_list ::= duration_list NK_COMMA duration_literal */ + { 367, -1 }, /* (199) rollup_func_list ::= rollup_func_name */ + { 367, -3 }, /* (200) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 370, -1 }, /* (201) rollup_func_name ::= function_name */ + { 370, -1 }, /* (202) rollup_func_name ::= FIRST */ + { 370, -1 }, /* (203) rollup_func_name ::= LAST */ + { 363, -1 }, /* (204) col_name_list ::= col_name */ + { 363, -3 }, /* (205) col_name_list ::= col_name_list NK_COMMA col_name */ + { 372, -1 }, /* (206) col_name ::= column_name */ + { 322, -2 }, /* (207) cmd ::= SHOW DNODES */ + { 322, -2 }, /* (208) cmd ::= SHOW USERS */ + { 322, -3 }, /* (209) cmd ::= SHOW USER PRIVILEGES */ + { 322, -2 }, /* (210) cmd ::= SHOW DATABASES */ + { 322, -4 }, /* (211) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 322, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 322, -3 }, /* (213) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 322, -2 }, /* (214) cmd ::= SHOW MNODES */ + { 322, -2 }, /* (215) cmd ::= SHOW QNODES */ + { 322, -2 }, /* (216) cmd ::= SHOW FUNCTIONS */ + { 322, -5 }, /* (217) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 322, -2 }, /* (218) cmd ::= SHOW STREAMS */ + { 322, -2 }, /* (219) cmd ::= SHOW ACCOUNTS */ + { 322, -2 }, /* (220) cmd ::= SHOW APPS */ + { 322, -2 }, /* (221) cmd ::= SHOW CONNECTIONS */ + { 322, -2 }, /* (222) cmd ::= SHOW LICENCES */ + { 322, -2 }, /* (223) cmd ::= SHOW GRANTS */ + { 322, -4 }, /* (224) cmd ::= SHOW CREATE DATABASE db_name */ + { 322, -4 }, /* (225) cmd ::= SHOW CREATE TABLE full_table_name */ + { 322, -4 }, /* (226) cmd ::= SHOW CREATE STABLE full_table_name */ + { 322, -2 }, /* (227) cmd ::= SHOW QUERIES */ + { 322, -2 }, /* (228) cmd ::= SHOW SCORES */ + { 322, -2 }, /* (229) cmd ::= SHOW TOPICS */ + { 322, -2 }, /* (230) cmd ::= SHOW VARIABLES */ + { 322, -3 }, /* (231) cmd ::= SHOW CLUSTER VARIABLES */ + { 322, -3 }, /* (232) cmd ::= SHOW LOCAL VARIABLES */ + { 322, -5 }, /* (233) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + { 322, -2 }, /* (234) cmd ::= SHOW BNODES */ + { 322, -2 }, /* (235) cmd ::= SHOW SNODES */ + { 322, -2 }, /* (236) cmd ::= SHOW CLUSTER */ + { 322, -2 }, /* (237) cmd ::= SHOW TRANSACTIONS */ + { 322, -4 }, /* (238) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 322, -2 }, /* (239) cmd ::= SHOW CONSUMERS */ + { 322, -2 }, /* (240) cmd ::= SHOW SUBSCRIPTIONS */ + { 322, -5 }, /* (241) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { 322, -7 }, /* (242) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + { 322, -3 }, /* (243) cmd ::= SHOW VNODES NK_INTEGER */ + { 322, -3 }, /* (244) cmd ::= SHOW VNODES NK_STRING */ + { 373, 0 }, /* (245) db_name_cond_opt ::= */ + { 373, -2 }, /* (246) db_name_cond_opt ::= db_name NK_DOT */ + { 374, 0 }, /* (247) like_pattern_opt ::= */ + { 374, -2 }, /* (248) like_pattern_opt ::= LIKE NK_STRING */ + { 375, -1 }, /* (249) table_name_cond ::= table_name */ + { 376, 0 }, /* (250) from_db_opt ::= */ + { 376, -2 }, /* (251) from_db_opt ::= FROM db_name */ + { 377, 0 }, /* (252) tag_list_opt ::= */ + { 377, -1 }, /* (253) tag_list_opt ::= tag_item */ + { 377, -3 }, /* (254) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + { 378, -1 }, /* (255) tag_item ::= TBNAME */ + { 378, -1 }, /* (256) tag_item ::= QTAGS */ + { 378, -1 }, /* (257) tag_item ::= column_name */ + { 378, -2 }, /* (258) tag_item ::= column_name column_alias */ + { 378, -3 }, /* (259) tag_item ::= column_name AS column_alias */ + { 322, -8 }, /* (260) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 322, -4 }, /* (261) cmd ::= DROP INDEX exists_opt full_table_name */ + { 380, -10 }, /* (262) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 380, -12 }, /* (263) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + { 381, -1 }, /* (264) func_list ::= func */ + { 381, -3 }, /* (265) func_list ::= func_list NK_COMMA func */ + { 384, -4 }, /* (266) func ::= function_name NK_LP expression_list NK_RP */ + { 383, 0 }, /* (267) sma_stream_opt ::= */ + { 383, -3 }, /* (268) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + { 383, -3 }, /* (269) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + { 383, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + { 322, -6 }, /* (271) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + { 322, -7 }, /* (272) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 322, -9 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 322, -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 322, -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 322, -4 }, /* (276) cmd ::= DROP TOPIC exists_opt topic_name */ + { 322, -7 }, /* (277) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 322, -2 }, /* (278) cmd ::= DESC full_table_name */ + { 322, -2 }, /* (279) cmd ::= DESCRIBE full_table_name */ + { 322, -3 }, /* (280) cmd ::= RESET QUERY CACHE */ + { 322, -4 }, /* (281) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + { 387, 0 }, /* (282) analyze_opt ::= */ + { 387, -1 }, /* (283) analyze_opt ::= ANALYZE */ + { 388, 0 }, /* (284) explain_options ::= */ + { 388, -3 }, /* (285) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 388, -3 }, /* (286) explain_options ::= explain_options RATIO NK_FLOAT */ + { 322, -10 }, /* (287) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 322, -4 }, /* (288) cmd ::= DROP FUNCTION exists_opt function_name */ + { 389, 0 }, /* (289) agg_func_opt ::= */ + { 389, -1 }, /* (290) agg_func_opt ::= AGGREGATE */ + { 390, 0 }, /* (291) bufsize_opt ::= */ + { 390, -2 }, /* (292) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 322, -11 }, /* (293) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + { 322, -4 }, /* (294) cmd ::= DROP STREAM exists_opt stream_name */ + { 392, 0 }, /* (295) stream_options ::= */ + { 392, -3 }, /* (296) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 392, -3 }, /* (297) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 392, -4 }, /* (298) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 392, -3 }, /* (299) stream_options ::= stream_options WATERMARK duration_literal */ + { 392, -4 }, /* (300) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 392, -3 }, /* (301) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + { 393, 0 }, /* (302) subtable_opt ::= */ + { 393, -4 }, /* (303) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + { 322, -3 }, /* (304) cmd ::= KILL CONNECTION NK_INTEGER */ + { 322, -3 }, /* (305) cmd ::= KILL QUERY NK_STRING */ + { 322, -3 }, /* (306) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 322, -2 }, /* (307) cmd ::= BALANCE VGROUP */ + { 322, -4 }, /* (308) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 322, -4 }, /* (309) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 322, -3 }, /* (310) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 395, -2 }, /* (311) dnode_list ::= DNODE NK_INTEGER */ + { 395, -3 }, /* (312) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 322, -4 }, /* (313) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 322, -1 }, /* (314) cmd ::= query_or_subquery */ + { 322, -7 }, /* (315) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { 322, -4 }, /* (316) cmd ::= INSERT INTO full_table_name query_or_subquery */ + { 325, -1 }, /* (317) literal ::= NK_INTEGER */ + { 325, -1 }, /* (318) literal ::= NK_FLOAT */ + { 325, -1 }, /* (319) literal ::= NK_STRING */ + { 325, -1 }, /* (320) literal ::= NK_BOOL */ + { 325, -2 }, /* (321) literal ::= TIMESTAMP NK_STRING */ + { 325, -1 }, /* (322) literal ::= duration_literal */ + { 325, -1 }, /* (323) literal ::= NULL */ + { 325, -1 }, /* (324) literal ::= NK_QUESTION */ + { 369, -1 }, /* (325) duration_literal ::= NK_VARIABLE */ + { 397, -1 }, /* (326) signed ::= NK_INTEGER */ + { 397, -2 }, /* (327) signed ::= NK_PLUS NK_INTEGER */ + { 397, -2 }, /* (328) signed ::= NK_MINUS NK_INTEGER */ + { 397, -1 }, /* (329) signed ::= NK_FLOAT */ + { 397, -2 }, /* (330) signed ::= NK_PLUS NK_FLOAT */ + { 397, -2 }, /* (331) signed ::= NK_MINUS NK_FLOAT */ + { 358, -1 }, /* (332) signed_literal ::= signed */ + { 358, -1 }, /* (333) signed_literal ::= NK_STRING */ + { 358, -1 }, /* (334) signed_literal ::= NK_BOOL */ + { 358, -2 }, /* (335) signed_literal ::= TIMESTAMP NK_STRING */ + { 358, -1 }, /* (336) signed_literal ::= duration_literal */ + { 358, -1 }, /* (337) signed_literal ::= NULL */ + { 358, -1 }, /* (338) signed_literal ::= literal_func */ + { 358, -1 }, /* (339) signed_literal ::= NK_QUESTION */ + { 399, -1 }, /* (340) literal_list ::= signed_literal */ + { 399, -3 }, /* (341) literal_list ::= literal_list NK_COMMA signed_literal */ + { 333, -1 }, /* (342) db_name ::= NK_ID */ + { 364, -1 }, /* (343) table_name ::= NK_ID */ + { 356, -1 }, /* (344) column_name ::= NK_ID */ + { 371, -1 }, /* (345) function_name ::= NK_ID */ + { 400, -1 }, /* (346) table_alias ::= NK_ID */ + { 379, -1 }, /* (347) column_alias ::= NK_ID */ + { 327, -1 }, /* (348) user_name ::= NK_ID */ + { 334, -1 }, /* (349) topic_name ::= NK_ID */ + { 391, -1 }, /* (350) stream_name ::= NK_ID */ + { 386, -1 }, /* (351) cgroup_name ::= NK_ID */ + { 401, -1 }, /* (352) expr_or_subquery ::= expression */ + { 394, -1 }, /* (353) expression ::= literal */ + { 394, -1 }, /* (354) expression ::= pseudo_column */ + { 394, -1 }, /* (355) expression ::= column_reference */ + { 394, -1 }, /* (356) expression ::= function_expression */ + { 394, -1 }, /* (357) expression ::= case_when_expression */ + { 394, -3 }, /* (358) expression ::= NK_LP expression NK_RP */ + { 394, -2 }, /* (359) expression ::= NK_PLUS expr_or_subquery */ + { 394, -2 }, /* (360) expression ::= NK_MINUS expr_or_subquery */ + { 394, -3 }, /* (361) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 394, -3 }, /* (362) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 394, -3 }, /* (363) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 394, -3 }, /* (364) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 394, -3 }, /* (365) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 394, -3 }, /* (366) expression ::= column_reference NK_ARROW NK_STRING */ + { 394, -3 }, /* (367) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 394, -3 }, /* (368) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 361, -1 }, /* (369) expression_list ::= expr_or_subquery */ + { 361, -3 }, /* (370) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 403, -1 }, /* (371) column_reference ::= column_name */ + { 403, -3 }, /* (372) column_reference ::= table_name NK_DOT column_name */ + { 402, -1 }, /* (373) pseudo_column ::= ROWTS */ + { 402, -1 }, /* (374) pseudo_column ::= TBNAME */ + { 402, -3 }, /* (375) pseudo_column ::= table_name NK_DOT TBNAME */ + { 402, -1 }, /* (376) pseudo_column ::= QSTART */ + { 402, -1 }, /* (377) pseudo_column ::= QEND */ + { 402, -1 }, /* (378) pseudo_column ::= QDURATION */ + { 402, -1 }, /* (379) pseudo_column ::= WSTART */ + { 402, -1 }, /* (380) pseudo_column ::= WEND */ + { 402, -1 }, /* (381) pseudo_column ::= WDURATION */ + { 402, -1 }, /* (382) pseudo_column ::= IROWTS */ + { 402, -1 }, /* (383) pseudo_column ::= QTAGS */ + { 404, -4 }, /* (384) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 404, -4 }, /* (385) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 404, -6 }, /* (386) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 404, -1 }, /* (387) function_expression ::= literal_func */ + { 398, -3 }, /* (388) literal_func ::= noarg_func NK_LP NK_RP */ + { 398, -1 }, /* (389) literal_func ::= NOW */ + { 408, -1 }, /* (390) noarg_func ::= NOW */ + { 408, -1 }, /* (391) noarg_func ::= TODAY */ + { 408, -1 }, /* (392) noarg_func ::= TIMEZONE */ + { 408, -1 }, /* (393) noarg_func ::= DATABASE */ + { 408, -1 }, /* (394) noarg_func ::= CLIENT_VERSION */ + { 408, -1 }, /* (395) noarg_func ::= SERVER_VERSION */ + { 408, -1 }, /* (396) noarg_func ::= SERVER_STATUS */ + { 408, -1 }, /* (397) noarg_func ::= CURRENT_USER */ + { 408, -1 }, /* (398) noarg_func ::= USER */ + { 406, -1 }, /* (399) star_func ::= COUNT */ + { 406, -1 }, /* (400) star_func ::= FIRST */ + { 406, -1 }, /* (401) star_func ::= LAST */ + { 406, -1 }, /* (402) star_func ::= LAST_ROW */ + { 407, -1 }, /* (403) star_func_para_list ::= NK_STAR */ + { 407, -1 }, /* (404) star_func_para_list ::= other_para_list */ + { 409, -1 }, /* (405) other_para_list ::= star_func_para */ + { 409, -3 }, /* (406) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 410, -1 }, /* (407) star_func_para ::= expr_or_subquery */ + { 410, -3 }, /* (408) star_func_para ::= table_name NK_DOT NK_STAR */ + { 405, -4 }, /* (409) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 405, -5 }, /* (410) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 411, -1 }, /* (411) when_then_list ::= when_then_expr */ + { 411, -2 }, /* (412) when_then_list ::= when_then_list when_then_expr */ + { 414, -4 }, /* (413) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 412, 0 }, /* (414) case_when_else_opt ::= */ + { 412, -2 }, /* (415) case_when_else_opt ::= ELSE common_expression */ + { 415, -3 }, /* (416) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 415, -5 }, /* (417) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 415, -6 }, /* (418) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 415, -3 }, /* (419) predicate ::= expr_or_subquery IS NULL */ + { 415, -4 }, /* (420) predicate ::= expr_or_subquery IS NOT NULL */ + { 415, -3 }, /* (421) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 416, -1 }, /* (422) compare_op ::= NK_LT */ + { 416, -1 }, /* (423) compare_op ::= NK_GT */ + { 416, -1 }, /* (424) compare_op ::= NK_LE */ + { 416, -1 }, /* (425) compare_op ::= NK_GE */ + { 416, -1 }, /* (426) compare_op ::= NK_NE */ + { 416, -1 }, /* (427) compare_op ::= NK_EQ */ + { 416, -1 }, /* (428) compare_op ::= LIKE */ + { 416, -2 }, /* (429) compare_op ::= NOT LIKE */ + { 416, -1 }, /* (430) compare_op ::= MATCH */ + { 416, -1 }, /* (431) compare_op ::= NMATCH */ + { 416, -1 }, /* (432) compare_op ::= CONTAINS */ + { 417, -1 }, /* (433) in_op ::= IN */ + { 417, -2 }, /* (434) in_op ::= NOT IN */ + { 418, -3 }, /* (435) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 419, -1 }, /* (436) boolean_value_expression ::= boolean_primary */ + { 419, -2 }, /* (437) boolean_value_expression ::= NOT boolean_primary */ + { 419, -3 }, /* (438) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 419, -3 }, /* (439) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 420, -1 }, /* (440) boolean_primary ::= predicate */ + { 420, -3 }, /* (441) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 413, -1 }, /* (442) common_expression ::= expr_or_subquery */ + { 413, -1 }, /* (443) common_expression ::= boolean_value_expression */ + { 421, 0 }, /* (444) from_clause_opt ::= */ + { 421, -2 }, /* (445) from_clause_opt ::= FROM table_reference_list */ + { 422, -1 }, /* (446) table_reference_list ::= table_reference */ + { 422, -3 }, /* (447) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 423, -1 }, /* (448) table_reference ::= table_primary */ + { 423, -1 }, /* (449) table_reference ::= joined_table */ + { 424, -2 }, /* (450) table_primary ::= table_name alias_opt */ + { 424, -4 }, /* (451) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 424, -2 }, /* (452) table_primary ::= subquery alias_opt */ + { 424, -1 }, /* (453) table_primary ::= parenthesized_joined_table */ + { 426, 0 }, /* (454) alias_opt ::= */ + { 426, -1 }, /* (455) alias_opt ::= table_alias */ + { 426, -2 }, /* (456) alias_opt ::= AS table_alias */ + { 428, -3 }, /* (457) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 428, -3 }, /* (458) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 425, -6 }, /* (459) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 429, 0 }, /* (460) join_type ::= */ + { 429, -1 }, /* (461) join_type ::= INNER */ + { 431, -12 }, /* (462) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 432, 0 }, /* (463) set_quantifier_opt ::= */ + { 432, -1 }, /* (464) set_quantifier_opt ::= DISTINCT */ + { 432, -1 }, /* (465) set_quantifier_opt ::= ALL */ + { 433, -1 }, /* (466) select_list ::= select_item */ + { 433, -3 }, /* (467) select_list ::= select_list NK_COMMA select_item */ + { 441, -1 }, /* (468) select_item ::= NK_STAR */ + { 441, -1 }, /* (469) select_item ::= common_expression */ + { 441, -2 }, /* (470) select_item ::= common_expression column_alias */ + { 441, -3 }, /* (471) select_item ::= common_expression AS column_alias */ + { 441, -3 }, /* (472) select_item ::= table_name NK_DOT NK_STAR */ + { 396, 0 }, /* (473) where_clause_opt ::= */ + { 396, -2 }, /* (474) where_clause_opt ::= WHERE search_condition */ + { 434, 0 }, /* (475) partition_by_clause_opt ::= */ + { 434, -3 }, /* (476) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 442, -1 }, /* (477) partition_list ::= partition_item */ + { 442, -3 }, /* (478) partition_list ::= partition_list NK_COMMA partition_item */ + { 443, -1 }, /* (479) partition_item ::= expr_or_subquery */ + { 443, -2 }, /* (480) partition_item ::= expr_or_subquery column_alias */ + { 443, -3 }, /* (481) partition_item ::= expr_or_subquery AS column_alias */ + { 438, 0 }, /* (482) twindow_clause_opt ::= */ + { 438, -6 }, /* (483) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 438, -4 }, /* (484) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 438, -6 }, /* (485) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 438, -8 }, /* (486) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 382, 0 }, /* (487) sliding_opt ::= */ + { 382, -4 }, /* (488) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 437, 0 }, /* (489) fill_opt ::= */ + { 437, -4 }, /* (490) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 437, -6 }, /* (491) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 444, -1 }, /* (492) fill_mode ::= NONE */ + { 444, -1 }, /* (493) fill_mode ::= PREV */ + { 444, -1 }, /* (494) fill_mode ::= NULL */ + { 444, -1 }, /* (495) fill_mode ::= LINEAR */ + { 444, -1 }, /* (496) fill_mode ::= NEXT */ + { 439, 0 }, /* (497) group_by_clause_opt ::= */ + { 439, -3 }, /* (498) group_by_clause_opt ::= GROUP BY group_by_list */ + { 445, -1 }, /* (499) group_by_list ::= expr_or_subquery */ + { 445, -3 }, /* (500) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 440, 0 }, /* (501) having_clause_opt ::= */ + { 440, -2 }, /* (502) having_clause_opt ::= HAVING search_condition */ + { 435, 0 }, /* (503) range_opt ::= */ + { 435, -6 }, /* (504) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 436, 0 }, /* (505) every_opt ::= */ + { 436, -4 }, /* (506) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 446, -4 }, /* (507) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 447, -1 }, /* (508) query_simple ::= query_specification */ + { 447, -1 }, /* (509) query_simple ::= union_query_expression */ + { 451, -4 }, /* (510) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 451, -3 }, /* (511) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 452, -1 }, /* (512) query_simple_or_subquery ::= query_simple */ + { 452, -1 }, /* (513) query_simple_or_subquery ::= subquery */ + { 385, -1 }, /* (514) query_or_subquery ::= query_expression */ + { 385, -1 }, /* (515) query_or_subquery ::= subquery */ + { 448, 0 }, /* (516) order_by_clause_opt ::= */ + { 448, -3 }, /* (517) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 449, 0 }, /* (518) slimit_clause_opt ::= */ + { 449, -2 }, /* (519) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 449, -4 }, /* (520) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 449, -4 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 450, 0 }, /* (522) limit_clause_opt ::= */ + { 450, -2 }, /* (523) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 450, -4 }, /* (524) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 450, -4 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 427, -3 }, /* (526) subquery ::= NK_LP query_expression NK_RP */ + { 427, -3 }, /* (527) subquery ::= NK_LP subquery NK_RP */ + { 430, -1 }, /* (528) search_condition ::= common_expression */ + { 453, -1 }, /* (529) sort_specification_list ::= sort_specification */ + { 453, -3 }, /* (530) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 454, -3 }, /* (531) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 455, 0 }, /* (532) ordering_specification_opt ::= */ + { 455, -1 }, /* (533) ordering_specification_opt ::= ASC */ + { 455, -1 }, /* (534) ordering_specification_opt ::= DESC */ + { 456, 0 }, /* (535) null_ordering_opt ::= */ + { 456, -2 }, /* (536) null_ordering_opt ::= NULLS FIRST */ + { 456, -2 }, /* (537) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3676,7 +3717,7 @@ static YYACTIONTYPE yy_reduce( yymsp[-2].minor.yy199 = yylhsminor.yy199; break; case 42: /* priv_level ::= topic_name */ - case 456: /* alias_opt ::= table_alias */ yytestcase(yyruleno==456); + case 455: /* alias_opt ::= table_alias */ yytestcase(yyruleno==455); { yylhsminor.yy199 = yymsp[0].minor.yy199; } yymsp[0].minor.yy199 = yylhsminor.yy199; break; @@ -3707,44 +3748,44 @@ static YYACTIONTYPE yy_reduce( case 51: /* dnode_endpoint ::= NK_STRING */ case 52: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==52); case 53: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==53); - case 343: /* db_name ::= NK_ID */ yytestcase(yyruleno==343); - case 344: /* table_name ::= NK_ID */ yytestcase(yyruleno==344); - case 345: /* column_name ::= NK_ID */ yytestcase(yyruleno==345); - case 346: /* function_name ::= NK_ID */ yytestcase(yyruleno==346); - case 347: /* table_alias ::= NK_ID */ yytestcase(yyruleno==347); - case 348: /* column_alias ::= NK_ID */ yytestcase(yyruleno==348); - case 349: /* user_name ::= NK_ID */ yytestcase(yyruleno==349); - case 350: /* topic_name ::= NK_ID */ yytestcase(yyruleno==350); - case 351: /* stream_name ::= NK_ID */ yytestcase(yyruleno==351); - case 352: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==352); - case 391: /* noarg_func ::= NOW */ yytestcase(yyruleno==391); - case 392: /* noarg_func ::= TODAY */ yytestcase(yyruleno==392); - case 393: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==393); - case 394: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==394); - case 395: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==395); - case 396: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==396); - case 397: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==397); - case 398: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==398); - case 399: /* noarg_func ::= USER */ yytestcase(yyruleno==399); - case 400: /* star_func ::= COUNT */ yytestcase(yyruleno==400); - case 401: /* star_func ::= FIRST */ yytestcase(yyruleno==401); - case 402: /* star_func ::= LAST */ yytestcase(yyruleno==402); - case 403: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==403); + case 342: /* db_name ::= NK_ID */ yytestcase(yyruleno==342); + case 343: /* table_name ::= NK_ID */ yytestcase(yyruleno==343); + case 344: /* column_name ::= NK_ID */ yytestcase(yyruleno==344); + case 345: /* function_name ::= NK_ID */ yytestcase(yyruleno==345); + case 346: /* table_alias ::= NK_ID */ yytestcase(yyruleno==346); + case 347: /* column_alias ::= NK_ID */ yytestcase(yyruleno==347); + case 348: /* user_name ::= NK_ID */ yytestcase(yyruleno==348); + case 349: /* topic_name ::= NK_ID */ yytestcase(yyruleno==349); + case 350: /* stream_name ::= NK_ID */ yytestcase(yyruleno==350); + case 351: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==351); + case 390: /* noarg_func ::= NOW */ yytestcase(yyruleno==390); + case 391: /* noarg_func ::= TODAY */ yytestcase(yyruleno==391); + case 392: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==392); + case 393: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==393); + case 394: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==394); + case 395: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==395); + case 396: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==396); + case 397: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==397); + case 398: /* noarg_func ::= USER */ yytestcase(yyruleno==398); + case 399: /* star_func ::= COUNT */ yytestcase(yyruleno==399); + case 400: /* star_func ::= FIRST */ yytestcase(yyruleno==400); + case 401: /* star_func ::= LAST */ yytestcase(yyruleno==401); + case 402: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==402); { yylhsminor.yy199 = yymsp[0].minor.yy0; } yymsp[0].minor.yy199 = yylhsminor.yy199; break; case 54: /* force_opt ::= */ case 73: /* not_exists_opt ::= */ yytestcase(yyruleno==73); case 75: /* exists_opt ::= */ yytestcase(yyruleno==75); - case 283: /* analyze_opt ::= */ yytestcase(yyruleno==283); - case 290: /* agg_func_opt ::= */ yytestcase(yyruleno==290); - case 464: /* set_quantifier_opt ::= */ yytestcase(yyruleno==464); + case 282: /* analyze_opt ::= */ yytestcase(yyruleno==282); + case 289: /* agg_func_opt ::= */ yytestcase(yyruleno==289); + case 463: /* set_quantifier_opt ::= */ yytestcase(yyruleno==463); { yymsp[1].minor.yy397 = false; } break; case 55: /* force_opt ::= FORCE */ - case 284: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==284); - case 291: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==291); - case 465: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==465); + case 283: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==283); + case 290: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==290); + case 464: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==464); { yymsp[0].minor.yy397 = true; } break; case 56: /* cmd ::= ALTER LOCAL NK_STRING */ @@ -3858,39 +3899,35 @@ static YYACTIONTYPE yy_reduce( { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 92: /* db_options ::= db_options STRICT NK_STRING */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; - break; - case 93: /* db_options ::= db_options VGROUPS NK_INTEGER */ + case 92: /* db_options ::= db_options VGROUPS NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 94: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + case 93: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 95: /* db_options ::= db_options RETENTIONS retention_list */ + case 94: /* db_options ::= db_options RETENTIONS retention_list */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_RETENTIONS, yymsp[0].minor.yy404); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 96: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ + case 95: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 97: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ + case 96: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 98: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + case 97: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + case 98: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 100: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; @@ -3898,11 +3935,11 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + case 100: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 102: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; @@ -3910,732 +3947,732 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 103: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + case 102: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 104: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + case 103: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 105: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ + case 104: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 106: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ + case 105: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 107: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ + case 106: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ { yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 108: /* alter_db_options ::= alter_db_option */ + case 107: /* alter_db_options ::= alter_db_option */ { yylhsminor.yy148 = createAlterDatabaseOptions(pCxt); yylhsminor.yy148 = setAlterDatabaseOption(pCxt, yylhsminor.yy148, &yymsp[0].minor.yy123); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 109: /* alter_db_options ::= alter_db_options alter_db_option */ + case 108: /* alter_db_options ::= alter_db_options alter_db_option */ { yylhsminor.yy148 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy148, &yymsp[0].minor.yy123); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 110: /* alter_db_option ::= BUFFER NK_INTEGER */ + case 109: /* alter_db_option ::= BUFFER NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 111: /* alter_db_option ::= CACHEMODEL NK_STRING */ + case 110: /* alter_db_option ::= CACHEMODEL NK_STRING */ { yymsp[-1].minor.yy123.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 112: /* alter_db_option ::= CACHESIZE NK_INTEGER */ + case 111: /* alter_db_option ::= CACHESIZE NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 113: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + case 112: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 114: /* alter_db_option ::= KEEP integer_list */ - case 115: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==115); + case 113: /* alter_db_option ::= KEEP integer_list */ + case 114: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==114); { yymsp[-1].minor.yy123.type = DB_OPTION_KEEP; yymsp[-1].minor.yy123.pList = yymsp[0].minor.yy404; } break; - case 116: /* alter_db_option ::= PAGES NK_INTEGER */ + case 115: /* alter_db_option ::= PAGES NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_PAGES; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 117: /* alter_db_option ::= REPLICA NK_INTEGER */ + case 116: /* alter_db_option ::= REPLICA NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 118: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ + case 117: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_WAL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 119: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ + case 118: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ { yymsp[-1].minor.yy123.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 120: /* integer_list ::= NK_INTEGER */ + case 119: /* integer_list ::= NK_INTEGER */ { yylhsminor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 121: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 313: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==313); + case 120: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 312: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==312); { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 122: /* variable_list ::= NK_VARIABLE */ + case 121: /* variable_list ::= NK_VARIABLE */ { yylhsminor.yy404 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 123: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + case 122: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 124: /* retention_list ::= retention */ - case 146: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==146); - case 149: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==149); - case 156: /* column_def_list ::= column_def */ yytestcase(yyruleno==156); - case 200: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==200); - case 205: /* col_name_list ::= col_name */ yytestcase(yyruleno==205); - case 254: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==254); - case 265: /* func_list ::= func */ yytestcase(yyruleno==265); - case 341: /* literal_list ::= signed_literal */ yytestcase(yyruleno==341); - case 406: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==406); - case 412: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==412); - case 467: /* select_list ::= select_item */ yytestcase(yyruleno==467); - case 478: /* partition_list ::= partition_item */ yytestcase(yyruleno==478); - case 530: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==530); + case 123: /* retention_list ::= retention */ + case 145: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==145); + case 148: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==148); + case 155: /* column_def_list ::= column_def */ yytestcase(yyruleno==155); + case 199: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==199); + case 204: /* col_name_list ::= col_name */ yytestcase(yyruleno==204); + case 253: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==253); + case 264: /* func_list ::= func */ yytestcase(yyruleno==264); + case 340: /* literal_list ::= signed_literal */ yytestcase(yyruleno==340); + case 405: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==405); + case 411: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==411); + case 466: /* select_list ::= select_item */ yytestcase(yyruleno==466); + case 477: /* partition_list ::= partition_item */ yytestcase(yyruleno==477); + case 529: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==529); { yylhsminor.yy404 = createNodeList(pCxt, yymsp[0].minor.yy148); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 125: /* retention_list ::= retention_list NK_COMMA retention */ - case 157: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==157); - case 201: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==201); - case 206: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==206); - case 255: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==255); - case 266: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==266); - case 342: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==342); - case 407: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==407); - case 468: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==468); - case 479: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==479); - case 531: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==531); + case 124: /* retention_list ::= retention_list NK_COMMA retention */ + case 156: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==156); + case 200: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==200); + case 205: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==205); + case 254: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==254); + case 265: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==265); + case 341: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==341); + case 406: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==406); + case 467: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==467); + case 478: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==478); + case 530: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==530); { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 126: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + case 125: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ { yylhsminor.yy148 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 127: /* speed_opt ::= */ - case 292: /* bufsize_opt ::= */ yytestcase(yyruleno==292); + case 126: /* speed_opt ::= */ + case 291: /* bufsize_opt ::= */ yytestcase(yyruleno==291); { yymsp[1].minor.yy706 = 0; } break; - case 128: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 293: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==293); + case 127: /* speed_opt ::= MAX_SPEED NK_INTEGER */ + case 292: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==292); { yymsp[-1].minor.yy706 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 129: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 131: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==131); + case 128: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 130: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==130); { pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-5].minor.yy148, yymsp[-3].minor.yy404, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } break; - case 130: /* cmd ::= CREATE TABLE multi_create_clause */ + case 129: /* cmd ::= CREATE TABLE multi_create_clause */ { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy404); } break; - case 132: /* cmd ::= DROP TABLE multi_drop_clause */ + case 131: /* cmd ::= DROP TABLE multi_drop_clause */ { pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy404); } break; - case 133: /* cmd ::= DROP STABLE exists_opt full_table_name */ + case 132: /* cmd ::= DROP STABLE exists_opt full_table_name */ { pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } break; - case 134: /* cmd ::= ALTER TABLE alter_table_clause */ - case 315: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==315); + case 133: /* cmd ::= ALTER TABLE alter_table_clause */ + case 314: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==314); { pCxt->pRootNode = yymsp[0].minor.yy148; } break; - case 135: /* cmd ::= ALTER STABLE alter_table_clause */ + case 134: /* cmd ::= ALTER STABLE alter_table_clause */ { pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy148); } break; - case 136: /* alter_table_clause ::= full_table_name alter_table_options */ + case 135: /* alter_table_clause ::= full_table_name alter_table_options */ { yylhsminor.yy148 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 137: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + case 136: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ { yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 138: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ + case 137: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ { yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy199); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 139: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + case 138: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ { yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 140: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + case 139: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ { yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 141: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + case 140: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ { yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 142: /* alter_table_clause ::= full_table_name DROP TAG column_name */ + case 141: /* alter_table_clause ::= full_table_name DROP TAG column_name */ { yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy199); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 143: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + case 142: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ { yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 144: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + case 143: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ { yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 145: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + case 144: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ { yylhsminor.yy148 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy148, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 147: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 150: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==150); - case 413: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==413); + case 146: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 149: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==149); + case 412: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==412); { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } yymsp[-1].minor.yy404 = yylhsminor.yy404; break; - case 148: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + case 147: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ { yylhsminor.yy148 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy397, yymsp[-8].minor.yy148, yymsp[-6].minor.yy148, yymsp[-5].minor.yy404, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } yymsp[-9].minor.yy148 = yylhsminor.yy148; break; - case 151: /* drop_table_clause ::= exists_opt full_table_name */ + case 150: /* drop_table_clause ::= exists_opt full_table_name */ { yylhsminor.yy148 = createDropTableClause(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 152: /* specific_cols_opt ::= */ - case 183: /* tags_def_opt ::= */ yytestcase(yyruleno==183); - case 253: /* tag_list_opt ::= */ yytestcase(yyruleno==253); - case 476: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==476); - case 498: /* group_by_clause_opt ::= */ yytestcase(yyruleno==498); - case 517: /* order_by_clause_opt ::= */ yytestcase(yyruleno==517); + case 151: /* specific_cols_opt ::= */ + case 182: /* tags_def_opt ::= */ yytestcase(yyruleno==182); + case 252: /* tag_list_opt ::= */ yytestcase(yyruleno==252); + case 475: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==475); + case 497: /* group_by_clause_opt ::= */ yytestcase(yyruleno==497); + case 516: /* order_by_clause_opt ::= */ yytestcase(yyruleno==516); { yymsp[1].minor.yy404 = NULL; } break; - case 153: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ + case 152: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ { yymsp[-2].minor.yy404 = yymsp[-1].minor.yy404; } break; - case 154: /* full_table_name ::= table_name */ + case 153: /* full_table_name ::= table_name */ { yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy199, NULL); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 155: /* full_table_name ::= db_name NK_DOT table_name */ + case 154: /* full_table_name ::= db_name NK_DOT table_name */ { yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, NULL); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 158: /* column_def ::= column_name type_name */ + case 157: /* column_def ::= column_name type_name */ { yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530, NULL); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 159: /* column_def ::= column_name type_name COMMENT NK_STRING */ + case 158: /* column_def ::= column_name type_name COMMENT NK_STRING */ { yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-2].minor.yy530, &yymsp[0].minor.yy0); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 160: /* type_name ::= BOOL */ + case 159: /* type_name ::= BOOL */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 161: /* type_name ::= TINYINT */ + case 160: /* type_name ::= TINYINT */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 162: /* type_name ::= SMALLINT */ + case 161: /* type_name ::= SMALLINT */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 163: /* type_name ::= INT */ - case 164: /* type_name ::= INTEGER */ yytestcase(yyruleno==164); + case 162: /* type_name ::= INT */ + case 163: /* type_name ::= INTEGER */ yytestcase(yyruleno==163); { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 165: /* type_name ::= BIGINT */ + case 164: /* type_name ::= BIGINT */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 166: /* type_name ::= FLOAT */ + case 165: /* type_name ::= FLOAT */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 167: /* type_name ::= DOUBLE */ + case 166: /* type_name ::= DOUBLE */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 168: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + case 167: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 169: /* type_name ::= TIMESTAMP */ + case 168: /* type_name ::= TIMESTAMP */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 170: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + case 169: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 171: /* type_name ::= TINYINT UNSIGNED */ + case 170: /* type_name ::= TINYINT UNSIGNED */ { yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 172: /* type_name ::= SMALLINT UNSIGNED */ + case 171: /* type_name ::= SMALLINT UNSIGNED */ { yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 173: /* type_name ::= INT UNSIGNED */ + case 172: /* type_name ::= INT UNSIGNED */ { yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 174: /* type_name ::= BIGINT UNSIGNED */ + case 173: /* type_name ::= BIGINT UNSIGNED */ { yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 175: /* type_name ::= JSON */ + case 174: /* type_name ::= JSON */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 176: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + case 175: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 177: /* type_name ::= MEDIUMBLOB */ + case 176: /* type_name ::= MEDIUMBLOB */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 178: /* type_name ::= BLOB */ + case 177: /* type_name ::= BLOB */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 179: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + case 178: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 180: /* type_name ::= DECIMAL */ + case 179: /* type_name ::= DECIMAL */ { yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + case 180: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ { yymsp[-5].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 184: /* tags_def_opt ::= tags_def */ - case 405: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==405); + case 183: /* tags_def_opt ::= tags_def */ + case 404: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==404); { yylhsminor.yy404 = yymsp[0].minor.yy404; } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 185: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ + case 184: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ { yymsp[-3].minor.yy404 = yymsp[-1].minor.yy404; } break; - case 186: /* table_options ::= */ + case 185: /* table_options ::= */ { yymsp[1].minor.yy148 = createDefaultTableOptions(pCxt); } break; - case 187: /* table_options ::= table_options COMMENT NK_STRING */ + case 186: /* table_options ::= table_options COMMENT NK_STRING */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 188: /* table_options ::= table_options MAX_DELAY duration_list */ + case 187: /* table_options ::= table_options MAX_DELAY duration_list */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy404); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 189: /* table_options ::= table_options WATERMARK duration_list */ + case 188: /* table_options ::= table_options WATERMARK duration_list */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy404); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 190: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + case 189: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy404); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 191: /* table_options ::= table_options TTL NK_INTEGER */ + case 190: /* table_options ::= table_options TTL NK_INTEGER */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 192: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + case 191: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_SMA, yymsp[-1].minor.yy404); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 193: /* table_options ::= table_options DELETE_MARK duration_list */ + case 192: /* table_options ::= table_options DELETE_MARK duration_list */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy404); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 194: /* alter_table_options ::= alter_table_option */ + case 193: /* alter_table_options ::= alter_table_option */ { yylhsminor.yy148 = createAlterTableOptions(pCxt); yylhsminor.yy148 = setTableOption(pCxt, yylhsminor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 195: /* alter_table_options ::= alter_table_options alter_table_option */ + case 194: /* alter_table_options ::= alter_table_options alter_table_option */ { yylhsminor.yy148 = setTableOption(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 196: /* alter_table_option ::= COMMENT NK_STRING */ + case 195: /* alter_table_option ::= COMMENT NK_STRING */ { yymsp[-1].minor.yy123.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 197: /* alter_table_option ::= TTL NK_INTEGER */ + case 196: /* alter_table_option ::= TTL NK_INTEGER */ { yymsp[-1].minor.yy123.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 198: /* duration_list ::= duration_literal */ - case 370: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==370); + case 197: /* duration_list ::= duration_literal */ + case 369: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==369); { yylhsminor.yy404 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 199: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 371: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==371); + case 198: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 370: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==370); { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 202: /* rollup_func_name ::= function_name */ + case 201: /* rollup_func_name ::= function_name */ { yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy199, NULL); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 203: /* rollup_func_name ::= FIRST */ - case 204: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==204); - case 257: /* tag_item ::= QTAGS */ yytestcase(yyruleno==257); + case 202: /* rollup_func_name ::= FIRST */ + case 203: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==203); + case 256: /* tag_item ::= QTAGS */ yytestcase(yyruleno==256); { yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 207: /* col_name ::= column_name */ - case 258: /* tag_item ::= column_name */ yytestcase(yyruleno==258); + case 206: /* col_name ::= column_name */ + case 257: /* tag_item ::= column_name */ yytestcase(yyruleno==257); { yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 208: /* cmd ::= SHOW DNODES */ + case 207: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 209: /* cmd ::= SHOW USERS */ + case 208: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 210: /* cmd ::= SHOW USER PRIVILEGES */ + case 209: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 211: /* cmd ::= SHOW DATABASES */ + case 210: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 212: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + case 211: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } break; - case 213: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + case 212: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } break; - case 214: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ + case 213: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy148, NULL, OP_TYPE_LIKE); } break; - case 215: /* cmd ::= SHOW MNODES */ + case 214: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 216: /* cmd ::= SHOW QNODES */ + case 215: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 217: /* cmd ::= SHOW FUNCTIONS */ + case 216: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 218: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + case 217: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } break; - case 219: /* cmd ::= SHOW STREAMS */ + case 218: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 220: /* cmd ::= SHOW ACCOUNTS */ + case 219: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 221: /* cmd ::= SHOW APPS */ + case 220: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 222: /* cmd ::= SHOW CONNECTIONS */ + case 221: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 223: /* cmd ::= SHOW LICENCES */ - case 224: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==224); + case 222: /* cmd ::= SHOW LICENCES */ + case 223: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==223); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 225: /* cmd ::= SHOW CREATE DATABASE db_name */ + case 224: /* cmd ::= SHOW CREATE DATABASE db_name */ { pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } break; - case 226: /* cmd ::= SHOW CREATE TABLE full_table_name */ + case 225: /* cmd ::= SHOW CREATE TABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy148); } break; - case 227: /* cmd ::= SHOW CREATE STABLE full_table_name */ + case 226: /* cmd ::= SHOW CREATE STABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy148); } break; - case 228: /* cmd ::= SHOW QUERIES */ + case 227: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 229: /* cmd ::= SHOW SCORES */ + case 228: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 230: /* cmd ::= SHOW TOPICS */ + case 229: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 231: /* cmd ::= SHOW VARIABLES */ - case 232: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==232); + case 230: /* cmd ::= SHOW VARIABLES */ + case 231: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==231); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 233: /* cmd ::= SHOW LOCAL VARIABLES */ + case 232: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 234: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + case 233: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ { pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy148); } break; - case 235: /* cmd ::= SHOW BNODES */ + case 234: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 236: /* cmd ::= SHOW SNODES */ + case 235: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 237: /* cmd ::= SHOW CLUSTER */ + case 236: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 238: /* cmd ::= SHOW TRANSACTIONS */ + case 237: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 239: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + case 238: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ { pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy148); } break; - case 240: /* cmd ::= SHOW CONSUMERS */ + case 239: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 241: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 240: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 242: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + case 241: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } break; - case 243: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + case 242: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148, yymsp[-3].minor.yy404); } break; - case 244: /* cmd ::= SHOW VNODES NK_INTEGER */ + case 243: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 245: /* cmd ::= SHOW VNODES NK_STRING */ + case 244: /* cmd ::= SHOW VNODES NK_STRING */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 246: /* db_name_cond_opt ::= */ - case 251: /* from_db_opt ::= */ yytestcase(yyruleno==251); + case 245: /* db_name_cond_opt ::= */ + case 250: /* from_db_opt ::= */ yytestcase(yyruleno==250); { yymsp[1].minor.yy148 = createDefaultDatabaseCondValue(pCxt); } break; - case 247: /* db_name_cond_opt ::= db_name NK_DOT */ + case 246: /* db_name_cond_opt ::= db_name NK_DOT */ { yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 248: /* like_pattern_opt ::= */ - case 303: /* subtable_opt ::= */ yytestcase(yyruleno==303); - case 415: /* case_when_else_opt ::= */ yytestcase(yyruleno==415); - case 445: /* from_clause_opt ::= */ yytestcase(yyruleno==445); - case 474: /* where_clause_opt ::= */ yytestcase(yyruleno==474); - case 483: /* twindow_clause_opt ::= */ yytestcase(yyruleno==483); - case 488: /* sliding_opt ::= */ yytestcase(yyruleno==488); - case 490: /* fill_opt ::= */ yytestcase(yyruleno==490); - case 502: /* having_clause_opt ::= */ yytestcase(yyruleno==502); - case 504: /* range_opt ::= */ yytestcase(yyruleno==504); - case 506: /* every_opt ::= */ yytestcase(yyruleno==506); - case 519: /* slimit_clause_opt ::= */ yytestcase(yyruleno==519); - case 523: /* limit_clause_opt ::= */ yytestcase(yyruleno==523); + case 247: /* like_pattern_opt ::= */ + case 302: /* subtable_opt ::= */ yytestcase(yyruleno==302); + case 414: /* case_when_else_opt ::= */ yytestcase(yyruleno==414); + case 444: /* from_clause_opt ::= */ yytestcase(yyruleno==444); + case 473: /* where_clause_opt ::= */ yytestcase(yyruleno==473); + case 482: /* twindow_clause_opt ::= */ yytestcase(yyruleno==482); + case 487: /* sliding_opt ::= */ yytestcase(yyruleno==487); + case 489: /* fill_opt ::= */ yytestcase(yyruleno==489); + case 501: /* having_clause_opt ::= */ yytestcase(yyruleno==501); + case 503: /* range_opt ::= */ yytestcase(yyruleno==503); + case 505: /* every_opt ::= */ yytestcase(yyruleno==505); + case 518: /* slimit_clause_opt ::= */ yytestcase(yyruleno==518); + case 522: /* limit_clause_opt ::= */ yytestcase(yyruleno==522); { yymsp[1].minor.yy148 = NULL; } break; - case 249: /* like_pattern_opt ::= LIKE NK_STRING */ + case 248: /* like_pattern_opt ::= LIKE NK_STRING */ { yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 250: /* table_name_cond ::= table_name */ + case 249: /* table_name_cond ::= table_name */ { yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 252: /* from_db_opt ::= FROM db_name */ + case 251: /* from_db_opt ::= FROM db_name */ { yymsp[-1].minor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } break; - case 256: /* tag_item ::= TBNAME */ + case 255: /* tag_item ::= TBNAME */ { yylhsminor.yy148 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 259: /* tag_item ::= column_name column_alias */ + case 258: /* tag_item ::= column_name column_alias */ { yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy199), &yymsp[0].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 260: /* tag_item ::= column_name AS column_alias */ + case 259: /* tag_item ::= column_name AS column_alias */ { yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy199), &yymsp[0].minor.yy199); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 261: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + case 260: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy397, yymsp[-3].minor.yy148, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } break; - case 262: /* cmd ::= DROP INDEX exists_opt full_table_name */ + case 261: /* cmd ::= DROP INDEX exists_opt full_table_name */ { pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } break; - case 263: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + case 262: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ { yymsp[-9].minor.yy148 = createIndexOption(pCxt, yymsp[-7].minor.yy404, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + case 263: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ { yymsp[-11].minor.yy148 = createIndexOption(pCxt, yymsp[-9].minor.yy404, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 267: /* func ::= function_name NK_LP expression_list NK_RP */ + case 266: /* func ::= function_name NK_LP expression_list NK_RP */ { yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 268: /* sma_stream_opt ::= */ - case 296: /* stream_options ::= */ yytestcase(yyruleno==296); + case 267: /* sma_stream_opt ::= */ + case 295: /* stream_options ::= */ yytestcase(yyruleno==295); { yymsp[1].minor.yy148 = createStreamOptions(pCxt); } break; - case 269: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - case 300: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==300); + case 268: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + case 299: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==299); { ((SStreamOptions*)yymsp[-2].minor.yy148)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 270: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + case 269: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 271: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + case 270: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 272: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + case 271: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ { pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } break; - case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + case 272: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy199, false); } break; - case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[0].minor.yy199, true); } break; - case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, yymsp[0].minor.yy148, false); } break; - case 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, yymsp[0].minor.yy148, true); } break; - case 277: /* cmd ::= DROP TOPIC exists_opt topic_name */ + case 276: /* cmd ::= DROP TOPIC exists_opt topic_name */ { pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 278: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + case 277: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ { pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } break; - case 279: /* cmd ::= DESC full_table_name */ - case 280: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==280); + case 278: /* cmd ::= DESC full_table_name */ + case 279: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==279); { pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy148); } break; - case 281: /* cmd ::= RESET QUERY CACHE */ + case 280: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 282: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 281: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ { pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy397, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 285: /* explain_options ::= */ + case 284: /* explain_options ::= */ { yymsp[1].minor.yy148 = createDefaultExplainOptions(pCxt); } break; - case 286: /* explain_options ::= explain_options VERBOSE NK_BOOL */ + case 285: /* explain_options ::= explain_options VERBOSE NK_BOOL */ { yylhsminor.yy148 = setExplainVerbose(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 287: /* explain_options ::= explain_options RATIO NK_FLOAT */ + case 286: /* explain_options ::= explain_options RATIO NK_FLOAT */ { yylhsminor.yy148 = setExplainRatio(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 288: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + case 287: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ { pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-8].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy530, yymsp[0].minor.yy706); } break; - case 289: /* cmd ::= DROP FUNCTION exists_opt function_name */ + case 288: /* cmd ::= DROP FUNCTION exists_opt function_name */ { pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 294: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + case 293: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ { pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy397, &yymsp[-7].minor.yy199, yymsp[-4].minor.yy148, yymsp[-6].minor.yy148, yymsp[-3].minor.yy404, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } break; - case 295: /* cmd ::= DROP STREAM exists_opt stream_name */ + case 294: /* cmd ::= DROP STREAM exists_opt stream_name */ { pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 297: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 296: /* stream_options ::= stream_options TRIGGER AT_ONCE */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 298: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + case 297: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 299: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + case 298: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ { ((SStreamOptions*)yymsp[-3].minor.yy148)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-3].minor.yy148; } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 301: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + case 300: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ { ((SStreamOptions*)yymsp[-3].minor.yy148)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-3].minor.yy148; } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 302: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + case 301: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ { ((SStreamOptions*)yymsp[-2].minor.yy148)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-2].minor.yy148; } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 304: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 489: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==489); - case 507: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==507); + case 303: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 488: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==488); + case 506: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==506); { yymsp[-3].minor.yy148 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy148); } break; - case 305: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 304: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 306: /* cmd ::= KILL QUERY NK_STRING */ + case 305: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 307: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 306: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 308: /* cmd ::= BALANCE VGROUP */ + case 307: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 309: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 308: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 310: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + case 309: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ { pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy404); } break; - case 311: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 310: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 312: /* dnode_list ::= DNODE NK_INTEGER */ + case 311: /* dnode_list ::= DNODE NK_INTEGER */ { yymsp[-1].minor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 314: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ + case 313: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ { pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 316: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + case 315: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ { pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy148, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } break; - case 317: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ + case 316: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ { pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } break; - case 318: /* literal ::= NK_INTEGER */ + case 317: /* literal ::= NK_INTEGER */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 319: /* literal ::= NK_FLOAT */ + case 318: /* literal ::= NK_FLOAT */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 320: /* literal ::= NK_STRING */ + case 319: /* literal ::= NK_STRING */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 321: /* literal ::= NK_BOOL */ + case 320: /* literal ::= NK_BOOL */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 322: /* literal ::= TIMESTAMP NK_STRING */ + case 321: /* literal ::= TIMESTAMP NK_STRING */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 323: /* literal ::= duration_literal */ - case 333: /* signed_literal ::= signed */ yytestcase(yyruleno==333); - case 353: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==353); - case 354: /* expression ::= literal */ yytestcase(yyruleno==354); - case 355: /* expression ::= pseudo_column */ yytestcase(yyruleno==355); - case 356: /* expression ::= column_reference */ yytestcase(yyruleno==356); - case 357: /* expression ::= function_expression */ yytestcase(yyruleno==357); - case 358: /* expression ::= case_when_expression */ yytestcase(yyruleno==358); - case 388: /* function_expression ::= literal_func */ yytestcase(yyruleno==388); - case 437: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==437); - case 441: /* boolean_primary ::= predicate */ yytestcase(yyruleno==441); - case 443: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==443); - case 444: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==444); - case 447: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==447); - case 449: /* table_reference ::= table_primary */ yytestcase(yyruleno==449); - case 450: /* table_reference ::= joined_table */ yytestcase(yyruleno==450); - case 454: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==454); - case 509: /* query_simple ::= query_specification */ yytestcase(yyruleno==509); - case 510: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==510); - case 513: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==513); - case 515: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==515); + case 322: /* literal ::= duration_literal */ + case 332: /* signed_literal ::= signed */ yytestcase(yyruleno==332); + case 352: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==352); + case 353: /* expression ::= literal */ yytestcase(yyruleno==353); + case 354: /* expression ::= pseudo_column */ yytestcase(yyruleno==354); + case 355: /* expression ::= column_reference */ yytestcase(yyruleno==355); + case 356: /* expression ::= function_expression */ yytestcase(yyruleno==356); + case 357: /* expression ::= case_when_expression */ yytestcase(yyruleno==357); + case 387: /* function_expression ::= literal_func */ yytestcase(yyruleno==387); + case 436: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==436); + case 440: /* boolean_primary ::= predicate */ yytestcase(yyruleno==440); + case 442: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==442); + case 443: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==443); + case 446: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==446); + case 448: /* table_reference ::= table_primary */ yytestcase(yyruleno==448); + case 449: /* table_reference ::= joined_table */ yytestcase(yyruleno==449); + case 453: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==453); + case 508: /* query_simple ::= query_specification */ yytestcase(yyruleno==508); + case 509: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==509); + case 512: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==512); + case 514: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==514); { yylhsminor.yy148 = yymsp[0].minor.yy148; } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 324: /* literal ::= NULL */ + case 323: /* literal ::= NULL */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 325: /* literal ::= NK_QUESTION */ + case 324: /* literal ::= NK_QUESTION */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 326: /* duration_literal ::= NK_VARIABLE */ + case 325: /* duration_literal ::= NK_VARIABLE */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 327: /* signed ::= NK_INTEGER */ + case 326: /* signed ::= NK_INTEGER */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 328: /* signed ::= NK_PLUS NK_INTEGER */ + case 327: /* signed ::= NK_PLUS NK_INTEGER */ { yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 329: /* signed ::= NK_MINUS NK_INTEGER */ + case 328: /* 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; @@ -4643,14 +4680,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 330: /* signed ::= NK_FLOAT */ + case 329: /* signed ::= NK_FLOAT */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 331: /* signed ::= NK_PLUS NK_FLOAT */ + case 330: /* signed ::= NK_PLUS NK_FLOAT */ { yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 332: /* signed ::= NK_MINUS NK_FLOAT */ + case 331: /* 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; @@ -4658,57 +4695,57 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 334: /* signed_literal ::= NK_STRING */ + case 333: /* signed_literal ::= NK_STRING */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 335: /* signed_literal ::= NK_BOOL */ + case 334: /* signed_literal ::= NK_BOOL */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 336: /* signed_literal ::= TIMESTAMP NK_STRING */ + case 335: /* signed_literal ::= TIMESTAMP NK_STRING */ { yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 337: /* signed_literal ::= duration_literal */ - case 339: /* signed_literal ::= literal_func */ yytestcase(yyruleno==339); - case 408: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==408); - case 470: /* select_item ::= common_expression */ yytestcase(yyruleno==470); - case 480: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==480); - case 514: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==514); - case 516: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==516); - case 529: /* search_condition ::= common_expression */ yytestcase(yyruleno==529); + case 336: /* signed_literal ::= duration_literal */ + case 338: /* signed_literal ::= literal_func */ yytestcase(yyruleno==338); + case 407: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==407); + case 469: /* select_item ::= common_expression */ yytestcase(yyruleno==469); + case 479: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==479); + case 513: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==513); + case 515: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==515); + case 528: /* search_condition ::= common_expression */ yytestcase(yyruleno==528); { yylhsminor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 338: /* signed_literal ::= NULL */ + case 337: /* signed_literal ::= NULL */ { yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 340: /* signed_literal ::= NK_QUESTION */ + case 339: /* signed_literal ::= NK_QUESTION */ { yylhsminor.yy148 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 359: /* expression ::= NK_LP expression NK_RP */ - case 442: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==442); - case 528: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==528); + case 358: /* expression ::= NK_LP expression NK_RP */ + case 441: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==441); + case 527: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==527); { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 360: /* expression ::= NK_PLUS expr_or_subquery */ + case 359: /* expression ::= NK_PLUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 361: /* expression ::= NK_MINUS expr_or_subquery */ + case 360: /* expression ::= NK_MINUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 362: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 361: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4716,7 +4753,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 363: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 362: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4724,7 +4761,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 364: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 363: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4732,7 +4769,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 365: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 364: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4740,7 +4777,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 366: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 365: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4748,14 +4785,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 367: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 366: /* expression ::= column_reference NK_ARROW NK_STRING */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 368: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 367: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4763,7 +4800,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 369: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 368: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4771,70 +4808,70 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 372: /* column_reference ::= column_name */ + case 371: /* column_reference ::= column_name */ { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy199, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 373: /* column_reference ::= table_name NK_DOT column_name */ + case 372: /* column_reference ::= table_name NK_DOT column_name */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 374: /* pseudo_column ::= ROWTS */ - case 375: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==375); - case 377: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==377); - case 378: /* pseudo_column ::= QEND */ yytestcase(yyruleno==378); - case 379: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==379); - case 380: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==380); - case 381: /* pseudo_column ::= WEND */ yytestcase(yyruleno==381); - case 382: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==382); - case 383: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==383); - case 384: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==384); - case 390: /* literal_func ::= NOW */ yytestcase(yyruleno==390); + case 373: /* pseudo_column ::= ROWTS */ + case 374: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==374); + case 376: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==376); + case 377: /* pseudo_column ::= QEND */ yytestcase(yyruleno==377); + case 378: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==378); + case 379: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==379); + case 380: /* pseudo_column ::= WEND */ yytestcase(yyruleno==380); + case 381: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==381); + case 382: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==382); + case 383: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==383); + case 389: /* literal_func ::= NOW */ yytestcase(yyruleno==389); { yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 376: /* pseudo_column ::= table_name NK_DOT TBNAME */ + case 375: /* pseudo_column ::= table_name NK_DOT TBNAME */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy199)))); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 385: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 386: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==386); + case 384: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 385: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==385); { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404)); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 387: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + case 386: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy530)); } yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 389: /* literal_func ::= noarg_func NK_LP NK_RP */ + case 388: /* literal_func ::= noarg_func NK_LP NK_RP */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy199, NULL)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 404: /* star_func_para_list ::= NK_STAR */ + case 403: /* star_func_para_list ::= NK_STAR */ { yylhsminor.yy404 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 409: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 473: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==473); + case 408: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 472: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==472); { yylhsminor.yy148 = createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 410: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ + case 409: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 411: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + case 410: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 414: /* when_then_expr ::= WHEN common_expression THEN common_expression */ + case 413: /* when_then_expr ::= WHEN common_expression THEN common_expression */ { yymsp[-3].minor.yy148 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } break; - case 416: /* case_when_else_opt ::= ELSE common_expression */ + case 415: /* case_when_else_opt ::= ELSE common_expression */ { yymsp[-1].minor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } break; - case 417: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 422: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==422); + case 416: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 421: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==421); { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4842,7 +4879,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 418: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 417: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4850,7 +4887,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 419: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 418: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4858,71 +4895,71 @@ static YYACTIONTYPE yy_reduce( } yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 420: /* predicate ::= expr_or_subquery IS NULL */ + case 419: /* predicate ::= expr_or_subquery IS NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), NULL)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 421: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 420: /* predicate ::= expr_or_subquery IS NOT NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL)); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 423: /* compare_op ::= NK_LT */ + case 422: /* compare_op ::= NK_LT */ { yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; } break; - case 424: /* compare_op ::= NK_GT */ + case 423: /* compare_op ::= NK_GT */ { yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; } break; - case 425: /* compare_op ::= NK_LE */ + case 424: /* compare_op ::= NK_LE */ { yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; } break; - case 426: /* compare_op ::= NK_GE */ + case 425: /* compare_op ::= NK_GE */ { yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; } break; - case 427: /* compare_op ::= NK_NE */ + case 426: /* compare_op ::= NK_NE */ { yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; } break; - case 428: /* compare_op ::= NK_EQ */ + case 427: /* compare_op ::= NK_EQ */ { yymsp[0].minor.yy20 = OP_TYPE_EQUAL; } break; - case 429: /* compare_op ::= LIKE */ + case 428: /* compare_op ::= LIKE */ { yymsp[0].minor.yy20 = OP_TYPE_LIKE; } break; - case 430: /* compare_op ::= NOT LIKE */ + case 429: /* compare_op ::= NOT LIKE */ { yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; } break; - case 431: /* compare_op ::= MATCH */ + case 430: /* compare_op ::= MATCH */ { yymsp[0].minor.yy20 = OP_TYPE_MATCH; } break; - case 432: /* compare_op ::= NMATCH */ + case 431: /* compare_op ::= NMATCH */ { yymsp[0].minor.yy20 = OP_TYPE_NMATCH; } break; - case 433: /* compare_op ::= CONTAINS */ + case 432: /* compare_op ::= CONTAINS */ { yymsp[0].minor.yy20 = OP_TYPE_JSON_CONTAINS; } break; - case 434: /* in_op ::= IN */ + case 433: /* in_op ::= IN */ { yymsp[0].minor.yy20 = OP_TYPE_IN; } break; - case 435: /* in_op ::= NOT IN */ + case 434: /* in_op ::= NOT IN */ { yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; } break; - case 436: /* in_predicate_value ::= NK_LP literal_list NK_RP */ + case 435: /* in_predicate_value ::= NK_LP literal_list NK_RP */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 438: /* boolean_value_expression ::= NOT boolean_primary */ + case 437: /* boolean_value_expression ::= NOT boolean_primary */ { SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 439: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 438: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4930,7 +4967,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 440: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 439: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); @@ -4938,48 +4975,48 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 446: /* from_clause_opt ::= FROM table_reference_list */ - case 475: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==475); - case 503: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==503); + case 445: /* from_clause_opt ::= FROM table_reference_list */ + case 474: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==474); + case 502: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==502); { yymsp[-1].minor.yy148 = yymsp[0].minor.yy148; } break; - case 448: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ + case 447: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ { yylhsminor.yy148 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, NULL); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 451: /* table_primary ::= table_name alias_opt */ + case 450: /* table_primary ::= table_name alias_opt */ { yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 452: /* table_primary ::= db_name NK_DOT table_name alias_opt */ + case 451: /* table_primary ::= db_name NK_DOT table_name alias_opt */ { yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-3].minor.yy199, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 453: /* table_primary ::= subquery alias_opt */ + case 452: /* table_primary ::= subquery alias_opt */ { yylhsminor.yy148 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 455: /* alias_opt ::= */ + case 454: /* alias_opt ::= */ { yymsp[1].minor.yy199 = nil_token; } break; - case 457: /* alias_opt ::= AS table_alias */ + case 456: /* alias_opt ::= AS table_alias */ { yymsp[-1].minor.yy199 = yymsp[0].minor.yy199; } break; - case 458: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 459: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==459); + case 457: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 458: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==458); { yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148; } break; - case 460: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + case 459: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ { yylhsminor.yy148 = createJoinTableNode(pCxt, yymsp[-4].minor.yy470, yymsp[-5].minor.yy148, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 461: /* join_type ::= */ + case 460: /* join_type ::= */ { yymsp[1].minor.yy470 = JOIN_TYPE_INNER; } break; - case 462: /* join_type ::= INNER */ + case 461: /* join_type ::= INNER */ { yymsp[0].minor.yy470 = JOIN_TYPE_INNER; } break; - case 463: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 462: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { yymsp[-11].minor.yy148 = createSelectStmt(pCxt, yymsp[-10].minor.yy397, yymsp[-9].minor.yy404, yymsp[-8].minor.yy148); yymsp[-11].minor.yy148 = addWhereClause(pCxt, yymsp[-11].minor.yy148, yymsp[-7].minor.yy148); @@ -4992,73 +5029,73 @@ static YYACTIONTYPE yy_reduce( yymsp[-11].minor.yy148 = addFillClause(pCxt, yymsp[-11].minor.yy148, yymsp[-3].minor.yy148); } break; - case 466: /* set_quantifier_opt ::= ALL */ + case 465: /* set_quantifier_opt ::= ALL */ { yymsp[0].minor.yy397 = false; } break; - case 469: /* select_item ::= NK_STAR */ + case 468: /* select_item ::= NK_STAR */ { yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 471: /* select_item ::= common_expression column_alias */ - case 481: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==481); + case 470: /* select_item ::= common_expression column_alias */ + case 480: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==480); { yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 472: /* select_item ::= common_expression AS column_alias */ - case 482: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==482); + case 471: /* select_item ::= common_expression AS column_alias */ + case 481: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==481); { yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), &yymsp[0].minor.yy199); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 477: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 499: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==499); - case 518: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==518); + case 476: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 498: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==498); + case 517: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==517); { yymsp[-2].minor.yy404 = yymsp[0].minor.yy404; } break; - case 484: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + case 483: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ { yymsp[-5].minor.yy148 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 485: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + case 484: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ { yymsp[-3].minor.yy148 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 486: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + case 485: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-5].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 487: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + case 486: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-7].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 491: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ + case 490: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ { yymsp[-3].minor.yy148 = createFillNode(pCxt, yymsp[-1].minor.yy334, NULL); } break; - case 492: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + case 491: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ { yymsp[-5].minor.yy148 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } break; - case 493: /* fill_mode ::= NONE */ + case 492: /* fill_mode ::= NONE */ { yymsp[0].minor.yy334 = FILL_MODE_NONE; } break; - case 494: /* fill_mode ::= PREV */ + case 493: /* fill_mode ::= PREV */ { yymsp[0].minor.yy334 = FILL_MODE_PREV; } break; - case 495: /* fill_mode ::= NULL */ + case 494: /* fill_mode ::= NULL */ { yymsp[0].minor.yy334 = FILL_MODE_NULL; } break; - case 496: /* fill_mode ::= LINEAR */ + case 495: /* fill_mode ::= LINEAR */ { yymsp[0].minor.yy334 = FILL_MODE_LINEAR; } break; - case 497: /* fill_mode ::= NEXT */ + case 496: /* fill_mode ::= NEXT */ { yymsp[0].minor.yy334 = FILL_MODE_NEXT; } break; - case 500: /* group_by_list ::= expr_or_subquery */ + case 499: /* group_by_list ::= expr_or_subquery */ { yylhsminor.yy404 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 501: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + case 500: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ { yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 505: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + case 504: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ { yymsp[-5].minor.yy148 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 508: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 507: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { yylhsminor.yy148 = addOrderByClause(pCxt, yymsp[-3].minor.yy148, yymsp[-2].minor.yy404); yylhsminor.yy148 = addSlimitClause(pCxt, yylhsminor.yy148, yymsp[-1].minor.yy148); @@ -5066,50 +5103,50 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 511: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + case 510: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ { yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy148, yymsp[0].minor.yy148); } yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 512: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + case 511: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ { yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 520: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 524: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==524); + case 519: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 523: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==523); { yymsp[-1].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==525); + case 520: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 524: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==524); { yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 522: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 526: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==526); + case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==525); { yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 527: /* subquery ::= NK_LP query_expression NK_RP */ + case 526: /* subquery ::= NK_LP query_expression NK_RP */ { yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy148); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 532: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + case 531: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ { yylhsminor.yy148 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), yymsp[-1].minor.yy898, yymsp[0].minor.yy499); } yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 533: /* ordering_specification_opt ::= */ + case 532: /* ordering_specification_opt ::= */ { yymsp[1].minor.yy898 = ORDER_ASC; } break; - case 534: /* ordering_specification_opt ::= ASC */ + case 533: /* ordering_specification_opt ::= ASC */ { yymsp[0].minor.yy898 = ORDER_ASC; } break; - case 535: /* ordering_specification_opt ::= DESC */ + case 534: /* ordering_specification_opt ::= DESC */ { yymsp[0].minor.yy898 = ORDER_DESC; } break; - case 536: /* null_ordering_opt ::= */ + case 535: /* null_ordering_opt ::= */ { yymsp[1].minor.yy499 = NULL_ORDER_DEFAULT; } break; - case 537: /* null_ordering_opt ::= NULLS FIRST */ + case 536: /* null_ordering_opt ::= NULLS FIRST */ { yymsp[-1].minor.yy499 = NULL_ORDER_FIRST; } break; - case 538: /* null_ordering_opt ::= NULLS LAST */ + case 537: /* null_ordering_opt ::= NULLS LAST */ { yymsp[-1].minor.yy499 = NULL_ORDER_LAST; } break; default: diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 334d12b95f..17d02c1cce 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -48,7 +48,7 @@ TEST_F(ParserInitialCTest, createAccount) { * | PRECISION {'ms' | 'us' | 'ns'} * | REPLICA value * | RETENTIONS ingestion_duration:keep_duration ... - * | STRICT {'off' | 'on'} + * | STRICT {'off' | 'on'} // not support * | WAL_LEVEL value * | VGROUPS value * | SINGLE_STABLE {0 | 1} @@ -216,7 +216,7 @@ TEST_F(ParserInitialCTest, createDatabase) { addDbRetentionFunc(15 * MILLISECOND_PER_SECOND, 7 * MILLISECOND_PER_DAY, TIME_UNIT_SECOND, TIME_UNIT_DAY); addDbRetentionFunc(1 * MILLISECOND_PER_MINUTE, 21 * MILLISECOND_PER_DAY, TIME_UNIT_MINUTE, TIME_UNIT_DAY); addDbRetentionFunc(15 * MILLISECOND_PER_MINUTE, 500 * MILLISECOND_PER_DAY, TIME_UNIT_MINUTE, TIME_UNIT_DAY); - setDbStrictaFunc(1); + // setDbStrictaFunc(1); setDbWalLevelFunc(2); setDbVgroupsFunc(100); setDbSingleStableFunc(1); @@ -244,7 +244,7 @@ TEST_F(ParserInitialCTest, createDatabase) { "PRECISION 'ns' " "REPLICA 3 " "RETENTIONS 15s:7d,1m:21d,15m:500d " - "STRICT 'on' " + // "STRICT 'on' " "WAL_LEVEL 2 " "VGROUPS 100 " "SINGLE_STABLE 1 " From f137e8395da5a7a07ca21a4c572150b24326afd5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 13 Dec 2022 10:18:00 +0800 Subject: [PATCH 47/74] refact: change SRWLatch to TdThreadMutex in mnode --- source/dnode/mnode/impl/inc/mndInt.h | 16 ++++---- source/dnode/mnode/impl/src/mndSync.c | 59 ++++++++++++++------------- 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndInt.h b/source/dnode/mnode/impl/inc/mndInt.h index a0f3c98f83..aa18b409f4 100644 --- a/source/dnode/mnode/impl/inc/mndInt.h +++ b/source/dnode/mnode/impl/inc/mndInt.h @@ -84,14 +84,14 @@ typedef struct { } STelemMgmt; typedef struct { - tsem_t syncSem; - int64_t sync; - int32_t errCode; - int32_t transId; - SRWLatch lock; - int8_t selfIndex; - int8_t numOfReplicas; - SReplica replicas[TSDB_MAX_REPLICA]; + tsem_t syncSem; + int64_t sync; + int32_t errCode; + int32_t transId; + TdThreadMutex lock; + int8_t selfIndex; + int8_t numOfReplicas; + SReplica replicas[TSDB_MAX_REPLICA]; } SSyncMgmt; typedef struct { diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 10b1e36496..3747811e89 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -89,9 +89,9 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta sdbSetApplyInfo(pMnode->pSdb, pMeta->index, pMeta->term, pMeta->lastConfigIndex); } - taosWLockLatch(&pMgmt->lock); + taosThreadMutexLock(&pMgmt->lock); if (transId <= 0) { - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); mError("trans:%d, invalid commit msg", transId); } else if (transId == pMgmt->transId) { if (pMgmt->errCode != 0) { @@ -101,9 +101,9 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta } pMgmt->transId = 0; tsem_post(&pMgmt->syncSem); - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); } else { - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); STrans *pTrans = mndAcquireTrans(pMnode, transId); if (pTrans != NULL) { mInfo("trans:%d, execute in mnode which not leader", transId); @@ -198,18 +198,18 @@ int32_t mndSnapshotDoWrite(const SSyncFSM *pFsm, void *pWriter, void *pBuf, int3 } static void mndBecomeFollower(const SSyncFSM *pFsm) { - SMnode *pMnode = pFsm->data; + SMnode *pMnode = pFsm->data; + SSyncMgmt *pMgmt = &pMnode->syncMgmt; mInfo("vgId:1, become follower"); - taosWLockLatch(&pMnode->syncMgmt.lock); - if (pMnode->syncMgmt.transId != 0) { - mInfo("vgId:1, become follower and post sem, trans:%d, failed to propose since not leader", - pMnode->syncMgmt.transId); - pMnode->syncMgmt.transId = 0; - pMnode->syncMgmt.errCode = TSDB_CODE_SYN_NOT_LEADER; - tsem_post(&pMnode->syncMgmt.syncSem); + taosThreadMutexLock(&pMgmt->lock); + if (pMgmt->transId != 0) { + mInfo("vgId:1, become follower and post sem, trans:%d, failed to propose since not leader", pMgmt->transId); + pMgmt->transId = 0; + pMgmt->errCode = TSDB_CODE_SYN_NOT_LEADER; + tsem_post(&pMgmt->syncSem); } - taosWUnLockLatch(&pMnode->syncMgmt.lock); + taosThreadMutexUnlock(&pMgmt->lock); } static void mndBecomeLeader(const SSyncFSM *pFsm) { @@ -265,7 +265,7 @@ SSyncFSM *mndSyncMakeFsm(SMnode *pMnode) { int32_t mndInitSync(SMnode *pMnode) { SSyncMgmt *pMgmt = &pMnode->syncMgmt; - taosInitRWLatch(&pMgmt->lock); + taosThreadMutexInit(&pMgmt->lock, NULL); pMgmt->transId = 0; SSyncInfo syncInfo = { @@ -313,6 +313,7 @@ void mndCleanupSync(SMnode *pMnode) { mInfo("mnode-sync is stopped, id:%" PRId64, pMgmt->sync); tsem_destroy(&pMgmt->syncSem); + taosThreadMutexDestroy(&pMgmt->lock); memset(pMgmt, 0, sizeof(SSyncMgmt)); } @@ -327,35 +328,35 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { if (req.pCont == NULL) return -1; memcpy(req.pCont, pRaw, req.contLen); - taosWLockLatch(&pMgmt->lock); + taosThreadMutexLock(&pMgmt->lock); if (pMgmt->transId != 0) { mError("trans:%d, can't be proposed since trans:%d already waiting for confirm", transId, pMgmt->transId); - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); terrno = TSDB_CODE_MND_LAST_TRANS_NOT_FINISHED; return -1; } mInfo("trans:%d, will be proposed", transId); pMgmt->transId = transId; - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); int32_t code = syncPropose(pMgmt->sync, &req, false); if (code == 0) { - mInfo("trans:%d, is proposing and wait sem", pMgmt->transId); + mInfo("trans:%d, is proposing and wait sem", transId); tsem_wait(&pMgmt->syncSem); } else if (code > 0) { mInfo("trans:%d, confirm at once since replica is 1, continue execute", transId); - taosWLockLatch(&pMgmt->lock); + taosThreadMutexLock(&pMgmt->lock); pMgmt->transId = 0; - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); sdbWriteWithoutFree(pMnode->pSdb, pRaw); sdbSetApplyInfo(pMnode->pSdb, req.info.conn.applyIndex, req.info.conn.applyTerm, SYNC_INDEX_INVALID); code = 0; } else { mError("trans:%d, failed to proposed since %s", transId, terrstr()); - taosWLockLatch(&pMgmt->lock); + taosThreadMutexLock(&pMgmt->lock); pMgmt->transId = 0; - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); if (terrno == 0) { terrno = TSDB_CODE_APP_ERROR; } @@ -382,13 +383,15 @@ void mndSyncStart(SMnode *pMnode) { } void mndSyncStop(SMnode *pMnode) { - taosWLockLatch(&pMnode->syncMgmt.lock); - if (pMnode->syncMgmt.transId != 0) { - mInfo("vgId:1, is stopped and post sem, trans:%d", pMnode->syncMgmt.transId); - pMnode->syncMgmt.transId = 0; - tsem_post(&pMnode->syncMgmt.syncSem); + SSyncMgmt *pMgmt = &pMnode->syncMgmt; + + taosThreadMutexLock(&pMgmt->lock); + if (pMgmt->transId != 0) { + mInfo("vgId:1, is stopped and post sem, trans:%d", pMgmt->transId); + pMgmt->transId = 0; + tsem_post(&pMgmt->syncSem); } - taosWUnLockLatch(&pMnode->syncMgmt.lock); + taosThreadMutexUnlock(&pMgmt->lock); } bool mndIsLeader(SMnode *pMnode) { From bd99fc5ceb7cc065d162228673b0f95392158c7a Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Tue, 13 Dec 2022 11:00:13 +0800 Subject: [PATCH 48/74] fix: expand scalar input number of rows with the max num of rows --- source/libs/function/src/tudf.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index 32e57565d4..13233c4964 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -837,9 +837,27 @@ int32_t convertUdfColumnToDataBlock(SUdfColumn *udfCol, SSDataBlock *block) { } int32_t convertScalarParamToDataBlock(SScalarParam *input, int32_t numOfCols, SSDataBlock *output) { - output->info.rows = input->numOfRows; + int32_t numOfRows = 0; + for (int32_t i = 0; i < numOfCols; ++i) { + numOfRows = (input[i].numOfRows > numOfRows) ? input[i].numOfRows : numOfRows; + } + output->info.rows = numOfRows; output->pDataBlock = taosArrayInit(numOfCols, sizeof(SColumnInfoData)); for (int32_t i = 0; i < numOfCols; ++i) { + if ((input+i)->numOfRows < numOfRows) { + SColumnInfoData* pColInfoData = (input+i)->columnData; + int32_t startRow = (input+i)->numOfRows; + int32_t expandRows = numOfRows - startRow; + colInfoDataEnsureCapacity(pColInfoData, numOfRows, false); + bool isNull = colDataIsNull_s(pColInfoData, (input+i)->numOfRows - 1); + if (isNull) { + colDataAppendNNULL(pColInfoData, startRow, expandRows); + } else { + char* data = colDataGetData(pColInfoData, (input + i)->numOfRows - 1); + colDataAppendNItems(pColInfoData, startRow, data, expandRows); + } + } + taosArrayPush(output->pDataBlock, (input + i)->columnData); if (IS_VAR_DATA_TYPE((input + i)->columnData->info.type)) { From 9da398913e91628c22bb11dda0f9b6fac13094c2 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 13 Dec 2022 11:11:22 +0800 Subject: [PATCH 49/74] refact: post sem in mnode while sync timeout --- source/dnode/mnode/impl/inc/mndInt.h | 1 + source/dnode/mnode/impl/inc/mndSync.h | 1 + source/dnode/mnode/impl/src/mndMain.c | 1 + source/dnode/mnode/impl/src/mndSync.c | 35 ++++++++++++++++++++++++++- 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/source/dnode/mnode/impl/inc/mndInt.h b/source/dnode/mnode/impl/inc/mndInt.h index aa18b409f4..526fa142eb 100644 --- a/source/dnode/mnode/impl/inc/mndInt.h +++ b/source/dnode/mnode/impl/inc/mndInt.h @@ -88,6 +88,7 @@ typedef struct { int64_t sync; int32_t errCode; int32_t transId; + int32_t transSec; TdThreadMutex lock; int8_t selfIndex; int8_t numOfReplicas; diff --git a/source/dnode/mnode/impl/inc/mndSync.h b/source/dnode/mnode/impl/inc/mndSync.h index 993efbcd08..1f9a698a8a 100644 --- a/source/dnode/mnode/impl/inc/mndSync.h +++ b/source/dnode/mnode/impl/inc/mndSync.h @@ -26,6 +26,7 @@ int32_t mndInitSync(SMnode *pMnode); void mndCleanupSync(SMnode *pMnode); bool mndIsLeader(SMnode *pMnode); int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId); +void mndSyncCheckTimeout(SMnode *pMnode); void mndSyncStart(SMnode *pMnode); void mndSyncStop(SMnode *pMnode); diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index 237d45bc38..e12a908d88 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -280,6 +280,7 @@ static void *mndThreadFp(void *param) { if (sec % (tsStatusInterval * 5) == 0) { mndCheckDnodeOffline(pMnode); + mndSyncCheckTimeout(pMnode); } } diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 3747811e89..a1805c3289 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -17,6 +17,8 @@ #include "mndSync.h" #include "mndTrans.h" +#define TRANS_TIMEOUT_SEC 10 + static int32_t mndSyncEqCtrlMsg(const SMsgCb *msgcb, SRpcMsg *pMsg) { if (pMsg == NULL || pMsg->pCont == NULL) { return -1; @@ -100,6 +102,7 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta mInfo("trans:%d, is proposed and post sem", transId); } pMgmt->transId = 0; + pMgmt->transSec = 0; tsem_post(&pMgmt->syncSem); taosThreadMutexUnlock(&pMgmt->lock); } else { @@ -206,6 +209,7 @@ static void mndBecomeFollower(const SSyncFSM *pFsm) { if (pMgmt->transId != 0) { mInfo("vgId:1, become follower and post sem, trans:%d, failed to propose since not leader", pMgmt->transId); pMgmt->transId = 0; + pMgmt->transSec = 0; pMgmt->errCode = TSDB_CODE_SYN_NOT_LEADER; tsem_post(&pMgmt->syncSem); } @@ -267,6 +271,7 @@ int32_t mndInitSync(SMnode *pMnode) { SSyncMgmt *pMgmt = &pMnode->syncMgmt; taosThreadMutexInit(&pMgmt->lock, NULL); pMgmt->transId = 0; + pMgmt->transSec = 0; SSyncInfo syncInfo = { .snapshotStrategy = SYNC_STRATEGY_STANDARD_SNAPSHOT, @@ -317,6 +322,30 @@ void mndCleanupSync(SMnode *pMnode) { memset(pMgmt, 0, sizeof(SSyncMgmt)); } +void mndSyncCheckTimeout(SMnode *pMnode) { + SSyncMgmt *pMgmt = &pMnode->syncMgmt; + taosThreadMutexLock(&pMgmt->lock); + if (pMgmt->transId != 0) { + int32_t curSec = taosGetTimestampSec(); + int32_t delta = curSec - pMgmt->transSec; + if (delta > TRANS_TIMEOUT_SEC) { + mError("trans:%d, failed to propose since timeout, start:%d cur:%d delta:%d", pMgmt->transId, pMgmt->transSec, + curSec, delta); + pMgmt->transId = 0; + pMgmt->transSec = 0; + terrno = TSDB_CODE_SYN_TIMEOUT; + pMgmt->errCode = TSDB_CODE_SYN_TIMEOUT; + tsem_post(&pMgmt->syncSem); + } else { + mDebug("trans:%d, waiting for sync confirm, start:%d cur:%d delta:%d", pMgmt->transId, pMgmt->transSec, curSec, + curSec - pMgmt->transSec); + } + } else { + mTrace("check sync timeout msg, no trans waiting for confirm"); + } + taosThreadMutexUnlock(&pMgmt->lock); +} + int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { SSyncMgmt *pMgmt = &pMnode->syncMgmt; pMgmt->errCode = 0; @@ -333,11 +362,12 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { mError("trans:%d, can't be proposed since trans:%d already waiting for confirm", transId, pMgmt->transId); taosThreadMutexUnlock(&pMgmt->lock); terrno = TSDB_CODE_MND_LAST_TRANS_NOT_FINISHED; - return -1; + return terrno; } mInfo("trans:%d, will be proposed", transId); pMgmt->transId = transId; + pMgmt->transSec = taosGetTimestampSec(); taosThreadMutexUnlock(&pMgmt->lock); int32_t code = syncPropose(pMgmt->sync, &req, false); @@ -348,6 +378,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { mInfo("trans:%d, confirm at once since replica is 1, continue execute", transId); taosThreadMutexLock(&pMgmt->lock); pMgmt->transId = 0; + pMgmt->transSec = 0; taosThreadMutexUnlock(&pMgmt->lock); sdbWriteWithoutFree(pMnode->pSdb, pRaw); sdbSetApplyInfo(pMnode->pSdb, req.info.conn.applyIndex, req.info.conn.applyTerm, SYNC_INDEX_INVALID); @@ -356,6 +387,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { mError("trans:%d, failed to proposed since %s", transId, terrstr()); taosThreadMutexLock(&pMgmt->lock); pMgmt->transId = 0; + pMgmt->transSec = 0; taosThreadMutexUnlock(&pMgmt->lock); if (terrno == 0) { terrno = TSDB_CODE_APP_ERROR; @@ -389,6 +421,7 @@ void mndSyncStop(SMnode *pMnode) { if (pMgmt->transId != 0) { mInfo("vgId:1, is stopped and post sem, trans:%d", pMgmt->transId); pMgmt->transId = 0; + pMgmt->transSec = 0; tsem_post(&pMgmt->syncSem); } taosThreadMutexUnlock(&pMgmt->lock); From e7646660058da0d9c317ecd4b4bf37753860b807 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 13 Dec 2022 11:28:48 +0800 Subject: [PATCH 50/74] fix: return errorcode if sync stop --- source/dnode/mnode/impl/src/mndSync.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index a1805c3289..ba14f526a9 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -341,7 +341,7 @@ void mndSyncCheckTimeout(SMnode *pMnode) { curSec - pMgmt->transSec); } } else { - mTrace("check sync timeout msg, no trans waiting for confirm"); + // mTrace("check sync timeout msg, no trans waiting for confirm"); } taosThreadMutexUnlock(&pMgmt->lock); } @@ -422,6 +422,7 @@ void mndSyncStop(SMnode *pMnode) { mInfo("vgId:1, is stopped and post sem, trans:%d", pMgmt->transId); pMgmt->transId = 0; pMgmt->transSec = 0; + pMgmt->errCode = TSDB_CODE_APP_IS_STOPPING; tsem_post(&pMgmt->syncSem); } taosThreadMutexUnlock(&pMgmt->lock); From 9dff4371ec111fe68c0ce3d0b914d8a57e52f8dd Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 13 Dec 2022 12:20:48 +0800 Subject: [PATCH 51/74] enh: shielding database option 'strict' --- tests/script/tsim/db/alter_option.sim | 2 +- tests/script/tsim/db/create_all_options.sim | 2 +- tests/script/tsim/stream/drop_stream.sim | 2 +- tests/system-test/6-cluster/5dnode1mnode.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/script/tsim/db/alter_option.sim b/tests/script/tsim/db/alter_option.sim index 63018aea8c..f4392fbca4 100644 --- a/tests/script/tsim/db/alter_option.sim +++ b/tests/script/tsim/db/alter_option.sim @@ -69,7 +69,7 @@ endi if $data4_db != 3 then # replica return -1 endi -if $data5_db != off then # strict +if $data5_db != on then # strict return -1 endi if $data6_db != 345600m then # duration diff --git a/tests/script/tsim/db/create_all_options.sim b/tests/script/tsim/db/create_all_options.sim index 7012fbac6c..382cc986e2 100644 --- a/tests/script/tsim/db/create_all_options.sim +++ b/tests/script/tsim/db/create_all_options.sim @@ -89,7 +89,7 @@ if $data4_db != 1 then # replica print expect 1, actual: $data4_db return -1 endi -if $data5_db != off then # strict +if $data5_db != on then # strict return -1 endi if $data6_db != 14400m then # duration diff --git a/tests/script/tsim/stream/drop_stream.sim b/tests/script/tsim/stream/drop_stream.sim index 817780ca59..1a474bd9ae 100644 --- a/tests/script/tsim/stream/drop_stream.sim +++ b/tests/script/tsim/stream/drop_stream.sim @@ -219,7 +219,7 @@ sql drop database test; print ========== interval\session\state window -sql CREATE DATABASE test1 BUFFER 96 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 STRICT 'off' WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0; +sql CREATE DATABASE test1 BUFFER 96 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0; sql use test1; sql CREATE STABLE st (time TIMESTAMP, ca DOUBLE, cb DOUBLE, cc int) TAGS (ta VARCHAR(10) ); diff --git a/tests/system-test/6-cluster/5dnode1mnode.py b/tests/system-test/6-cluster/5dnode1mnode.py index b576b37a4d..d0157ec7c7 100644 --- a/tests/system-test/6-cluster/5dnode1mnode.py +++ b/tests/system-test/6-cluster/5dnode1mnode.py @@ -125,7 +125,7 @@ class TDTestCase: tdSql.execute(f'create table ct{i+1} using stb1 tags ( {i+1} )') tdSql.query('select * from information_schema.ins_databases;') - tdSql.checkData(2,5,'off') + tdSql.checkData(2,5,'on') tdSql.error("alter database db strict 'off'") # tdSql.execute('alter database db strict 'on'') # tdSql.query('select * from information_schema.ins_databases;') From b89877b4c1ee124bd8a9de5fcb4fa65fa435f558 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 13 Dec 2022 13:41:06 +0800 Subject: [PATCH 52/74] refact: add vnode timer --- source/dnode/mgmt/mgmt_vnode/inc/vmInt.h | 2 + source/dnode/mgmt/mgmt_vnode/src/vmInt.c | 49 ++++++++++++++++++++++-- source/dnode/vnode/src/vnd/vnodeSync.c | 15 -------- 3 files changed, 47 insertions(+), 19 deletions(-) diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h index b38dc19361..b5c554e0ca 100644 --- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h +++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h @@ -38,6 +38,8 @@ typedef struct SVnodeMgmt { TdThreadRwlock lock; SVnodesStat state; STfs *pTfs; + TdThread thread; + bool stop; } SVnodeMgmt; typedef struct { diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 07ebd72379..56a9a0e22b 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -334,6 +334,49 @@ static void vmCleanup(SVnodeMgmt *pMgmt) { taosMemoryFree(pMgmt); } +static void vmCheckSyncTimeout(SVnodeMgmt *pMgmt) {} + +static void *vmThreadFp(void *param) { + SVnodeMgmt *pMgmt = param; + int64_t lastTime = 0; + setThreadName("vnode-timer"); + + while (1) { + lastTime++; + taosMsleep(100); + if (pMgmt->stop) break; + if (lastTime % 10 != 0) continue; + + int64_t sec = lastTime / 10; + if (sec % (tsStatusInterval * 5) == 0) { + vmCheckSyncTimeout(pMgmt); + } + } + + return NULL; +} + +static int32_t vmInitTimer(SVnodeMgmt *pMgmt) { + TdThreadAttr thAttr; + taosThreadAttrInit(&thAttr); + taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_JOINABLE); + if (taosThreadCreate(&pMgmt->thread, &thAttr, vmThreadFp, pMgmt) != 0) { + dError("failed to create vnode timer thread since %s", strerror(errno)); + return -1; + } + + taosThreadAttrDestroy(&thAttr); + return 0; +} + +static void vmCleanupTimer(SVnodeMgmt *pMgmt) { + pMgmt->stop = true; + if (taosCheckPthreadValid(pMgmt->thread)) { + taosThreadJoin(pMgmt->thread, NULL); + taosThreadClear(&pMgmt->thread); + } +} + static int32_t vmInit(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) { int32_t code = -1; @@ -510,12 +553,10 @@ static int32_t vmStartVnodes(SVnodeMgmt *pMgmt) { taosMemoryFree(ppVnodes); } - return 0; + return vmInitTimer(pMgmt); } -static void vmStop(SVnodeMgmt *pMgmt) { - // process inside the vnode -} +static void vmStop(SVnodeMgmt *pMgmt) { vmCleanupTimer(pMgmt); } SMgmtFunc vmGetMgmtFunc() { SMgmtFunc mgmtFunc = {0}; diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index aa215a852f..5a0556ba27 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -26,21 +26,6 @@ static inline void vnodeWaitBlockMsg(SVnode *pVnode, const SRpcMsg *pMsg) { tsem_wait(&pVnode->syncSem); } -static inline void vnodeWaitBlockMsgOld(SVnode *pVnode, const SRpcMsg *pMsg) { - if (vnodeIsMsgBlock(pMsg->msgType)) { - const STraceId *trace = &pMsg->info.traceId; - taosThreadMutexLock(&pVnode->lock); - if (!pVnode->blocked) { - vGTrace("vgId:%d, msg:%p wait block, type:%s", pVnode->config.vgId, pMsg, TMSG_INFO(pMsg->msgType)); - pVnode->blocked = true; - taosThreadMutexUnlock(&pVnode->lock); - tsem_wait(&pVnode->syncSem); - } else { - taosThreadMutexUnlock(&pVnode->lock); - } - } -} - static inline void vnodePostBlockMsg(SVnode *pVnode, const SRpcMsg *pMsg) { if (vnodeIsMsgBlock(pMsg->msgType)) { const STraceId *trace = &pMsg->info.traceId; From 3108e658e6d1fb418d328571b4fdd3facbb405ff Mon Sep 17 00:00:00 2001 From: slzhou Date: Tue, 13 Dec 2022 14:51:11 +0800 Subject: [PATCH 53/74] fix: expand scalar param column data to fill the udf datablock --- source/libs/function/src/tudf.c | 11 ++++- tests/script/sh/compile_udf.sh | 3 +- tests/script/sh/gpd.c | 50 +++++----------------- tests/script/tsim/query/udf_with_const.sim | 45 +++++++++++++++++++ 4 files changed, 67 insertions(+), 42 deletions(-) create mode 100644 tests/script/tsim/query/udf_with_const.sim diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index 13233c4964..0b309bc8f5 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -853,8 +853,15 @@ int32_t convertScalarParamToDataBlock(SScalarParam *input, int32_t numOfCols, SS if (isNull) { colDataAppendNNULL(pColInfoData, startRow, expandRows); } else { - char* data = colDataGetData(pColInfoData, (input + i)->numOfRows - 1); - colDataAppendNItems(pColInfoData, startRow, data, expandRows); + char* src = colDataGetData(pColInfoData, (input + i)->numOfRows - 1); + int32_t bytes = pColInfoData->info.bytes; + char* data = taosMemoryMalloc(bytes); + memcpy(data, src, bytes); + for (int j = 0; j < expandRows; ++j) { + colDataAppend(pColInfoData, startRow+j, data, false); + } + //colDataAppendNItems(pColInfoData, startRow, data, expandRows); + taosMemoryFree(data); } } diff --git a/tests/script/sh/compile_udf.sh b/tests/script/sh/compile_udf.sh index c7148d7d7d..5265e5a99b 100755 --- a/tests/script/sh/compile_udf.sh +++ b/tests/script/sh/compile_udf.sh @@ -1,10 +1,11 @@ set +e -rm -rf /tmp/udf/libbitand.so /tmp/udf/libsqrsum.so +rm -rf /tmp/udf/libbitand.so /tmp/udf/libsqrsum.so /tmp/udf/libgpd.so mkdir -p /tmp/udf echo "compile udf bit_and and sqr_sum" gcc -fPIC -shared sh/bit_and.c -I../../include/libs/function/ -I../../include/client -I../../include/util -o /tmp/udf/libbitand.so gcc -fPIC -shared sh/l2norm.c -I../../include/libs/function/ -I../../include/client -I../../include/util -o /tmp/udf/libl2norm.so +gcc -fPIC -shared sh/gpd.c -I../../include/libs/function/ -I../../include/client -I../../include/util -o /tmp/udf/libgpd.so echo "debug show /tmp/udf/*.so" ls /tmp/udf/*.so diff --git a/tests/script/sh/gpd.c b/tests/script/sh/gpd.c index 8d69bacb5e..2259efa64a 100644 --- a/tests/script/sh/gpd.c +++ b/tests/script/sh/gpd.c @@ -12,13 +12,10 @@ TAOS* taos = NULL; DLL_EXPORT int32_t gpd_init() { - taos = taos_connect("localhost", "root", "taosdata", "", 7100); return 0; } DLL_EXPORT int32_t gpd_destroy() { - taos_close(taos); - taos_cleanup(); return 0; } @@ -32,43 +29,18 @@ DLL_EXPORT int32_t gpd(SUdfDataBlock* block, SUdfColumn *resultCol) { SUdfColumnData *resultData = &resultCol->colData; resultData->numOfRows = block->numOfRows; for (int32_t i = 0; i < resultData->numOfRows; ++i) { - int j = 0; - for (; j < block->numOfCols; ++j) { - if (udfColDataIsNull(block->udfCols[j], i)) { - udfColDataSetNull(resultCol, i); - break; - } - } - if ( j == block->numOfCols) { - int32_t luckyNum = 88; - udfColDataSet(resultCol, i, (char *)&luckyNum, false); - } + int64_t* calc_ts = (int64_t*)udfColDataGetData(block->udfCols[0], i); + char* varTbname = udfColDataGetData(block->udfCols[1], i); + char* varDbname = udfColDataGetData(block->udfCols[2], i); + + char dbName[256] = {0}; + char tblName[256] = {0}; + memcpy(dbName, varDataVal(varDbname), varDataLen(varDbname)); + memcpy(tblName, varDataVal(varTbname), varDataLen(varTbname)); + printf("%s, %s\n", dbName, tblName); + int32_t result = 0; + udfColDataSet(resultCol, i, (char*)&result, false); } - TAOS_RES* res = taos_query(taos, "create database if not exists gpd"); - if (taos_errno(res) != 0) { - char* errstr = taos_errstr(res); - } - res = taos_query(taos, "create table gpd.st (ts timestamp, f int) tags(t int)"); - if (taos_errno(res) != 0) { - char* errstr = taos_errstr(res); - } - taos_query(taos, "insert into gpd.t using gpd.st tags(1) values(now, 1) "); - if (taos_errno(res) != 0) { - char* errstr = taos_errstr(res); - } - - taos_query(taos, "select * from gpd.t"); - if (taos_errno(res) != 0) { - char* errstr = taos_errstr(res); - } - - //to simulate actual processing delay by udf -#ifdef LINUX - usleep(1 * 1000); // usleep takes sleep time in us (1 millionth of a second) -#endif -#ifdef WINDOWS - Sleep(1); -#endif return 0; } diff --git a/tests/script/tsim/query/udf_with_const.sim b/tests/script/tsim/query/udf_with_const.sim new file mode 100644 index 0000000000..7a2a3389bd --- /dev/null +++ b/tests/script/tsim/query/udf_with_const.sim @@ -0,0 +1,45 @@ +system_content printf %OS% +if $system_content == Windows_NT then + return 0; +endi + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c udf -v 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ======== step1 udf +system sh/compile_udf.sh +sql create database udf vgroups 3; +sql use udf; + +sql create table t (ts timestamp, f int); +sql insert into t values(now, 1)(now+1s, 2)(now+2s,3)(now+3s,4)(now+4s,5)(now+5s,6)(now+6s,7); + +system_content printf %OS% +if $system_content == Windows_NT then + return 0; +endi + +if $system_content == Windows_NT then + sql create function gpd as 'C:\\Windows\\Temp\\gpd.dll' outputtype int bufSize 8; +else + sql create function gpd as '/tmp/udf/libgpd.so' outputtype int bufSize 8; +endi +sql show functions; +if $rows != 1 then + return -1 +endi + +sql select gpd(ts, tbname, 'detail') from t; +if $rows != 7 then + return -1 +endi +print $data00 $data10 +if $data00 != @0@ then + return -1 +endi +sql drop function gpd; + +system sh/exec.sh -n dnode1 -s stop -x SIGINT From 186384dda32ebdced106c098e5ea81013f16b6aa Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 13 Dec 2022 15:26:16 +0800 Subject: [PATCH 54/74] fix: refact some example files --- examples/c/CMakeLists.txt | 91 - examples/c/apitest.c | 1948 ----------------- examples/c/asyncdemo.c | 2 +- examples/c/demo.c | 2 +- examples/c/epoll.c | 304 --- examples/c/makefile | 15 +- examples/c/prepare.c | 49 +- examples/c/schemaless.c | 35 +- examples/c/stream_demo.c | 7 +- examples/c/tmq.c | 20 +- source/libs/catalog/src/ctgCache.c | 2 +- source/libs/scheduler/src/schStatus.c | 2 +- source/libs/scheduler/src/scheduler.c | 2 +- .../script/api}/api_with_reqid_test.c | 0 tests/script/api/apitest.c | 936 ++++++++ {examples/c => tests/script/api}/demoapi.c | 3 - 16 files changed, 1011 insertions(+), 2407 deletions(-) delete mode 100644 examples/c/CMakeLists.txt delete mode 100644 examples/c/apitest.c delete mode 100644 examples/c/epoll.c rename {examples/c => tests/script/api}/api_with_reqid_test.c (100%) create mode 100644 tests/script/api/apitest.c rename {examples/c => tests/script/api}/demoapi.c (99%) diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt deleted file mode 100644 index 37edc739e4..0000000000 --- a/examples/c/CMakeLists.txt +++ /dev/null @@ -1,91 +0,0 @@ -PROJECT(TDengine) - -IF (TD_LINUX) - INCLUDE_DIRECTORIES(. ${TD_SOURCE_DIR}/src/inc ${TD_SOURCE_DIR}/src/client/inc ${TD_SOURCE_DIR}/inc) - AUX_SOURCE_DIRECTORY(. SRC) - # ADD_EXECUTABLE(demo apitest.c) - #TARGET_LINK_LIBRARIES(demo taos_static trpc tutil pthread ) - #ADD_EXECUTABLE(sml schemaless.c) - #TARGET_LINK_LIBRARIES(sml taos_static trpc tutil pthread ) - #ADD_EXECUTABLE(subscribe subscribe.c) - #TARGET_LINK_LIBRARIES(subscribe taos_static trpc tutil pthread ) - #ADD_EXECUTABLE(epoll epoll.c) - #TARGET_LINK_LIBRARIES(epoll taos_static trpc tutil pthread lua) - - add_executable(tmq "") - add_executable(stream_demo "") - add_executable(demoapi "") - add_executable(api_reqid "") - - target_sources(tmq - PRIVATE - "tmq.c" - ) - - target_sources(stream_demo - PRIVATE - "stream_demo.c" - ) - - target_sources(demoapi - PRIVATE - "demoapi.c" - ) - - target_sources(api_reqid - PRIVATE - "api_with_reqid_test.c" - ) - - - target_link_libraries(tmq - taos_static - ) - - target_link_libraries(stream_demo - taos_static - ) - - target_link_libraries(demoapi - taos_static - ) - - target_link_libraries(api_reqid - taos_static - ) - - - target_include_directories(tmq - PUBLIC "${TD_SOURCE_DIR}/include/os" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - - target_include_directories(stream_demo - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - - target_include_directories(demoapi - PUBLIC "${TD_SOURCE_DIR}/include/client" - PUBLIC "${TD_SOURCE_DIR}/include/os" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - - target_include_directories(api_reqid - PUBLIC "${TD_SOURCE_DIR}/include/client" - PUBLIC "${TD_SOURCE_DIR}/include/os" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - - SET_TARGET_PROPERTIES(tmq PROPERTIES OUTPUT_NAME tmq) - SET_TARGET_PROPERTIES(stream_demo PROPERTIES OUTPUT_NAME stream_demo) - SET_TARGET_PROPERTIES(demoapi PROPERTIES OUTPUT_NAME demoapi) - SET_TARGET_PROPERTIES(api_reqid PROPERTIES OUTPUT_NAME api_reqid) -ENDIF () -IF (TD_DARWIN) - INCLUDE_DIRECTORIES(. ${TD_SOURCE_DIR}/src/inc ${TD_SOURCE_DIR}/src/client/inc ${TD_SOURCE_DIR}/inc) - AUX_SOURCE_DIRECTORY(. SRC) - #ADD_EXECUTABLE(demo demo.c) - #TARGET_LINK_LIBRARIES(demo taos_static trpc tutil pthread lua) - #ADD_EXECUTABLE(epoll epoll.c) - #TARGET_LINK_LIBRARIES(epoll taos_static trpc tutil pthread lua) -ENDIF () diff --git a/examples/c/apitest.c b/examples/c/apitest.c deleted file mode 100644 index c179acaf4e..0000000000 --- a/examples/c/apitest.c +++ /dev/null @@ -1,1948 +0,0 @@ -// sample code to verify all TDengine API -// to compile: gcc -o apitest apitest.c -ltaos - -#include "cJSON.h" -#include "taoserror.h" - -#include -#include -#include -#include -#include "../../../include/client/taos.h" - -static void prepare_data(TAOS* taos) { - TAOS_RES* result; - result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database test precision 'us';"); - taos_free_result(result); - usleep(100000); - taos_select_db(taos, "test"); - - result = taos_query(taos, "create table meters(ts timestamp, a int) tags(area int);"); - taos_free_result(result); - - result = taos_query(taos, "create table t0 using meters tags(0);"); - taos_free_result(result); - result = taos_query(taos, "create table t1 using meters tags(1);"); - taos_free_result(result); - result = taos_query(taos, "create table t2 using meters tags(2);"); - taos_free_result(result); - result = taos_query(taos, "create table t3 using meters tags(3);"); - taos_free_result(result); - result = taos_query(taos, "create table t4 using meters tags(4);"); - taos_free_result(result); - result = taos_query(taos, "create table t5 using meters tags(5);"); - taos_free_result(result); - result = taos_query(taos, "create table t6 using meters tags(6);"); - taos_free_result(result); - result = taos_query(taos, "create table t7 using meters tags(7);"); - taos_free_result(result); - result = taos_query(taos, "create table t8 using meters tags(8);"); - taos_free_result(result); - result = taos_query(taos, "create table t9 using meters tags(9);"); - taos_free_result(result); - - result = taos_query(taos, - "insert into t0 values('2020-01-01 00:00:00.000', 0)" - " ('2020-01-01 00:01:00.000', 0)" - " ('2020-01-01 00:02:00.000', 0)" - " t1 values('2020-01-01 00:00:00.000', 0)" - " ('2020-01-01 00:01:00.000', 0)" - " ('2020-01-01 00:02:00.000', 0)" - " ('2020-01-01 00:03:00.000', 0)" - " t2 values('2020-01-01 00:00:00.000', 0)" - " ('2020-01-01 00:01:00.000', 0)" - " ('2020-01-01 00:01:01.000', 0)" - " ('2020-01-01 00:01:02.000', 0)" - " t3 values('2020-01-01 00:01:02.000', 0)" - " t4 values('2020-01-01 00:01:02.000', 0)" - " t5 values('2020-01-01 00:01:02.000', 0)" - " t6 values('2020-01-01 00:01:02.000', 0)" - " t7 values('2020-01-01 00:01:02.000', 0)" - " t8 values('2020-01-01 00:01:02.000', 0)" - " t9 values('2020-01-01 00:01:02.000', 0)"); - int affected = taos_affected_rows(result); - if (affected != 18) { - printf("\033[31m%d rows affected by last insert statement, but it should be 18\033[0m\n", affected); - } - taos_free_result(result); - // super tables subscription - usleep(1000000); -} - -static int print_result(TAOS_RES* res, int blockFetch) { - TAOS_ROW row = NULL; - int num_fields = taos_num_fields(res); - TAOS_FIELD* fields = taos_fetch_fields(res); - int nRows = 0; - - if (blockFetch) { - int rows = 0; - while ((rows = taos_fetch_block(res, &row))) { - // for (int i = 0; i < rows; i++) { - // char temp[256]; - // taos_print_row(temp, row + i, fields, num_fields); - // puts(temp); - // } - nRows += rows; - } - } else { - while ((row = taos_fetch_row(res))) { - char temp[256] = {0}; - taos_print_row(temp, row, fields, num_fields); - puts(temp); - nRows++; - } - } - - printf("%d rows consumed.\n", nRows); - return nRows; -} - -static void check_row_count(int line, TAOS_RES* res, int expected) { - int actual = print_result(res, expected % 2); - if (actual != expected) { - printf("\033[31mline %d: row count mismatch, expected: %d, actual: %d\033[0m\n", line, expected, actual); - } else { - printf("line %d: %d rows consumed as expected\n", line, actual); - } -} - -static void verify_query(TAOS* taos) { - prepare_data(taos); - - int code = taos_load_table_info(taos, "t0,t1,t2,t3,t4,t5,t6,t7,t8,t9"); - if (code != 0) { - printf("\033[31mfailed to load table info: 0x%08x\033[0m\n", code); - } - - code = taos_validate_sql(taos, "select * from nonexisttable"); - if (code == 0) { - printf("\033[31mimpossible, the table does not exists\033[0m\n"); - } - - code = taos_validate_sql(taos, "select * from meters"); - if (code != 0) { - printf("\033[31mimpossible, the table does exists: 0x%08x\033[0m\n", code); - } - - TAOS_RES* res = taos_query_with_reqid(taos, "select * from meters", genReqid()); - check_row_count(__LINE__, res, 18); - printf("result precision is: %d\n", taos_result_precision(res)); - int c = taos_field_count(res); - printf("field count is: %d\n", c); - int* lengths = taos_fetch_lengths(res); - for (int i = 0; i < c; i++) { - printf("length of column %d is %d\n", i, lengths[i]); - } - taos_free_result(res); - - res = taos_query_with_reqid(taos, "select * from t0", genReqid()); - check_row_count(__LINE__, res, 3); - taos_free_result(res); - - res = taos_query_with_reqid(taos, "select * from nonexisttable", genReqid()); - code = taos_errno(res); - printf("code=%d, error msg=%s\n", code, taos_errstr(res)); - taos_free_result(res); - - res = taos_query_with_reqid(taos, "select * from meters", genReqid()); - taos_stop_query(res); - taos_free_result(res); -} - -void subscribe_callback(TAOS_SUB* tsub, TAOS_RES* res, void* param, int code) { - int rows = print_result(res, *(int*)param); - printf("%d rows consumed in subscribe_callback\n", rows); -} - -static void verify_subscribe(TAOS* taos) { - prepare_data(taos); - - TAOS_SUB* tsub = taos_subscribe(taos, 0, "test", "select * from meters;", NULL, NULL, 0); - TAOS_RES* res = taos_consume(tsub); - check_row_count(__LINE__, res, 18); - - res = taos_consume(tsub); - check_row_count(__LINE__, res, 0); - - TAOS_RES* result; - result = taos_query(taos, "insert into t0 values('2020-01-01 00:02:00.001', 0);"); - taos_free_result(result); - result = taos_query(taos, "insert into t8 values('2020-01-01 00:01:03.000', 0);"); - taos_free_result(result); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 2); - - result = taos_query(taos, "insert into t2 values('2020-01-01 00:01:02.001', 0);"); - taos_free_result(result); - result = taos_query(taos, "insert into t1 values('2020-01-01 00:03:00.001', 0);"); - taos_free_result(result); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 2); - - result = taos_query(taos, "insert into t1 values('2020-01-01 00:03:00.002', 0);"); - taos_free_result(result); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 1); - - // keep progress information and restart subscription - taos_unsubscribe(tsub, 1); - result = taos_query(taos, "insert into t0 values('2020-01-01 00:04:00.000', 0);"); - taos_free_result(result); - tsub = taos_subscribe(taos, 1, "test", "select * from meters;", NULL, NULL, 0); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 24); - - // keep progress information and continue previous subscription - taos_unsubscribe(tsub, 1); - tsub = taos_subscribe(taos, 0, "test", "select * from meters;", NULL, NULL, 0); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 0); - - // don't keep progress information and continue previous subscription - taos_unsubscribe(tsub, 0); - tsub = taos_subscribe(taos, 0, "test", "select * from meters;", NULL, NULL, 0); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 24); - - // single meter subscription - - taos_unsubscribe(tsub, 0); - tsub = taos_subscribe(taos, 0, "test", "select * from t0;", NULL, NULL, 0); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 5); - - res = taos_consume(tsub); - check_row_count(__LINE__, res, 0); - - result = taos_query(taos, "insert into t0 values('2020-01-01 00:04:00.001', 0);"); - taos_free_result(result); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 1); - - taos_unsubscribe(tsub, 0); - - int blockFetch = 0; - tsub = taos_subscribe(taos, 1, "test", "select * from meters;", subscribe_callback, &blockFetch, 1000); - usleep(2000000); - result = taos_query(taos, "insert into t0 values('2020-01-01 00:05:00.001', 0);"); - taos_free_result(result); - usleep(2000000); - taos_unsubscribe(tsub, 0); -} - -void verify_prepare(TAOS* taos) { - TAOS_RES* result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - - usleep(100000); - result = taos_query(taos, "create database test;"); - - int code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - - taos_free_result(result); - - usleep(100000); - taos_select_db(taos, "test"); - - // create table - const char* sql = - "create table m1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " - "binary(40), blob nchar(10))"; - result = taos_query_with_reqid(taos, sql, genReqid()); - code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - // insert 10 records - struct { - int64_t ts; - int8_t b; - int8_t v1; - int16_t v2; - int32_t v4; - int64_t v8; - float f4; - double f8; - char bin[40]; - char blob[80]; - } v = {0}; - - TAOS_STMT* stmt = taos_stmt_init(taos); - TAOS_BIND params[10]; - params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; - params[0].buffer_length = sizeof(v.ts); - params[0].buffer = &v.ts; - params[0].length = ¶ms[0].buffer_length; - params[0].is_null = NULL; - - params[1].buffer_type = TSDB_DATA_TYPE_BOOL; - params[1].buffer_length = sizeof(v.b); - params[1].buffer = &v.b; - params[1].length = ¶ms[1].buffer_length; - params[1].is_null = NULL; - - params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; - params[2].buffer_length = sizeof(v.v1); - params[2].buffer = &v.v1; - params[2].length = ¶ms[2].buffer_length; - params[2].is_null = NULL; - - params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; - params[3].buffer_length = sizeof(v.v2); - params[3].buffer = &v.v2; - params[3].length = ¶ms[3].buffer_length; - params[3].is_null = NULL; - - params[4].buffer_type = TSDB_DATA_TYPE_INT; - params[4].buffer_length = sizeof(v.v4); - params[4].buffer = &v.v4; - params[4].length = ¶ms[4].buffer_length; - params[4].is_null = NULL; - - params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; - params[5].buffer_length = sizeof(v.v8); - params[5].buffer = &v.v8; - params[5].length = ¶ms[5].buffer_length; - params[5].is_null = NULL; - - params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; - params[6].buffer_length = sizeof(v.f4); - params[6].buffer = &v.f4; - params[6].length = ¶ms[6].buffer_length; - params[6].is_null = NULL; - - params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; - params[7].buffer_length = sizeof(v.f8); - params[7].buffer = &v.f8; - params[7].length = ¶ms[7].buffer_length; - params[7].is_null = NULL; - - params[8].buffer_type = TSDB_DATA_TYPE_BINARY; - params[8].buffer_length = sizeof(v.bin); - params[8].buffer = v.bin; - params[8].length = ¶ms[8].buffer_length; - params[8].is_null = NULL; - - strcpy(v.blob, "一二三四五六七八九十"); - params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; - params[9].buffer_length = strlen(v.blob); - params[9].buffer = v.blob; - params[9].length = ¶ms[9].buffer_length; - params[9].is_null = NULL; - - int is_null = 1; - - sql = "insert into m1 values(?,?,?,?,?,?,?,?,?,?)"; - code = taos_stmt_prepare(stmt, sql, 0); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - v.ts = 1591060628000; - for (int i = 0; i < 10; ++i) { - v.ts += 1; - for (int j = 1; j < 10; ++j) { - params[j].is_null = ((i == j) ? &is_null : 0); - } - v.b = (int8_t)i % 2; - v.v1 = (int8_t)i; - v.v2 = (int16_t)(i * 2); - v.v4 = (int32_t)(i * 4); - v.v8 = (int64_t)(i * 8); - v.f4 = (float)(i * 40); - v.f8 = (double)(i * 80); - for (int j = 0; j < sizeof(v.bin); ++j) { - v.bin[j] = (char)(i + '0'); - } - - taos_stmt_bind_param(stmt, params); - taos_stmt_add_batch(stmt); - } - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - taos_stmt_close(stmt); - - // query the records - stmt = taos_stmt_init(taos); - taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); - v.v1 = 5; - v.v2 = 15; - taos_stmt_bind_param(stmt, params + 2); - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - result = taos_stmt_use_result(stmt); - - TAOS_ROW row; - int rows = 0; - int num_fields = taos_num_fields(result); - TAOS_FIELD* fields = taos_fetch_fields(result); - - // fetch the records row by row - while ((row = taos_fetch_row(result))) { - char temp[256] = {0}; - rows++; - taos_print_row(temp, row, fields, num_fields); - printf("%s\n", temp); - } - - taos_free_result(result); - taos_stmt_close(stmt); -} - -void verify_prepare2(TAOS* taos) { - TAOS_RES* result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database test;"); - - int code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - usleep(100000); - taos_select_db(taos, "test"); - - // create table - const char* sql = - "create table m1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " - "binary(40), blob nchar(10))"; - result = taos_query(taos, sql); - code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - // insert 10 records - struct { - int64_t ts[10]; - int8_t b[10]; - int8_t v1[10]; - int16_t v2[10]; - int32_t v4[10]; - int64_t v8[10]; - float f4[10]; - double f8[10]; - char bin[10][40]; - char blob[10][80]; - } v; - - int32_t* t8_len = malloc(sizeof(int32_t) * 10); - int32_t* t16_len = malloc(sizeof(int32_t) * 10); - int32_t* t32_len = malloc(sizeof(int32_t) * 10); - int32_t* t64_len = malloc(sizeof(int32_t) * 10); - int32_t* float_len = malloc(sizeof(int32_t) * 10); - int32_t* double_len = malloc(sizeof(int32_t) * 10); - int32_t* bin_len = malloc(sizeof(int32_t) * 10); - int32_t* blob_len = malloc(sizeof(int32_t) * 10); - - TAOS_STMT* stmt = taos_stmt_init(taos); - TAOS_MULTI_BIND params[10]; - char is_null[10] = {0}; - - params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; - params[0].buffer_length = sizeof(v.ts[0]); - params[0].buffer = v.ts; - params[0].length = t64_len; - params[0].is_null = is_null; - params[0].num = 10; - - params[1].buffer_type = TSDB_DATA_TYPE_BOOL; - params[1].buffer_length = sizeof(v.b[0]); - params[1].buffer = v.b; - params[1].length = t8_len; - params[1].is_null = is_null; - params[1].num = 10; - - params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; - params[2].buffer_length = sizeof(v.v1[0]); - params[2].buffer = v.v1; - params[2].length = t8_len; - params[2].is_null = is_null; - params[2].num = 10; - - params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; - params[3].buffer_length = sizeof(v.v2[0]); - params[3].buffer = v.v2; - params[3].length = t16_len; - params[3].is_null = is_null; - params[3].num = 10; - - params[4].buffer_type = TSDB_DATA_TYPE_INT; - params[4].buffer_length = sizeof(v.v4[0]); - params[4].buffer = v.v4; - params[4].length = t32_len; - params[4].is_null = is_null; - params[4].num = 10; - - params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; - params[5].buffer_length = sizeof(v.v8[0]); - params[5].buffer = v.v8; - params[5].length = t64_len; - params[5].is_null = is_null; - params[5].num = 10; - - params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; - params[6].buffer_length = sizeof(v.f4[0]); - params[6].buffer = v.f4; - params[6].length = float_len; - params[6].is_null = is_null; - params[6].num = 10; - - params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; - params[7].buffer_length = sizeof(v.f8[0]); - params[7].buffer = v.f8; - params[7].length = double_len; - params[7].is_null = is_null; - params[7].num = 10; - - params[8].buffer_type = TSDB_DATA_TYPE_BINARY; - params[8].buffer_length = sizeof(v.bin[0]); - params[8].buffer = v.bin; - params[8].length = bin_len; - params[8].is_null = is_null; - params[8].num = 10; - - params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; - params[9].buffer_length = sizeof(v.blob[0]); - params[9].buffer = v.blob; - params[9].length = blob_len; - params[9].is_null = is_null; - params[9].num = 10; - - sql = "insert into ? (ts, b, v1, v2, v4, v8, f4, f8, bin, blob) values(?,?,?,?,?,?,?,?,?,?)"; - code = taos_stmt_prepare(stmt, sql, 0); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - code = taos_stmt_set_tbname(stmt, "m1"); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - int64_t ts = 1591060628000; - for (int i = 0; i < 10; ++i) { - v.ts[i] = ts++; - is_null[i] = 0; - - v.b[i] = (int8_t)i % 2; - v.v1[i] = (int8_t)i; - v.v2[i] = (int16_t)(i * 2); - v.v4[i] = (int32_t)(i * 4); - v.v8[i] = (int64_t)(i * 8); - v.f4[i] = (float)(i * 40); - v.f8[i] = (double)(i * 80); - for (int j = 0; j < sizeof(v.bin[0]); ++j) { - v.bin[i][j] = (char)(i + '0'); - } - strcpy(v.blob[i], "一二三四五六七八九十"); - - t8_len[i] = sizeof(int8_t); - t16_len[i] = sizeof(int16_t); - t32_len[i] = sizeof(int32_t); - t64_len[i] = sizeof(int64_t); - float_len[i] = sizeof(float); - double_len[i] = sizeof(double); - bin_len[i] = sizeof(v.bin[0]); - blob_len[i] = (int32_t)strlen(v.blob[i]); - } - - taos_stmt_bind_param_batch(stmt, params); - taos_stmt_add_batch(stmt); - - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - taos_stmt_close(stmt); - - // query the records - stmt = taos_stmt_init(taos); - taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); - TAOS_BIND qparams[2]; - - int8_t v1 = 5; - int16_t v2 = 15; - qparams[0].buffer_type = TSDB_DATA_TYPE_TINYINT; - qparams[0].buffer_length = sizeof(v1); - qparams[0].buffer = &v1; - qparams[0].length = &qparams[0].buffer_length; - qparams[0].is_null = NULL; - - qparams[1].buffer_type = TSDB_DATA_TYPE_SMALLINT; - qparams[1].buffer_length = sizeof(v2); - qparams[1].buffer = &v2; - qparams[1].length = &qparams[1].buffer_length; - qparams[1].is_null = NULL; - - taos_stmt_bind_param(stmt, qparams); - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - result = taos_stmt_use_result(stmt); - - TAOS_ROW row; - int rows = 0; - int num_fields = taos_num_fields(result); - TAOS_FIELD* fields = taos_fetch_fields(result); - - // fetch the records row by row - while ((row = taos_fetch_row(result))) { - char temp[256] = {0}; - rows++; - taos_print_row(temp, row, fields, num_fields); - printf("%s\n", temp); - } - - taos_free_result(result); - taos_stmt_close(stmt); - - free(t8_len); - free(t16_len); - free(t32_len); - free(t64_len); - free(float_len); - free(double_len); - free(bin_len); - free(blob_len); -} - -void verify_prepare3(TAOS* taos) { - TAOS_RES* result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database test;"); - - int code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - usleep(100000); - taos_select_db(taos, "test"); - - // create table - const char* sql = - "create stable st1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " - "binary(40), blob nchar(10)) tags (id1 int, id2 binary(40))"; - result = taos_query(taos, sql); - code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - TAOS_BIND tags[2]; - - int32_t id1 = 1; - char id2[40] = "abcdefghijklmnopqrstuvwxyz0123456789"; - uintptr_t id2_len = strlen(id2); - - tags[0].buffer_type = TSDB_DATA_TYPE_INT; - tags[0].buffer_length = sizeof(int); - tags[0].buffer = &id1; - tags[0].length = NULL; - tags[0].is_null = NULL; - - tags[1].buffer_type = TSDB_DATA_TYPE_BINARY; - tags[1].buffer_length = sizeof(id2); - tags[1].buffer = id2; - tags[1].length = &id2_len; - tags[1].is_null = NULL; - - // insert 10 records - struct { - int64_t ts[10]; - int8_t b[10]; - int8_t v1[10]; - int16_t v2[10]; - int32_t v4[10]; - int64_t v8[10]; - float f4[10]; - double f8[10]; - char bin[10][40]; - char blob[10][80]; - } v; - - int32_t* t8_len = malloc(sizeof(int32_t) * 10); - int32_t* t16_len = malloc(sizeof(int32_t) * 10); - int32_t* t32_len = malloc(sizeof(int32_t) * 10); - int32_t* t64_len = malloc(sizeof(int32_t) * 10); - int32_t* float_len = malloc(sizeof(int32_t) * 10); - int32_t* double_len = malloc(sizeof(int32_t) * 10); - int32_t* bin_len = malloc(sizeof(int32_t) * 10); - int32_t* blob_len = malloc(sizeof(int32_t) * 10); - - TAOS_STMT* stmt = taos_stmt_init(taos); - TAOS_MULTI_BIND params[10]; - char is_null[10] = {0}; - - params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; - params[0].buffer_length = sizeof(v.ts[0]); - params[0].buffer = v.ts; - params[0].length = t64_len; - params[0].is_null = is_null; - params[0].num = 10; - - params[1].buffer_type = TSDB_DATA_TYPE_BOOL; - params[1].buffer_length = sizeof(v.b[0]); - params[1].buffer = v.b; - params[1].length = t8_len; - params[1].is_null = is_null; - params[1].num = 10; - - params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; - params[2].buffer_length = sizeof(v.v1[0]); - params[2].buffer = v.v1; - params[2].length = t8_len; - params[2].is_null = is_null; - params[2].num = 10; - - params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; - params[3].buffer_length = sizeof(v.v2[0]); - params[3].buffer = v.v2; - params[3].length = t16_len; - params[3].is_null = is_null; - params[3].num = 10; - - params[4].buffer_type = TSDB_DATA_TYPE_INT; - params[4].buffer_length = sizeof(v.v4[0]); - params[4].buffer = v.v4; - params[4].length = t32_len; - params[4].is_null = is_null; - params[4].num = 10; - - params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; - params[5].buffer_length = sizeof(v.v8[0]); - params[5].buffer = v.v8; - params[5].length = t64_len; - params[5].is_null = is_null; - params[5].num = 10; - - params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; - params[6].buffer_length = sizeof(v.f4[0]); - params[6].buffer = v.f4; - params[6].length = float_len; - params[6].is_null = is_null; - params[6].num = 10; - - params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; - params[7].buffer_length = sizeof(v.f8[0]); - params[7].buffer = v.f8; - params[7].length = double_len; - params[7].is_null = is_null; - params[7].num = 10; - - params[8].buffer_type = TSDB_DATA_TYPE_BINARY; - params[8].buffer_length = sizeof(v.bin[0]); - params[8].buffer = v.bin; - params[8].length = bin_len; - params[8].is_null = is_null; - params[8].num = 10; - - params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; - params[9].buffer_length = sizeof(v.blob[0]); - params[9].buffer = v.blob; - params[9].length = blob_len; - params[9].is_null = is_null; - params[9].num = 10; - - sql = "insert into ? using st1 tags(?,?) values(?,?,?,?,?,?,?,?,?,?)"; - code = taos_stmt_prepare(stmt, sql, 0); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - code = taos_stmt_set_tbname_tags(stmt, "m1", tags); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - int64_t ts = 1591060628000; - for (int i = 0; i < 10; ++i) { - v.ts[i] = ts++; - is_null[i] = 0; - - v.b[i] = (int8_t)i % 2; - v.v1[i] = (int8_t)i; - v.v2[i] = (int16_t)(i * 2); - v.v4[i] = (int32_t)(i * 4); - v.v8[i] = (int64_t)(i * 8); - v.f4[i] = (float)(i * 40); - v.f8[i] = (double)(i * 80); - for (int j = 0; j < sizeof(v.bin[0]); ++j) { - v.bin[i][j] = (char)(i + '0'); - } - strcpy(v.blob[i], "一二三四五六七八九十"); - - t8_len[i] = sizeof(int8_t); - t16_len[i] = sizeof(int16_t); - t32_len[i] = sizeof(int32_t); - t64_len[i] = sizeof(int64_t); - float_len[i] = sizeof(float); - double_len[i] = sizeof(double); - bin_len[i] = sizeof(v.bin[0]); - blob_len[i] = (int32_t)strlen(v.blob[i]); - } - - taos_stmt_bind_param_batch(stmt, params); - taos_stmt_add_batch(stmt); - - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - taos_stmt_close(stmt); - - // query the records - stmt = taos_stmt_init(taos); - taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); - - TAOS_BIND qparams[2]; - - int8_t v1 = 5; - int16_t v2 = 15; - qparams[0].buffer_type = TSDB_DATA_TYPE_TINYINT; - qparams[0].buffer_length = sizeof(v1); - qparams[0].buffer = &v1; - qparams[0].length = &qparams[0].buffer_length; - qparams[0].is_null = NULL; - - qparams[1].buffer_type = TSDB_DATA_TYPE_SMALLINT; - qparams[1].buffer_length = sizeof(v2); - qparams[1].buffer = &v2; - qparams[1].length = &qparams[1].buffer_length; - qparams[1].is_null = NULL; - - taos_stmt_bind_param(stmt, qparams); - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - result = taos_stmt_use_result(stmt); - - TAOS_ROW row; - int rows = 0; - int num_fields = taos_num_fields(result); - TAOS_FIELD* fields = taos_fetch_fields(result); - - // fetch the records row by row - while ((row = taos_fetch_row(result))) { - char temp[256] = {0}; - rows++; - taos_print_row(temp, row, fields, num_fields); - printf("%s\n", temp); - } - - taos_free_result(result); - taos_stmt_close(stmt); - - free(t8_len); - free(t16_len); - free(t32_len); - free(t64_len); - free(float_len); - free(double_len); - free(bin_len); - free(blob_len); -} - -void retrieve_callback(void* param, TAOS_RES* tres, int numOfRows) { - if (numOfRows > 0) { - printf("%d rows async retrieved\n", numOfRows); - taos_fetch_rows_a(tres, retrieve_callback, param); - } else { - if (numOfRows < 0) { - printf("\033[31masync retrieve failed, code: %d\033[0m\n", numOfRows); - } else { - printf("async retrieve completed\n"); - } - taos_free_result(tres); - } -} - -void select_callback(void* param, TAOS_RES* tres, int code) { - if (code == 0 && tres) { - taos_fetch_rows_a(tres, retrieve_callback, param); - } else { - printf("\033[31masync select failed, code: %d\033[0m\n", code); - } -} - -void verify_async(TAOS* taos) { - prepare_data(taos); - taos_query_a(taos, "select * from meters", select_callback, NULL); - usleep(1000000); -} - -void stream_callback(void* param, TAOS_RES* res, TAOS_ROW row) { - if (res == NULL || row == NULL) { - return; - } - - int num_fields = taos_num_fields(res); - TAOS_FIELD* fields = taos_fetch_fields(res); - - printf("got one row from stream_callback\n"); - char temp[256] = {0}; - taos_print_row(temp, row, fields, num_fields); - puts(temp); -} - -void verify_stream(TAOS* taos) { - prepare_data(taos); - TAOS_STREAM* strm = - taos_open_stream(taos, "select count(*) from meters interval(1m)", stream_callback, 0, NULL, NULL); - printf("waiting for stream data\n"); - usleep(100000); - TAOS_RES* result = taos_query(taos, "insert into t0 values(now, 0)(now+5s,1)(now+10s, 2);"); - taos_free_result(result); - usleep(200000000); - taos_close_stream(strm); -} - -int32_t verify_schema_less(TAOS* taos) { - TAOS_RES* result; - result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database test precision 'us' update 1;"); - taos_free_result(result); - usleep(100000); - - taos_select_db(taos, "test"); - result = taos_query(taos, "create stable ste(ts timestamp, f int) tags(t1 bigint)"); - taos_free_result(result); - usleep(100000); - - int code = 0; - - char* lines[] = { - "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000ns", - "st,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833640000000ns", - "ste,t2=5f64,t3=L\"ste\" c1=true,c2=4i64,c3=\"iam\" 1626056811823316532ns", - "st,t1=4i64,t2=5f64,t3=\"t4\" c1=3i64,c3=L\"passitagain\",c2=true,c4=5f64 1626006833642000000ns", - "ste,t2=5f64,t3=L\"ste2\" c3=\"iamszhou\",c4=false 1626056811843316532ns", - "ste,t2=5f64,t3=L\"ste2\" c3=\"iamszhou\",c4=false,c5=32i8,c6=64i16,c7=32i32,c8=88.88f32 1626056812843316532ns", - "st,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64,c6=7u64 " - "1626006933640000000ns", - "stf,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64,c6=7u64 " - "1626006933640000000ns", - "stf,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin_stf\",c2=false,c5=5f64,c6=7u64 " - "1626006933641000000ns"}; - - code = taos_insert_lines(taos, lines, sizeof(lines) / sizeof(char*)); - - char* lines2[] = { - "stg,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000ns", - "stg,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833640000000ns"}; - code = taos_insert_lines(taos, &lines2[0], 1); - code = taos_insert_lines(taos, &lines2[1], 1); - - char* lines3[] = { - "sth,t1=4i64,t2=5f64,t4=5f64,ID=\"childtable\" c1=3i64,c3=L\"passitagin_stf\",c2=false,c5=5f64,c6=7u64 " - "1626006933641ms", - "sth,t1=4i64,t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin_stf\",c2=false,c5=5f64,c6=7u64 1626006933654ms"}; - code = taos_insert_lines(taos, lines3, 2); - - char* lines4[] = {"st123456,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000ns", - "dgtyqodr,t2=5f64,t3=L\"ste\" c1=tRue,c2=4i64,c3=\"iam\" 1626056811823316532ns"}; - code = taos_insert_lines(taos, lines4, 2); - - char* lines5[] = { - "zqlbgs,id=\"zqlbgs_39302_21680\",t0=f,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11." - "12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\" " - "c0=f,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=" - "\"binaryColValue\",c8=L\"ncharColValue\",c9=7u64 1626006833639000000ns", - "zqlbgs,t9=f,id=\"zqlbgs_39302_21680\",t0=f,t1=127i8,t11=127i8,t2=32767i16,t3=2147483647i32,t4=" - "9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\",t10=" - "L\"ncharTagValue\" " - "c10=f,c0=f,c1=127i8,c12=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22." - "123456789f64,c7=\"binaryColValue\",c8=L\"ncharColValue\",c9=7u64,c11=L\"ncharColValue\" 1626006833639000000ns"}; - code = taos_insert_lines(taos, &lines5[0], 1); - code = taos_insert_lines(taos, &lines5[1], 1); - - char* lines6[] = {"st123456,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000ns", - "dgtyqodr,t2=5f64,t3=L\"ste\" c1=tRue,c2=4i64,c3=\"iam\" 1626056811823316532ns"}; - code = taos_insert_lines(taos, lines6, 2); - return (code); -} - -void verify_telnet_insert(TAOS* taos) { - TAOS_RES* result; - - result = taos_query(taos, "drop database if exists db;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database db precision 'ms';"); - taos_free_result(result); - usleep(100000); - - (void)taos_select_db(taos, "db"); - int32_t code = 0; - - /* metric */ - char* lines0[] = { - "stb0_0 1626006833639000000ns 4i8 host=\"host0\",interface=\"eth0\"", - "stb0_1 1626006833639000000ns 4i8 host=\"host0\",interface=\"eth0\"", - "stb0_2 1626006833639000000ns 4i8 host=\"host0\",interface=\"eth0\"", - }; - code = taos_insert_telnet_lines(taos, lines0, 3); - if (code) { - printf("lines0 code: %d, %s.\n", code, tstrerror(code)); - } - - /* timestamp */ - char* lines1[] = { - "stb1 1626006833s 1i8 host=\"host0\"", "stb1 1626006833639000000ns 2i8 host=\"host0\"", - "stb1 1626006833640000us 3i8 host=\"host0\"", "stb1 1626006833641123 4i8 host=\"host0\"", - "stb1 1626006833651ms 5i8 host=\"host0\"", "stb1 0 6i8 host=\"host0\"", - }; - code = taos_insert_telnet_lines(taos, lines1, 6); - if (code) { - printf("lines1 code: %d, %s.\n", code, tstrerror(code)); - } - - /* metric value */ - // tinyin - char* lines2_0[] = {"stb2_0 1626006833651ms -127i8 host=\"host0\"", "stb2_0 1626006833652ms 127i8 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_0, 2); - if (code) { - printf("lines2_0 code: %d, %s.\n", code, tstrerror(code)); - } - - // smallint - char* lines2_1[] = {"stb2_1 1626006833651ms -32767i16 host=\"host0\"", - "stb2_1 1626006833652ms 32767i16 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_1, 2); - if (code) { - printf("lines2_1 code: %d, %s.\n", code, tstrerror(code)); - } - - // int - char* lines2_2[] = {"stb2_2 1626006833651ms -2147483647i32 host=\"host0\"", - "stb2_2 1626006833652ms 2147483647i32 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_2, 2); - if (code) { - printf("lines2_2 code: %d, %s.\n", code, tstrerror(code)); - } - - // bigint - char* lines2_3[] = {"stb2_3 1626006833651ms -9223372036854775807i64 host=\"host0\"", - "stb2_3 1626006833652ms 9223372036854775807i64 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_3, 2); - if (code) { - printf("lines2_3 code: %d, %s.\n", code, tstrerror(code)); - } - - // float - char* lines2_4[] = { - "stb2_4 1626006833610ms 3f32 host=\"host0\"", "stb2_4 1626006833620ms -3f32 host=\"host0\"", - "stb2_4 1626006833630ms 3.4f32 host=\"host0\"", "stb2_4 1626006833640ms -3.4f32 host=\"host0\"", - "stb2_4 1626006833650ms 3.4E10f32 host=\"host0\"", "stb2_4 1626006833660ms -3.4e10f32 host=\"host0\"", - "stb2_4 1626006833670ms 3.4E+2f32 host=\"host0\"", "stb2_4 1626006833680ms -3.4e-2f32 host=\"host0\"", - "stb2_4 1626006833690ms 3.15 host=\"host0\"", "stb2_4 1626006833700ms 3.4E38f32 host=\"host0\"", - "stb2_4 1626006833710ms -3.4E38f32 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_4, 11); - if (code) { - printf("lines2_4 code: %d, %s.\n", code, tstrerror(code)); - } - - // double - char* lines2_5[] = { - "stb2_5 1626006833610ms 3f64 host=\"host0\"", "stb2_5 1626006833620ms -3f64 host=\"host0\"", - "stb2_5 1626006833630ms 3.4f64 host=\"host0\"", "stb2_5 1626006833640ms -3.4f64 host=\"host0\"", - "stb2_5 1626006833650ms 3.4E10f64 host=\"host0\"", "stb2_5 1626006833660ms -3.4e10f64 host=\"host0\"", - "stb2_5 1626006833670ms 3.4E+2f64 host=\"host0\"", "stb2_5 1626006833680ms -3.4e-2f64 host=\"host0\"", - "stb2_5 1626006833690ms 1.7E308f64 host=\"host0\"", "stb2_5 1626006833700ms -1.7E308f64 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_5, 10); - if (code) { - printf("lines2_5 code: %d, %s.\n", code, tstrerror(code)); - } - - // bool - char* lines2_6[] = {"stb2_6 1626006833610ms t host=\"host0\"", "stb2_6 1626006833620ms T host=\"host0\"", - "stb2_6 1626006833630ms true host=\"host0\"", "stb2_6 1626006833640ms True host=\"host0\"", - "stb2_6 1626006833650ms TRUE host=\"host0\"", "stb2_6 1626006833660ms f host=\"host0\"", - "stb2_6 1626006833670ms F host=\"host0\"", "stb2_6 1626006833680ms false host=\"host0\"", - "stb2_6 1626006833690ms False host=\"host0\"", "stb2_6 1626006833700ms FALSE host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_6, 10); - if (code) { - printf("lines2_6 code: %d, %s.\n", code, tstrerror(code)); - } - - // binary - char* lines2_7[] = {"stb2_7 1626006833610ms \"binary_val.!@#$%^&*\" host=\"host0\"", - "stb2_7 1626006833620ms \"binary_val.:;,./?|+-=\" host=\"host0\"", - "stb2_7 1626006833630ms \"binary_val.()[]{}<>\" host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_7, 3); - if (code) { - printf("lines2_7 code: %d, %s.\n", code, tstrerror(code)); - } - - // nchar - char* lines2_8[] = { - "stb2_8 1626006833610ms L\"nchar_val数值一\" host=\"host0\"", - "stb2_8 1626006833620ms L\"nchar_val数值二\" host=\"host0\"", - }; - code = taos_insert_telnet_lines(taos, lines2_8, 2); - if (code) { - printf("lines2_8 code: %d, %s.\n", code, tstrerror(code)); - } - - /* tags */ - // tag value types - char* lines3_0[] = { - "stb3_0 1626006833610ms 1 " - "t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=3.4E38f32,t6=1.7E308f64,t7=true,t8=\"binary_" - "val_1\",t9=L\"标签值1\"", - "stb3_0 1626006833610ms 2 " - "t1=-127i8,t2=-32767i16,t3=-2147483647i32,t4=-9223372036854775807i64,t5=-3.4E38f32,t6=-1.7E308f64,t7=false,t8=" - "\"binary_val_2\",t9=L\"标签值2\""}; - code = taos_insert_telnet_lines(taos, lines3_0, 2); - if (code) { - printf("lines3_0 code: %d, %s.\n", code, tstrerror(code)); - } - - // tag ID as child table name - char* lines3_1[] = {"stb3_1 1626006833610ms 1 id=\"child_table1\",host=\"host1\"", - "stb3_1 1626006833610ms 2 host=\"host2\",iD=\"child_table2\"", - "stb3_1 1626006833610ms 3 ID=\"child_table3\",host=\"host3\""}; - code = taos_insert_telnet_lines(taos, lines3_1, 3); - if (code) { - printf("lines3_1 code: %d, %s.\n", code, tstrerror(code)); - } - - return; -} - -void verify_json_insert(TAOS* taos) { - TAOS_RES* result; - - result = taos_query(taos, "drop database if exists db;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database db precision 'ms';"); - taos_free_result(result); - usleep(100000); - - (void)taos_select_db(taos, "db"); - int32_t code = 0; - - char* message = - "{ \ - \"metric\":\"cpu_load_0\", \ - \"timestamp\": 1626006833610123, \ - \"value\": 55.5, \ - \"tags\": \ - { \ - \"host\": \"ubuntu\", \ - \"interface1\": \"eth0\", \ - \"Id\": \"tb0\" \ - } \ - }"; - - code = taos_insert_json_payload(taos, message); - if (code) { - printf("payload_0 code: %d, %s.\n", code, tstrerror(code)); - } - - char* message1 = - "[ \ - { \ - \"metric\":\"cpu_load_1\", \ - \"timestamp\": 1626006833610123, \ - \"value\": 55.5, \ - \"tags\": \ - { \ - \"host\": \"ubuntu\", \ - \"interface\": \"eth1\", \ - \"Id\": \"tb1\" \ - } \ - }, \ - { \ - \"metric\":\"cpu_load_2\", \ - \"timestamp\": 1626006833610123, \ - \"value\": 55.5, \ - \"tags\": \ - { \ - \"host\": \"ubuntu\", \ - \"interface\": \"eth2\", \ - \"Id\": \"tb2\" \ - } \ - } \ - ]"; - - code = taos_insert_json_payload(taos, message1); - if (code) { - printf("payload_1 code: %d, %s.\n", code, tstrerror(code)); - } - - char* message2 = - "[ \ - { \ - \"metric\":\"cpu_load_3\", \ - \"timestamp\": \ - { \ - \"value\": 1626006833610123, \ - \"type\": \"us\" \ - }, \ - \"value\": \ - { \ - \"value\": 55, \ - \"type\": \"int\" \ - }, \ - \"tags\": \ - { \ - \"host\": \ - { \ - \"value\": \"ubuntu\", \ - \"type\": \"binary\" \ - }, \ - \"interface\": \ - { \ - \"value\": \"eth3\", \ - \"type\": \"nchar\" \ - }, \ - \"ID\": \"tb3\", \ - \"port\": \ - { \ - \"value\": 4040, \ - \"type\": \"int\" \ - } \ - } \ - }, \ - { \ - \"metric\":\"cpu_load_4\", \ - \"timestamp\": 1626006833610123, \ - \"value\": 66.6, \ - \"tags\": \ - { \ - \"host\": \"ubuntu\", \ - \"interface\": \"eth4\", \ - \"Id\": \"tb4\" \ - } \ - } \ - ]"; - code = taos_insert_json_payload(taos, message2); - if (code) { - printf("payload_2 code: %d, %s.\n", code, tstrerror(code)); - } - - cJSON *payload, *tags; - char* payload_str; - - /* Default format */ - // number - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_0"); - cJSON_AddNumberToObject(payload, "timestamp", 1626006833610123); - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_0 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // true - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_1"); - cJSON_AddNumberToObject(payload, "timestamp", 1626006833610123); - cJSON_AddTrueToObject(payload, "value"); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_1 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // false - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_2"); - cJSON_AddNumberToObject(payload, "timestamp", 1626006833610123); - cJSON_AddFalseToObject(payload, "value"); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_2 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // string - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_3"); - cJSON_AddNumberToObject(payload, "timestamp", 1626006833610123); - cJSON_AddStringToObject(payload, "value", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_3 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // timestamp 0 -> current time - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_4"); - cJSON_AddNumberToObject(payload, "timestamp", 0); - cJSON_AddNumberToObject(payload, "value", 123); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_4 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // ID - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_5"); - cJSON_AddNumberToObject(payload, "timestamp", 0); - cJSON_AddNumberToObject(payload, "value", 123); - tags = cJSON_CreateObject(); - cJSON_AddStringToObject(tags, "ID", "tb0_5"); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddStringToObject(tags, "iD", "tb000"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddStringToObject(tags, "id", "tb555"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_5 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - /* Nested format */ - // timestamp - cJSON* timestamp; - // seconds - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_0"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_0 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // milleseconds - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_1"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833610); - cJSON_AddStringToObject(timestamp, "type", "ms"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_1 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // microseconds - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_2"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833610123); - cJSON_AddStringToObject(timestamp, "type", "us"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_2 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // nanoseconds - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_3"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833610123321); - cJSON_AddStringToObject(timestamp, "type", "ns"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_3 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // now - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_4"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 0); - cJSON_AddStringToObject(timestamp, "type", "ns"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_4 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // metric value - cJSON* metric_val; - // bool - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_0"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddTrueToObject(metric_val, "value"); - cJSON_AddStringToObject(metric_val, "type", "bool"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_0 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // tinyint - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_1"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 127); - cJSON_AddStringToObject(metric_val, "type", "tinyint"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_1 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // smallint - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_2"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 32767); - cJSON_AddStringToObject(metric_val, "type", "smallint"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_2 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // int - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_3"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 2147483647); - cJSON_AddStringToObject(metric_val, "type", "int"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_3 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // bigint - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_4"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 9223372036854775807); - cJSON_AddStringToObject(metric_val, "type", "bigint"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_4 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // float - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_5"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 11.12345); - cJSON_AddStringToObject(metric_val, "type", "float"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_5 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // double - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_6"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 22.123456789); - cJSON_AddStringToObject(metric_val, "type", "double"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_6 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // binary - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_7"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddStringToObject(metric_val, "value", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddStringToObject(metric_val, "type", "binary"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_7 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // nchar - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_8"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddStringToObject(metric_val, "value", "你好"); - cJSON_AddStringToObject(metric_val, "type", "nchar"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_8 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // tag value - cJSON* tag; - - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb3_0"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddStringToObject(metric_val, "value", "hello"); - cJSON_AddStringToObject(metric_val, "type", "nchar"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - - tag = cJSON_CreateObject(); - cJSON_AddTrueToObject(tag, "value"); - cJSON_AddStringToObject(tag, "type", "bool"); - cJSON_AddItemToObject(tags, "t1", tag); - - tag = cJSON_CreateObject(); - cJSON_AddFalseToObject(tag, "value"); - cJSON_AddStringToObject(tag, "type", "bool"); - cJSON_AddItemToObject(tags, "t2", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 127); - cJSON_AddStringToObject(tag, "type", "tinyint"); - cJSON_AddItemToObject(tags, "t3", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 32767); - cJSON_AddStringToObject(tag, "type", "smallint"); - cJSON_AddItemToObject(tags, "t4", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 2147483647); - cJSON_AddStringToObject(tag, "type", "int"); - cJSON_AddItemToObject(tags, "t5", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 9223372036854775807); - cJSON_AddStringToObject(tag, "type", "bigint"); - cJSON_AddItemToObject(tags, "t6", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 11.12345); - cJSON_AddStringToObject(tag, "type", "float"); - cJSON_AddItemToObject(tags, "t7", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 22.1234567890); - cJSON_AddStringToObject(tag, "type", "double"); - cJSON_AddItemToObject(tags, "t8", tag); - - tag = cJSON_CreateObject(); - cJSON_AddStringToObject(tag, "value", "binary_val"); - cJSON_AddStringToObject(tag, "type", "binary"); - cJSON_AddItemToObject(tags, "t9", tag); - - tag = cJSON_CreateObject(); - cJSON_AddStringToObject(tag, "value", "你好"); - cJSON_AddStringToObject(tag, "type", "nchar"); - cJSON_AddItemToObject(tags, "t10", tag); - - cJSON_AddItemToObject(payload, "tags", tags); - - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload3_0 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); -} - -int main(int argc, char* argv[]) { - const char* host = "127.0.0.1"; - const char* user = "root"; - const char* passwd = "taosdata"; - - taos_options(TSDB_OPTION_TIMEZONE, "GMT-8"); - TAOS* taos = taos_connect(host, user, passwd, "", 0); - if (taos == NULL) { - printf("\033[31mfailed to connect to db, reason:%s\033[0m\n", taos_errstr(taos)); - exit(1); - } - - char* info = taos_get_server_info(taos); - printf("server info: %s\n", info); - info = taos_get_client_info(taos); - printf("client info: %s\n", info); - - printf("************ verify schema-less *************\n"); - verify_schema_less(taos); - - printf("************ verify telnet-insert *************\n"); - verify_telnet_insert(taos); - - printf("************ verify json-insert *************\n"); - verify_json_insert(taos); - - printf("************ verify query *************\n"); - verify_query(taos); - - printf("********* verify async query **********\n"); - verify_async(taos); - - printf("*********** verify subscribe ************\n"); - verify_subscribe(taos); - - printf("************ verify prepare *************\n"); - verify_prepare(taos); - - printf("************ verify prepare2 *************\n"); - verify_prepare2(taos); - printf("************ verify prepare3 *************\n"); - verify_prepare3(taos); - - printf("************ verify stream *************\n"); - verify_stream(taos); - printf("done\n"); - taos_close(taos); - taos_cleanup(); -} diff --git a/examples/c/asyncdemo.c b/examples/c/asyncdemo.c index 07e61b871e..faf636ee2e 100644 --- a/examples/c/asyncdemo.c +++ b/examples/c/asyncdemo.c @@ -24,7 +24,7 @@ #include #include -#include "../../../include/client/taos.h" +#include "../../include/client/taos.h" int points = 5; int numOfTables = 3; diff --git a/examples/c/demo.c b/examples/c/demo.c index c3d9a5e96a..f11002d55b 100644 --- a/examples/c/demo.c +++ b/examples/c/demo.c @@ -20,7 +20,7 @@ #include #include #include -#include "../../../include/client/taos.h" // TAOS header file +#include "../../include/client/taos.h" // TAOS header file static void queryDB(TAOS *taos, char *command) { int i; diff --git a/examples/c/epoll.c b/examples/c/epoll.c deleted file mode 100644 index 284268ac43..0000000000 --- a/examples/c/epoll.c +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -// how to use to do a pressure-test upon eok -// tester: cat /dev/urandom | nc -c -// testee: ./debug/build/bin/epoll -l > /dev/null -// compare against: nc -l > /dev/null -// monitor and compare : glances - -#ifdef __APPLE__ -#include "osEok.h" -#else // __APPLE__ -#include -#endif // __APPLE__ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define D(fmt, ...) fprintf(stderr, "%s[%d]%s(): " fmt "\n", basename(__FILE__), __LINE__, __func__, ##__VA_ARGS__) -#define A(statement, fmt, ...) do { \ - if (statement) break; \ - fprintf(stderr, "%s[%d]%s(): assert [%s] failed: %d[%s]: " fmt "\n", \ - basename(__FILE__), __LINE__, __func__, \ - #statement, errno, strerror(errno), \ - ##__VA_ARGS__); \ - abort(); \ -} while (0) - -#define E(fmt, ...) do { \ - fprintf(stderr, "%s[%d]%s(): %d[%s]: " fmt "\n", \ - basename(__FILE__), __LINE__, __func__, \ - errno, strerror(errno), \ - ##__VA_ARGS__); \ -} while (0) - -#include "os.h" - -typedef struct ep_s ep_t; -struct ep_s { - int ep; - - pthread_mutex_t lock; - int sv[2]; // 0 for read, 1 for write; - pthread_t thread; - - volatile unsigned int stopping:1; - volatile unsigned int waiting:1; - volatile unsigned int wakenup:1; -}; - -static int ep_dummy = 0; - -static ep_t* ep_create(void); -static void ep_destroy(ep_t *ep); -static void* routine(void* arg); -static int open_listen(unsigned short port); - -typedef struct fde_s fde_t; -struct fde_s { - int skt; - void (*on_event)(ep_t *ep, struct epoll_event *events, fde_t *client); -}; - -static void listen_event(ep_t *ep, struct epoll_event *ev, fde_t *client); -static void null_event(ep_t *ep, struct epoll_event *ev, fde_t *client); - -#define usage(arg0, fmt, ...) do { \ - if (fmt[0]) { \ - fprintf(stderr, "" fmt "\n", ##__VA_ARGS__); \ - } \ - fprintf(stderr, "usage:\n"); \ - fprintf(stderr, " %s -l : specify listenning port\n", arg0); \ -} while (0) - -int main(int argc, char *argv[]) { - char *prg = basename(argv[0]); - if (argc==1) { - usage(prg, ""); - return 0; - } - ep_t* ep = ep_create(); - A(ep, "failed"); - for (int i=1; i=argc) { - usage(prg, "expecting after -l, but got nothing"); - return 1; // confirmed potential leakage - } - arg = argv[i]; - int port = atoi(arg); - int skt = open_listen(port); - if (skt==-1) continue; - fde_t *client = (fde_t*)calloc(1, sizeof(*client)); - if (!client) { - E("out of memory"); - close(skt); - continue; - } - client->skt = skt; - client->on_event = listen_event; - struct epoll_event ev = {0}; - ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLRDHUP; - ev.data.ptr = client; - A(0==epoll_ctl(ep->ep, EPOLL_CTL_ADD, skt, &ev), ""); - continue; - } - usage(prg, "unknown argument: [%s]", arg); - return 1; - } - char *line = NULL; - size_t linecap = 0; - ssize_t linelen; - while ((linelen = getline(&line, &linecap, stdin)) > 0) { - line[strlen(line)-1] = '\0'; - if (0==strcmp(line, "exit")) break; - if (0==strcmp(line, "quit")) break; - if (line==strstr(line, "close")) { - int fd = 0; - sscanf(line, "close %d", &fd); - if (fd<=2) { - fprintf(stderr, "fd [%d] invalid\n", fd); - continue; - } - A(0==epoll_ctl(ep->ep, EPOLL_CTL_DEL, fd, NULL), ""); - continue; - } - if (strlen(line)==0) continue; - fprintf(stderr, "unknown cmd:[%s]\n", line); - } - ep_destroy(ep); - D(""); - return 0; -} - -ep_t* ep_create(void) { - ep_t *ep = (ep_t*)calloc(1, sizeof(*ep)); - A(ep, "out of memory"); - A(-1!=(ep->ep = epoll_create(1)), ""); - ep->sv[0] = -1; - ep->sv[1] = -1; - A(0==socketpair(AF_LOCAL, SOCK_STREAM, 0, ep->sv), ""); - A(0==pthread_mutex_init(&ep->lock, NULL), ""); - A(0==pthread_mutex_lock(&ep->lock), ""); - struct epoll_event ev = {0}; - ev.events = EPOLLIN; - ev.data.ptr = &ep_dummy; - A(0==epoll_ctl(ep->ep, EPOLL_CTL_ADD, ep->sv[0], &ev), ""); - A(0==pthread_create(&ep->thread, NULL, routine, ep), ""); - A(0==pthread_mutex_unlock(&ep->lock), ""); - return ep; -} - -static void ep_destroy(ep_t *ep) { - A(ep, "invalid argument"); - ep->stopping = 1; - A(1==send(ep->sv[1], "1", 1, 0), ""); - A(0==pthread_join(ep->thread, NULL), ""); - A(0==pthread_mutex_destroy(&ep->lock), ""); - A(0==close(ep->sv[0]), ""); - A(0==close(ep->sv[1]), ""); - A(0==close(ep->ep), ""); - free(ep); -} - -static void* routine(void* arg) { - A(arg, "invalid argument"); - ep_t *ep = (ep_t*)arg; - - while (!ep->stopping) { - struct epoll_event evs[10]; - memset(evs, 0, sizeof(evs)); - - A(0==pthread_mutex_lock(&ep->lock), ""); - A(ep->waiting==0, "internal logic error"); - ep->waiting = 1; - A(0==pthread_mutex_unlock(&ep->lock), ""); - - int r = epoll_wait(ep->ep, evs, sizeof(evs)/sizeof(evs[0]), -1); - A(r>0, "indefinite epoll_wait shall not timeout:[%d]", r); - - A(0==pthread_mutex_lock(&ep->lock), ""); - A(ep->waiting==1, "internal logic error"); - ep->waiting = 0; - A(0==pthread_mutex_unlock(&ep->lock), ""); - - for (int i=0; idata.ptr == &ep_dummy) { - char c = '\0'; - A(1==recv(ep->sv[0], &c, 1, 0), "internal logic error"); - A(0==pthread_mutex_lock(&ep->lock), ""); - ep->wakenup = 0; - A(0==pthread_mutex_unlock(&ep->lock), ""); - continue; - } - A(ev->data.ptr, "internal logic error"); - fde_t *client = (fde_t*)ev->data.ptr; - client->on_event(ep, ev, client); - continue; - } - } - return NULL; -} - -static int open_listen(unsigned short port) { - int r = 0; - int skt = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (skt==-1) { - E("socket() failed"); - return -1; - } - do { - struct sockaddr_in si = {0}; - si.sin_family = AF_INET; - si.sin_addr.s_addr = inet_addr("0.0.0.0"); - si.sin_port = htons(port); - r = bind(skt, (struct sockaddr*)&si, sizeof(si)); - if (r) { - E("bind(%u) failed", port); - break; - } - r = listen(skt, 100); - if (r) { - E("listen() failed"); - break; - } - memset(&si, 0, sizeof(si)); - socklen_t len = sizeof(si); - r = getsockname(skt, (struct sockaddr *)&si, &len); - if (r) { - E("getsockname() failed"); - } - A(len==sizeof(si), "internal logic error"); - D("listenning at: %d", ntohs(si.sin_port)); - return skt; - } while (0); - close(skt); - return -1; -} - -static void listen_event(ep_t *ep, struct epoll_event *ev, fde_t *client) { - A(ev->events & EPOLLIN, "internal logic error"); - struct sockaddr_in si = {0}; - socklen_t silen = sizeof(si); - int skt = accept(client->skt, (struct sockaddr*)&si, &silen); - A(skt!=-1, "internal logic error"); - fde_t *server = (fde_t*)calloc(1, sizeof(*server)); - if (!server) { - close(skt); - return; - } - server->skt = skt; - server->on_event = null_event; - struct epoll_event ee = {0}; - ee.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLRDHUP; - ee.data.ptr = server; - A(0==epoll_ctl(ep->ep, EPOLL_CTL_ADD, skt, &ee), ""); -} - -static void null_event(ep_t *ep, struct epoll_event *ev, fde_t *client) { - if (ev->events & EPOLLIN) { - char buf[8192]; - int n = recv(client->skt, buf, sizeof(buf), 0); - A(n>=0 && n<=sizeof(buf), "internal logic error:[%d]", n); - A(n==fwrite(buf, 1, n, stdout), "internal logic error"); - } - if (ev->events & (EPOLLERR | EPOLLHUP | EPOLLRDHUP)) { - A(0==pthread_mutex_lock(&ep->lock), ""); - A(0==epoll_ctl(ep->ep, EPOLL_CTL_DEL, client->skt, NULL), ""); - A(0==pthread_mutex_unlock(&ep->lock), ""); - close(client->skt); - client->skt = -1; - client->on_event = NULL; - free(client); - } -} - diff --git a/examples/c/makefile b/examples/c/makefile index c85eb4adc5..244d13fad7 100644 --- a/examples/c/makefile +++ b/examples/c/makefile @@ -7,22 +7,21 @@ LFLAGS = '-Wl,-rpath,/usr/local/taos/driver/' -ltaos -lpthread -lm -lrt CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion \ -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX \ -Wno-unused-function -D_M_X64 -I/usr/local/taos/include -std=gnu99 \ - -I../../../deps/cJson/inc + -I/usr/local/include/cjson all: $(TARGET) exe: gcc $(CFLAGS) ./asyncdemo.c -o $(ROOT)asyncdemo $(LFLAGS) gcc $(CFLAGS) ./demo.c -o $(ROOT)demo $(LFLAGS) gcc $(CFLAGS) ./prepare.c -o $(ROOT)prepare $(LFLAGS) - gcc $(CFLAGS) ./stream.c -o $(ROOT)stream $(LFLAGS) - gcc $(CFLAGS) ./subscribe.c -o $(ROOT)subscribe $(LFLAGS) - gcc $(CFLAGS) ./apitest.c -o $(ROOT)apitest $(LFLAGS) + gcc $(CFLAGS) ./stream_demo.c -o $(ROOT)stream_demo $(LFLAGS) + gcc $(CFLAGS) ./tmq.c -o $(ROOT)tmq $(LFLAGS) + gcc $(CFLAGS) ./schemaless.c -o $(ROOT)schemaless $(LFLAGS) clean: rm $(ROOT)asyncdemo rm $(ROOT)demo rm $(ROOT)prepare - rm $(ROOT)batchprepare - rm $(ROOT)stream - rm $(ROOT)subscribe - rm $(ROOT)apitest + rm $(ROOT)stream_demo + rm $(ROOT)tmq + rm $(ROOT)schemaless diff --git a/examples/c/prepare.c b/examples/c/prepare.c index f0341cfe12..3edfe911ed 100644 --- a/examples/c/prepare.c +++ b/examples/c/prepare.c @@ -4,7 +4,7 @@ #include #include #include -#include "../../../include/client/taos.h" +#include "../../include/client/taos.h" void taosMsleep(int mseconds); @@ -70,70 +70,89 @@ int main(int argc, char *argv[]) char blob[80]; } v = {0}; + int32_t boolLen = sizeof(int8_t); + int32_t sintLen = sizeof(int16_t); + int32_t intLen = sizeof(int32_t); + int32_t bintLen = sizeof(int64_t); + int32_t floatLen = sizeof(float); + int32_t doubleLen = sizeof(double); + int32_t binLen = sizeof(v.bin); + int32_t ncharLen = 30; + stmt = taos_stmt_init(taos); - TAOS_BIND params[10]; + TAOS_MULTI_BIND params[10]; params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; params[0].buffer_length = sizeof(v.ts); params[0].buffer = &v.ts; - params[0].length = ¶ms[0].buffer_length; + params[0].length = &bintLen; params[0].is_null = NULL; + params[0].num = 1; params[1].buffer_type = TSDB_DATA_TYPE_BOOL; params[1].buffer_length = sizeof(v.b); params[1].buffer = &v.b; - params[1].length = ¶ms[1].buffer_length; + params[1].length = &boolLen; params[1].is_null = NULL; + params[1].num = 1; params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; params[2].buffer_length = sizeof(v.v1); params[2].buffer = &v.v1; - params[2].length = ¶ms[2].buffer_length; + params[2].length = &boolLen; params[2].is_null = NULL; + params[2].num = 1; params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; params[3].buffer_length = sizeof(v.v2); params[3].buffer = &v.v2; - params[3].length = ¶ms[3].buffer_length; + params[3].length = &sintLen; params[3].is_null = NULL; + params[3].num = 1; params[4].buffer_type = TSDB_DATA_TYPE_INT; params[4].buffer_length = sizeof(v.v4); params[4].buffer = &v.v4; - params[4].length = ¶ms[4].buffer_length; + params[4].length = &intLen; params[4].is_null = NULL; + params[4].num = 1; params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; params[5].buffer_length = sizeof(v.v8); params[5].buffer = &v.v8; - params[5].length = ¶ms[5].buffer_length; + params[5].length = &bintLen; params[5].is_null = NULL; + params[5].num = 1; params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; params[6].buffer_length = sizeof(v.f4); params[6].buffer = &v.f4; - params[6].length = ¶ms[6].buffer_length; + params[6].length = &floatLen; params[6].is_null = NULL; + params[6].num = 1; params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; params[7].buffer_length = sizeof(v.f8); params[7].buffer = &v.f8; - params[7].length = ¶ms[7].buffer_length; + params[7].length = &doubleLen; params[7].is_null = NULL; + params[7].num = 1; params[8].buffer_type = TSDB_DATA_TYPE_BINARY; params[8].buffer_length = sizeof(v.bin); params[8].buffer = v.bin; - params[8].length = ¶ms[8].buffer_length; + params[8].length = &binLen; params[8].is_null = NULL; + params[8].num = 1; strcpy(v.blob, "一二三四五六七八九十"); params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; - params[9].buffer_length = strlen(v.blob); + params[9].buffer_length = sizeof(v.blob); params[9].buffer = v.blob; - params[9].length = ¶ms[9].buffer_length; + params[9].length = &ncharLen; params[9].is_null = NULL; + params[9].num = 1; - int is_null = 1; + char is_null = 1; sql = "insert into m1 values(?,?,?,?,?,?,?,?,?,?)"; code = taos_stmt_prepare(stmt, sql, 0); @@ -153,7 +172,7 @@ int main(int argc, char *argv[]) v.v8 = (int64_t)(i * 8); v.f4 = (float)(i * 40); v.f8 = (double)(i * 80); - for (int j = 0; j < sizeof(v.bin) - 1; ++j) { + for (int j = 0; j < sizeof(v.bin); ++j) { v.bin[j] = (char)(i + '0'); } diff --git a/examples/c/schemaless.c b/examples/c/schemaless.c index 99aa361b0a..5c0bbb372c 100644 --- a/examples/c/schemaless.c +++ b/examples/c/schemaless.c @@ -1,5 +1,4 @@ -#include "../../../include/client/taos.h" -#include "os.h" +#include "../../include/client/taos.h" #include "taoserror.h" #include @@ -7,26 +6,14 @@ #include #include #include +#include +#include + int numSuperTables = 8; int numChildTables = 4; int numRowsPerChildTable = 2048; -void shuffle(char**lines, size_t n) -{ - if (n > 1) - { - size_t i; - for (i = 0; i < n - 1; i++) - { - size_t j = i + taosRand() / (RAND_MAX / (n - i) + 1); - char* t = lines[j]; - lines[j] = lines[i]; - lines[i] = t; - } - } -} - static int64_t getTimeInUs() { struct timeval systemTime; gettimeofday(&systemTime, NULL); @@ -46,7 +33,7 @@ int main(int argc, char* argv[]) { exit(1); } - char* info = taos_get_server_info(taos); + const char* info = taos_get_server_info(taos); printf("server info: %s\n", info); info = taos_get_client_info(taos); printf("client info: %s\n", info); @@ -61,9 +48,10 @@ int main(int argc, char* argv[]) { time_t ct = time(0); int64_t ts = ct * 1000; - char* lineFormat = "sta%d,t0=true,t1=127i8,t2=32767i16,t3=%di32,t4=9223372036854775807i64,t9=11.12345f32,t10=22.123456789f64,t11=\"binaryTagValue\",t12=L\"ncharTagValue\" c0=true,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=254u8,c6=32770u16,c7=2147483699u32,c8=9223372036854775899u64,c9=11.12345f32,c10=22.123456789f64,c11=\"binaryValue\",c12=L\"ncharValue\" %lldms"; + char* lineFormat = "sta%d,t0=true,t1=127i8,t2=32767i16,t3=%di32,t4=9223372036854775807i64,t9=11.12345f32,t10=22.123456789f64,t11=\"binaryTagValue\",t12=L\"ncharTagValue\" c0=true,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=254u8,c6=32770u16,c7=2147483699u32,c8=9223372036854775899u64,c9=11.12345f32,c10=22.123456789f64,c11=\"binaryValue\",c12=L\"ncharValue\" %lld"; - char** lines = calloc(numSuperTables * numChildTables * numRowsPerChildTable, sizeof(char*)); + int lineNum = numSuperTables * numChildTables * numRowsPerChildTable; + char** lines = calloc((size_t)lineNum, sizeof(char*)); int l = 0; for (int i = 0; i < numSuperTables; ++i) { for (int j = 0; j < numChildTables; ++j) { @@ -75,13 +63,14 @@ int main(int argc, char* argv[]) { } } } - //shuffle(lines, numSuperTables * numChildTables * numRowsPerChildTable); printf("%s\n", "begin taos_insert_lines"); int64_t begin = getTimeInUs(); - int32_t code = taos_insert_lines(taos, lines, numSuperTables * numChildTables * numRowsPerChildTable); + TAOS_RES *res = taos_schemaless_insert(taos, lines, lineNum, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_MILLI_SECONDS); + int code = taos_errno(res); + taos_free_result(res); int64_t end = getTimeInUs(); - printf("code: %d, %s. time used: %"PRId64"\n", code, tstrerror(code), end-begin); + printf("code: %d, %s. time used: %" PRId64 "\n", code, tstrerror(code), end-begin); return 0; } diff --git a/examples/c/stream_demo.c b/examples/c/stream_demo.c index 46c8297fba..46107c7e13 100644 --- a/examples/c/stream_demo.c +++ b/examples/c/stream_demo.c @@ -108,10 +108,13 @@ int32_t create_stream() { } int main(int argc, char* argv[]) { - int code; if (argc > 1) { printf("env init\n"); - code = init_env(); + int code = init_env(); + if (code) { + return code; + } + } create_stream(); } diff --git a/examples/c/tmq.c b/examples/c/tmq.c index 1147671ea1..71e571d4dd 100644 --- a/examples/c/tmq.c +++ b/examples/c/tmq.c @@ -21,9 +21,6 @@ #include "taos.h" static int running = 1; -static char dbName[64] = "tmqdb"; -static char stbName[64] = "stb"; -static char topicName[64] = "topicname"; static int32_t msg_process(TAOS_RES* msg) { char buf[1024]; @@ -43,7 +40,7 @@ static int32_t msg_process(TAOS_RES* msg) { TAOS_FIELD* fields = taos_fetch_fields(msg); int32_t numOfFields = taos_field_count(msg); - int32_t* length = taos_fetch_lengths(msg); + //int32_t* length = taos_fetch_lengths(msg); int32_t precision = taos_result_precision(msg); rows++; taos_print_row(buf, row, fields, numOfFields); @@ -62,6 +59,13 @@ static int32_t init_env() { TAOS_RES* pRes; // drop database if exists printf("create database\n"); + pRes = taos_query(pConn, "drop topic topicname"); + if (taos_errno(pRes) != 0) { + printf("error in drop tmqdb, reason:%s\n", taos_errstr(pRes)); + return -1; + } + taos_free_result(pRes); + pRes = taos_query(pConn, "drop database if exists tmqdb"); if (taos_errno(pRes) != 0) { printf("error in drop tmqdb, reason:%s\n", taos_errstr(pRes)); @@ -249,7 +253,7 @@ int main(int argc, char* argv[]) { tmq_t* tmq = build_consumer(); if (NULL == tmq) { - fprintf(stderr, "%% build_consumer() fail!\n"); + fprintf(stderr, "build_consumer() fail!\n"); return -1; } @@ -259,7 +263,7 @@ int main(int argc, char* argv[]) { } if ((code = tmq_subscribe(tmq, topic_list))) { - fprintf(stderr, "%% Failed to tmq_subscribe(): %s\n", tmq_err2str(code)); + fprintf(stderr, "Failed to tmq_subscribe(): %s\n", tmq_err2str(code)); } tmq_list_destroy(topic_list); @@ -267,9 +271,9 @@ int main(int argc, char* argv[]) { code = tmq_consumer_close(tmq); if (code) { - fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(code)); + fprintf(stderr, "Failed to close consumer: %s\n", tmq_err2str(code)); } else { - fprintf(stderr, "%% Consumer closed\n"); + fprintf(stderr, "Consumer closed\n"); } return 0; diff --git a/source/libs/catalog/src/ctgCache.c b/source/libs/catalog/src/ctgCache.c index 47cb0ef559..94ee295fe4 100644 --- a/source/libs/catalog/src/ctgCache.c +++ b/source/libs/catalog/src/ctgCache.c @@ -1728,7 +1728,7 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) { } if (dbInfo->vgVersion < 0 || taosHashGetSize(dbInfo->vgHash) <= 0) { - ctgError("invalid db vgInfo, dbFName:%s, vgHash:%p, vgVersion:%d, vgHashSize:%d", dbFName, dbInfo->vgHash, + ctgDebug("invalid db vgInfo, dbFName:%s, vgHash:%p, vgVersion:%d, vgHashSize:%d", dbFName, dbInfo->vgHash, dbInfo->vgVersion, taosHashGetSize(dbInfo->vgHash)); CTG_ERR_JRET(TSDB_CODE_APP_ERROR); } diff --git a/source/libs/scheduler/src/schStatus.c b/source/libs/scheduler/src/schStatus.c index 66d58c95d1..4c16a81a05 100644 --- a/source/libs/scheduler/src/schStatus.c +++ b/source/libs/scheduler/src/schStatus.c @@ -64,7 +64,7 @@ _return: int32_t schHandleOpBeginEvent(int64_t jobId, SSchJob** job, SCH_OP_TYPE type, SSchedulerReq* pReq) { SSchJob* pJob = schAcquireJob(jobId); if (NULL == pJob) { - qWarn("Acquire sch job failed, may be dropped, jobId:0x%" PRIx64, jobId); + qDebug("Acquire sch job failed, may be dropped, jobId:0x%" PRIx64, jobId); SCH_ERR_RET(TSDB_CODE_SCH_STATUS_ERROR); } diff --git a/source/libs/scheduler/src/scheduler.c b/source/libs/scheduler/src/scheduler.c index 1926c26dc9..7cd5e957b6 100644 --- a/source/libs/scheduler/src/scheduler.c +++ b/source/libs/scheduler/src/scheduler.c @@ -157,7 +157,7 @@ void schedulerFreeJob(int64_t *jobId, int32_t errCode) { SSchJob *pJob = schAcquireJob(*jobId); if (NULL == pJob) { - qWarn("Acquire sch job failed, may be dropped, jobId:0x%" PRIx64, *jobId); + qDebug("Acquire sch job failed, may be dropped, jobId:0x%" PRIx64, *jobId); return; } diff --git a/examples/c/api_with_reqid_test.c b/tests/script/api/api_with_reqid_test.c similarity index 100% rename from examples/c/api_with_reqid_test.c rename to tests/script/api/api_with_reqid_test.c diff --git a/tests/script/api/apitest.c b/tests/script/api/apitest.c new file mode 100644 index 0000000000..7280522021 --- /dev/null +++ b/tests/script/api/apitest.c @@ -0,0 +1,936 @@ +// sample code to verify all TDengine API +// to compile: gcc -o apitest apitest.c -ltaos + +#include "cJSON.h" +#include "taoserror.h" + +#include +#include +#include +#include +#include "../../include/client/taos.h" + +static int64_t count = 10000; + +int64_t genReqid() { + count += 100; + return count; +} + +static void prepare_data(TAOS* taos) { + TAOS_RES* result; + result = taos_query(taos, "drop database if exists test;"); + taos_free_result(result); + usleep(100000); + result = taos_query(taos, "create database test precision 'us';"); + taos_free_result(result); + usleep(100000); + taos_select_db(taos, "test"); + + result = taos_query(taos, "create table meters(ts timestamp, a int) tags(area int);"); + taos_free_result(result); + + result = taos_query(taos, "create table t0 using meters tags(0);"); + taos_free_result(result); + result = taos_query(taos, "create table t1 using meters tags(1);"); + taos_free_result(result); + result = taos_query(taos, "create table t2 using meters tags(2);"); + taos_free_result(result); + result = taos_query(taos, "create table t3 using meters tags(3);"); + taos_free_result(result); + result = taos_query(taos, "create table t4 using meters tags(4);"); + taos_free_result(result); + result = taos_query(taos, "create table t5 using meters tags(5);"); + taos_free_result(result); + result = taos_query(taos, "create table t6 using meters tags(6);"); + taos_free_result(result); + result = taos_query(taos, "create table t7 using meters tags(7);"); + taos_free_result(result); + result = taos_query(taos, "create table t8 using meters tags(8);"); + taos_free_result(result); + result = taos_query(taos, "create table t9 using meters tags(9);"); + taos_free_result(result); + + result = taos_query(taos, + "insert into t0 values('2020-01-01 00:00:00.000', 0)" + " ('2020-01-01 00:01:00.000', 0)" + " ('2020-01-01 00:02:00.000', 0)" + " t1 values('2020-01-01 00:00:00.000', 0)" + " ('2020-01-01 00:01:00.000', 0)" + " ('2020-01-01 00:02:00.000', 0)" + " ('2020-01-01 00:03:00.000', 0)" + " t2 values('2020-01-01 00:00:00.000', 0)" + " ('2020-01-01 00:01:00.000', 0)" + " ('2020-01-01 00:01:01.000', 0)" + " ('2020-01-01 00:01:02.000', 0)" + " t3 values('2020-01-01 00:01:02.000', 0)" + " t4 values('2020-01-01 00:01:02.000', 0)" + " t5 values('2020-01-01 00:01:02.000', 0)" + " t6 values('2020-01-01 00:01:02.000', 0)" + " t7 values('2020-01-01 00:01:02.000', 0)" + " t8 values('2020-01-01 00:01:02.000', 0)" + " t9 values('2020-01-01 00:01:02.000', 0)"); + int affected = taos_affected_rows(result); + if (affected != 18) { + printf("\033[31m%d rows affected by last insert statement, but it should be 18\033[0m\n", affected); + } + taos_free_result(result); + // super tables subscription + usleep(1000000); +} + +static int print_result(TAOS_RES* res, int blockFetch) { + TAOS_ROW row = NULL; + int num_fields = taos_num_fields(res); + TAOS_FIELD* fields = taos_fetch_fields(res); + int nRows = 0; + + if (blockFetch) { + int rows = 0; + while ((rows = taos_fetch_block(res, &row))) { + // for (int i = 0; i < rows; i++) { + // char temp[256]; + // taos_print_row(temp, row + i, fields, num_fields); + // puts(temp); + // } + nRows += rows; + } + } else { + while ((row = taos_fetch_row(res))) { + char temp[256] = {0}; + taos_print_row(temp, row, fields, num_fields); + puts(temp); + nRows++; + } + } + + printf("%d rows consumed.\n", nRows); + return nRows; +} + +static void check_row_count(int line, TAOS_RES* res, int expected) { + int actual = print_result(res, expected % 2); + if (actual != expected) { + printf("\033[31mline %d: row count mismatch, expected: %d, actual: %d\033[0m\n", line, expected, actual); + } else { + printf("line %d: %d rows consumed as expected\n", line, actual); + } +} + +static void verify_query(TAOS* taos) { + prepare_data(taos); + + int code = taos_load_table_info(taos, "t0,t1,t2,t3,t4,t5,t6,t7,t8,t9"); + if (code != 0) { + printf("\033[31mfailed to load table info: 0x%08x\033[0m\n", code); + } + + code = taos_validate_sql(taos, "select * from nonexisttable"); + if (code == 0) { + printf("\033[31mimpossible, the table does not exists\033[0m\n"); + } + + code = taos_validate_sql(taos, "select * from meters"); + if (code != 0) { + printf("\033[31mimpossible, the table does exists: 0x%08x\033[0m\n", code); + } + + TAOS_RES* res = taos_query_with_reqid(taos, "select * from meters", genReqid()); + check_row_count(__LINE__, res, 18); + printf("result precision is: %d\n", taos_result_precision(res)); + int c = taos_field_count(res); + printf("field count is: %d\n", c); + int* lengths = taos_fetch_lengths(res); + for (int i = 0; i < c; i++) { + printf("length of column %d is %d\n", i, lengths[i]); + } + taos_free_result(res); + + res = taos_query_with_reqid(taos, "select * from t0", genReqid()); + check_row_count(__LINE__, res, 3); + taos_free_result(res); + + res = taos_query_with_reqid(taos, "select * from nonexisttable", genReqid()); + code = taos_errno(res); + printf("code=%d, error msg=%s\n", code, taos_errstr(res)); + taos_free_result(res); + + res = taos_query_with_reqid(taos, "select * from meters", genReqid()); + taos_stop_query(res); + taos_free_result(res); +} + +void subscribe_callback(TAOS_SUB* tsub, TAOS_RES* res, void* param, int code) { + int rows = print_result(res, *(int*)param); + printf("%d rows consumed in subscribe_callback\n", rows); +} + +void verify_prepare(TAOS* taos) { + TAOS_RES* result = taos_query(taos, "drop database if exists test;"); + taos_free_result(result); + + usleep(100000); + result = taos_query(taos, "create database test;"); + + int code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + + taos_free_result(result); + + usleep(100000); + taos_select_db(taos, "test"); + + // create table + const char* sql = + "create table m1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " + "binary(40), blob nchar(10))"; + result = taos_query_with_reqid(taos, sql, genReqid()); + code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + // insert 10 records + struct { + int64_t ts; + int8_t b; + int8_t v1; + int16_t v2; + int32_t v4; + int64_t v8; + float f4; + double f8; + char bin[40]; + char blob[80]; + } v = {0}; + + int32_t boolLen = sizeof(int8_t); + int32_t sintLen = sizeof(int16_t); + int32_t intLen = sizeof(int32_t); + int32_t bintLen = sizeof(int64_t); + int32_t floatLen = sizeof(float); + int32_t doubleLen = sizeof(double); + int32_t binLen = sizeof(v.bin); + int32_t ncharLen = 30; + TAOS_STMT* stmt = taos_stmt_init(taos); + TAOS_MULTI_BIND params[10]; + params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; + params[0].buffer_length = sizeof(v.ts); + params[0].buffer = &v.ts; + params[0].length = &bintLen; + params[0].is_null = NULL; + params[0].num = 1; + + params[1].buffer_type = TSDB_DATA_TYPE_BOOL; + params[1].buffer_length = sizeof(v.b); + params[1].buffer = &v.b; + params[1].length = &boolLen; + params[1].is_null = NULL; + params[1].num = 1; + + params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; + params[2].buffer_length = sizeof(v.v1); + params[2].buffer = &v.v1; + params[2].length = &boolLen; + params[2].is_null = NULL; + params[2].num = 1; + + params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; + params[3].buffer_length = sizeof(v.v2); + params[3].buffer = &v.v2; + params[3].length = &sintLen; + params[3].is_null = NULL; + params[3].num = 1; + + params[4].buffer_type = TSDB_DATA_TYPE_INT; + params[4].buffer_length = sizeof(v.v4); + params[4].buffer = &v.v4; + params[4].length = &intLen; + params[4].is_null = NULL; + params[4].num = 1; + + params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; + params[5].buffer_length = sizeof(v.v8); + params[5].buffer = &v.v8; + params[5].length = &bintLen; + params[5].is_null = NULL; + params[5].num = 1; + + params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; + params[6].buffer_length = sizeof(v.f4); + params[6].buffer = &v.f4; + params[6].length = &floatLen; + params[6].is_null = NULL; + params[6].num = 1; + + params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; + params[7].buffer_length = sizeof(v.f8); + params[7].buffer = &v.f8; + params[7].length = &doubleLen; + params[7].is_null = NULL; + params[7].num = 1; + + params[8].buffer_type = TSDB_DATA_TYPE_BINARY; + params[8].buffer_length = sizeof(v.bin); + params[8].buffer = v.bin; + params[8].length = &binLen; + params[8].is_null = NULL; + params[8].num = 1; + + strcpy(v.blob, "一二三四五六七八九十"); + params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; + params[9].buffer_length = sizeof(v.blob); + params[9].buffer = v.blob; + params[9].length = &ncharLen; + params[9].is_null = NULL; + params[9].num = 1; + + char is_null = 1; + + sql = "insert into m1 values(?,?,?,?,?,?,?,?,?,?)"; + code = taos_stmt_prepare(stmt, sql, 0); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + v.ts = 1591060628000; + for (int i = 0; i < 10; ++i) { + v.ts += 1; + for (int j = 1; j < 10; ++j) { + params[j].is_null = ((i == j) ? &is_null : 0); + } + v.b = (int8_t)i % 2; + v.v1 = (int8_t)i; + v.v2 = (int16_t)(i * 2); + v.v4 = (int32_t)(i * 4); + v.v8 = (int64_t)(i * 8); + v.f4 = (float)(i * 40); + v.f8 = (double)(i * 80); + for (int j = 0; j < sizeof(v.bin); ++j) { + v.bin[j] = (char)(i + '0'); + } + + taos_stmt_bind_param(stmt, params); + taos_stmt_add_batch(stmt); + } + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + taos_stmt_close(stmt); + + // query the records + stmt = taos_stmt_init(taos); + taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); + v.v1 = 5; + v.v2 = 15; + taos_stmt_bind_param(stmt, params + 2); + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + result = taos_stmt_use_result(stmt); + + TAOS_ROW row; + int rows = 0; + int num_fields = taos_num_fields(result); + TAOS_FIELD* fields = taos_fetch_fields(result); + + // fetch the records row by row + while ((row = taos_fetch_row(result))) { + char temp[256] = {0}; + rows++; + taos_print_row(temp, row, fields, num_fields); + printf("%s\n", temp); + } + + taos_free_result(result); + taos_stmt_close(stmt); +} + +void verify_prepare2(TAOS* taos) { + TAOS_RES* result = taos_query(taos, "drop database if exists test;"); + taos_free_result(result); + usleep(100000); + result = taos_query(taos, "create database test;"); + + int code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + usleep(100000); + taos_select_db(taos, "test"); + + // create table + const char* sql = + "create table m1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " + "binary(40), blob nchar(10))"; + result = taos_query(taos, sql); + code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + // insert 10 records + struct { + int64_t ts[10]; + int8_t b[10]; + int8_t v1[10]; + int16_t v2[10]; + int32_t v4[10]; + int64_t v8[10]; + float f4[10]; + double f8[10]; + char bin[10][40]; + char blob[10][80]; + } v; + + int32_t* t8_len = malloc(sizeof(int32_t) * 10); + int32_t* t16_len = malloc(sizeof(int32_t) * 10); + int32_t* t32_len = malloc(sizeof(int32_t) * 10); + int32_t* t64_len = malloc(sizeof(int32_t) * 10); + int32_t* float_len = malloc(sizeof(int32_t) * 10); + int32_t* double_len = malloc(sizeof(int32_t) * 10); + int32_t* bin_len = malloc(sizeof(int32_t) * 10); + int32_t* blob_len = malloc(sizeof(int32_t) * 10); + + TAOS_STMT* stmt = taos_stmt_init(taos); + TAOS_MULTI_BIND params[10]; + char is_null[10] = {0}; + + params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; + params[0].buffer_length = sizeof(v.ts[0]); + params[0].buffer = v.ts; + params[0].length = t64_len; + params[0].is_null = is_null; + params[0].num = 10; + + params[1].buffer_type = TSDB_DATA_TYPE_BOOL; + params[1].buffer_length = sizeof(v.b[0]); + params[1].buffer = v.b; + params[1].length = t8_len; + params[1].is_null = is_null; + params[1].num = 10; + + params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; + params[2].buffer_length = sizeof(v.v1[0]); + params[2].buffer = v.v1; + params[2].length = t8_len; + params[2].is_null = is_null; + params[2].num = 10; + + params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; + params[3].buffer_length = sizeof(v.v2[0]); + params[3].buffer = v.v2; + params[3].length = t16_len; + params[3].is_null = is_null; + params[3].num = 10; + + params[4].buffer_type = TSDB_DATA_TYPE_INT; + params[4].buffer_length = sizeof(v.v4[0]); + params[4].buffer = v.v4; + params[4].length = t32_len; + params[4].is_null = is_null; + params[4].num = 10; + + params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; + params[5].buffer_length = sizeof(v.v8[0]); + params[5].buffer = v.v8; + params[5].length = t64_len; + params[5].is_null = is_null; + params[5].num = 10; + + params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; + params[6].buffer_length = sizeof(v.f4[0]); + params[6].buffer = v.f4; + params[6].length = float_len; + params[6].is_null = is_null; + params[6].num = 10; + + params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; + params[7].buffer_length = sizeof(v.f8[0]); + params[7].buffer = v.f8; + params[7].length = double_len; + params[7].is_null = is_null; + params[7].num = 10; + + params[8].buffer_type = TSDB_DATA_TYPE_BINARY; + params[8].buffer_length = sizeof(v.bin[0]); + params[8].buffer = v.bin; + params[8].length = bin_len; + params[8].is_null = is_null; + params[8].num = 10; + + params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; + params[9].buffer_length = sizeof(v.blob[0]); + params[9].buffer = v.blob; + params[9].length = blob_len; + params[9].is_null = is_null; + params[9].num = 10; + + sql = "insert into ? (ts, b, v1, v2, v4, v8, f4, f8, bin, blob) values(?,?,?,?,?,?,?,?,?,?)"; + code = taos_stmt_prepare(stmt, sql, 0); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + code = taos_stmt_set_tbname(stmt, "m1"); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + int64_t ts = 1591060628000; + for (int i = 0; i < 10; ++i) { + v.ts[i] = ts++; + is_null[i] = 0; + + v.b[i] = (int8_t)i % 2; + v.v1[i] = (int8_t)i; + v.v2[i] = (int16_t)(i * 2); + v.v4[i] = (int32_t)(i * 4); + v.v8[i] = (int64_t)(i * 8); + v.f4[i] = (float)(i * 40); + v.f8[i] = (double)(i * 80); + for (int j = 0; j < sizeof(v.bin[0]); ++j) { + v.bin[i][j] = (char)(i + '0'); + } + strcpy(v.blob[i], "一二三四五六七八九十"); + + t8_len[i] = sizeof(int8_t); + t16_len[i] = sizeof(int16_t); + t32_len[i] = sizeof(int32_t); + t64_len[i] = sizeof(int64_t); + float_len[i] = sizeof(float); + double_len[i] = sizeof(double); + bin_len[i] = sizeof(v.bin[0]); + blob_len[i] = (int32_t)strlen(v.blob[i]); + } + + taos_stmt_bind_param_batch(stmt, params); + taos_stmt_add_batch(stmt); + + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + taos_stmt_close(stmt); + + // query the records + stmt = taos_stmt_init(taos); + taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); + TAOS_MULTI_BIND qparams[2]; + + int8_t v1 = 5; + int16_t v2 = 15; + int32_t tinyLen = sizeof(v1); + int32_t smallLen = sizeof(v2); + + qparams[0].buffer_type = TSDB_DATA_TYPE_TINYINT; + qparams[0].buffer_length = sizeof(v1); + qparams[0].buffer = &v1; + qparams[0].length = &tinyLen; + qparams[0].is_null = NULL; + qparams[0].num = 1; + + qparams[1].buffer_type = TSDB_DATA_TYPE_SMALLINT; + qparams[1].buffer_length = sizeof(v2); + qparams[1].buffer = &v2; + qparams[1].length = &smallLen; + qparams[1].is_null = NULL; + qparams[1].num = 1; + + taos_stmt_bind_param(stmt, qparams); + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + result = taos_stmt_use_result(stmt); + + TAOS_ROW row; + int rows = 0; + int num_fields = taos_num_fields(result); + TAOS_FIELD* fields = taos_fetch_fields(result); + + // fetch the records row by row + while ((row = taos_fetch_row(result))) { + char temp[256] = {0}; + rows++; + taos_print_row(temp, row, fields, num_fields); + printf("%s\n", temp); + } + + taos_free_result(result); + taos_stmt_close(stmt); + + free(t8_len); + free(t16_len); + free(t32_len); + free(t64_len); + free(float_len); + free(double_len); + free(bin_len); + free(blob_len); +} + +void verify_prepare3(TAOS* taos) { + TAOS_RES* result = taos_query(taos, "drop database if exists test;"); + taos_free_result(result); + usleep(100000); + result = taos_query(taos, "create database test;"); + + int code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + usleep(100000); + taos_select_db(taos, "test"); + + // create table + const char* sql = + "create stable st1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " + "binary(40), blob nchar(10)) tags (id1 int, id2 binary(40))"; + result = taos_query(taos, sql); + code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + TAOS_MULTI_BIND tags[2]; + + int32_t id1 = 1; + char id2[40] = "abcdefghijklmnopqrstuvwxyz0123456789"; + int32_t id2_len = (int32_t)strlen(id2); + + tags[0].buffer_type = TSDB_DATA_TYPE_INT; + tags[0].buffer_length = sizeof(int); + tags[0].buffer = &id1; + tags[0].length = NULL; + tags[0].is_null = NULL; + tags[0].num = 1; + + tags[1].buffer_type = TSDB_DATA_TYPE_BINARY; + tags[1].buffer_length = sizeof(id2); + tags[1].buffer = id2; + tags[1].length = &id2_len; + tags[1].is_null = NULL; + tags[1].num = 1; + + // insert 10 records + struct { + int64_t ts[10]; + int8_t b[10]; + int8_t v1[10]; + int16_t v2[10]; + int32_t v4[10]; + int64_t v8[10]; + float f4[10]; + double f8[10]; + char bin[10][40]; + char blob[10][80]; + } v; + + int32_t* t8_len = malloc(sizeof(int32_t) * 10); + int32_t* t16_len = malloc(sizeof(int32_t) * 10); + int32_t* t32_len = malloc(sizeof(int32_t) * 10); + int32_t* t64_len = malloc(sizeof(int32_t) * 10); + int32_t* float_len = malloc(sizeof(int32_t) * 10); + int32_t* double_len = malloc(sizeof(int32_t) * 10); + int32_t* bin_len = malloc(sizeof(int32_t) * 10); + int32_t* blob_len = malloc(sizeof(int32_t) * 10); + + TAOS_STMT* stmt = taos_stmt_init(taos); + TAOS_MULTI_BIND params[10]; + char is_null[10] = {0}; + + params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; + params[0].buffer_length = sizeof(v.ts[0]); + params[0].buffer = v.ts; + params[0].length = t64_len; + params[0].is_null = is_null; + params[0].num = 10; + + params[1].buffer_type = TSDB_DATA_TYPE_BOOL; + params[1].buffer_length = sizeof(v.b[0]); + params[1].buffer = v.b; + params[1].length = t8_len; + params[1].is_null = is_null; + params[1].num = 10; + + params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; + params[2].buffer_length = sizeof(v.v1[0]); + params[2].buffer = v.v1; + params[2].length = t8_len; + params[2].is_null = is_null; + params[2].num = 10; + + params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; + params[3].buffer_length = sizeof(v.v2[0]); + params[3].buffer = v.v2; + params[3].length = t16_len; + params[3].is_null = is_null; + params[3].num = 10; + + params[4].buffer_type = TSDB_DATA_TYPE_INT; + params[4].buffer_length = sizeof(v.v4[0]); + params[4].buffer = v.v4; + params[4].length = t32_len; + params[4].is_null = is_null; + params[4].num = 10; + + params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; + params[5].buffer_length = sizeof(v.v8[0]); + params[5].buffer = v.v8; + params[5].length = t64_len; + params[5].is_null = is_null; + params[5].num = 10; + + params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; + params[6].buffer_length = sizeof(v.f4[0]); + params[6].buffer = v.f4; + params[6].length = float_len; + params[6].is_null = is_null; + params[6].num = 10; + + params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; + params[7].buffer_length = sizeof(v.f8[0]); + params[7].buffer = v.f8; + params[7].length = double_len; + params[7].is_null = is_null; + params[7].num = 10; + + params[8].buffer_type = TSDB_DATA_TYPE_BINARY; + params[8].buffer_length = sizeof(v.bin[0]); + params[8].buffer = v.bin; + params[8].length = bin_len; + params[8].is_null = is_null; + params[8].num = 10; + + params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; + params[9].buffer_length = sizeof(v.blob[0]); + params[9].buffer = v.blob; + params[9].length = blob_len; + params[9].is_null = is_null; + params[9].num = 10; + + sql = "insert into ? using st1 tags(?,?) values(?,?,?,?,?,?,?,?,?,?)"; + code = taos_stmt_prepare(stmt, sql, 0); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + code = taos_stmt_set_tbname_tags(stmt, "m1", tags); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + int64_t ts = 1591060628000; + for (int i = 0; i < 10; ++i) { + v.ts[i] = ts++; + is_null[i] = 0; + + v.b[i] = (int8_t)i % 2; + v.v1[i] = (int8_t)i; + v.v2[i] = (int16_t)(i * 2); + v.v4[i] = (int32_t)(i * 4); + v.v8[i] = (int64_t)(i * 8); + v.f4[i] = (float)(i * 40); + v.f8[i] = (double)(i * 80); + for (int j = 0; j < sizeof(v.bin[0]); ++j) { + v.bin[i][j] = (char)(i + '0'); + } + strcpy(v.blob[i], "一二三四五六七八九十"); + + t8_len[i] = sizeof(int8_t); + t16_len[i] = sizeof(int16_t); + t32_len[i] = sizeof(int32_t); + t64_len[i] = sizeof(int64_t); + float_len[i] = sizeof(float); + double_len[i] = sizeof(double); + bin_len[i] = sizeof(v.bin[0]); + blob_len[i] = (int32_t)strlen(v.blob[i]); + } + + taos_stmt_bind_param_batch(stmt, params); + taos_stmt_add_batch(stmt); + + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + taos_stmt_close(stmt); + + // query the records + stmt = taos_stmt_init(taos); + taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); + + TAOS_MULTI_BIND qparams[2]; + + int8_t v1 = 5; + int16_t v2 = 15; + int32_t tinyLen = sizeof(v1); + int32_t smallLen = sizeof(v2); + + qparams[0].buffer_type = TSDB_DATA_TYPE_TINYINT; + qparams[0].buffer_length = sizeof(v1); + qparams[0].buffer = &v1; + qparams[0].length = &tinyLen; + qparams[0].is_null = NULL; + qparams[0].num = 1; + + qparams[1].buffer_type = TSDB_DATA_TYPE_SMALLINT; + qparams[1].buffer_length = sizeof(v2); + qparams[1].buffer = &v2; + qparams[1].length = &smallLen; + qparams[1].is_null = NULL; + qparams[1].num = 1; + + taos_stmt_bind_param(stmt, qparams); + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + result = taos_stmt_use_result(stmt); + + TAOS_ROW row; + int rows = 0; + int num_fields = taos_num_fields(result); + TAOS_FIELD* fields = taos_fetch_fields(result); + + // fetch the records row by row + while ((row = taos_fetch_row(result))) { + char temp[256] = {0}; + rows++; + taos_print_row(temp, row, fields, num_fields); + printf("%s\n", temp); + } + + taos_free_result(result); + taos_stmt_close(stmt); + + free(t8_len); + free(t16_len); + free(t32_len); + free(t64_len); + free(float_len); + free(double_len); + free(bin_len); + free(blob_len); +} + +void retrieve_callback(void* param, TAOS_RES* tres, int numOfRows) { + if (numOfRows > 0) { + printf("%d rows async retrieved\n", numOfRows); + taos_fetch_rows_a(tres, retrieve_callback, param); + } else { + if (numOfRows < 0) { + printf("\033[31masync retrieve failed, code: %d\033[0m\n", numOfRows); + } else { + printf("async retrieve completed\n"); + } + taos_free_result(tres); + } +} + +void select_callback(void* param, TAOS_RES* tres, int code) { + if (code == 0 && tres) { + taos_fetch_rows_a(tres, retrieve_callback, param); + } else { + printf("\033[31masync select failed, code: %d\033[0m\n", code); + } +} + +void verify_async(TAOS* taos) { + prepare_data(taos); + taos_query_a(taos, "select * from meters", select_callback, NULL); + usleep(1000000); +} + +void stream_callback(void* param, TAOS_RES* res, TAOS_ROW row) { + if (res == NULL || row == NULL) { + return; + } + + int num_fields = taos_num_fields(res); + TAOS_FIELD* fields = taos_fetch_fields(res); + + printf("got one row from stream_callback\n"); + char temp[256] = {0}; + taos_print_row(temp, row, fields, num_fields); + puts(temp); +} + +int main(int argc, char* argv[]) { + const char* host = "127.0.0.1"; + const char* user = "root"; + const char* passwd = "taosdata"; + + taos_options(TSDB_OPTION_TIMEZONE, "GMT-8"); + TAOS* taos = taos_connect(host, user, passwd, "", 0); + if (taos == NULL) { + printf("\033[31mfailed to connect to db, reason:%s\033[0m\n", taos_errstr(taos)); + exit(1); + } + + const char* info = taos_get_server_info(taos); + printf("server info: %s\n", info); + info = taos_get_client_info(taos); + printf("client info: %s\n", info); + + printf("************ verify query *************\n"); + verify_query(taos); + + printf("********* verify async query **********\n"); + verify_async(taos); + + printf("************ verify prepare *************\n"); + verify_prepare(taos); + + printf("************ verify prepare2 *************\n"); + verify_prepare2(taos); + printf("************ verify prepare3 *************\n"); + verify_prepare3(taos); + + printf("done\n"); + taos_close(taos); + taos_cleanup(); +} diff --git a/examples/c/demoapi.c b/tests/script/api/demoapi.c similarity index 99% rename from examples/c/demoapi.c rename to tests/script/api/demoapi.c index 18f1b5a059..6c060a6325 100644 --- a/examples/c/demoapi.c +++ b/tests/script/api/demoapi.c @@ -21,7 +21,6 @@ #ifndef WINDOWS #include #endif -#include "osSleep.h" #include "taos.h" #define debugPrint(fmt, ...) \ @@ -81,11 +80,9 @@ static void prepare_data(TAOS* taos) { TAOS_RES *res; res = taos_query(taos, "drop database if exists test;"); taos_free_result(res); - taosMsleep(100); res = taos_query(taos, "create database test;"); taos_free_result(res); - taosMsleep(100); if (taos_select_db(taos, "test")) { errorPrint("%s() LN%d: taos_select_db() failed\n", __func__, __LINE__); From c14c1b9ae2aadcb32597ac1b69c3f22586c0cf31 Mon Sep 17 00:00:00 2001 From: slzhou Date: Tue, 13 Dec 2022 15:30:18 +0800 Subject: [PATCH 55/74] fix: add test case --- source/libs/function/src/udfd.c | 2 +- tests/parallel_test/cases.task | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index af0c27a89f..40c75ce6ba 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -812,7 +812,7 @@ void udfdPipeRead(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { if (nread < 0) { if (nread == UV_EOF) { - fnError("udfd read EOF"); + fnInfo("udfd pipe read EOF"); } else { fnError("Receive error %s", uv_err_name(nread)); } diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 4cbba106ba..5361ba356f 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -174,6 +174,7 @@ ,,y,script,./test.sh -f tsim/query/scalarNull.sim ,,y,script,./test.sh -f tsim/query/session.sim ,,y,script,./test.sh -f tsim/query/udf.sim +,,y,script,./test.sh -f tsim/query/udf_with_const.sim ,,y,script,./test.sh -f tsim/qnode/basic1.sim ,,y,script,./test.sh -f tsim/snode/basic1.sim ,,y,script,./test.sh -f tsim/mnode/basic1.sim From 08375a523d7f2f6ee765a22cdda97d738fc683be Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 13 Dec 2022 15:44:26 +0800 Subject: [PATCH 56/74] fix: fix invalid retrieved buf page --- source/libs/function/src/tpercentile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index 27d029aaa5..157ee08f15 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -364,6 +364,7 @@ int32_t tMemBucketPut(tMemBucket *pBucket, const void *data, size_t size) { assert(pSlot->info.data->num >= pBucket->elemPerPage && pSlot->info.size > 0); // keep the pointer in memory + setBufPageDirty(pSlot->info.data, true); releaseBufPage(pBucket->pBuffer, pSlot->info.data); pSlot->info.data = NULL; } @@ -505,6 +506,7 @@ double getPercentileImpl(tMemBucket *pMemBucket, int32_t count, double fraction) SFilePage *pg = getBufPage(pMemBucket->pBuffer, *pageId); tMemBucketPut(pMemBucket, pg->data, (int32_t)pg->num); + setBufPageDirty(pg, true); releaseBufPage(pMemBucket->pBuffer, pg); } From 259946e0f8d6165af51fd9b940c1fdc7ea5010b7 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 13 Dec 2022 18:21:30 +0800 Subject: [PATCH 57/74] fix: add cmake file --- examples/c/CMakeLists.txt | 95 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 examples/c/CMakeLists.txt diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt new file mode 100644 index 0000000000..5f798f88a5 --- /dev/null +++ b/examples/c/CMakeLists.txt @@ -0,0 +1,95 @@ +PROJECT(TDengine) + +IF (TD_LINUX) + INCLUDE_DIRECTORIES(. ${TD_SOURCE_DIR}/src/inc ${TD_SOURCE_DIR}/src/client/inc ${TD_SOURCE_DIR}/inc) + AUX_SOURCE_DIRECTORY(. SRC) + + add_executable(tmq "") + add_executable(stream_demo "") + add_executable(schemaless "") + add_executable(prepare "") + add_executable(demo "") + add_executable(asyncdemo "") + + target_sources(tmq + PRIVATE + "tmq.c" + ) + + target_sources(stream_demo + PRIVATE + "stream_demo.c" + ) + + target_sources(schemaless + PRIVATE + "schemaless.c" + ) + + target_sources(prepare + PRIVATE + "prepare.c" + ) + + target_sources(demo + PRIVATE + "demo.c" + ) + + target_sources(asyncdemo + PRIVATE + "asyncdemo.c" + ) + + target_link_libraries(tmq + taos_static + ) + + target_link_libraries(stream_demo + taos_static + ) + + target_link_libraries(schemaless + taos_static + ) + + target_link_libraries(prepare + taos_static + ) + + target_link_libraries(demo + taos_static + ) + + target_link_libraries(asyncdemo + taos_static + ) + + target_include_directories(tmq + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + target_include_directories(stream_demo + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + target_include_directories(schemaless + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + target_include_directories(api_reqid + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + ) + + + SET_TARGET_PROPERTIES(tmq PROPERTIES OUTPUT_NAME tmq) + SET_TARGET_PROPERTIES(stream_demo PROPERTIES OUTPUT_NAME stream_demo) + SET_TARGET_PROPERTIES(schemaless PROPERTIES OUTPUT_NAME schemaless) + SET_TARGET_PROPERTIES(prepare PROPERTIES OUTPUT_NAME prepare) + SET_TARGET_PROPERTIES(demo PROPERTIES OUTPUT_NAME demo) + SET_TARGET_PROPERTIES(asyncdemo PROPERTIES OUTPUT_NAME asyncdemo) +ENDIF () +IF (TD_DARWIN) + INCLUDE_DIRECTORIES(. ${TD_SOURCE_DIR}/src/inc ${TD_SOURCE_DIR}/src/client/inc ${TD_SOURCE_DIR}/inc) + AUX_SOURCE_DIRECTORY(. SRC) +ENDIF () From 518d60ad545e3f00255eb127cf2b483a638f5e3b Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 13 Dec 2022 18:31:51 +0800 Subject: [PATCH 58/74] fix: fix CMakeList.txt issue --- examples/c/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index 5f798f88a5..df2960b2c5 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -77,10 +77,6 @@ IF (TD_LINUX) PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" ) - target_include_directories(api_reqid - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - SET_TARGET_PROPERTIES(tmq PROPERTIES OUTPUT_NAME tmq) SET_TARGET_PROPERTIES(stream_demo PROPERTIES OUTPUT_NAME stream_demo) From b4d3d1432f3a3f142ac1a524426f82145eed6d42 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 13 Dec 2022 18:51:51 +0800 Subject: [PATCH 59/74] fix: invalid head file --- examples/c/schemaless.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/c/schemaless.c b/examples/c/schemaless.c index 5c0bbb372c..184f4e2662 100644 --- a/examples/c/schemaless.c +++ b/examples/c/schemaless.c @@ -1,6 +1,4 @@ #include "../../include/client/taos.h" -#include "taoserror.h" - #include #include #include @@ -67,10 +65,9 @@ int main(int argc, char* argv[]) { printf("%s\n", "begin taos_insert_lines"); int64_t begin = getTimeInUs(); TAOS_RES *res = taos_schemaless_insert(taos, lines, lineNum, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_MILLI_SECONDS); - int code = taos_errno(res); - taos_free_result(res); int64_t end = getTimeInUs(); - printf("code: %d, %s. time used: %" PRId64 "\n", code, tstrerror(code), end-begin); + printf("code: %s. time used: %" PRId64 "\n", taos_errstr(res), end-begin); + taos_free_result(res); return 0; } From aa18d0a4132dd44616554e1af866f46d09d3c16e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 13 Dec 2022 19:19:12 +0800 Subject: [PATCH 60/74] other: adjust compiler flag for clang. --- cmake/cmake.define | 22 ++++++++++++++-------- cmake/cmake.platform | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cmake/cmake.define b/cmake/cmake.define index d73c42e375..600343740d 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -124,26 +124,32 @@ ELSE () ENDIF () INCLUDE(CheckCCompilerFlag) - CHECK_C_COMPILER_FLAG("-msse4.2" GCC_SUPPORT_SSE42) - CHECK_C_COMPILER_FLAG("-mfma" GCC_SUPPORT_FMA) - CHECK_C_COMPILER_FLAG("-mavx" GCC_SUPPORT_AVX) - CHECK_C_COMPILER_FLAG("-mavx2" GCC_SUPPORT_AVX2) + IF ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + SET(COMPILER_SUPPORT_SSE42 true) + MESSAGE(STATUS "Always enable sse4.2 for Clang") + ELSE() + CHECK_C_COMPILER_FLAG("-msse4.2" COMPILER_SUPPORT_SSE42) + ENDIF() - IF (GCC_SUPPORT_SSE42) + CHECK_C_COMPILER_FLAG("-mfma" COMPILER_SUPPORT_FMA) + CHECK_C_COMPILER_FLAG("-mavx" COMPILER_SUPPORT_AVX) + CHECK_C_COMPILER_FLAG("-mavx2" COMPILER_SUPPORT_AVX2) + + IF (COMPILER_SUPPORT_SSE42) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") ENDIF() - IF (GCC_SUPPORT_FMA) + IF (COMPILER_SUPPORT_FMA) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfma") ENDIF() IF ("${SIMD_SUPPORT}" MATCHES "true") - IF (GCC_SUPPORT_AVX) + IF (COMPILER_SUPPORT_AVX) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") ENDIF() - IF (GCC_SUPPORT_AVX2) + IF (COMPILER_SUPPORT_AVX2) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") ENDIF() diff --git a/cmake/cmake.platform b/cmake/cmake.platform index 711d74fa4c..a4bfcaf609 100644 --- a/cmake/cmake.platform +++ b/cmake/cmake.platform @@ -147,7 +147,7 @@ ELSE () ENDIF () ENDIF () -MESSAGE(STATUS "platform arch:" ${PLATFORM_ARCH_STR}) +MESSAGE(STATUS "Platform arch:" ${PLATFORM_ARCH_STR}) MESSAGE("C Compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID}, ${CMAKE_C_COMPILER_VERSION})") MESSAGE("CXX Compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_C_COMPILER_ID}, ${CMAKE_CXX_COMPILER_VERSION})") From c2f0aabc8e86e28bd21c2c684715bb9a2092bb66 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 13 Dec 2022 19:26:56 +0800 Subject: [PATCH 61/74] fix: int64 print issue --- examples/c/asyncdemo.c | 6 +++--- examples/c/schemaless.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/c/asyncdemo.c b/examples/c/asyncdemo.c index faf636ee2e..518b940d7a 100644 --- a/examples/c/asyncdemo.c +++ b/examples/c/asyncdemo.c @@ -23,7 +23,7 @@ #include #include #include - +#include #include "../../include/client/taos.h" int points = 5; @@ -230,7 +230,7 @@ void taos_insert_call_back(void *param, TAOS_RES *tres, int code) if (tablesInsertProcessed >= numOfTables) { gettimeofday(&systemTime, NULL); et = systemTime.tv_sec * 1000000 + systemTime.tv_usec; - printf("%lld mseconds to insert %d data points\n", (et - st) / 1000, points*numOfTables); + printf("%" PRId64 " mseconds to insert %d data points\n", (et - st) / 1000, points*numOfTables); } } @@ -267,7 +267,7 @@ void taos_retrieve_call_back(void *param, TAOS_RES *tres, int numOfRows) if (tablesSelectProcessed >= numOfTables) { gettimeofday(&systemTime, NULL); et = systemTime.tv_sec * 1000000 + systemTime.tv_usec; - printf("%lld mseconds to query %d data rows\n", (et - st) / 1000, points * numOfTables); + printf("%" PRId64 " mseconds to query %d data rows\n", (et - st) / 1000, points * numOfTables); } taos_free_result(tres); diff --git a/examples/c/schemaless.c b/examples/c/schemaless.c index 184f4e2662..141e4c9f3b 100644 --- a/examples/c/schemaless.c +++ b/examples/c/schemaless.c @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { time_t ct = time(0); int64_t ts = ct * 1000; - char* lineFormat = "sta%d,t0=true,t1=127i8,t2=32767i16,t3=%di32,t4=9223372036854775807i64,t9=11.12345f32,t10=22.123456789f64,t11=\"binaryTagValue\",t12=L\"ncharTagValue\" c0=true,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=254u8,c6=32770u16,c7=2147483699u32,c8=9223372036854775899u64,c9=11.12345f32,c10=22.123456789f64,c11=\"binaryValue\",c12=L\"ncharValue\" %lld"; + char* lineFormat = "sta%d,t0=true,t1=127i8,t2=32767i16,t3=%di32,t4=9223372036854775807i64,t9=11.12345f32,t10=22.123456789f64,t11=\"binaryTagValue\",t12=L\"ncharTagValue\" c0=true,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=254u8,c6=32770u16,c7=2147483699u32,c8=9223372036854775899u64,c9=11.12345f32,c10=22.123456789f64,c11=\"binaryValue\",c12=L\"ncharValue\" %" PRId64; int lineNum = numSuperTables * numChildTables * numRowsPerChildTable; char** lines = calloc((size_t)lineNum, sizeof(char*)); From 6fb45a5f47dbe8356be6f39a73693def9d01fc1c Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 13 Dec 2022 20:16:45 +0800 Subject: [PATCH 62/74] remove unused param --- include/libs/transport/trpc.h | 14 ++++++------- source/client/src/clientEnv.c | 5 ++--- source/client/src/clientImpl.c | 17 ++++++++-------- source/common/src/tglobal.c | 20 +++---------------- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 5 ++--- source/libs/transport/inc/transportInt.h | 6 ++---- source/libs/transport/src/trans.c | 2 -- 7 files changed, 23 insertions(+), 46 deletions(-) diff --git a/include/libs/transport/trpc.h b/include/libs/transport/trpc.h index 87f753e6aa..de3c2a9f52 100644 --- a/include/libs/transport/trpc.h +++ b/include/libs/transport/trpc.h @@ -77,14 +77,12 @@ typedef void (*RpcDfp)(void *ahandle); typedef struct SRpcInit { char localFqdn[TSDB_FQDN_LEN]; - uint16_t localPort; // local port - char *label; // for debug purpose - int32_t numOfThreads; // number of threads to handle connections - int32_t sessions; // number of sessions allowed - int8_t connType; // TAOS_CONN_UDP, TAOS_CONN_TCPC, TAOS_CONN_TCPS - int32_t idleTime; // milliseconds, 0 means idle timer is disabled - int32_t retryLimit; // retry limit - int32_t retryInterval; // retry interval ms + uint16_t localPort; // local port + char *label; // for debug purpose + int32_t numOfThreads; // number of threads to handle connections + int32_t sessions; // number of sessions allowed + int8_t connType; // TAOS_CONN_UDP, TAOS_CONN_TCPC, TAOS_CONN_TCPS + int32_t idleTime; // milliseconds, 0 means idle timer is disabled int32_t retryMinInterval; // retry init interval int32_t retryStepFactor; // retry interval factor diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index c694a6c1a0..2cb337fc4c 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -146,8 +146,7 @@ void *openTransporter(const char *user, const char *auth, int32_t numOfThread) { rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.compressSize = tsCompressMsgSize; rpcInit.dfp = destroyAhandle; - rpcInit.retryLimit = tsRpcRetryLimit; - rpcInit.retryInterval = tsRpcRetryInterval; + rpcInit.retryMinInterval = tsRedirectPeriod; rpcInit.retryStepFactor = tsRedirectFactor; rpcInit.retryMaxInterval = tsRedirectMaxPeriod; @@ -232,7 +231,7 @@ void destroyTscObj(void *pObj) { pTscObj->pAppInfo->numOfConns); // In any cases, we should not free app inst here. Or an race condition rises. - /*int64_t connNum = */atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); + /*int64_t connNum = */ atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); taosThreadMutexDestroy(&pTscObj->mutex); taosMemoryFree(pTscObj); diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index e26512d065..807c752873 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -190,8 +190,8 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, (*pRequest)->body.param = param; STscObj* pTscObj = (*pRequest)->pTscObj; - int32_t err = taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, - sizeof((*pRequest)->self)); + int32_t err = taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, + sizeof((*pRequest)->self)); if (err) { tscError("%" PRId64 " failed to add to request container, reqId:0x%" PRIx64 ", conn:%" PRId64 ", %s", (*pRequest)->self, (*pRequest)->requestId, pTscObj->id, sql); @@ -1646,7 +1646,8 @@ int32_t getVersion1BlockMetaSize(const char* p, int32_t numOfCols) { static int32_t estimateJsonLen(SReqResultInfo* pResultInfo, int32_t numOfCols, int32_t numOfRows) { char* p = (char*)pResultInfo->pData; - // | version | total length | total rows | total columns | flag seg| block group id | column schema | each column length | + // | version | total length | total rows | total columns | flag seg| block group id | column schema | each column + // length | int32_t len = getVersion1BlockMetaSize(p, numOfCols); int32_t* colLength = (int32_t*)(p + len); len += sizeof(int32_t) * numOfCols; @@ -1972,8 +1973,6 @@ TSDB_SERVER_STATUS taos_check_server_status(const char* fqdn, int port, char* de rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.compressSize = tsCompressMsgSize; rpcInit.user = "_dnd"; - rpcInit.retryLimit = tsRpcRetryLimit; - rpcInit.retryInterval = tsRpcRetryInterval; clientRpc = rpcOpen(&rpcInit); if (clientRpc == NULL) { @@ -2295,14 +2294,14 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly) { taosAsyncQueryImpl(*(int64_t*)taos, sql, syncQueryFn, param, validateOnly); tsem_wait(¶m->sem); - SRequestObj *pRequest = NULL; + SRequestObj* pRequest = NULL; if (param->pRequest != NULL) { param->pRequest->syncQuery = true; pRequest = param->pRequest; } else { taosMemoryFree(param); } - + return pRequest; } @@ -2318,13 +2317,13 @@ TAOS_RES* taosQueryImplWithReqid(TAOS* taos, const char* sql, bool validateOnly, taosAsyncQueryImplWithReqid(*(int64_t*)taos, sql, syncQueryFn, param, validateOnly, reqid); tsem_wait(¶m->sem); - SRequestObj *pRequest = NULL; + SRequestObj* pRequest = NULL; if (param->pRequest != NULL) { param->pRequest->syncQuery = true; pRequest = param->pRequest; } else { taosMemoryFree(param); } - + return pRequest; } diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 7e9b28939b..093bff76c1 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -180,8 +180,6 @@ int32_t tsUptimeInterval = 300; // seconds char tsUdfdResFuncs[512] = ""; // udfd resident funcs that teardown when udfd exits char tsUdfdLdLibPath[512] = ""; -int32_t tsRpcRetryLimit = 100; -int32_t tsRpcRetryInterval = 15; #ifndef _STORAGE int32_t taosSetTfsCfg(SConfig *pCfg) { SConfigItem *pItem = cfgGetItem(pCfg, "dataDir"); @@ -203,7 +201,9 @@ int32_t taosSetTfsCfg(SConfig *pCfg) { int32_t taosSetTfsCfg(SConfig *pCfg); #endif -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) { @@ -313,8 +313,6 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { if (cfgAddBool(pCfg, "smlDataFormat", tsSmlDataFormat, 1) != 0) return -1; if (cfgAddInt32(pCfg, "smlBatchSize", tsSmlBatchSize, 1, INT32_MAX, true) != 0) return -1; if (cfgAddInt32(pCfg, "maxMemUsedByInsert", tsMaxMemUsedByInsert, 1, INT32_MAX, true) != 0) return -1; - if (cfgAddInt32(pCfg, "rpcRetryLimit", tsRpcRetryLimit, 1, 100000, 0) != 0) return -1; - if (cfgAddInt32(pCfg, "rpcRetryInterval", tsRpcRetryInterval, 1, 100000, 0) != 0) return -1; if (cfgAddInt32(pCfg, "maxRetryWaitTime", tsMaxRetryWaitTime, 0, 86400000, 0) != 0) return -1; tsNumOfTaskQueueThreads = tsNumOfCores / 2; @@ -457,9 +455,6 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { if (cfgAddString(pCfg, "udfdResFuncs", tsUdfdResFuncs, 0) != 0) return -1; if (cfgAddString(pCfg, "udfdLdLibPath", tsUdfdLdLibPath, 0) != 0) return -1; - if (cfgAddInt32(pCfg, "rpcRetryLimit", tsRpcRetryLimit, 1, 100000, 0) != 0) return -1; - if (cfgAddInt32(pCfg, "rpcRetryInterval", tsRpcRetryInterval, 1, 100000, 0) != 0) return -1; - GRANT_CFG_ADD; return 0; } @@ -674,8 +669,6 @@ static int32_t taosSetClientCfg(SConfig *pCfg) { tsQueryUseNodeAllocator = cfgGetItem(pCfg, "queryUseNodeAllocator")->bval; tsKeepColumnName = cfgGetItem(pCfg, "keepColumnName")->bval; - tsRpcRetryLimit = cfgGetItem(pCfg, "rpcRetryLimit")->i32; - tsRpcRetryInterval = cfgGetItem(pCfg, "rpcRetryInterval")->i32; tsMaxRetryWaitTime = cfgGetItem(pCfg, "maxRetryWaitTime")->i32; return 0; } @@ -738,10 +731,6 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tstrncpy(tsTelemServer, cfgGetItem(pCfg, "telemetryServer")->str, TSDB_FQDN_LEN); tsTelemPort = (uint16_t)cfgGetItem(pCfg, "telemetryPort")->i32; - tsElectInterval = cfgGetItem(pCfg, "syncElectInterval")->i32; - tsHeartbeatInterval = cfgGetItem(pCfg, "syncHeartbeatInterval")->i32; - tsHeartbeatTimeout = cfgGetItem(pCfg, "syncHeartbeatTimeout")->i32; - tsTransPullupInterval = cfgGetItem(pCfg, "transPullupInterval")->i32; tsMqRebalanceInterval = cfgGetItem(pCfg, "mqRebalanceInterval")->i32; tsTtlUnit = cfgGetItem(pCfg, "ttlUnit")->i32; @@ -761,9 +750,6 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { if (tsQueryBufferSize >= 0) { tsQueryBufferSizeBytes = tsQueryBufferSize * 1048576UL; } - - tsRpcRetryLimit = cfgGetItem(pCfg, "rpcRetryLimit")->i32; - tsRpcRetryInterval = cfgGetItem(pCfg, "rpcRetryInterval")->i32; GRANT_CFG_GET; return 0; } diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 4fa09a46b7..5e1dcc6353 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -145,7 +145,8 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { if (pMsg == NULL) goto _OVER; memcpy(pMsg, pRpc, sizeof(SRpcMsg)); - dGTrace("msg:%p, is created, type:%s handle:%p len:%d", pMsg, TMSG_INFO(pRpc->msgType), pMsg->info.handle, pRpc->contLen); + dGTrace("msg:%p, is created, type:%s handle:%p len:%d", pMsg, TMSG_INFO(pRpc->msgType), pMsg->info.handle, + pRpc->contLen); code = dmProcessNodeMsg(pWrapper, pMsg); @@ -258,8 +259,6 @@ int32_t dmInitClient(SDnode *pDnode) { rpcInit.rfp = rpcRfp; rpcInit.compressSize = tsCompressMsgSize; - rpcInit.retryLimit = tsRpcRetryLimit; - rpcInit.retryInterval = tsRpcRetryInterval; rpcInit.retryMinInterval = tsRedirectPeriod; rpcInit.retryStepFactor = tsRedirectFactor; rpcInit.retryMaxInterval = tsRedirectMaxPeriod; diff --git a/source/libs/transport/inc/transportInt.h b/source/libs/transport/inc/transportInt.h index 57aba67b1d..2db4a72795 100644 --- a/source/libs/transport/inc/transportInt.h +++ b/source/libs/transport/inc/transportInt.h @@ -47,10 +47,8 @@ typedef struct { char label[TSDB_LABEL_LEN]; char user[TSDB_UNI_LEN]; // meter ID - int32_t compressSize; // -1: no compress, 0 : all data compressed, size: compress data if larger than size - int8_t encryption; // encrypt or not - int32_t retryLimit; // retry limit - int32_t retryInterval; // retry interval ms + int32_t compressSize; // -1: no compress, 0 : all data compressed, size: compress data if larger than size + int8_t encryption; // encrypt or not int32_t retryMinInterval; // retry init interval int32_t retryStepFactor; // retry interval factor diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c index e026d98091..55c3c61b05 100644 --- a/source/libs/transport/src/trans.c +++ b/source/libs/transport/src/trans.c @@ -52,8 +52,6 @@ void* rpcOpen(const SRpcInit* pInit) { } pRpc->encryption = pInit->encryption; - pRpc->retryLimit = pInit->retryLimit; - pRpc->retryInterval = pInit->retryInterval; pRpc->retryMinInterval = pInit->retryMinInterval; // retry init interval pRpc->retryStepFactor = pInit->retryStepFactor; From 581a041ddd157ace5630ef5f42fc5b1715c32f92 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 13 Dec 2022 20:39:36 +0800 Subject: [PATCH 63/74] remove unused param --- source/libs/qworker/inc/qwInt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/qworker/inc/qwInt.h b/source/libs/qworker/inc/qwInt.h index 9d8fad6fea..eb6091d605 100644 --- a/source/libs/qworker/inc/qwInt.h +++ b/source/libs/qworker/inc/qwInt.h @@ -31,7 +31,7 @@ extern "C" { #define QW_DEFAULT_SCHEDULER_NUMBER 100 #define QW_DEFAULT_TASK_NUMBER 10000 -#define QW_DEFAULT_SCH_TASK_NUMBER 3000 +#define QW_DEFAULT_SCH_TASK_NUMBER 500 #define QW_DEFAULT_SHORT_RUN_TIMES 2 #define QW_DEFAULT_HEARTBEAT_MSEC 5000 #define QW_SCH_TIMEOUT_MSEC 180000 From 8b1f45231286a3d0d565c95dccdc545c3d91a5a4 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 13 Dec 2022 22:37:29 +0800 Subject: [PATCH 64/74] fix(query): set data load flag for multi-way merge . --- cmake/cmake.define | 4 ++-- source/libs/executor/src/groupoperator.c | 1 + source/libs/executor/test/executorTests.cpp | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/cmake.define b/cmake/cmake.define index 600343740d..7410c92525 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -124,9 +124,9 @@ ELSE () ENDIF () INCLUDE(CheckCCompilerFlag) - IF ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + IF (("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "AppleClang")) SET(COMPILER_SUPPORT_SSE42 true) - MESSAGE(STATUS "Always enable sse4.2 for Clang") + MESSAGE(STATUS "Always enable sse4.2 for Clang/AppleClang") ELSE() CHECK_C_COMPILER_FLAG("-msse4.2" COMPILER_SUPPORT_SSE42) ENDIF() diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 22db8c21b5..d8a510c6ce 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -696,6 +696,7 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) { pInfo->pageIndex += 1; releaseBufPage(pInfo->pBuf, page); + pInfo->binfo.pRes->info.dataLoad = 1; blockDataUpdateTsWindow(pInfo->binfo.pRes, 0); pInfo->binfo.pRes->info.id.groupId = pGroupInfo->groupId; diff --git a/source/libs/executor/test/executorTests.cpp b/source/libs/executor/test/executorTests.cpp index 1c42163349..2efd06f440 100644 --- a/source/libs/executor/test/executorTests.cpp +++ b/source/libs/executor/test/executorTests.cpp @@ -166,6 +166,7 @@ SSDataBlock* get2ColsDummyBlock(SOperatorInfo* pOperator) { pInfo->current += 1; + pBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pBlock, 0); return pBlock; } From 360282e565ae55661d968cce1d6577c5b8ea6516 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 14 Dec 2022 09:05:35 +0800 Subject: [PATCH 65/74] fix: compile issue in user env --- examples/c/CMakeLists.txt | 13 ------------- examples/c/asyncdemo.c | 2 +- examples/c/demo.c | 2 +- examples/c/prepare.c | 2 +- examples/c/schemaless.c | 2 +- 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index df2960b2c5..e14c4e60d9 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -65,19 +65,6 @@ IF (TD_LINUX) taos_static ) - target_include_directories(tmq - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - - target_include_directories(stream_demo - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - - target_include_directories(schemaless - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - - SET_TARGET_PROPERTIES(tmq PROPERTIES OUTPUT_NAME tmq) SET_TARGET_PROPERTIES(stream_demo PROPERTIES OUTPUT_NAME stream_demo) SET_TARGET_PROPERTIES(schemaless PROPERTIES OUTPUT_NAME schemaless) diff --git a/examples/c/asyncdemo.c b/examples/c/asyncdemo.c index 518b940d7a..83d217769b 100644 --- a/examples/c/asyncdemo.c +++ b/examples/c/asyncdemo.c @@ -24,7 +24,7 @@ #include #include #include -#include "../../include/client/taos.h" +#include "taos.h" int points = 5; int numOfTables = 3; diff --git a/examples/c/demo.c b/examples/c/demo.c index f11002d55b..2eda8cd811 100644 --- a/examples/c/demo.c +++ b/examples/c/demo.c @@ -20,7 +20,7 @@ #include #include #include -#include "../../include/client/taos.h" // TAOS header file +#include "taos.h" // TAOS header file static void queryDB(TAOS *taos, char *command) { int i; diff --git a/examples/c/prepare.c b/examples/c/prepare.c index 3edfe911ed..4f05b6fb4c 100644 --- a/examples/c/prepare.c +++ b/examples/c/prepare.c @@ -4,7 +4,7 @@ #include #include #include -#include "../../include/client/taos.h" +#include "taos.h" void taosMsleep(int mseconds); diff --git a/examples/c/schemaless.c b/examples/c/schemaless.c index 141e4c9f3b..328a663ae7 100644 --- a/examples/c/schemaless.c +++ b/examples/c/schemaless.c @@ -1,4 +1,4 @@ -#include "../../include/client/taos.h" +#include "taos.h" #include #include #include From 2b256542a5c561d25230d24041c042b92e2feb07 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 14 Dec 2022 09:14:40 +0800 Subject: [PATCH 66/74] refact: add vnode timer --- include/libs/sync/sync.h | 3 +- include/util/tdef.h | 3 ++ source/dnode/mgmt/mgmt_vnode/src/vmInt.c | 15 ++++++++-- source/dnode/vnode/inc/vnode.h | 1 + source/dnode/vnode/src/inc/vnodeInt.h | 2 ++ source/dnode/vnode/src/vnd/vnodeSync.c | 28 +++++++++++++++++-- source/libs/sync/inc/syncInt.h | 2 +- source/libs/sync/src/syncMain.c | 23 +++++++++++---- .../test/syncConfigChangeSnapshotTest.cpp | 2 +- .../libs/sync/test/syncConfigChangeTest.cpp | 2 +- source/libs/sync/test/syncReplicateTest.cpp | 2 +- source/libs/sync/test/syncTestTool.cpp | 2 +- 12 files changed, 70 insertions(+), 15 deletions(-) diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index 4cf4800472..1e1ed3bddc 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -230,7 +230,7 @@ int64_t syncOpen(SSyncInfo* pSyncInfo); int32_t syncStart(int64_t rid); void syncStop(int64_t rid); void syncPreStop(int64_t rid); -int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak); +int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak, int64_t* seq); int32_t syncProcessMsg(int64_t rid, SRpcMsg* pMsg); int32_t syncReconfig(int64_t rid, SSyncCfg* pCfg); int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex); @@ -240,6 +240,7 @@ int32_t syncStepDown(int64_t rid, SyncTerm newTerm); bool syncIsReadyForRead(int64_t rid); bool syncSnapshotSending(int64_t rid); bool syncSnapshotRecving(int64_t rid); +void syncSendTimeoutRsp(int64_t rid, int64_t seq); SSyncState syncGetState(int64_t rid); void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet); diff --git a/include/util/tdef.h b/include/util/tdef.h index e0089014aa..47435a2322 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -497,6 +497,9 @@ enum { // sort page size by default #define DEFAULT_PAGESIZE 4096 +#define VNODE_TIMEOUT_SEC 60 +#define MNODE_TIMEOUT_SEC 10 + #ifdef __cplusplus } #endif diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 56a9a0e22b..2345c752a9 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -334,7 +334,18 @@ static void vmCleanup(SVnodeMgmt *pMgmt) { taosMemoryFree(pMgmt); } -static void vmCheckSyncTimeout(SVnodeMgmt *pMgmt) {} +static void vmCheckSyncTimeout(SVnodeMgmt *pMgmt) { + taosThreadRwlockRdlock(&pMgmt->lock); + void *pIter = taosHashIterate(pMgmt->hash, NULL); + while (pIter) { + SVnodeObj **ppVnode = pIter; + if (ppVnode == NULL || *ppVnode == NULL) continue; + + SVnodeObj *pVnode = *ppVnode; + vnodeSyncCheckTimeout(pVnode->pImpl); + pIter = taosHashIterate(pMgmt->hash, pIter); + } +} static void *vmThreadFp(void *param) { SVnodeMgmt *pMgmt = param; @@ -348,7 +359,7 @@ static void *vmThreadFp(void *param) { if (lastTime % 10 != 0) continue; int64_t sec = lastTime / 10; - if (sec % (tsStatusInterval * 5) == 0) { + if (sec % (VNODE_TIMEOUT_SEC / 2) == 0) { vmCheckSyncTimeout(pMgmt); } } diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 99260ffefd..540f0c3127 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -54,6 +54,7 @@ int32_t vnodeAlter(const char *path, SAlterVnodeReplicaReq *pReq, STfs *pTfs); void vnodeDestroy(const char *path, STfs *pTfs); SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb); void vnodePreClose(SVnode *pVnode); +void vnodeSyncCheckTimeout(SVnode* pVnode); void vnodeClose(SVnode *pVnode); int32_t vnodeStart(SVnode *pVnode); diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 8cf212cb1d..e025626ecf 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -344,6 +344,8 @@ struct SVnode { bool blocked; bool restored; tsem_t syncSem; + int32_t blockSec; + int64_t blockSeq; SQHandle* pQuery; }; diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 5a0556ba27..36eb6b293a 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -22,7 +22,8 @@ static inline bool vnodeIsMsgWeak(tmsg_t type) { return false; } static inline void vnodeWaitBlockMsg(SVnode *pVnode, const SRpcMsg *pMsg) { const STraceId *trace = &pMsg->info.traceId; - vGTrace("vgId:%d, msg:%p wait block, type:%s", pVnode->config.vgId, pMsg, TMSG_INFO(pMsg->msgType)); + vGTrace("vgId:%d, msg:%p wait block, type:%s sec:%d seq:%" PRId64, pVnode->config.vgId, pMsg, + TMSG_INFO(pMsg->msgType), pVnode->blockSec, pVnode->blockSeq); tsem_wait(&pVnode->syncSem); } @@ -202,12 +203,16 @@ void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) #else static int32_t inline vnodeProposeMsg(SVnode *pVnode, SRpcMsg *pMsg, bool isWeak) { + int64_t seq = 0; + taosThreadMutexLock(&pVnode->lock); - int32_t code = syncPropose(pVnode->sync, pMsg, isWeak); + int32_t code = syncPropose(pVnode->sync, pMsg, isWeak, &seq); bool wait = (code == 0 && vnodeIsMsgBlock(pMsg->msgType)); if (wait) { ASSERT(!pVnode->blocked); pVnode->blocked = true; + pVnode->blockSec = taosGetTimestampSec(); + pVnode->blockSeq = seq; } taosThreadMutexUnlock(&pVnode->lock); @@ -606,6 +611,25 @@ void vnodeSyncClose(SVnode *pVnode) { syncStop(pVnode->sync); } +void vnodeSyncCheckTimeout(SVnode *pVnode) { + vTrace("vgId:%d, check sync timeout msg", pVnode->config.vgId); + taosThreadMutexLock(&pVnode->lock); + if (pVnode->blocked) { + int32_t curSec = taosGetTimestampSec(); + int32_t delta = curSec - pVnode->blockSec; + if (delta > VNODE_TIMEOUT_SEC) { + syncSendTimeoutRsp(pVnode->sync, pVnode->blockSeq); + vError("vgId:%d, failed to propose since timeout and post block, start:%d cur:%d delta:%d seq:%" PRId64, + pVnode->config.vgId, pVnode->blockSec, curSec, delta, pVnode->blockSeq); + pVnode->blocked = false; + pVnode->blockSec = 0; + pVnode->blockSeq = 0; + tsem_post(&pVnode->syncSem); + } + } + taosThreadMutexUnlock(&pVnode->lock); +} + bool vnodeIsRoleLeader(SVnode *pVnode) { SSyncState state = syncGetState(pVnode->sync); return state.state == TAOS_SYNC_STATE_LEADER; diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index dee0bf95c7..a5524ffbde 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -215,7 +215,7 @@ int32_t syncNodeStart(SSyncNode* pSyncNode); int32_t syncNodeStartStandBy(SSyncNode* pSyncNode); void syncNodeClose(SSyncNode* pSyncNode); void syncNodePreClose(SSyncNode* pSyncNode); -int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak); +int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_t *seq); int32_t syncNodeRestore(SSyncNode* pSyncNode); void syncHbTimerDataFree(SSyncHbTimerData* pData); diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 6fabab18cb..f4a6050171 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -151,7 +151,7 @@ int32_t syncReconfig(int64_t rid, SSyncCfg* pNewCfg) { } syncNodeStartHeartbeatTimer(pSyncNode); - //syncNodeReplicate(pSyncNode); + // syncNodeReplicate(pSyncNode); } syncNodeRelease(pSyncNode); @@ -218,6 +218,18 @@ int32_t syncLeaderTransfer(int64_t rid) { return ret; } +void syncSendTimeoutRsp(int64_t rid, int64_t seq) { + SSyncNode* pNode = syncNodeAcquire(rid); + if (pNode == NULL) return; + + SRpcMsg rpcMsg = {0}; + (void)syncRespMgrGetAndDel(pNode->pSyncRespMgr, seq, &rpcMsg.info); + rpcMsg.code = TSDB_CODE_SYN_TIMEOUT; + + syncNodeRelease(pNode); + rpcSendResponse(&rpcMsg); +} + SyncIndex syncMinMatchIndex(SSyncNode* pSyncNode) { SyncIndex minMatchIndex = SYNC_INDEX_INVALID; @@ -538,7 +550,7 @@ int32_t syncNodeLeaderTransferTo(SSyncNode* pSyncNode, SNodeInfo newLeader) { pMsg->newLeaderId.vgId = pSyncNode->vgId; pMsg->newNodeInfo = newLeader; - int32_t ret = syncNodePropose(pSyncNode, &rpcMsg, false); + int32_t ret = syncNodePropose(pSyncNode, &rpcMsg, false, NULL); rpcFreeCont(rpcMsg.pCont); return ret; } @@ -670,19 +682,19 @@ void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet) { syncNodeRelease(pSyncNode); } -int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak) { +int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak, int64_t* seq) { SSyncNode* pSyncNode = syncNodeAcquire(rid); if (pSyncNode == NULL) { sError("sync propose error"); return -1; } - int32_t ret = syncNodePropose(pSyncNode, pMsg, isWeak); + int32_t ret = syncNodePropose(pSyncNode, pMsg, isWeak, seq); syncNodeRelease(pSyncNode); return ret; } -int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) { +int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_t* seq) { if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { terrno = TSDB_CODE_SYN_NOT_LEADER; sNError(pSyncNode, "sync propose not leader, %s, type:%s", syncStr(pSyncNode->state), TMSG_INFO(pMsg->msgType)); @@ -739,6 +751,7 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) { (void)syncRespMgrDel(pSyncNode->pSyncRespMgr, seqNum); } + if (seq != NULL) *seq = seqNum; return code; } } diff --git a/source/libs/sync/test/syncConfigChangeSnapshotTest.cpp b/source/libs/sync/test/syncConfigChangeSnapshotTest.cpp index 057f2ea6dd..7a5d0777bb 100644 --- a/source/libs/sync/test/syncConfigChangeSnapshotTest.cpp +++ b/source/libs/sync/test/syncConfigChangeSnapshotTest.cpp @@ -337,7 +337,7 @@ int main(int argc, char** argv) { if (alreadySend < writeRecordNum) { SRpcMsg* pRpcMsg = createRpcMsg(alreadySend, writeRecordNum, myIndex); - int32_t ret = syncPropose(rid, pRpcMsg, false); + int32_t ret = syncPropose(rid, pRpcMsg, false, NULL); if (ret == -1 && terrno == TSDB_CODE_SYN_NOT_LEADER) { sTrace("%s value%d write not leader", s, alreadySend); } else { diff --git a/source/libs/sync/test/syncConfigChangeTest.cpp b/source/libs/sync/test/syncConfigChangeTest.cpp index bab3d2236f..f35a23b15b 100644 --- a/source/libs/sync/test/syncConfigChangeTest.cpp +++ b/source/libs/sync/test/syncConfigChangeTest.cpp @@ -249,7 +249,7 @@ int main(int argc, char** argv) { if (alreadySend < writeRecordNum) { SRpcMsg* pRpcMsg = createRpcMsg(alreadySend, writeRecordNum, myIndex); - int32_t ret = syncPropose(rid, pRpcMsg, false); + int32_t ret = syncPropose(rid, pRpcMsg, false, NULL); if (ret == -1 && terrno == TSDB_CODE_SYN_NOT_LEADER) { sTrace("%s value%d write not leader", s, alreadySend); } else { diff --git a/source/libs/sync/test/syncReplicateTest.cpp b/source/libs/sync/test/syncReplicateTest.cpp index 4a82bba15d..22132eb01f 100644 --- a/source/libs/sync/test/syncReplicateTest.cpp +++ b/source/libs/sync/test/syncReplicateTest.cpp @@ -189,7 +189,7 @@ int main(int argc, char** argv) { if (alreadySend < writeRecordNum) { SRpcMsg* pRpcMsg = createRpcMsg(alreadySend, writeRecordNum, myIndex); - int32_t ret = syncPropose(rid, pRpcMsg, false); + int32_t ret = syncPropose(rid, pRpcMsg, false, NULL); if (ret == -1 && terrno == TSDB_CODE_SYN_NOT_LEADER) { sTrace("%s value%d write not leader", s, alreadySend); } else { diff --git a/source/libs/sync/test/syncTestTool.cpp b/source/libs/sync/test/syncTestTool.cpp index 8c486df118..4bc2e92d0c 100644 --- a/source/libs/sync/test/syncTestTool.cpp +++ b/source/libs/sync/test/syncTestTool.cpp @@ -396,7 +396,7 @@ int main(int argc, char** argv) { if (alreadySend < writeRecordNum) { SRpcMsg* pRpcMsg = createRpcMsg(alreadySend, writeRecordNum, myIndex); - int32_t ret = syncPropose(rid, pRpcMsg, false); + int32_t ret = syncPropose(rid, pRpcMsg, false, NULL); if (ret == -1 && terrno == TSDB_CODE_SYN_NOT_LEADER) { sTrace("%s value%d write not leader, leaderTransferWait:%d", simpleStr, alreadySend, leaderTransferWait); } else { From f623837b60e31b7ca86ee227a5b4a3a6156d1134 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 14 Dec 2022 09:14:54 +0800 Subject: [PATCH 67/74] refact: adjust mnode timer --- source/dnode/mnode/impl/inc/mndInt.h | 1 + source/dnode/mnode/impl/src/mndMain.c | 3 +++ source/dnode/mnode/impl/src/mndSync.c | 28 +++++++++++++++------------ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndInt.h b/source/dnode/mnode/impl/inc/mndInt.h index 526fa142eb..785ecc2bf5 100644 --- a/source/dnode/mnode/impl/inc/mndInt.h +++ b/source/dnode/mnode/impl/inc/mndInt.h @@ -89,6 +89,7 @@ typedef struct { int32_t errCode; int32_t transId; int32_t transSec; + int64_t transSeq; TdThreadMutex lock; int8_t selfIndex; int8_t numOfReplicas; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index e12a908d88..1a92f94f5e 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -280,6 +280,9 @@ static void *mndThreadFp(void *param) { if (sec % (tsStatusInterval * 5) == 0) { mndCheckDnodeOffline(pMnode); + } + + if (sec % (MNODE_TIMEOUT_SEC / 2) == 0) { mndSyncCheckTimeout(pMnode); } } diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index ba14f526a9..6295cfbf55 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -17,8 +17,6 @@ #include "mndSync.h" #include "mndTrans.h" -#define TRANS_TIMEOUT_SEC 10 - static int32_t mndSyncEqCtrlMsg(const SMsgCb *msgcb, SRpcMsg *pMsg) { if (pMsg == NULL || pMsg->pCont == NULL) { return -1; @@ -103,6 +101,7 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta } pMgmt->transId = 0; pMgmt->transSec = 0; + pMgmt->transSeq = 0; tsem_post(&pMgmt->syncSem); taosThreadMutexUnlock(&pMgmt->lock); } else { @@ -210,6 +209,7 @@ static void mndBecomeFollower(const SSyncFSM *pFsm) { mInfo("vgId:1, become follower and post sem, trans:%d, failed to propose since not leader", pMgmt->transId); pMgmt->transId = 0; pMgmt->transSec = 0; + pMgmt->transSeq = 0; pMgmt->errCode = TSDB_CODE_SYN_NOT_LEADER; tsem_post(&pMgmt->syncSem); } @@ -272,6 +272,7 @@ int32_t mndInitSync(SMnode *pMnode) { taosThreadMutexInit(&pMgmt->lock, NULL); pMgmt->transId = 0; pMgmt->transSec = 0; + pMgmt->transSeq = 0; SSyncInfo syncInfo = { .snapshotStrategy = SYNC_STRATEGY_STANDARD_SNAPSHOT, @@ -328,17 +329,18 @@ void mndSyncCheckTimeout(SMnode *pMnode) { if (pMgmt->transId != 0) { int32_t curSec = taosGetTimestampSec(); int32_t delta = curSec - pMgmt->transSec; - if (delta > TRANS_TIMEOUT_SEC) { - mError("trans:%d, failed to propose since timeout, start:%d cur:%d delta:%d", pMgmt->transId, pMgmt->transSec, - curSec, delta); + if (delta > MNODE_TIMEOUT_SEC) { + mError("trans:%d, failed to propose since timeout, start:%d cur:%d delta:%d seq:%" PRId64, pMgmt->transId, + pMgmt->transSec, curSec, delta, pMgmt->transSeq); pMgmt->transId = 0; pMgmt->transSec = 0; + pMgmt->transSeq = 0; terrno = TSDB_CODE_SYN_TIMEOUT; pMgmt->errCode = TSDB_CODE_SYN_TIMEOUT; tsem_post(&pMgmt->syncSem); } else { - mDebug("trans:%d, waiting for sync confirm, start:%d cur:%d delta:%d", pMgmt->transId, pMgmt->transSec, curSec, - curSec - pMgmt->transSec); + mDebug("trans:%d, waiting for sync confirm, start:%d cur:%d delta:%d seq:%" PRId64, pMgmt->transId, + pMgmt->transSec, curSec, curSec - pMgmt->transSec, pMgmt->transSeq); } } else { // mTrace("check sync timeout msg, no trans waiting for confirm"); @@ -368,26 +370,28 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { mInfo("trans:%d, will be proposed", transId); pMgmt->transId = transId; pMgmt->transSec = taosGetTimestampSec(); - taosThreadMutexUnlock(&pMgmt->lock); - int32_t code = syncPropose(pMgmt->sync, &req, false); + int64_t seq = 0; + int32_t code = syncPropose(pMgmt->sync, &req, false, &seq); if (code == 0) { - mInfo("trans:%d, is proposing and wait sem", transId); + mInfo("trans:%d, is proposing and wait sem, seq:%" PRId64, transId, seq); + pMgmt->transSeq = seq; + taosThreadMutexUnlock(&pMgmt->lock); tsem_wait(&pMgmt->syncSem); } else if (code > 0) { mInfo("trans:%d, confirm at once since replica is 1, continue execute", transId); - taosThreadMutexLock(&pMgmt->lock); pMgmt->transId = 0; pMgmt->transSec = 0; + pMgmt->transSeq = 0; taosThreadMutexUnlock(&pMgmt->lock); sdbWriteWithoutFree(pMnode->pSdb, pRaw); sdbSetApplyInfo(pMnode->pSdb, req.info.conn.applyIndex, req.info.conn.applyTerm, SYNC_INDEX_INVALID); code = 0; } else { mError("trans:%d, failed to proposed since %s", transId, terrstr()); - taosThreadMutexLock(&pMgmt->lock); pMgmt->transId = 0; pMgmt->transSec = 0; + pMgmt->transSeq = 0; taosThreadMutexUnlock(&pMgmt->lock); if (terrno == 0) { terrno = TSDB_CODE_APP_ERROR; From 3b519172a38014b5f91d0d9a85a616fe9d07fcc8 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 14 Dec 2022 10:30:47 +0800 Subject: [PATCH 68/74] refact: post sem in mnode while sync timeout --- source/dnode/mnode/impl/src/mndMain.c | 7 +++++++ source/dnode/mnode/impl/src/mndSync.c | 21 ++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index 1a92f94f5e..117a9f5e67 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -101,6 +101,7 @@ static void *mndBuildCheckpointTickMsg(int32_t *pContLen, int64_t sec) { } static void mndPullupTrans(SMnode *pMnode) { + mTrace("pullup trans msg"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -110,6 +111,7 @@ static void mndPullupTrans(SMnode *pMnode) { } static void mndPullupTtl(SMnode *pMnode) { + mTrace("pullup ttl"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); SRpcMsg rpcMsg = {.msgType = TDMT_MND_TTL_TIMER, .pCont = pReq, .contLen = contLen}; @@ -117,6 +119,7 @@ static void mndPullupTtl(SMnode *pMnode) { } static void mndCalMqRebalance(SMnode *pMnode) { + mTrace("calc mq rebalance"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -143,6 +146,7 @@ static void mndStreamCheckpointTick(SMnode *pMnode, int64_t sec) { } static void mndPullupTelem(SMnode *pMnode) { + mTrace("pullup telem msg"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -152,6 +156,7 @@ static void mndPullupTelem(SMnode *pMnode) { } static void mndPullupGrant(SMnode *pMnode) { + mTrace("pullup grant msg"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -162,6 +167,7 @@ static void mndPullupGrant(SMnode *pMnode) { } static void mndIncreaseUpTime(SMnode *pMnode) { + mTrace("increate uptime"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -213,6 +219,7 @@ static void mndSetVgroupOffline(SMnode *pMnode, int32_t dnodeId, int64_t curMs) } static void mndCheckDnodeOffline(SMnode *pMnode) { + mTrace("check dnode offline"); if (mndAcquireRpc(pMnode) != 0) return; SSdb *pSdb = pMnode->pSdb; diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 6295cfbf55..c96faddc4c 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -78,26 +78,27 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta SSdbRaw *pRaw = pMsg->pCont; int32_t transId = sdbGetIdFromRaw(pMnode->pSdb, pRaw); - pMgmt->errCode = pMeta->code; mInfo("trans:%d, is proposed, saved:%d code:0x%x, apply index:%" PRId64 " term:%" PRIu64 " config:%" PRId64 - " role:%s raw:%p", + " role:%s raw:%p sec:%d seq:%" PRId64, transId, pMgmt->transId, pMeta->code, pMeta->index, pMeta->term, pMeta->lastConfigIndex, syncStr(pMeta->state), - pRaw); + pRaw, pMgmt->transSec, pMgmt->transSeq); - if (pMgmt->errCode == 0) { + if (pMeta->code == 0) { sdbWriteWithoutFree(pMnode->pSdb, pRaw); sdbSetApplyInfo(pMnode->pSdb, pMeta->index, pMeta->term, pMeta->lastConfigIndex); } taosThreadMutexLock(&pMgmt->lock); + pMgmt->errCode = pMeta->code; + if (transId <= 0) { taosThreadMutexUnlock(&pMgmt->lock); - mError("trans:%d, invalid commit msg", transId); + mError("trans:%d, invalid commit msg, cache transId:%d seq:%" PRId64, transId, pMgmt->transId, pMgmt->transSeq); } else if (transId == pMgmt->transId) { if (pMgmt->errCode != 0) { mError("trans:%d, failed to propose since %s, post sem", transId, tstrerror(pMgmt->errCode)); } else { - mInfo("trans:%d, is proposed and post sem", transId); + mInfo("trans:%d, is proposed and post sem, seq:%" PRId64, transId, pMgmt->transSeq); } pMgmt->transId = 0; pMgmt->transSec = 0; @@ -108,7 +109,7 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta taosThreadMutexUnlock(&pMgmt->lock); STrans *pTrans = mndAcquireTrans(pMnode, transId); if (pTrans != NULL) { - mInfo("trans:%d, execute in mnode which not leader", transId); + mInfo("trans:%d, execute in mnode which not leader or sync timeout", transId); mndTransExecute(pMnode, pTrans); mndReleaseTrans(pMnode, pTrans); // sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA); @@ -324,6 +325,7 @@ void mndCleanupSync(SMnode *pMnode) { } void mndSyncCheckTimeout(SMnode *pMnode) { + mTrace("check sync timeout"); SSyncMgmt *pMgmt = &pMnode->syncMgmt; taosThreadMutexLock(&pMgmt->lock); if (pMgmt->transId != 0) { @@ -350,7 +352,6 @@ void mndSyncCheckTimeout(SMnode *pMnode) { int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { SSyncMgmt *pMgmt = &pMnode->syncMgmt; - pMgmt->errCode = 0; SRpcMsg req = {.msgType = TDMT_MND_APPLY_MSG, .contLen = sdbGetRawTotalSize(pRaw)}; if (req.contLen <= 0) return -1; @@ -360,6 +361,8 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { memcpy(req.pCont, pRaw, req.contLen); taosThreadMutexLock(&pMgmt->lock); + pMgmt->errCode = 0; + if (pMgmt->transId != 0) { mError("trans:%d, can't be proposed since trans:%d already waiting for confirm", transId, pMgmt->transId); taosThreadMutexUnlock(&pMgmt->lock); @@ -406,7 +409,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { } terrno = pMgmt->errCode; - return pMgmt->errCode; + return terrno; } void mndSyncStart(SMnode *pMnode) { From 9af36669ad051eac01e6d20cea09e33a67ed5fcb Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 14 Dec 2022 11:56:08 +0800 Subject: [PATCH 69/74] refact: post sem in vnode while sync timeout --- source/dnode/mgmt/mgmt_vnode/src/vmInt.c | 16 +++++++++------- source/libs/sync/src/syncMain.c | 8 ++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 2345c752a9..313a88fc5c 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -335,15 +335,17 @@ static void vmCleanup(SVnodeMgmt *pMgmt) { } static void vmCheckSyncTimeout(SVnodeMgmt *pMgmt) { - taosThreadRwlockRdlock(&pMgmt->lock); - void *pIter = taosHashIterate(pMgmt->hash, NULL); - while (pIter) { - SVnodeObj **ppVnode = pIter; - if (ppVnode == NULL || *ppVnode == NULL) continue; + int32_t numOfVnodes = 0; + SVnodeObj **ppVnodes = vmGetVnodeListFromHash(pMgmt, &numOfVnodes); - SVnodeObj *pVnode = *ppVnode; + for (int32_t i = 0; i < numOfVnodes; ++i) { + SVnodeObj *pVnode = ppVnodes[i]; vnodeSyncCheckTimeout(pVnode->pImpl); - pIter = taosHashIterate(pMgmt->hash, pIter); + vmReleaseVnode(pMgmt, pVnode); + } + + if (ppVnodes != NULL) { + taosMemoryFree(ppVnodes); } } diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index f4a6050171..af456f42f8 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -223,11 +223,15 @@ void syncSendTimeoutRsp(int64_t rid, int64_t seq) { if (pNode == NULL) return; SRpcMsg rpcMsg = {0}; - (void)syncRespMgrGetAndDel(pNode->pSyncRespMgr, seq, &rpcMsg.info); + int32_t ret = syncRespMgrGetAndDel(pNode->pSyncRespMgr, seq, &rpcMsg.info); rpcMsg.code = TSDB_CODE_SYN_TIMEOUT; syncNodeRelease(pNode); - rpcSendResponse(&rpcMsg); + if (ret == 1) { + sInfo("send response since sync timeout, seq:%" PRId64 " handle:%p ahandle:%p", seq, rpcMsg.info.handle, + rpcMsg.info.ahandle); + rpcSendResponse(&rpcMsg); + } } SyncIndex syncMinMatchIndex(SSyncNode* pSyncNode) { From 60bab9ae55115ca53d8ff9a097fbe42ce9325342 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 14 Dec 2022 16:09:28 +0800 Subject: [PATCH 70/74] refact: post sem in vnode while sync timeout --- include/libs/sync/sync.h | 2 +- source/dnode/vnode/src/inc/vnodeInt.h | 51 +++++++++++++------------- source/dnode/vnode/src/vnd/vnodeSync.c | 24 +++++++++--- source/libs/sync/src/syncMain.c | 10 +++-- 4 files changed, 52 insertions(+), 35 deletions(-) diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index 1e1ed3bddc..a13d203889 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -240,7 +240,7 @@ int32_t syncStepDown(int64_t rid, SyncTerm newTerm); bool syncIsReadyForRead(int64_t rid); bool syncSnapshotSending(int64_t rid); bool syncSnapshotRecving(int64_t rid); -void syncSendTimeoutRsp(int64_t rid, int64_t seq); +int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq); SSyncState syncGetState(int64_t rid); void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet); diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index e025626ecf..958200da4c 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -322,31 +322,32 @@ struct STsdbKeepCfg { }; struct SVnode { - char* path; - SVnodeCfg config; - SVState state; - SVStatis statis; - STfs* pTfs; - SMsgCb msgCb; - TdThreadMutex mutex; - TdThreadCond poolNotEmpty; - SVBufPool* pPool; - SVBufPool* inUse; - SMeta* pMeta; - SSma* pSma; - STsdb* pTsdb; - SWal* pWal; - STQ* pTq; - SSink* pSink; - tsem_t canCommit; - int64_t sync; - TdThreadMutex lock; - bool blocked; - bool restored; - tsem_t syncSem; - int32_t blockSec; - int64_t blockSeq; - SQHandle* pQuery; + char* path; + SVnodeCfg config; + SVState state; + SVStatis statis; + STfs* pTfs; + SMsgCb msgCb; + TdThreadMutex mutex; + TdThreadCond poolNotEmpty; + SVBufPool* pPool; + SVBufPool* inUse; + SMeta* pMeta; + SSma* pSma; + STsdb* pTsdb; + SWal* pWal; + STQ* pTq; + SSink* pSink; + tsem_t canCommit; + int64_t sync; + TdThreadMutex lock; + bool blocked; + bool restored; + tsem_t syncSem; + int32_t blockSec; + int64_t blockSeq; + SRpcHandleInfo blockInfo; + SQHandle* pQuery; }; #define TD_VID(PVNODE) ((PVNODE)->config.vgId) diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 36eb6b293a..8e907261ff 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -32,8 +32,11 @@ static inline void vnodePostBlockMsg(SVnode *pVnode, const SRpcMsg *pMsg) { const STraceId *trace = &pMsg->info.traceId; taosThreadMutexLock(&pVnode->lock); if (pVnode->blocked) { - vGTrace("vgId:%d, msg:%p post block, type:%s", pVnode->config.vgId, pMsg, TMSG_INFO(pMsg->msgType)); + vGTrace("vgId:%d, msg:%p post block, type:%s sec:%d seq:%" PRId64, pVnode->config.vgId, pMsg, + TMSG_INFO(pMsg->msgType), pVnode->blockSec, pVnode->blockSeq); pVnode->blocked = false; + pVnode->blockSec = 0; + pVnode->blockSeq = 0; tsem_post(&pVnode->syncSem); } taosThreadMutexUnlock(&pVnode->lock); @@ -213,6 +216,7 @@ static int32_t inline vnodeProposeMsg(SVnode *pVnode, SRpcMsg *pMsg, bool isWeak pVnode->blocked = true; pVnode->blockSec = taosGetTimestampSec(); pVnode->blockSeq = seq; + pVnode->blockInfo = pMsg->info; } taosThreadMutexUnlock(&pVnode->lock); @@ -279,12 +283,15 @@ void vnodeApplyWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) { for (int32_t i = 0; i < numOfMsgs; ++i) { if (taosGetQitem(qall, (void **)&pMsg) == 0) continue; const STraceId *trace = &pMsg->info.traceId; - vGTrace("vgId:%d, msg:%p get from vnode-apply queue, type:%s handle:%p index:%" PRId64, vgId, pMsg, - TMSG_INFO(pMsg->msgType), pMsg->info.handle, pMsg->info.conn.applyIndex); if (vnodeIsMsgBlock(pMsg->msgType)) { - vTrace("vgId:%d, blocking msg obtained from apply-queue. index:%" PRId64 ", term: %" PRId64 ", type: %s", vgId, - pMsg->info.conn.applyIndex, pMsg->info.conn.applyTerm, TMSG_INFO(pMsg->msgType)); + vGTrace("vgId:%d, msg:%p get from vnode-apply queue, type:%s handle:%p index:%" PRId64 + ", blocking msg obtained sec:%d seq:%" PRId64, + vgId, pMsg, TMSG_INFO(pMsg->msgType), pMsg->info.handle, pMsg->info.conn.applyIndex, pVnode->blockSec, + pVnode->blockSeq); + } else { + vGTrace("vgId:%d, msg:%p get from vnode-apply queue, type:%s handle:%p index:%" PRId64, vgId, pMsg, + TMSG_INFO(pMsg->msgType), pMsg->info.handle, pMsg->info.conn.applyIndex); } SRpcMsg rsp = {.code = pMsg->code, .info = pMsg->info}; @@ -618,9 +625,14 @@ void vnodeSyncCheckTimeout(SVnode *pVnode) { int32_t curSec = taosGetTimestampSec(); int32_t delta = curSec - pVnode->blockSec; if (delta > VNODE_TIMEOUT_SEC) { - syncSendTimeoutRsp(pVnode->sync, pVnode->blockSeq); vError("vgId:%d, failed to propose since timeout and post block, start:%d cur:%d delta:%d seq:%" PRId64, pVnode->config.vgId, pVnode->blockSec, curSec, delta, pVnode->blockSeq); + if (syncSendTimeoutRsp(pVnode->sync, pVnode->blockSeq) != 0) { + SRpcMsg rpcMsg = {.code = TSDB_CODE_SYN_TIMEOUT, .info = pVnode->blockInfo}; + vInfo("send timeout response since its applyed, seq:%" PRId64 " handle:%p ahandle:%p", pVnode->blockSeq, + rpcMsg.info.handle, rpcMsg.info.ahandle); + rpcSendResponse(&rpcMsg); + } pVnode->blocked = false; pVnode->blockSec = 0; pVnode->blockSeq = 0; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index af456f42f8..d6ce77193a 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -218,9 +218,9 @@ int32_t syncLeaderTransfer(int64_t rid) { return ret; } -void syncSendTimeoutRsp(int64_t rid, int64_t seq) { +int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq) { SSyncNode* pNode = syncNodeAcquire(rid); - if (pNode == NULL) return; + if (pNode == NULL) return -1; SRpcMsg rpcMsg = {0}; int32_t ret = syncRespMgrGetAndDel(pNode->pSyncRespMgr, seq, &rpcMsg.info); @@ -228,9 +228,13 @@ void syncSendTimeoutRsp(int64_t rid, int64_t seq) { syncNodeRelease(pNode); if (ret == 1) { - sInfo("send response since sync timeout, seq:%" PRId64 " handle:%p ahandle:%p", seq, rpcMsg.info.handle, + sInfo("send timeout response, seq:%" PRId64 " handle:%p ahandle:%p", seq, rpcMsg.info.handle, rpcMsg.info.ahandle); rpcSendResponse(&rpcMsg); + return 0; + } else { + sInfo("no rpcinfo to send timeout response, seq:%" PRId64, seq); + return -1; } } From e6709caafbd5b5c82eb447527967da85eccb68ba Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 14 Dec 2022 16:14:39 +0800 Subject: [PATCH 71/74] remove sch status on timeout --- source/libs/qworker/src/qwUtil.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index f3d073634d..fdd2775daa 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -74,6 +74,8 @@ int32_t qwAddSchedulerImpl(SQWorker *mgmt, uint64_t sId, int32_t rwType) { SQWSchStatus newSch = {0}; newSch.tasksHash = taosHashInit(mgmt->cfg.maxSchTaskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); + newSch.hbBrokenTs = taosGetTimestampMs(); + if (NULL == newSch.tasksHash) { QW_SCH_ELOG("taosHashInit %d failed", mgmt->cfg.maxSchTaskNum); QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); From 4db6b043c62510e396d410c5c769d0d2bf20352b Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 14 Dec 2022 19:01:31 +0800 Subject: [PATCH 72/74] fix: reduce the frequency of retry in sync not ready case while alter db --- source/dnode/mnode/impl/inc/mndTrans.h | 1 + source/dnode/mnode/impl/src/mndDb.c | 18 ++++++--- source/dnode/mnode/impl/src/mndTrans.c | 18 +++++++-- source/dnode/vnode/src/inc/vnodeInt.h | 52 +++++++++++++------------- source/dnode/vnode/src/vnd/vnodeSync.c | 6 ++- 5 files changed, 60 insertions(+), 35 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndTrans.h b/source/dnode/mnode/impl/inc/mndTrans.h index 2372fa30e5..07066d2251 100644 --- a/source/dnode/mnode/impl/inc/mndTrans.h +++ b/source/dnode/mnode/impl/inc/mndTrans.h @@ -75,6 +75,7 @@ void mndTransSetCb(STrans *pTrans, ETrnFunc startFunc, ETrnFunc stopFunc, voi void mndTransSetDbName(STrans *pTrans, const char *dbname, const char *stbname); void mndTransSetSerial(STrans *pTrans); void mndTransSetOper(STrans *pTrans, EOperType oper); +int32_t mndTrancCheckConflict(SMnode *pMnode, STrans *pTrans); int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans); int32_t mndTransProcessRsp(SRpcMsg *pRsp); diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 43155124c1..0715556da2 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -776,6 +776,8 @@ static int32_t mndAlterDb(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pOld, SDbObj *p int32_t code = -1; mndTransSetDbName(pTrans, pOld->name, NULL); + if (mndTrancCheckConflict(pMnode, pTrans) != 0) return -1; + if (mndSetAlterDbRedoLogs(pMnode, pTrans, pOld, pNew) != 0) goto _OVER; if (mndSetAlterDbCommitLogs(pMnode, pTrans, pOld, pNew) != 0) goto _OVER; if (mndSetAlterDbRedoActions(pMnode, pTrans, pOld, pNew) != 0) goto _OVER; @@ -835,12 +837,14 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) { _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { + if (terrno != 0) code = terrno; mError("db:%s, failed to alter since %s", alterReq.db, terrstr()); } mndReleaseDb(pMnode, pDb); taosArrayDestroy(dbObj.cfg.pRetensions); + terrno = code; return code; } @@ -1183,7 +1187,8 @@ int32_t mndExtractDbInfo(SMnode *pMnode, SDbObj *pDb, SUseDbRsp *pRsp, const SUs int32_t numOfTable = mndGetDBTableNum(pDb, pMnode); - if (pReq == NULL || pReq->vgVersion < pDb->vgVersion || pReq->dbId != pDb->uid || numOfTable != pReq->numOfTable || pReq->stateTs < pDb->stateTs) { + if (pReq == NULL || pReq->vgVersion < pDb->vgVersion || pReq->dbId != pDb->uid || numOfTable != pReq->numOfTable || + pReq->stateTs < pDb->stateTs) { mndBuildDBVgroupInfo(pDb, pMnode, pRsp->pVgroupInfos); } @@ -1298,21 +1303,22 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbVgVersion *pDbs, int32_t numOfDbs, SUseDbRsp usedbRsp = {0}; - if ((0 == strcasecmp(pDbVgVersion->dbFName, TSDB_INFORMATION_SCHEMA_DB) || (0 == strcasecmp(pDbVgVersion->dbFName, TSDB_PERFORMANCE_SCHEMA_DB)))) { + if ((0 == strcasecmp(pDbVgVersion->dbFName, TSDB_INFORMATION_SCHEMA_DB) || + (0 == strcasecmp(pDbVgVersion->dbFName, TSDB_PERFORMANCE_SCHEMA_DB)))) { memcpy(usedbRsp.db, pDbVgVersion->dbFName, TSDB_DB_FNAME_LEN); int32_t vgVersion = mndGetGlobalVgroupVersion(pMnode); if (pDbVgVersion->vgVersion < vgVersion) { usedbRsp.pVgroupInfos = taosArrayInit(10, sizeof(SVgroupInfo)); - + mndBuildDBVgroupInfo(NULL, pMnode, usedbRsp.pVgroupInfos); usedbRsp.vgVersion = vgVersion++; } else { usedbRsp.vgVersion = pDbVgVersion->vgVersion; } usedbRsp.vgNum = taosArrayGetSize(usedbRsp.pVgroupInfos); - + taosArrayPush(batchUseRsp.pArray, &usedbRsp); - + continue; } @@ -1328,7 +1334,7 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbVgVersion *pDbs, int32_t numOfDbs, int32_t numOfTable = mndGetDBTableNum(pDb, pMnode); - if (pDbVgVersion->vgVersion >= pDb->vgVersion && numOfTable == pDbVgVersion->numOfTable && + if (pDbVgVersion->vgVersion >= pDb->vgVersion && numOfTable == pDbVgVersion->numOfTable && pDbVgVersion->stateTs == pDb->stateTs) { mTrace("db:%s, valid dbinfo, vgVersion:%d stateTs:%" PRId64 " numOfTables:%d, not changed vgVersion:%d stateTs:%" PRId64 " numOfTables:%d", diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 4b11884050..42037304b9 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -838,7 +838,7 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) { return conflict; } -int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) { +int32_t mndTrancCheckConflict(SMnode *pMnode, STrans *pTrans) { if (pTrans->conflict == TRN_CONFLICT_DB || pTrans->conflict == TRN_CONFLICT_DB_INSIDE) { if (strlen(pTrans->dbname) == 0 && strlen(pTrans->stbname) == 0) { terrno = TSDB_CODE_MND_TRANS_CONFLICT; @@ -853,6 +853,14 @@ int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) { return -1; } + return 0; +} + +int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) { + if (mndTrancCheckConflict(pMnode, pTrans) != 0) { + return -1; + } + if (taosArrayGetSize(pTrans->commitActions) <= 0) { terrno = TSDB_CODE_MND_TRANS_CLOG_IS_NULL; mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr()); @@ -1027,6 +1035,7 @@ int32_t mndTransProcessRsp(SRpcMsg *pRsp) { if (pAction != NULL) { pAction->msgReceived = 1; pAction->errCode = pRsp->code; + pTrans->lastErrorNo = pRsp->code; } mInfo("trans:%d, %s:%d response is received, code:0x%x, accept:0x%x retry:0x%x", transId, mndTransStr(pAction->stage), @@ -1238,7 +1247,7 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans) if (numOfActions == 0) return code; if (pTrans->redoActionPos >= numOfActions) return code; - mInfo("trans:%d, execute %d actions serial", pTrans->id, numOfActions); + mInfo("trans:%d, execute %d actions serial, current redoAction:%d", pTrans->id, numOfActions, pTrans->redoActionPos); for (int32_t action = pTrans->redoActionPos; action < numOfActions; ++action) { STransAction *pAction = taosArrayGet(pTrans->redoActions, pTrans->redoActionPos); @@ -1289,13 +1298,16 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans) } else if (code == TSDB_CODE_ACTION_IN_PROGRESS) { mInfo("trans:%d, %s:%d is in progress and wait it finish", pTrans->id, mndTransStr(pAction->stage), pAction->id); break; - } else if (code == pAction->retryCode) { + } else if (code == pAction->retryCode || code == TSDB_CODE_SYN_PROPOSE_NOT_READY || + code == TSDB_CODE_SYN_RESTORING || code == TSDB_CODE_SYN_NOT_LEADER) { mInfo("trans:%d, %s:%d receive code:0x%x and retry", pTrans->id, mndTransStr(pAction->stage), pAction->id, code); + pTrans->lastErrorNo = code; taosMsleep(300); action--; continue; } else { terrno = code; + pTrans->lastErrorNo = code; pTrans->code = code; mInfo("trans:%d, %s:%d receive code:0x%x and wait another schedule, failedTimes:%d", pTrans->id, mndTransStr(pAction->stage), pAction->id, code, pTrans->failedTimes); diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 958200da4c..094468c666 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -322,32 +322,34 @@ struct STsdbKeepCfg { }; struct SVnode { - char* path; - SVnodeCfg config; - SVState state; - SVStatis statis; - STfs* pTfs; - SMsgCb msgCb; - TdThreadMutex mutex; - TdThreadCond poolNotEmpty; - SVBufPool* pPool; - SVBufPool* inUse; - SMeta* pMeta; - SSma* pSma; - STsdb* pTsdb; - SWal* pWal; - STQ* pTq; - SSink* pSink; - tsem_t canCommit; - int64_t sync; - TdThreadMutex lock; - bool blocked; - bool restored; - tsem_t syncSem; - int32_t blockSec; - int64_t blockSeq; + char* path; + SVnodeCfg config; + SVState state; + SVStatis statis; + STfs* pTfs; + SMsgCb msgCb; + TdThreadMutex mutex; + TdThreadCond poolNotEmpty; + SVBufPool* pPool; + SVBufPool* inUse; + SMeta* pMeta; + SSma* pSma; + STsdb* pTsdb; + SWal* pWal; + STQ* pTq; + SSink* pSink; + tsem_t canCommit; + int64_t sync; + TdThreadMutex lock; + bool blocked; + bool restored; + tsem_t syncSem; + int32_t blockSec; + int64_t blockSeq; + SQHandle* pQuery; +#if 0 SRpcHandleInfo blockInfo; - SQHandle* pQuery; +#endif }; #define TD_VID(PVNODE) ((PVNODE)->config.vgId) diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 8e907261ff..2c23646db1 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -216,7 +216,9 @@ static int32_t inline vnodeProposeMsg(SVnode *pVnode, SRpcMsg *pMsg, bool isWeak pVnode->blocked = true; pVnode->blockSec = taosGetTimestampSec(); pVnode->blockSeq = seq; +#if 0 pVnode->blockInfo = pMsg->info; +#endif } taosThreadMutexUnlock(&pVnode->lock); @@ -628,10 +630,12 @@ void vnodeSyncCheckTimeout(SVnode *pVnode) { vError("vgId:%d, failed to propose since timeout and post block, start:%d cur:%d delta:%d seq:%" PRId64, pVnode->config.vgId, pVnode->blockSec, curSec, delta, pVnode->blockSeq); if (syncSendTimeoutRsp(pVnode->sync, pVnode->blockSeq) != 0) { +#if 0 SRpcMsg rpcMsg = {.code = TSDB_CODE_SYN_TIMEOUT, .info = pVnode->blockInfo}; - vInfo("send timeout response since its applyed, seq:%" PRId64 " handle:%p ahandle:%p", pVnode->blockSeq, + vError("send timeout response since its applyed, seq:%" PRId64 " handle:%p ahandle:%p", pVnode->blockSeq, rpcMsg.info.handle, rpcMsg.info.ahandle); rpcSendResponse(&rpcMsg); +#endif } pVnode->blocked = false; pVnode->blockSec = 0; From 75b707186c8c22c136a957481cc953092169b2fb Mon Sep 17 00:00:00 2001 From: Guangxin Yuan <274841922@qq.com> Date: Wed, 14 Dec 2022 20:50:02 +0800 Subject: [PATCH 73/74] fix docs of 11-kafka.md (#18953) Co-authored-by: root --- docs/en/20-third-party/11-kafka.md | 2 +- docs/zh/20-third-party/11-kafka.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/20-third-party/11-kafka.md b/docs/en/20-third-party/11-kafka.md index 6720af8bf8..3e8f7c295d 100644 --- a/docs/en/20-third-party/11-kafka.md +++ b/docs/en/20-third-party/11-kafka.md @@ -76,7 +76,7 @@ Development: false ### Install from source code ``` -git clone https://github.com:taosdata/kafka-connect-tdengine.git +git clone https://github.com/taosdata/kafka-connect-tdengine.git cd kafka-connect-tdengine mvn clean package unzip -d $CONFLUENT_HOME/share/java/ target/components/packages/taosdata-kafka-connect-tdengine-*.zip diff --git a/docs/zh/20-third-party/11-kafka.md b/docs/zh/20-third-party/11-kafka.md index 1172f4fbc5..cc2247f25e 100644 --- a/docs/zh/20-third-party/11-kafka.md +++ b/docs/zh/20-third-party/11-kafka.md @@ -79,7 +79,7 @@ Development: false ### 从源码安装 ``` -git clone https://github.com:taosdata/kafka-connect-tdengine.git +git clone https://github.com/taosdata/kafka-connect-tdengine.git cd kafka-connect-tdengine mvn clean package unzip -d $CONFLUENT_HOME/share/java/ target/components/packages/taosdata-kafka-connect-tdengine-*.zip From 8af1cf15a792b61372c0e09e2296b7e04ad14e50 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Wed, 14 Dec 2022 20:58:42 +0800 Subject: [PATCH 74/74] enh: adjust batchSize dynamically on retryBackoff --- source/libs/sync/src/syncPipeline.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 7bd8d75dd1..88727351c6 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -594,6 +594,7 @@ int32_t syncLogReplMgrRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { int count = 0; int64_t firstIndex = -1; SyncTerm term = -1; + int64_t batchSize = TMAX(1, pMgr->size >> (4 + pMgr->retryBackoff)); for (SyncIndex index = pMgr->startIndex; index < pMgr->endIndex; index++) { int64_t pos = index % pMgr->size; @@ -620,7 +621,10 @@ int32_t syncLogReplMgrRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { retried = true; if (firstIndex == -1) firstIndex = index; - count++; + + if (batchSize <= count++) { + break; + } } ret = 0; @@ -800,8 +804,9 @@ int32_t syncLogReplMgrReplicateProbeOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { ASSERT(pMgr->restored); + SRaftId* pDestId = &pNode->replicasId[pMgr->peerId]; - int32_t batchSize = TMAX(1, pMgr->size / 20); + int32_t batchSize = TMAX(1, pMgr->size >> (4 + pMgr->retryBackoff)); int32_t count = 0; int64_t nowMs = taosGetMonoTimestampMs(); int64_t limit = pMgr->size >> 1;