From 4a55ed07b3a82bc6893f358dbd26b911a9908877 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 28 Jun 2022 10:34:51 +0800 Subject: [PATCH 01/51] feature: query redirect --- include/common/tmsgdef.h | 16 ++++++----- source/client/src/clientEnv.c | 2 +- source/client/src/clientImpl.c | 2 +- source/dnode/mgmt/mgmt_mnode/src/mmHandle.c | 10 +++---- source/dnode/mgmt/mgmt_qnode/src/qmHandle.c | 12 ++++---- source/dnode/mgmt/mgmt_vnode/src/vmHandle.c | 12 ++++---- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 2 +- source/dnode/mnode/impl/src/mndMain.c | 6 ++-- source/dnode/mnode/impl/src/mndQuery.c | 24 ++++++++-------- source/dnode/qnode/src/qnode.c | 14 +++++----- source/dnode/vnode/src/vnd/vnodeSvr.c | 14 +++++----- source/libs/executor/src/executorimpl.c | 2 +- source/libs/function/src/udfd.c | 2 +- source/libs/parser/src/parTranslater.c | 2 +- source/libs/planner/src/planPhysiCreater.c | 2 +- source/libs/qcom/src/queryUtil.c | 2 +- source/libs/qworker/src/qwMsg.c | 6 ++-- source/libs/qworker/test/qworkerTests.cpp | 16 +++++------ source/libs/scheduler/src/schJob.c | 6 ++-- source/libs/scheduler/src/schRemote.c | 28 +++++++++---------- source/libs/scheduler/test/schedulerTests.cpp | 10 +++---- 21 files changed, 96 insertions(+), 94 deletions(-) diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index acf08bd47e..cbf0c4b2fe 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -167,10 +167,6 @@ enum { TD_NEW_MSG_SEG(TDMT_VND_MSG) TD_DEF_MSG_TYPE(TDMT_VND_SUBMIT, "submit", SSubmitReq, SSubmitRsp) - TD_DEF_MSG_TYPE(TDMT_VND_QUERY, "query", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_VND_QUERY_CONTINUE, "query-continue", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_VND_QUERY_HEARTBEAT, "query-heartbeat", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_VND_FETCH, "fetch", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_CREATE_TABLE, "create-table", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_ALTER_TABLE, "alter-table", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_DROP_TABLE, "drop-table", NULL, NULL) @@ -184,12 +180,9 @@ enum { TD_DEF_MSG_TYPE(TDMT_VND_MQ_VG_CHANGE, "vnode-mq-vg-change", SMqRebVgReq, SMqRebVgRsp) TD_DEF_MSG_TYPE(TDMT_VND_MQ_VG_DELETE, "vnode-mq-vg-delete", SMqVDeleteReq, SMqVDeleteRsp) TD_DEF_MSG_TYPE(TDMT_VND_MQ_COMMIT_OFFSET, "vnode-commit-offset", STqOffset, STqOffset) - TD_DEF_MSG_TYPE(TDMT_VND_CANCEL_TASK, "vnode-cancel-task", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_VND_DROP_TASK, "vnode-drop-task", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_CREATE_TOPIC, "vnode-create-topic", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_ALTER_TOPIC, "vnode-alter-topic", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_DROP_TOPIC, "vnode-drop-topic", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_VND_EXPLAIN, "vnode-explain", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_SUBSCRIBE, "vnode-subscribe", SMVSubscribeReq, SMVSubscribeRsp) TD_DEF_MSG_TYPE(TDMT_VND_CONSUME, "vnode-consume", SMqPollReq, SMqDataBlkRsp) TD_DEF_MSG_TYPE(TDMT_VND_STREAM_TRIGGER, "vnode-stream-trigger", NULL, NULL) @@ -206,6 +199,15 @@ enum { TD_DEF_MSG_TYPE(TDMT_VND_COMPACT, "compact", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_DROP_TTL_TABLE, "drop-ttl-stb", NULL, NULL) + TD_NEW_MSG_SEG(TDMT_SCH_MSG) + TD_DEF_MSG_TYPE(TDMT_SCH_QUERY, "query", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_QUERY_CONTINUE, "query-continue", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_QUERY_HEARTBEAT, "query-heartbeat", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_FETCH, "fetch", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_CANCEL_TASK, "vnode-cancel-task", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_DROP_TASK, "vnode-drop-task", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_EXPLAIN, "vnode-explain", NULL, NULL) + TD_NEW_MSG_SEG(TDMT_STREAM_MSG) TD_DEF_MSG_TYPE(TDMT_STREAM_TASK_DEPLOY, "stream-task-deploy", SStreamTaskDeployReq, SStreamTaskDeployRsp) TD_DEF_MSG_TYPE(TDMT_STREAM_TASK_DROP, "stream-task-drop", NULL, NULL) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 22b491994e..a36c7a0048 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -91,7 +91,7 @@ void closeTransporter(SAppInstInfo *pAppInfo) { static bool clientRpcRfp(int32_t code, tmsg_t msgType) { if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED || code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) { - if (msgType == TDMT_VND_QUERY || msgType == TDMT_VND_FETCH) { + if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_FETCH) { return false; } return true; diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 8c63046323..632b8441c4 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -808,7 +808,7 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) { code = handleSubmitExecRes(pRequest, pRes->res, pCatalog, &epset); break; } - case TDMT_VND_QUERY: { + case TDMT_SCH_QUERY: { code = handleQueryExecRes(pRequest, pRes->res, pCatalog, &epset); break; } diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index 3bf6d9b04f..fbf3379490 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -209,10 +209,10 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_MND_SHOW_VARIABLES, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_SERVER_VERSION, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY_CONTINUE, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY_HEARTBEAT, mmPutMsgToFetchQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_FETCH, mmPutMsgToFetchQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_CONTINUE, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_HEARTBEAT, mmPutMsgToFetchQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_FETCH, mmPutMsgToFetchQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_CREATE_STB_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_STB_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_STB_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; @@ -220,7 +220,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_SMA_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_MQ_VG_CHANGE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_MQ_VG_DELETE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_TASK, mmPutMsgToFetchQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_DROP_TASK, mmPutMsgToFetchQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DEPLOY_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DROP_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_CONFIG_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c b/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c index 864f5b485a..1a7b5c1a1b 100644 --- a/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c +++ b/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c @@ -107,14 +107,14 @@ SArray *qmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_MON_QM_INFO, qmPutNodeMsgToMonitorQueue, 0) == NULL) goto _OVER; // Requests handled by VNODE - if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY, qmPutNodeMsgToQueryQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY_CONTINUE, qmPutNodeMsgToQueryQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_FETCH, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY, qmPutNodeMsgToQueryQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_CONTINUE, qmPutNodeMsgToQueryQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_FETCH, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_FETCH_RSP, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY_HEARTBEAT, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_HEARTBEAT, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_CANCEL_TASK, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_TASK, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_CANCEL_TASK, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_DROP_TASK, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; code = 0; _OVER: diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index 00d83f0ad4..938e5f32b0 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -324,16 +324,16 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_MON_VM_LOAD, vmPutMsgToMonitorQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_SUBMIT, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY, vmPutMsgToQueryQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY_CONTINUE, vmPutMsgToQueryQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_FETCH, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY, vmPutMsgToQueryQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_CONTINUE, vmPutMsgToQueryQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_FETCH, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_TABLE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_UPDATE_TAG_VAL, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_TABLE_META, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_TABLE_CFG, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_TABLES_META, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_CANCEL_TASK, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_TASK, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_CANCEL_TASK, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_DROP_TASK, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_CREATE_STB, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_TTL_TABLE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_STB, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; @@ -349,7 +349,7 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_MQ_COMMIT_OFFSET, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_CONSUME, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DELETE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY_HEARTBEAT, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_HEARTBEAT, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TRIGGER, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DROP, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 7e31cc3144..c1b5b86d4c 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -251,7 +251,7 @@ static inline void dmReleaseHandle(SRpcHandleInfo *pHandle, int8_t type) { static bool rpcRfp(int32_t code, tmsg_t msgType) { if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED || code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) { - if (msgType == TDMT_VND_QUERY || msgType == TDMT_VND_FETCH) { + if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_FETCH) { return false; } return true; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index 136afb714e..0a9c5a82c8 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -527,9 +527,9 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { static int32_t mndCheckMnodeState(SRpcMsg *pMsg) { if (!IsReq(pMsg)) return 0; - if (pMsg->msgType == TDMT_VND_QUERY || pMsg->msgType == TDMT_VND_QUERY_CONTINUE || - pMsg->msgType == TDMT_VND_QUERY_HEARTBEAT || pMsg->msgType == TDMT_VND_FETCH || - pMsg->msgType == TDMT_VND_DROP_TASK) { + if (pMsg->msgType == TDMT_SCH_QUERY || pMsg->msgType == TDMT_SCH_QUERY_CONTINUE || + pMsg->msgType == TDMT_SCH_QUERY_HEARTBEAT || pMsg->msgType == TDMT_SCH_FETCH || + pMsg->msgType == TDMT_SCH_DROP_TASK) { return 0; } if (mndAcquireRpcRef(pMsg->info.node) == 0) return 0; diff --git a/source/dnode/mnode/impl/src/mndQuery.c b/source/dnode/mnode/impl/src/mndQuery.c index 671152f9c6..b67a11997e 100644 --- a/source/dnode/mnode/impl/src/mndQuery.c +++ b/source/dnode/mnode/impl/src/mndQuery.c @@ -19,13 +19,13 @@ #include "qworker.h" int32_t mndPreProcessQueryMsg(SRpcMsg *pMsg) { - if (TDMT_VND_QUERY != pMsg->msgType) return 0; + if (TDMT_SCH_QUERY != pMsg->msgType) return 0; SMnode *pMnode = pMsg->info.node; return qWorkerPreprocessQueryMsg(pMnode->pQuery, pMsg); } void mndPostProcessQueryMsg(SRpcMsg *pMsg) { - if (TDMT_VND_QUERY != pMsg->msgType) return; + if (TDMT_SCH_QUERY != pMsg->msgType) return; SMnode *pMnode = pMsg->info.node; qWorkerAbortPreprocessQueryMsg(pMnode->pQuery, pMsg); } @@ -37,19 +37,19 @@ int32_t mndProcessQueryMsg(SRpcMsg *pMsg) { mTrace("msg:%p, in query queue is processing", pMsg); switch (pMsg->msgType) { - case TDMT_VND_QUERY: + case TDMT_SCH_QUERY: code = qWorkerProcessQueryMsg(&handle, pMnode->pQuery, pMsg, 0); break; - case TDMT_VND_QUERY_CONTINUE: + case TDMT_SCH_QUERY_CONTINUE: code = qWorkerProcessCQueryMsg(&handle, pMnode->pQuery, pMsg, 0); break; - case TDMT_VND_FETCH: + case TDMT_SCH_FETCH: code = qWorkerProcessFetchMsg(pMnode, pMnode->pQuery, pMsg, 0); break; - case TDMT_VND_DROP_TASK: + case TDMT_SCH_DROP_TASK: code = qWorkerProcessDropMsg(pMnode, pMnode->pQuery, pMsg, 0); break; - case TDMT_VND_QUERY_HEARTBEAT: + case TDMT_SCH_QUERY_HEARTBEAT: code = qWorkerProcessHbMsg(pMnode, pMnode->pQuery, pMsg, 0); break; default: @@ -67,11 +67,11 @@ int32_t mndInitQuery(SMnode *pMnode) { return -1; } - mndSetMsgHandle(pMnode, TDMT_VND_QUERY, mndProcessQueryMsg); - mndSetMsgHandle(pMnode, TDMT_VND_QUERY_CONTINUE, mndProcessQueryMsg); - mndSetMsgHandle(pMnode, TDMT_VND_FETCH, mndProcessQueryMsg); - mndSetMsgHandle(pMnode, TDMT_VND_DROP_TASK, mndProcessQueryMsg); - mndSetMsgHandle(pMnode, TDMT_VND_QUERY_HEARTBEAT, mndProcessQueryMsg); + mndSetMsgHandle(pMnode, TDMT_SCH_QUERY, mndProcessQueryMsg); + mndSetMsgHandle(pMnode, TDMT_SCH_QUERY_CONTINUE, mndProcessQueryMsg); + mndSetMsgHandle(pMnode, TDMT_SCH_FETCH, mndProcessQueryMsg); + mndSetMsgHandle(pMnode, TDMT_SCH_DROP_TASK, mndProcessQueryMsg); + mndSetMsgHandle(pMnode, TDMT_SCH_QUERY_HEARTBEAT, mndProcessQueryMsg); return 0; } diff --git a/source/dnode/qnode/src/qnode.c b/source/dnode/qnode/src/qnode.c index ebaf73a952..a0aa640ed6 100644 --- a/source/dnode/qnode/src/qnode.c +++ b/source/dnode/qnode/src/qnode.c @@ -65,7 +65,7 @@ int32_t qndGetLoad(SQnode *pQnode, SQnodeLoad *pLoad) { } int32_t qndPreprocessQueryMsg(SQnode *pQnode, SRpcMsg * pMsg) { - if (TDMT_VND_QUERY != pMsg->msgType) { + if (TDMT_SCH_QUERY != pMsg->msgType) { return 0; } @@ -78,28 +78,28 @@ int32_t qndProcessQueryMsg(SQnode *pQnode, int64_t ts, SRpcMsg *pMsg) { qTrace("message in qnode queue is processing"); switch (pMsg->msgType) { - case TDMT_VND_QUERY: + case TDMT_SCH_QUERY: code = qWorkerProcessQueryMsg(&handle, pQnode->pQuery, pMsg, ts); break; - case TDMT_VND_QUERY_CONTINUE: + case TDMT_SCH_QUERY_CONTINUE: code = qWorkerProcessCQueryMsg(&handle, pQnode->pQuery, pMsg, ts); break; - case TDMT_VND_FETCH: + case TDMT_SCH_FETCH: code = qWorkerProcessFetchMsg(pQnode, pQnode->pQuery, pMsg, ts); break; case TDMT_VND_FETCH_RSP: code = qWorkerProcessFetchRsp(pQnode, pQnode->pQuery, pMsg, ts); break; - case TDMT_VND_CANCEL_TASK: + case TDMT_SCH_CANCEL_TASK: code = qWorkerProcessCancelMsg(pQnode, pQnode->pQuery, pMsg, ts); break; - case TDMT_VND_DROP_TASK: + case TDMT_SCH_DROP_TASK: code = qWorkerProcessDropMsg(pQnode, pQnode->pQuery, pMsg, ts); break; case TDMT_VND_CONSUME: // code = tqProcessConsumeReq(pQnode->pTq, pMsg); // break; - case TDMT_VND_QUERY_HEARTBEAT: + case TDMT_SCH_QUERY_HEARTBEAT: code = qWorkerProcessHbMsg(pQnode, pQnode->pQuery, pMsg, ts); break; default: diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 72c766e0ae..63b7289661 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -216,7 +216,7 @@ _err: } int32_t vnodePreprocessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg) { - if (TDMT_VND_QUERY != pMsg->msgType) { + if (TDMT_SCH_QUERY != pMsg->msgType) { return 0; } @@ -227,9 +227,9 @@ int32_t vnodeProcessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg) { vTrace("message in vnode query queue is processing"); SReadHandle handle = {.meta = pVnode->pMeta, .config = &pVnode->config, .vnode = pVnode, .pMsgCb = &pVnode->msgCb}; switch (pMsg->msgType) { - case TDMT_VND_QUERY: + case TDMT_SCH_QUERY: return qWorkerProcessQueryMsg(&handle, pVnode->pQuery, pMsg, 0); - case TDMT_VND_QUERY_CONTINUE: + case TDMT_SCH_QUERY_CONTINUE: return qWorkerProcessCQueryMsg(&handle, pVnode->pQuery, pMsg, 0); default: vError("unknown msg type:%d in query queue", pMsg->msgType); @@ -243,15 +243,15 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) { int32_t msgLen = pMsg->contLen - sizeof(SMsgHead); switch (pMsg->msgType) { - case TDMT_VND_FETCH: + case TDMT_SCH_FETCH: return qWorkerProcessFetchMsg(pVnode, pVnode->pQuery, pMsg, 0); case TDMT_VND_FETCH_RSP: return qWorkerProcessFetchRsp(pVnode, pVnode->pQuery, pMsg, 0); - case TDMT_VND_CANCEL_TASK: + case TDMT_SCH_CANCEL_TASK: return qWorkerProcessCancelMsg(pVnode, pVnode->pQuery, pMsg, 0); - case TDMT_VND_DROP_TASK: + case TDMT_SCH_DROP_TASK: return qWorkerProcessDropMsg(pVnode, pVnode->pQuery, pMsg, 0); - case TDMT_VND_QUERY_HEARTBEAT: + case TDMT_SCH_QUERY_HEARTBEAT: return qWorkerProcessHbMsg(pVnode, pVnode->pQuery, pMsg, 0); case TDMT_VND_TABLE_META: return vnodeGetTableMeta(pVnode, pMsg); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 17e5482b60..a4a46c6e63 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -2035,7 +2035,7 @@ static int32_t doSendFetchDataRequest(SExchangeInfo* pExchangeInfo, SExecTaskInf pMsgSendInfo->param = pWrapper; pMsgSendInfo->msgInfo.pData = pMsg; pMsgSendInfo->msgInfo.len = sizeof(SResFetchReq); - pMsgSendInfo->msgType = TDMT_VND_FETCH; + pMsgSendInfo->msgType = TDMT_SCH_FETCH; pMsgSendInfo->fp = loadRemoteDataCallback; int64_t transporterId = 0; diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 364ee0692f..c6c1f00395 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -549,7 +549,7 @@ int32_t udfdLoadUdf(char *udfName, SUdf *udf) { static bool udfdRpcRfp(int32_t code, tmsg_t msgType) { if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED || code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) { - if (msgType == TDMT_VND_QUERY || msgType == TDMT_VND_FETCH) { + if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_FETCH) { return false; } return true; diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 45240536e3..dc149f0224 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -5965,7 +5965,7 @@ static int32_t setQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_EXPLAIN_STMT: pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE; pQuery->haveResultSet = true; - pQuery->msgType = TDMT_VND_QUERY; + pQuery->msgType = TDMT_SCH_QUERY; break; case QUERY_NODE_DELETE_STMT: pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE; diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 46747af3a9..77df96f82d 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1555,7 +1555,7 @@ static int32_t createPhysiSubplan(SPhysiPlanContext* pCxt, SLogicSubplan* pLogic if (SUBPLAN_TYPE_MODIFY == pLogicSubplan->subplanType) { code = buildVnodeModifySubplan(pCxt, pLogicSubplan, pSubplan); } else { - pSubplan->msgType = TDMT_VND_QUERY; + pSubplan->msgType = TDMT_SCH_QUERY; code = createPhysiNode(pCxt, pLogicSubplan->pNode, pSubplan, &pSubplan->pNode); if (TSDB_CODE_SUCCESS == code && !pCxt->pPlanCxt->streamQuery && !pCxt->pPlanCxt->topicQuery) { code = createDataDispatcher(pCxt, pSubplan->pNode, &pSubplan->pDataSink); diff --git a/source/libs/qcom/src/queryUtil.c b/source/libs/qcom/src/queryUtil.c index 9ba149a33b..40c5807057 100644 --- a/source/libs/qcom/src/queryUtil.c +++ b/source/libs/qcom/src/queryUtil.c @@ -216,7 +216,7 @@ void destroyQueryExecRes(SQueryExecRes* pRes) { tFreeSSubmitRsp((SSubmitRsp*)pRes->res); break; } - case TDMT_VND_QUERY: { + case TDMT_SCH_QUERY: { taosArrayDestroy((SArray*)pRes->res); break; } diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c index 82a62b5c5a..8c1371fce9 100644 --- a/source/libs/qworker/src/qwMsg.c +++ b/source/libs/qworker/src/qwMsg.c @@ -169,7 +169,7 @@ int32_t qwBuildAndSendCQueryMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) { req->taskId = tId; SRpcMsg pNewMsg = { - .msgType = TDMT_VND_QUERY_CONTINUE, + .msgType = TDMT_SCH_QUERY_CONTINUE, .pCont = req, .contLen = sizeof(SQueryContinueReq), .code = 0, @@ -202,7 +202,7 @@ int32_t qwRegisterQueryBrokenLinkArg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) { req->refId = htobe64(rId); SRpcMsg brokenMsg = { - .msgType = TDMT_VND_DROP_TASK, + .msgType = TDMT_SCH_DROP_TASK, .pCont = req, .contLen = sizeof(STaskDropReq), .code = TSDB_CODE_RPC_NETWORK_UNAVAIL, @@ -236,7 +236,7 @@ int32_t qwRegisterHbBrokenLinkArg(SQWorker *mgmt, uint64_t sId, SRpcHandleInfo * } SRpcMsg brokenMsg = { - .msgType = TDMT_VND_QUERY_HEARTBEAT, + .msgType = TDMT_SCH_QUERY_HEARTBEAT, .pCont = msg, .contLen = msgSize, .code = TSDB_CODE_RPC_NETWORK_UNAVAIL, diff --git a/source/libs/qworker/test/qworkerTests.cpp b/source/libs/qworker/test/qworkerTests.cpp index 5bb6acee60..7c7d262167 100644 --- a/source/libs/qworker/test/qworkerTests.cpp +++ b/source/libs/qworker/test/qworkerTests.cpp @@ -122,7 +122,7 @@ void qwtBuildQueryReqMsg(SRpcMsg *queryRpc) { qwtqueryMsg.taskId = htobe64(1); qwtqueryMsg.phyLen = htonl(100); qwtqueryMsg.sqlLen = 0; - queryRpc->msgType = TDMT_VND_QUERY; + queryRpc->msgType = TDMT_SCH_QUERY; queryRpc->pCont = &qwtqueryMsg; queryRpc->contLen = sizeof(SSubQueryMsg) + 100; } @@ -131,7 +131,7 @@ void qwtBuildFetchReqMsg(SResFetchReq *fetchMsg, SRpcMsg *fetchRpc) { fetchMsg->sId = htobe64(1); fetchMsg->queryId = htobe64(atomic_load_64(&qwtTestQueryId)); fetchMsg->taskId = htobe64(1); - fetchRpc->msgType = TDMT_VND_FETCH; + fetchRpc->msgType = TDMT_SCH_FETCH; fetchRpc->pCont = fetchMsg; fetchRpc->contLen = sizeof(SResFetchReq); } @@ -140,7 +140,7 @@ void qwtBuildDropReqMsg(STaskDropReq *dropMsg, SRpcMsg *dropRpc) { dropMsg->sId = htobe64(1); dropMsg->queryId = htobe64(atomic_load_64(&qwtTestQueryId)); dropMsg->taskId = htobe64(1); - dropRpc->msgType = TDMT_VND_DROP_TASK; + dropRpc->msgType = TDMT_SCH_DROP_TASK; dropRpc->pCont = dropMsg; dropRpc->contLen = sizeof(STaskDropReq); } @@ -756,9 +756,9 @@ void *queryQueueThread(void *param) { } } - if (TDMT_VND_QUERY == queryRpc->msgType) { + if (TDMT_SCH_QUERY == queryRpc->msgType) { qWorkerProcessQueryMsg(mockPointer, mgmt, queryRpc, 0); - } else if (TDMT_VND_QUERY_CONTINUE == queryRpc->msgType) { + } else if (TDMT_SCH_QUERY_CONTINUE == queryRpc->msgType) { qWorkerProcessCQueryMsg(mockPointer, mgmt, queryRpc, 0); } else { printf("unknown msg in query queue, type:%d\n", queryRpc->msgType); @@ -813,13 +813,13 @@ void *fetchQueueThread(void *param) { } switch (fetchRpc->msgType) { - case TDMT_VND_FETCH: + case TDMT_SCH_FETCH: qWorkerProcessFetchMsg(mockPointer, mgmt, fetchRpc, 0); break; - case TDMT_VND_CANCEL_TASK: + case TDMT_SCH_CANCEL_TASK: qWorkerProcessCancelMsg(mockPointer, mgmt, fetchRpc, 0); break; - case TDMT_VND_DROP_TASK: + case TDMT_SCH_DROP_TASK: qWorkerProcessDropMsg(mockPointer, mgmt, fetchRpc, 0); break; default: diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 89f355d78c..54d0d2f2e5 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -1183,7 +1183,7 @@ int32_t schFetchFromRemote(SSchJob *pJob) { return TSDB_CODE_SUCCESS; } - SCH_ERR_JRET(schBuildAndSendMsg(pJob, pJob->fetchTask, &pJob->resNode, TDMT_VND_FETCH)); + SCH_ERR_JRET(schBuildAndSendMsg(pJob, pJob->fetchTask, &pJob->resNode, TDMT_SCH_FETCH)); return TSDB_CODE_SUCCESS; @@ -1222,7 +1222,7 @@ void schDropTaskOnExecNode(SSchJob *pJob, SSchTask *pTask) { while (nodeInfo) { SCH_SET_TASK_HANDLE(pTask, nodeInfo->handle); - schBuildAndSendMsg(pJob, pTask, &nodeInfo->addr, TDMT_VND_DROP_TASK); + schBuildAndSendMsg(pJob, pTask, &nodeInfo->addr, TDMT_SCH_DROP_TASK); nodeInfo = taosHashIterate(pTask->execNodes, nodeInfo); } @@ -1307,7 +1307,7 @@ int32_t schSaveJobQueryRes(SSchJob *pJob, SQueryTableRsp *rsp) { tbInfo.tversion = rsp->tversion; taosArrayPush((SArray *)pJob->execRes.res, &tbInfo); - pJob->execRes.msgType = TDMT_VND_QUERY; + pJob->execRes.msgType = TDMT_SCH_QUERY; } return TSDB_CODE_SUCCESS; diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index 0bd747785c..a1691a3dd3 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -568,22 +568,22 @@ int32_t schGetCallbackFp(int32_t msgType, __async_send_cb_fn_t *fp) { case TDMT_VND_SUBMIT: *fp = schHandleSubmitCallback; break; - case TDMT_VND_QUERY: + case TDMT_SCH_QUERY: *fp = schHandleQueryCallback; break; case TDMT_VND_DELETE: *fp = schHandleDeleteCallback; break; - case TDMT_VND_EXPLAIN: + case TDMT_SCH_EXPLAIN: *fp = schHandleExplainCallback; break; - case TDMT_VND_FETCH: + case TDMT_SCH_FETCH: *fp = schHandleFetchCallback; break; - case TDMT_VND_DROP_TASK: + case TDMT_SCH_DROP_TASK: *fp = schHandleDropCallback; break; - case TDMT_VND_QUERY_HEARTBEAT: + case TDMT_SCH_QUERY_HEARTBEAT: *fp = schHandleHbCallback; break; case TDMT_SCH_LINK_BROKEN: @@ -694,7 +694,7 @@ int32_t schMakeHbRpcCtx(SSchJob *pJob, SSchTask *pTask, SRpcCtx *pCtx) { int32_t msgType = TDMT_VND_QUERY_HEARTBEAT_RSP; __async_send_cb_fn_t fp = NULL; - SCH_ERR_JRET(schGetCallbackFp(TDMT_VND_QUERY_HEARTBEAT, &fp)); + SCH_ERR_JRET(schGetCallbackFp(TDMT_SCH_QUERY_HEARTBEAT, &fp)); param->nodeEpId = epId; param->pTrans = pJob->conn.pTrans; @@ -784,7 +784,7 @@ int32_t schMakeQueryRpcCtx(SSchJob *pJob, SSchTask *pTask, SRpcCtx *pCtx) { } SSchTrans trans = {.pTrans = pJob->conn.pTrans, .pHandle = SCH_GET_TASK_HANDLE(pTask)}; - SCH_ERR_JRET(schGenerateCallBackInfo(pJob, pTask, NULL, 0, TDMT_VND_EXPLAIN, &trans, false, &pExplainMsgSendInfo)); + SCH_ERR_JRET(schGenerateCallBackInfo(pJob, pTask, NULL, 0, TDMT_SCH_EXPLAIN, &trans, false, &pExplainMsgSendInfo)); int32_t msgType = TDMT_VND_EXPLAIN_RSP; SRpcCtxVal ctxVal = {.val = pExplainMsgSendInfo, .clone = schCloneSMsgSendInfo}; @@ -882,7 +882,7 @@ int32_t schAsyncSendMsg(SSchJob *pJob, SSchTask *pTask, SSchTrans *trans, SQuery SEpSet *epSet = &addr->epSet; SMsgSendInfo *pMsgSendInfo = NULL; - bool isHb = (TDMT_VND_QUERY_HEARTBEAT == msgType); + bool isHb = (TDMT_SCH_QUERY_HEARTBEAT == msgType); SCH_ERR_JRET(schGenerateCallBackInfo(pJob, pTask, msg, msgSize, msgType, trans, isHb, &pMsgSendInfo)); SCH_ERR_JRET(schUpdateSendTargetInfo(pMsgSendInfo, addr, pTask)); @@ -926,7 +926,7 @@ int32_t schBuildAndSendHbMsg(SQueryNodeEpId *nodeEpId, SArray* taskAction) { int32_t code = 0; SRpcCtx rpcCtx = {0}; SSchTrans trans = {0}; - int32_t msgType = TDMT_VND_QUERY_HEARTBEAT; + int32_t msgType = TDMT_SCH_QUERY_HEARTBEAT; req.header.vgId = nodeEpId->nodeId; req.sId = schMgmt.sId; @@ -1032,7 +1032,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, tSerializeSVDeleteReq(msg, msgSize, &req); break; } - case TDMT_VND_QUERY: { + case TDMT_SCH_QUERY: { SCH_ERR_RET(schMakeQueryRpcCtx(pJob, pTask, &rpcCtx)); uint32_t len = strlen(pJob->sql); @@ -1060,7 +1060,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, persistHandle = true; break; } - case TDMT_VND_FETCH: { + case TDMT_SCH_FETCH: { msgSize = sizeof(SResFetchReq); msg = taosMemoryCalloc(1, msgSize); if (NULL == msg) { @@ -1078,7 +1078,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, break; } - case TDMT_VND_DROP_TASK: { + case TDMT_SCH_DROP_TASK: { msgSize = sizeof(STaskDropReq); msg = taosMemoryCalloc(1, msgSize); if (NULL == msg) { @@ -1096,7 +1096,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, pMsg->refId = htobe64(pJob->refId); break; } - case TDMT_VND_QUERY_HEARTBEAT: { + case TDMT_SCH_QUERY_HEARTBEAT: { SCH_ERR_RET(schMakeHbRpcCtx(pJob, pTask, &rpcCtx)); SSchedulerHbReq req = {0}; @@ -1135,7 +1135,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, SCH_ERR_JRET(schAsyncSendMsg(pJob, pTask, &trans, addr, msgType, msg, msgSize, persistHandle, (rpcCtx.args ? &rpcCtx : NULL))); - if (msgType == TDMT_VND_QUERY) { + if (msgType == TDMT_SCH_QUERY) { SCH_ERR_RET(schAppendTaskExecNode(pJob, pTask, addr, pTask->execIdx)); } diff --git a/source/libs/scheduler/test/schedulerTests.cpp b/source/libs/scheduler/test/schedulerTests.cpp index e5cc3cd481..43822e4f5b 100644 --- a/source/libs/scheduler/test/schedulerTests.cpp +++ b/source/libs/scheduler/test/schedulerTests.cpp @@ -118,7 +118,7 @@ void schtBuildQueryDag(SQueryPlan *dag) { scanPlan->level = 1; scanPlan->pParents = nodesMakeList(); scanPlan->pNode = (SPhysiNode*)taosMemoryCalloc(1, sizeof(SPhysiNode)); - scanPlan->msgType = TDMT_VND_QUERY; + scanPlan->msgType = TDMT_SCH_QUERY; mergePlan->id.queryId = qId; mergePlan->id.groupId = schtMergeTemplateId; @@ -130,7 +130,7 @@ void schtBuildQueryDag(SQueryPlan *dag) { mergePlan->pChildren = nodesMakeList(); mergePlan->pParents = NULL; mergePlan->pNode = (SPhysiNode*)taosMemoryCalloc(1, sizeof(SPhysiNode)); - mergePlan->msgType = TDMT_VND_QUERY; + mergePlan->msgType = TDMT_SCH_QUERY; merge->pNodeList = nodesMakeList(); scan->pNodeList = nodesMakeList(); @@ -181,7 +181,7 @@ void schtBuildQueryFlowCtrlDag(SQueryPlan *dag) { scanPlan[i].level = 1; scanPlan[i].pParents = nodesMakeList(); scanPlan[i].pNode = (SPhysiNode*)taosMemoryCalloc(1, sizeof(SPhysiNode)); - scanPlan[i].msgType = TDMT_VND_QUERY; + scanPlan[i].msgType = TDMT_SCH_QUERY; nodesListAppend(scanPlan[i].pParents, (SNode*)mergePlan); nodesListAppend(mergePlan->pChildren, (SNode*)(scanPlan + i)); @@ -198,7 +198,7 @@ void schtBuildQueryFlowCtrlDag(SQueryPlan *dag) { mergePlan->pParents = NULL; mergePlan->pNode = (SPhysiNode*)taosMemoryCalloc(1, sizeof(SPhysiNode)); - mergePlan->msgType = TDMT_VND_QUERY; + mergePlan->msgType = TDMT_SCH_QUERY; nodesListAppend(merge->pNodeList, (SNode*)mergePlan); @@ -896,7 +896,7 @@ TEST(queryTest, flowCtrlCase) { taosHashCancelIterate(pJob->execTasks, pIter); - if (task->lastMsgType == TDMT_VND_QUERY) { + if (task->lastMsgType == TDMT_SCH_QUERY) { SQueryTableRsp rsp = {0}; code = schHandleResponseMsg(pJob, task, TDMT_VND_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); From 0c85bd1e989a8ef6e8f5a24c96552fc5cc4957e4 Mon Sep 17 00:00:00 2001 From: tomchon Date: Tue, 28 Jun 2022 21:41:32 +0800 Subject: [PATCH 02/51] test: modify testcase of 2 mnodes --- tests/system-test/6-cluster/5dnode2mnode.py | 134 ++++++-------------- 1 file changed, 38 insertions(+), 96 deletions(-) diff --git a/tests/system-test/6-cluster/5dnode2mnode.py b/tests/system-test/6-cluster/5dnode2mnode.py index e08e738be6..509e535f01 100644 --- a/tests/system-test/6-cluster/5dnode2mnode.py +++ b/tests/system-test/6-cluster/5dnode2mnode.py @@ -9,28 +9,22 @@ from util.sql import * from util.cases import * from util.dnodes import TDDnodes from util.dnodes import TDDnode +from util.cluster import * + import time import socket import subprocess +sys.path.append("./6-cluster") -class MyDnodes(TDDnodes): - def __init__(self ,dnodes_lists): - super(MyDnodes,self).__init__() - self.dnodes = dnodes_lists # dnode must be TDDnode instance - self.simDeployed = False - +from clusterCommonCreate import * +from clusterCommonCheck import * + class TDTestCase: - noConn = True - def init(self,conn ,logSql): tdLog.debug(f"start to excute {__file__}") - self.TDDnodes = None - self.depoly_cluster(5) - self.master_dnode = self.TDDnodes.dnodes[0] - self.host=self.master_dnode.cfgDict["fqdn"] - conn1 = taos.connect(self.master_dnode.cfgDict["fqdn"] , config=self.master_dnode.cfgDir) - tdSql.init(conn1.cursor()) - + tdSql.init(conn.cursor()) + self.host = socket.gethostname() + def getBuildPath(self): selfPath = os.path.dirname(os.path.realpath(__file__)) @@ -41,90 +35,12 @@ class TDTestCase: projPath = selfPath[:selfPath.find("tests")] for root, dirs, files in os.walk(projPath): - if ("taosd" in files or "taosd.exe" in files): + if ("taosd" in files): rootRealPath = os.path.dirname(os.path.realpath(root)) if ("packaging" not in rootRealPath): buildPath = root[:len(root) - len("/build/bin")] break return buildPath - - - def depoly_cluster(self ,dnodes_nums): - - testCluster = False - valgrind = 0 - hostname = socket.gethostname() - dnodes = [] - start_port = 6030 - start_port_sec = 6130 - - for num in range(1, dnodes_nums+1): - dnode = TDDnode(num) - dnode.addExtraCfg("firstEp", f"{hostname}:{start_port}") - dnode.addExtraCfg("fqdn", f"{hostname}") - dnode.addExtraCfg("serverPort", f"{start_port + (num-1)*100}") - dnode.addExtraCfg("monitorFqdn", hostname) - dnode.addExtraCfg("monitorPort", 7043) - dnode.addExtraCfg("secondEp", f"{hostname}:{start_port_sec}") - - dnodes.append(dnode) - - self.TDDnodes = MyDnodes(dnodes) - self.TDDnodes.init("") - self.TDDnodes.setTestCluster(testCluster) - self.TDDnodes.setValgrind(valgrind) - self.TDDnodes.stopAll() - for dnode in self.TDDnodes.dnodes: - self.TDDnodes.deploy(dnode.index,{}) - - for dnode in self.TDDnodes.dnodes: - self.TDDnodes.starttaosd(dnode.index) - - # create cluster - for dnode in self.TDDnodes.dnodes[1:]: - # print(dnode.cfgDict) - dnode_id = dnode.cfgDict["fqdn"] + ":" +dnode.cfgDict["serverPort"] - dnode_first_host = dnode.cfgDict["firstEp"].split(":")[0] - dnode_first_port = dnode.cfgDict["firstEp"].split(":")[-1] - cmd = f"{self.getBuildPath()}/build/bin/taos -h {dnode_first_host} -P {dnode_first_port} -s \"create dnode \\\"{dnode_id}\\\"\"" - print(cmd) - os.system(cmd) - - time.sleep(2) - tdLog.info(" create cluster done! ") - - def five_dnode_one_mnode(self): - tdSql.query("show dnodes;") - tdSql.checkData(0,1,'%s:6030'%self.host) - tdSql.checkData(4,1,'%s:6430'%self.host) - tdSql.checkData(0,4,'ready') - tdSql.checkData(4,4,'ready') - tdSql.query("show mnodes;") - tdSql.checkData(0,1,'%s:6030'%self.host) - tdSql.checkData(0,2,'leader') - tdSql.checkData(0,3,'ready') - - - tdSql.error("create mnode on dnode 1;") - tdSql.error("drop mnode on dnode 1;") - - tdSql.execute("drop database if exists db") - tdSql.execute("create database if not exists db replica 1 duration 300") - tdSql.execute("use db") - tdSql.execute( - '''create table stb1 - (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) - tags (t1 int) - ''' - ) - tdSql.execute( - ''' - create table t1 - (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) - ''' - ) - for i in range(4): - tdSql.execute(f'create table ct{i+1} using stb1 tags ( {i+1} )') def five_dnode_two_mnode(self): tdSql.query("show dnodes;") @@ -187,6 +103,34 @@ class TDTestCase: tdSql.error("create mnode on dnode 2") tdSql.query("show dnodes;") print(tdSql.queryResult) + clusterComCheck.checkDnodes(5) + # restart all taosd + tdDnodes=cluster.dnodes + + # stop follower + tdLog.info("stop follower") + tdDnodes[1].stoptaosd() + if cluster.checkConnectStatus(0) : + print("cluster also work") + + # start follower + tdLog.info("start follower") + tdDnodes[1].starttaosd() + if clusterComCheck.checkMnodeStatus(2) : + print("both mnodes are ready") + + # stop leader + tdLog.info("stop leader") + tdDnodes[0].stoptaosd() + try: + cluster.checkConnectStatus(2) + tdLog.exit(" The election still succeeds when leader of both mnodes are killed ") + except Exception: + pass + tdLog.info("start leader") + tdDnodes[0].starttaosd() + if clusterComCheck.checkMnodeStatus(2) : + print("both mnodes are ready") # # fisrt drop follower of mnode # BUG @@ -229,8 +173,6 @@ class TDTestCase: def run(self): - print(self.master_dnode.cfgDict) - self.five_dnode_one_mnode() self.five_dnode_two_mnode() From 5ddcb862758d86a9b44637145e3d5b7d3754365a Mon Sep 17 00:00:00 2001 From: tomchon Date: Tue, 28 Jun 2022 21:43:24 +0800 Subject: [PATCH 03/51] test:modify testcase of insertWithMoreVgroups.py --- tests/system-test/1-insert/insertWithMoreVgroup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/1-insert/insertWithMoreVgroup.py b/tests/system-test/1-insert/insertWithMoreVgroup.py index 1ebbc1fc57..aad334f72a 100644 --- a/tests/system-test/1-insert/insertWithMoreVgroup.py +++ b/tests/system-test/1-insert/insertWithMoreVgroup.py @@ -81,7 +81,7 @@ class TDTestCase: user = "root" password = "taosdata" port =6030 - con=taos.connect(host=host, user=user, password=password, config=cfg ,port=port,config="/home/chr/TDengine/sim/psim/cfg/") + con=taos.connect(host=host, user=user, password=password, config=cfg ,port=port) cur=con.cursor() print(cur) return cur From c5b3183261c5c2635e8d8ae20b4fb4e5f9347403 Mon Sep 17 00:00:00 2001 From: tomchon Date: Wed, 29 Jun 2022 10:05:05 +0800 Subject: [PATCH 04/51] test:modify ways to start 5dnode2mnode.py --- tests/system-test/fulltest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index b0b8aa7108..b76d73b54c 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -116,7 +116,7 @@ python3 ./test.py -f 2-query/function_null.py python3 ./test.py -f 2-query/queryQnode.py python3 ./test.py -f 6-cluster/5dnode1mnode.py -python3 ./test.py -f 6-cluster/5dnode2mnode.py +python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3 python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 # BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3 # BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3 From 6d8fd7e50607fc192b39c6407aa9596a1543c0c2 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 29 Jun 2022 10:51:22 +0800 Subject: [PATCH 05/51] feat: query redirect --- include/common/tmsgdef.h | 7 +- include/libs/qcom/query.h | 16 ++- source/client/src/clientEnv.c | 5 +- source/client/src/clientImpl.c | 5 +- source/dnode/mgmt/mgmt_mnode/src/mmHandle.c | 1 + source/dnode/mgmt/mgmt_qnode/src/qmHandle.c | 1 + source/dnode/mgmt/mgmt_vnode/src/vmHandle.c | 1 + source/dnode/mgmt/node_mgmt/src/dmTransport.c | 2 +- source/dnode/mnode/impl/src/mndMain.c | 6 +- source/dnode/mnode/impl/src/mndQuery.c | 6 +- source/dnode/qnode/src/qnode.c | 3 +- source/dnode/vnode/src/vnd/vnodeSvr.c | 3 +- source/libs/function/src/udfd.c | 2 +- source/libs/planner/src/planPhysiCreater.c | 6 +- source/libs/qcom/src/queryUtil.c | 3 +- source/libs/scheduler/inc/schedulerInt.h | 1 + source/libs/scheduler/src/schJob.c | 107 +++++++++++++++++- source/libs/scheduler/src/schRemote.c | 31 +++-- 18 files changed, 170 insertions(+), 36 deletions(-) diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index cbf0c4b2fe..df14b0b34e 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -201,12 +201,13 @@ enum { TD_NEW_MSG_SEG(TDMT_SCH_MSG) TD_DEF_MSG_TYPE(TDMT_SCH_QUERY, "query", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_MERGE_QUERY, "merge-query", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SCH_QUERY_CONTINUE, "query-continue", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SCH_QUERY_HEARTBEAT, "query-heartbeat", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SCH_FETCH, "fetch", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_SCH_CANCEL_TASK, "vnode-cancel-task", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_SCH_DROP_TASK, "vnode-drop-task", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_SCH_EXPLAIN, "vnode-explain", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_CANCEL_TASK, "cancel-task", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_DROP_TASK, "drop-task", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_EXPLAIN, "explain", NULL, NULL) TD_NEW_MSG_SEG(TDMT_STREAM_MSG) TD_DEF_MSG_TYPE(TDMT_STREAM_TASK_DEPLOY, "stream-task-deploy", SStreamTaskDeployReq, SStreamTaskDeployRsp) diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index 0b767e96f6..3681c2f071 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -138,6 +138,7 @@ typedef struct SDataBuf { void* pData; uint32_t len; void* handle; + SEpSet* pEpSet; } SDataBuf; typedef struct STargetInfo { @@ -234,13 +235,24 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t #define NEED_CLIENT_HANDLE_ERROR(_code) \ (NEED_CLIENT_RM_TBLMETA_ERROR(_code) || NEED_CLIENT_REFRESH_VG_ERROR(_code) || \ NEED_CLIENT_REFRESH_TBLMETA_ERROR(_code)) +#define NEED_REDIRECT_ERROR(_code) \ + ((_code) == TSDB_CODE_RPC_REDIRECT || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL || \ + (_code) == TSDB_CODE_NODE_NOT_DEPLOYED || (_code) == TSDB_CODE_SYN_NOT_LEADER || \ + (_code) == TSDB_CODE_APP_NOT_READY) + #define NEED_CLIENT_RM_TBLMETA_REQ(_type) \ ((_type) == TDMT_VND_CREATE_TABLE || (_type) == TDMT_VND_CREATE_STB || (_type) == TDMT_VND_DROP_TABLE || \ (_type) == TDMT_VND_DROP_STB) +#define NEED_SCHEDULER_REDIRECT_ERROR(_code) \ + ((_code) == TSDB_CODE_RPC_REDIRECT || (_code) == TSDB_CODE_NODE_NOT_DEPLOYED || \ + (_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_APP_NOT_READY) + #define NEED_SCHEDULER_RETRY_ERROR(_code) \ - ((_code) == TSDB_CODE_RPC_REDIRECT || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL || \ - (_code) == TSDB_CODE_SCH_TIMEOUT_ERROR) + (NEED_SCHEDULER_REDIRECT_ERROR(_code) || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL || (_code) == TSDB_CODE_SCH_TIMEOUT_ERROR) + + + #define REQUEST_TOTAL_EXEC_TIMES 2 diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index a36c7a0048..4cc79096d1 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -89,9 +89,8 @@ void closeTransporter(SAppInstInfo *pAppInfo) { } static bool clientRpcRfp(int32_t code, tmsg_t msgType) { - if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED || - code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) { - if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_FETCH) { + if (NEED_REDIRECT_ERROR(code)) { + if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH) { return false; } return true; diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 632b8441c4..68a225f64c 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -808,7 +808,8 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) { code = handleSubmitExecRes(pRequest, pRes->res, pCatalog, &epset); break; } - case TDMT_SCH_QUERY: { + case TDMT_SCH_QUERY: + case TDMT_SCH_MERGE_QUERY: { code = handleQueryExecRes(pRequest, pRes->res, pCatalog, &epset); break; } @@ -1306,7 +1307,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) { updateTargetEpSet(pSendInfo, pTscObj, pMsg, pEpSet); - SDataBuf buf = {.len = pMsg->contLen, .pData = NULL, .handle = pMsg->info.handle}; + SDataBuf buf = {.len = pMsg->contLen, .pData = NULL, .handle = pMsg->info.handle, .pEpSet = pEpSet}; if (pMsg->contLen > 0) { buf.pData = taosMemoryCalloc(1, pMsg->contLen); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index fbf3379490..59d68b2110 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -210,6 +210,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_MND_SERVER_VERSION, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_MERGE_QUERY, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_CONTINUE, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_HEARTBEAT, mmPutMsgToFetchQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_FETCH, mmPutMsgToFetchQueue, 1) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c b/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c index 1a7b5c1a1b..5911daaa2b 100644 --- a/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c +++ b/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c @@ -108,6 +108,7 @@ SArray *qmGetMsgHandles() { // Requests handled by VNODE if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY, qmPutNodeMsgToQueryQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_MERGE_QUERY, qmPutNodeMsgToQueryQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_CONTINUE, qmPutNodeMsgToQueryQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_FETCH, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_FETCH_RSP, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index 938e5f32b0..5bc9582527 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -325,6 +325,7 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_SUBMIT, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY, vmPutMsgToQueryQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_MERGE_QUERY, vmPutMsgToQueryQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_CONTINUE, vmPutMsgToQueryQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_FETCH, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_TABLE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index c1b5b86d4c..75e69e3716 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -251,7 +251,7 @@ static inline void dmReleaseHandle(SRpcHandleInfo *pHandle, int8_t type) { static bool rpcRfp(int32_t code, tmsg_t msgType) { if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED || code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) { - if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_FETCH) { + if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH) { return false; } return true; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index 0a9c5a82c8..0f353b20a3 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -527,9 +527,9 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { static int32_t mndCheckMnodeState(SRpcMsg *pMsg) { if (!IsReq(pMsg)) return 0; - if (pMsg->msgType == TDMT_SCH_QUERY || pMsg->msgType == TDMT_SCH_QUERY_CONTINUE || - pMsg->msgType == TDMT_SCH_QUERY_HEARTBEAT || pMsg->msgType == TDMT_SCH_FETCH || - pMsg->msgType == TDMT_SCH_DROP_TASK) { + if (pMsg->msgType == TDMT_SCH_QUERY || pMsg->msgType == TDMT_SCH_MERGE_QUERY || + pMsg->msgType == TDMT_SCH_QUERY_CONTINUE || pMsg->msgType == TDMT_SCH_QUERY_HEARTBEAT || + pMsg->msgType == TDMT_SCH_FETCH || pMsg->msgType == TDMT_SCH_DROP_TASK) { return 0; } if (mndAcquireRpcRef(pMsg->info.node) == 0) return 0; diff --git a/source/dnode/mnode/impl/src/mndQuery.c b/source/dnode/mnode/impl/src/mndQuery.c index b67a11997e..aec99fa3b7 100644 --- a/source/dnode/mnode/impl/src/mndQuery.c +++ b/source/dnode/mnode/impl/src/mndQuery.c @@ -19,13 +19,13 @@ #include "qworker.h" int32_t mndPreProcessQueryMsg(SRpcMsg *pMsg) { - if (TDMT_SCH_QUERY != pMsg->msgType) return 0; + if (TDMT_SCH_QUERY != pMsg->msgType && TDMT_SCH_MERGE_QUERY != pMsg->msgType) return 0; SMnode *pMnode = pMsg->info.node; return qWorkerPreprocessQueryMsg(pMnode->pQuery, pMsg); } void mndPostProcessQueryMsg(SRpcMsg *pMsg) { - if (TDMT_SCH_QUERY != pMsg->msgType) return; + if (TDMT_SCH_QUERY != pMsg->msgType && TDMT_SCH_MERGE_QUERY != pMsg->msgType) return; SMnode *pMnode = pMsg->info.node; qWorkerAbortPreprocessQueryMsg(pMnode->pQuery, pMsg); } @@ -38,6 +38,7 @@ int32_t mndProcessQueryMsg(SRpcMsg *pMsg) { mTrace("msg:%p, in query queue is processing", pMsg); switch (pMsg->msgType) { case TDMT_SCH_QUERY: + case TDMT_SCH_MERGE_QUERY: code = qWorkerProcessQueryMsg(&handle, pMnode->pQuery, pMsg, 0); break; case TDMT_SCH_QUERY_CONTINUE: @@ -68,6 +69,7 @@ int32_t mndInitQuery(SMnode *pMnode) { } mndSetMsgHandle(pMnode, TDMT_SCH_QUERY, mndProcessQueryMsg); + mndSetMsgHandle(pMnode, TDMT_SCH_MERGE_QUERY, mndProcessQueryMsg); mndSetMsgHandle(pMnode, TDMT_SCH_QUERY_CONTINUE, mndProcessQueryMsg); mndSetMsgHandle(pMnode, TDMT_SCH_FETCH, mndProcessQueryMsg); mndSetMsgHandle(pMnode, TDMT_SCH_DROP_TASK, mndProcessQueryMsg); diff --git a/source/dnode/qnode/src/qnode.c b/source/dnode/qnode/src/qnode.c index a0aa640ed6..5909d6f599 100644 --- a/source/dnode/qnode/src/qnode.c +++ b/source/dnode/qnode/src/qnode.c @@ -65,7 +65,7 @@ int32_t qndGetLoad(SQnode *pQnode, SQnodeLoad *pLoad) { } int32_t qndPreprocessQueryMsg(SQnode *pQnode, SRpcMsg * pMsg) { - if (TDMT_SCH_QUERY != pMsg->msgType) { + if (TDMT_SCH_QUERY != pMsg->msgType && TDMT_SCH_MERGE_QUERY != pMsg->msgType) { return 0; } @@ -79,6 +79,7 @@ int32_t qndProcessQueryMsg(SQnode *pQnode, int64_t ts, SRpcMsg *pMsg) { switch (pMsg->msgType) { case TDMT_SCH_QUERY: + case TDMT_SCH_MERGE_QUERY: code = qWorkerProcessQueryMsg(&handle, pQnode->pQuery, pMsg, ts); break; case TDMT_SCH_QUERY_CONTINUE: diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 63b7289661..64fa6c705d 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -216,7 +216,7 @@ _err: } int32_t vnodePreprocessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg) { - if (TDMT_SCH_QUERY != pMsg->msgType) { + if (TDMT_SCH_QUERY != pMsg->msgType && TDMT_SCH_MERGE_QUERY != pMsg->msgType) { return 0; } @@ -228,6 +228,7 @@ int32_t vnodeProcessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg) { SReadHandle handle = {.meta = pVnode->pMeta, .config = &pVnode->config, .vnode = pVnode, .pMsgCb = &pVnode->msgCb}; switch (pMsg->msgType) { case TDMT_SCH_QUERY: + case TDMT_SCH_MERGE_QUERY: return qWorkerProcessQueryMsg(&handle, pVnode->pQuery, pMsg, 0); case TDMT_SCH_QUERY_CONTINUE: return qWorkerProcessCQueryMsg(&handle, pVnode->pQuery, pMsg, 0); diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index c6c1f00395..4aad544e19 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -549,7 +549,7 @@ int32_t udfdLoadUdf(char *udfName, SUdf *udf) { static bool udfdRpcRfp(int32_t code, tmsg_t msgType) { if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED || code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) { - if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_FETCH) { + if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH) { return false; } return true; diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 77df96f82d..cbb12fee0e 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1555,7 +1555,11 @@ static int32_t createPhysiSubplan(SPhysiPlanContext* pCxt, SLogicSubplan* pLogic if (SUBPLAN_TYPE_MODIFY == pLogicSubplan->subplanType) { code = buildVnodeModifySubplan(pCxt, pLogicSubplan, pSubplan); } else { - pSubplan->msgType = TDMT_SCH_QUERY; + if (SUBPLAN_TYPE_SCAN == pSubplan->subplanType) { + pSubplan->msgType = TDMT_SCH_QUERY; + } else { + pSubplan->msgType = TDMT_SCH_MERGE_QUERY; + } code = createPhysiNode(pCxt, pLogicSubplan->pNode, pSubplan, &pSubplan->pNode); if (TSDB_CODE_SUCCESS == code && !pCxt->pPlanCxt->streamQuery && !pCxt->pPlanCxt->topicQuery) { code = createDataDispatcher(pCxt, pSubplan->pNode, &pSubplan->pDataSink); diff --git a/source/libs/qcom/src/queryUtil.c b/source/libs/qcom/src/queryUtil.c index 40c5807057..69d48b2179 100644 --- a/source/libs/qcom/src/queryUtil.c +++ b/source/libs/qcom/src/queryUtil.c @@ -216,7 +216,8 @@ void destroyQueryExecRes(SQueryExecRes* pRes) { tFreeSSubmitRsp((SSubmitRsp*)pRes->res); break; } - case TDMT_SCH_QUERY: { + case TDMT_SCH_QUERY: + case TDMT_SCH_MERGE_QUERY: { taosArrayDestroy((SArray*)pRes->res); break; } diff --git a/source/libs/scheduler/inc/schedulerInt.h b/source/libs/scheduler/inc/schedulerInt.h index a119795787..4e36bd3f10 100644 --- a/source/libs/scheduler/inc/schedulerInt.h +++ b/source/libs/scheduler/inc/schedulerInt.h @@ -383,6 +383,7 @@ char* schGetOpStr(SCH_OP_TYPE type); int32_t schBeginOperation(SSchJob *pJob, SCH_OP_TYPE type, bool sync); int32_t schInitJob(SSchedulerReq *pReq, SSchJob **pSchJob); int32_t schSetJobQueryRes(SSchJob* pJob, SQueryResult* pRes); +int32_t schUpdateTaskCandidateAddr(SSchTask *pTask, SEpSet* pEpSet); #ifdef __cplusplus diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 54d0d2f2e5..fd27193b0f 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -682,6 +682,25 @@ int32_t schSetTaskCandidateAddrs(SSchJob *pJob, SSchTask *pTask) { return TSDB_CODE_SUCCESS; } +int32_t schUpdateTaskCandidateAddr(SSchTask *pTask, SEpSet* pEpSet) { + if (NULL == pTask->candidateAddrs || 1 != taosArrayGetSize(pTask->candidateAddrs)) { + SCH_TASK_ELOG("not able to update cndidate addr, addr num %d", (pTask->candidateAddrs ? taosArrayGetSize(pTask->candidateAddrs): 0)); + SCH_ERR_RET(TSDB_CODE_APP_ERROR); + } + + SQueryNodeAddr* pAddr = taosArrayGet(pTask->candidateAddrs, 0); + + SEp* pOld = &pAddr->epSet.eps[pAddr->epSet.inUse]; + SEp* pNew = &pEpSet->eps[pEpSet->inUse]; + + SCH_TASK_DLOG("update task ep from %s:%d to %s:%d", pOld->fqdn, pOld->port, pNew->fqdn, pNew->port); + + memcpy(&pAddr->epSet, pEpSet, sizeof(pAddr->epSet)); + + return TSDB_CODE_SUCCESS; +} + + int32_t schRemoveTaskFromExecList(SSchJob *pJob, SSchTask *pTask) { int32_t code = taosHashRemove(pJob->execTasks, &pTask->taskId, sizeof(pTask->taskId)); if (code) { @@ -821,7 +840,6 @@ int32_t schTaskCheckSetRetry(SSchJob *pJob, SSchTask *pTask, int32_t errCode, bo return TSDB_CODE_SUCCESS; } - // TODO CHECK epList/condidateList if (SCH_IS_DATA_SRC_TASK(pTask)) { if ((pTask->execIdx + 1) >= SCH_TASK_NUM_OF_EPS(&pTask->plan->execNode)) { *needRetry = false; @@ -853,7 +871,6 @@ int32_t schHandleTaskRetry(SSchJob *pJob, SSchTask *pTask) { SCH_SET_TASK_STATUS(pTask, JOB_TASK_STATUS_NOT_START); if (SCH_TASK_NEED_FLOW_CTRL(pJob, pTask)) { - SCH_ERR_RET(schDecTaskFlowQuota(pJob, pTask)); SCH_ERR_RET(schLaunchTasksInFlowCtrlList(pJob, pTask)); } @@ -1237,7 +1254,8 @@ int32_t schRescheduleTask(SSchJob *pJob, SSchTask *pTask) { } SCH_LOCK_TASK(pTask); - if (JOB_TASK_STATUS_EXECUTING == pTask->status && pJob->fetchTask != pTask && taosArrayGetSize(pTask->candidateAddrs) > 1) { + if (SCH_TASK_TIMEOUT(pTask) && JOB_TASK_STATUS_EXECUTING == pTask->status && + pJob->fetchTask != pTask && taosArrayGetSize(pTask->candidateAddrs) > 1) { SCH_TASK_DLOG("task execIdx %d will be rescheduled now", pTask->execIdx); schDropTaskOnExecNode(pJob, pTask); taosHashClear(pTask->execNodes); @@ -1281,7 +1299,7 @@ int32_t schProcessOnTaskStatusRsp(SQueryNodeEpId* pEpId, SArray* pStatusList) { continue; } - if (taskStatus->status == JOB_TASK_STATUS_NOT_START && SCH_TASK_TIMEOUT(pTask)) { + if (taskStatus->status == JOB_TASK_STATUS_NOT_START) { schRescheduleTask(pJob, pTask); } @@ -1657,5 +1675,86 @@ _return: SCH_RET(code); } +int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, int32_t rspCode) { + int32_t code = 0; + + if ((pTask->execIdx + 1) >= pTask->maxExecTimes) { + SCH_TASK_DLOG("task no more retry since reach max try times, execIdx:%d", pTask->execIdx); + SCH_UNLOCK_TASK(pTask); + schProcessOnJobFailure(pJob, rspCode); + return TSDB_CODE_SUCCESS; + } + + SCH_TASK_DLOG("task will be redirected now, status:%d", SCH_GET_TASK_STATUS_STR(pTask)); + + schDropTaskOnExecNode(pJob, pTask); + taosHashClear(pTask->execNodes); + SCH_ERR_JRET(schRemoveTaskFromExecList(pJob, pTask)); + schDeregisterTaskHb(pJob, pTask); + atomic_sub_fetch_32(&pTask->level->taskLaunchedNum, 1); + taosMemoryFreeClear(pTask->msg); + pTask->msgLen = 0; + pTask->lastMsgType = 0; + memset(&pTask->succeedAddr, 0, sizeof(pTask->succeedAddr)); + + if (SCH_IS_DATA_SRC_QRY_TASK(pTask)) { + if (SCH_TASK_NEED_FLOW_CTRL(pJob, pTask)) { + if (JOB_TASK_STATUS_EXECUTING == SCH_GET_TASK_STATUS(pTask)) { + SCH_ERR_JRET(schLaunchTasksInFlowCtrlList(pJob, pTask)); + } + } + } else { + pTask->childReady = 0; + + int32_t childrenNum = taosArrayGetSize(pTask->children); + for (int32_t i = 0; i < childrenNum; ++i) { + SSchTask* pChild = taosArrayGetP(pTask->children, i); + SCH_LOCK_TASK(pChild); + code = schDoTaskRedirect(pJob, pChild, rspCode); + SCH_UNLOCK_TASK(pChild); + SCH_ERR_JRET(code); + } + + qClearSubplanExecutionNode(pTask->plan); + } + + SCH_SET_TASK_STATUS(pTask, JOB_TASK_STATUS_NOT_START); + + SCH_ERR_JRET(schLaunchTask(pJob, pTask)); + + SCH_UNLOCK_TASK(pTask); + + return TSDB_CODE_SUCCESS; + +_return: + + code = schProcessOnTaskFailure(pJob, pTask, code); + + SCH_UNLOCK_TASK(pTask); + + SCH_RET(code); +} + +int32_t schHandleRedirect(SSchJob *pJob, SSchTask *pTask, int32_t msgType, SDataBuf* pData, int32_t rspCode) { + int32_t code = 0; + + if (SCH_IS_DATA_SRC_QRY_TASK(pTask)) { + if (NULL == pData->pEpSet) { + SCH_TASK_ELOG("no epset updated while got error %s", tstrerror(rspCode)); + SCH_ERR_JRET(rspCode); + } + + SCH_ERR_JRET(schUpdateTaskCandidateAddr(pTask, pData->pEpSet)); + } + + schDoTaskRedirect(pJob, pTask, rspCode); + +_return: + + schProcessOnTaskFailure(pJob, pTask, code); + + SCH_RET(code); +} + diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index a1691a3dd3..76d2061936 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -90,15 +90,6 @@ int32_t schValidateReceivedMsgType(SSchJob *pJob, SSchTask *pTask, int32_t msgTy int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, char *msg, int32_t msgSize, int32_t rspCode) { int32_t code = 0; - int8_t status = 0; - - if (schJobNeedToStop(pJob, &status)) { - SCH_TASK_ELOG("rsp not processed cause of job status, job status:%s, rspCode:0x%x", jobTaskStatusStr(status), rspCode); - taosMemoryFreeClear(msg); - SCH_RET(atomic_load_32(&pJob->errCode)); - } - - SCH_ERR_JRET(schValidateReceivedMsgType(pJob, pTask, msgType)); switch (msgType) { case TDMT_VND_CREATE_TABLE_RSP: { @@ -392,8 +383,23 @@ int32_t schHandleCallback(void *param, const SDataBuf *pMsg, int32_t msgType, in bool dropExecNode = (msgType == TDMT_SCH_LINK_BROKEN || rspCode == TSDB_CODE_RPC_NETWORK_UNAVAIL); SCH_ERR_JRET(schUpdateTaskHandle(pJob, pTask, dropExecNode, pMsg->handle, pParam->execIdx)); + + int8_t status = 0; + if (schJobNeedToStop(pJob, &status)) { + SCH_TASK_ELOG("rsp will not be processed cause of job status %s, rspCode:0x%x", jobTaskStatusStr(status), rspCode); + code = atomic_load_32(&pJob->errCode); + goto _return; + } + + SCH_ERR_JRET(schValidateReceivedMsgType(pJob, pTask, msgType)); + + if (NEED_SCHEDULER_REDIRECT_ERROR(rspCode) || ((rspCode == TSDB_CODE_RPC_NETWORK_UNAVAIL) && msgSize > 0)) { + code = schHandleRedirect(pJob, pTask, msgType, pMsg, rspCode); + goto _return; + } SCH_ERR_JRET(schHandleResponseMsg(pJob, pTask, msgType, pMsg->pData, pMsg->len, rspCode)); + pMsg->pData = NULL; _return: @@ -405,6 +411,7 @@ _return: schReleaseJob(pParam->refId); } + taosMemoryFreeClear(pMsg->pData); taosMemoryFreeClear(param); SCH_RET(code); } @@ -569,6 +576,7 @@ int32_t schGetCallbackFp(int32_t msgType, __async_send_cb_fn_t *fp) { *fp = schHandleSubmitCallback; break; case TDMT_SCH_QUERY: + case TDMT_SCH_MERGE_QUERY: *fp = schHandleQueryCallback; break; case TDMT_VND_DELETE: @@ -1032,7 +1040,8 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, tSerializeSVDeleteReq(msg, msgSize, &req); break; } - case TDMT_SCH_QUERY: { + case TDMT_SCH_QUERY: + case TDMT_SCH_MERGE_QUERY: { SCH_ERR_RET(schMakeQueryRpcCtx(pJob, pTask, &rpcCtx)); uint32_t len = strlen(pJob->sql); @@ -1135,7 +1144,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, SCH_ERR_JRET(schAsyncSendMsg(pJob, pTask, &trans, addr, msgType, msg, msgSize, persistHandle, (rpcCtx.args ? &rpcCtx : NULL))); - if (msgType == TDMT_SCH_QUERY) { + if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY) { SCH_ERR_RET(schAppendTaskExecNode(pJob, pTask, addr, pTask->execIdx)); } From 5df4cd9054eeb3e17e383696ca0500ca1d69be88 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 29 Jun 2022 11:27:01 +0800 Subject: [PATCH 06/51] feat: query redirect --- include/libs/planner/planner.h | 2 +- source/libs/planner/src/planner.c | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/libs/planner/planner.h b/include/libs/planner/planner.h index 727cdd8ad6..2ab703df95 100644 --- a/include/libs/planner/planner.h +++ b/include/libs/planner/planner.h @@ -48,7 +48,7 @@ int32_t qCreateQueryPlan(SPlanContext* pCxt, SQueryPlan** pPlan, SArray* pExecNo // @pSource one execution location of this group of datasource subplans int32_t qSetSubplanExecutionNode(SSubplan* pSubplan, int32_t groupId, SDownstreamSourceNode* pSource); -int32_t qClearSubplanExecutionNode(SSubplan* pSubplan, int32_t groupId); +int32_t qClearSubplanExecutionNode(SSubplan* pSubplan); // Convert to subplan to string for the scheduler to send to the executor int32_t qSubPlanToString(const SSubplan* pSubplan, char** pStr, int32_t* pLen); diff --git a/source/libs/planner/src/planner.c b/source/libs/planner/src/planner.c index 1b9d16311c..b1268358fb 100644 --- a/source/libs/planner/src/planner.c +++ b/source/libs/planner/src/planner.c @@ -85,11 +85,24 @@ int32_t qSetSubplanExecutionNode(SSubplan* subplan, int32_t groupId, SDownstream return setSubplanExecutionNode(subplan->pNode, groupId, pSource); } -int32_t qClearSubplanExecutionNode(SSubplan* pSubplan, int32_t groupId) { - // todo - return TSDB_CODE_FAILED; +static void clearSubplanExecutionNode(SPhysiNode* pNode) { + if (QUERY_NODE_PHYSICAL_PLAN_EXCHANGE == nodeType(pNode)) { + SExchangePhysiNode* pExchange = (SExchangePhysiNode*)pNode; + NODES_DESTORY_LIST(pExchange->pSrcEndPoints); + } else if (QUERY_NODE_PHYSICAL_PLAN_MERGE == nodeType(pNode)) { + SMergePhysiNode* pMerge = (SMergePhysiNode*)pNode; + pMerge->numOfChannels = LIST_LENGTH(pMerge->node.pChildren); + SNode* pChild = NULL; + FOREACH(pChild, pMerge->node.pChildren) { NODES_DESTORY_LIST(((SExchangePhysiNode*)pChild)->pSrcEndPoints); } + } + + SNode* pChild = NULL; + FOREACH(pChild, pNode->pChildren) { clearSubplanExecutionNode((SPhysiNode*)pChild); } } +void qClearSubplanExecutionNode(SSubplan* pSubplan) { clearSubplanExecutionNode(pSubplan->pNode); } + + int32_t qSubPlanToString(const SSubplan* pSubplan, char** pStr, int32_t* pLen) { if (SUBPLAN_TYPE_MODIFY == pSubplan->subplanType && NULL == pSubplan->pNode) { SDataInserterNode* insert = (SDataInserterNode*)pSubplan->pDataSink; From c6440a7a3c08496f555cc81a7ba9c1570ece8dc2 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 29 Jun 2022 11:33:37 +0800 Subject: [PATCH 07/51] feat: query redirect --- include/common/tmsgdef.h | 4 +--- source/libs/transport/src/transSvr.c | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index df14b0b34e..008bdcc294 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -208,6 +208,7 @@ enum { TD_DEF_MSG_TYPE(TDMT_SCH_CANCEL_TASK, "cancel-task", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SCH_DROP_TASK, "drop-task", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SCH_EXPLAIN, "explain", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SCH_LINK_BROKEN, "link-broken", NULL, NULL) TD_NEW_MSG_SEG(TDMT_STREAM_MSG) TD_DEF_MSG_TYPE(TDMT_STREAM_TASK_DEPLOY, "stream-task-deploy", SStreamTaskDeployReq, SStreamTaskDeployRsp) @@ -217,9 +218,6 @@ enum { TD_DEF_MSG_TYPE(TDMT_STREAM_TASK_RECOVER, "stream-task-recover", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_STREAM_RETRIEVE, "stream-retrieve", NULL, NULL) - TD_NEW_MSG_SEG(TDMT_SCH_MSG) - TD_DEF_MSG_TYPE(TDMT_SCH_LINK_BROKEN, "link-broken", NULL, NULL) - TD_NEW_MSG_SEG(TDMT_MON_MSG) TD_DEF_MSG_TYPE(TDMT_MON_MM_INFO, "monitor-minfo", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MON_VM_INFO, "monitor-vinfo", NULL, NULL) diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index 9809f3d564..f53507c8aa 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -1042,7 +1042,7 @@ void transReleaseSrvHandle(void* handle) { m->type = Release; tTrace("%s conn %p start to release", transLabel(pThrd->pTransInst), exh->handle); - transSendAsync(pThrd->asyncPool, &m->q); + transAsyncSend(pThrd->asyncPool, &m->q); transReleaseExHandle(refId); return; _return1: @@ -1071,7 +1071,7 @@ void transSendResponse(const STransMsg* msg) { STraceId* trace = (STraceId*)&msg->info.traceId; tGTrace("conn %p start to send resp (1/2)", exh->handle); - transSendAsync(pThrd->asyncPool, &m->q); + transAsyncSend(pThrd->asyncPool, &m->q); transReleaseExHandle(refId); return; _return1: @@ -1100,7 +1100,7 @@ void transRegisterMsg(const STransMsg* msg) { m->type = Register; tTrace("%s conn %p start to register brokenlink callback", transLabel(pThrd->pTransInst), exh->handle); - transSendAsync(pThrd->asyncPool, &m->q); + transAsyncSend(pThrd->asyncPool, &m->q); transReleaseExHandle(refId); return; From 3501475f602d3c54acdb2f3b5217c8d7d51df315 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 29 Jun 2022 16:11:41 +0800 Subject: [PATCH 08/51] enh: add new code --- include/util/taoserror.h | 1 + source/util/src/terror.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 08e09dca2f..db6f1c0e1e 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -86,6 +86,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_RPC_NETWORK_UNAVAIL TAOS_DEF_ERROR_CODE(0, 0x0102) #define TSDB_CODE_RPC_FQDN_ERROR TAOS_DEF_ERROR_CODE(0, 0x0103) #define TSDB_CODE_RPC_PORT_EADDRINUSE TAOS_DEF_ERROR_CODE(0, 0x0104) +#define TSDB_CODE_RPC_BROKEN_LINK TAOS_DEF_ERROR_CODE(0, 0x0105) //client #define TSDB_CODE_TSC_INVALID_OPERATION TAOS_DEF_ERROR_CODE(0, 0x0200) diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 96f0fb21ca..3ab307dc3f 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -89,8 +89,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_REF_NOT_EXIST, "Ref is not there") TAOS_DEFINE_ERROR(TSDB_CODE_RPC_REDIRECT, "Redirect") TAOS_DEFINE_ERROR(TSDB_CODE_RPC_AUTH_FAILURE, "Authentication failure") TAOS_DEFINE_ERROR(TSDB_CODE_RPC_NETWORK_UNAVAIL, "Unable to establish connection") -TAOS_DEFINE_ERROR(TSDB_CODE_RPC_FQDN_ERROR, "Unable to resolve FQDN") TAOS_DEFINE_ERROR(TSDB_CODE_RPC_PORT_EADDRINUSE, "Port already in use") +TAOS_DEFINE_ERROR(TSDB_CODE_RPC_BROKEN_LINK, "Conn is broken") //client TAOS_DEFINE_ERROR(TSDB_CODE_TSC_INVALID_OPERATION, "Invalid operation") From 86e379f081a59925c3798851d32d0940b3ed73f2 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 29 Jun 2022 17:11:30 +0800 Subject: [PATCH 09/51] feat: add retry --- source/libs/transport/src/transCli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 587e2bad98..e21237ec10 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -399,7 +399,7 @@ void cliHandleExcept(SCliConn* pConn) { STransConnCtx* pCtx = pMsg ? pMsg->ctx : NULL; STransMsg transMsg = {0}; - transMsg.code = TSDB_CODE_RPC_NETWORK_UNAVAIL; + transMsg.code = TSDB_CODE_RPC_BROKEN_LINK; transMsg.msgType = pMsg ? pMsg->msg.msgType + 1 : 0; transMsg.info.ahandle = NULL; From 914e06e8cb44d1f9139d6eb488571e6736f4e50b Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 29 Jun 2022 17:15:08 +0800 Subject: [PATCH 10/51] feat: query redirect --- include/libs/planner/planner.h | 2 +- include/libs/qcom/query.h | 3 +- source/client/src/clientHb.c | 2 +- source/client/src/clientImpl.c | 2 +- source/client/src/clientMsgHandler.c | 16 ++-- source/client/src/tmq.c | 8 +- source/dnode/mgmt/mgmt_qnode/src/qmHandle.c | 2 +- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 2 +- source/dnode/qnode/src/qnode.c | 2 +- source/dnode/vnode/src/vnd/vnodeSvr.c | 2 +- source/libs/catalog/src/ctgRemote.c | 2 +- source/libs/executor/src/executorimpl.c | 2 +- source/libs/executor/src/scanoperator.c | 2 +- source/libs/qworker/inc/qwInt.h | 3 + source/libs/qworker/inc/qwMsg.h | 2 +- source/libs/qworker/src/qwMsg.c | 18 ++-- source/libs/qworker/src/qworker.c | 17 ++-- source/libs/qworker/test/qworkerTests.cpp | 7 +- source/libs/scheduler/inc/schedulerInt.h | 5 +- source/libs/scheduler/src/schJob.c | 10 +-- source/libs/scheduler/src/schRemote.c | 85 +++++-------------- source/libs/scheduler/test/schedulerTests.cpp | 18 ++-- source/libs/transport/src/transSvr.c | 2 + 23 files changed, 87 insertions(+), 127 deletions(-) diff --git a/include/libs/planner/planner.h b/include/libs/planner/planner.h index 2ab703df95..b4c75da131 100644 --- a/include/libs/planner/planner.h +++ b/include/libs/planner/planner.h @@ -48,7 +48,7 @@ int32_t qCreateQueryPlan(SPlanContext* pCxt, SQueryPlan** pPlan, SArray* pExecNo // @pSource one execution location of this group of datasource subplans int32_t qSetSubplanExecutionNode(SSubplan* pSubplan, int32_t groupId, SDownstreamSourceNode* pSource); -int32_t qClearSubplanExecutionNode(SSubplan* pSubplan); +void qClearSubplanExecutionNode(SSubplan* pSubplan); // Convert to subplan to string for the scheduler to send to the executor int32_t qSubPlanToString(const SSubplan* pSubplan, char** pStr, int32_t* pLen); diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index 5767926e5e..92131e354a 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -135,6 +135,7 @@ typedef struct STableMetaOutput { } STableMetaOutput; typedef struct SDataBuf { + int32_t msgType; void* pData; uint32_t len; void* handle; @@ -147,7 +148,7 @@ typedef struct STargetInfo { int32_t vgId; } STargetInfo; -typedef int32_t (*__async_send_cb_fn_t)(void* param, const SDataBuf* pMsg, int32_t code); +typedef int32_t (*__async_send_cb_fn_t)(void* param, SDataBuf* pMsg, int32_t code); typedef int32_t (*__async_exec_fn_t)(void* param); typedef struct SRequestConnInfo { diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index 2de630e181..48fa2d7938 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -262,7 +262,7 @@ static int32_t hbQueryHbRspHandle(SAppHbMgr *pAppHbMgr, SClientHbRsp *pRsp) { return TSDB_CODE_SUCCESS; } -static int32_t hbAsyncCallBack(void *param, const SDataBuf *pMsg, int32_t code) { +static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) { static int32_t emptyRspNum = 0; if (code != 0) { taosMemoryFreeClear(param); diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 68a225f64c..b20fd4b9b0 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -1307,7 +1307,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) { updateTargetEpSet(pSendInfo, pTscObj, pMsg, pEpSet); - SDataBuf buf = {.len = pMsg->contLen, .pData = NULL, .handle = pMsg->info.handle, .pEpSet = pEpSet}; + SDataBuf buf = {.msgType = pMsg->msgType, .len = pMsg->contLen, .pData = NULL, .handle = pMsg->info.handle, .pEpSet = pEpSet}; if (pMsg->contLen > 0) { buf.pData = taosMemoryCalloc(1, pMsg->contLen); diff --git a/source/client/src/clientMsgHandler.c b/source/client/src/clientMsgHandler.c index 5c30df4ae2..ce866d2c20 100644 --- a/source/client/src/clientMsgHandler.c +++ b/source/client/src/clientMsgHandler.c @@ -26,7 +26,7 @@ static void setErrno(SRequestObj* pRequest, int32_t code) { terrno = code; } -int32_t genericRspCallback(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t genericRspCallback(void* param, SDataBuf* pMsg, int32_t code) { SRequestObj* pRequest = param; setErrno(pRequest, code); @@ -39,7 +39,7 @@ int32_t genericRspCallback(void* param, const SDataBuf* pMsg, int32_t code) { return code; } -int32_t processConnectRsp(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { SRequestObj* pRequest = param; if (code != TSDB_CODE_SUCCESS) { taosMemoryFree(pMsg->pData); @@ -116,7 +116,7 @@ SMsgSendInfo* buildMsgInfoImpl(SRequestObj* pRequest) { return pMsgSendInfo; } -int32_t processCreateDbRsp(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t processCreateDbRsp(void* param, SDataBuf* pMsg, int32_t code) { // todo rsp with the vnode id list SRequestObj* pRequest = param; taosMemoryFree(pMsg->pData); @@ -132,7 +132,7 @@ int32_t processCreateDbRsp(void* param, const SDataBuf* pMsg, int32_t code) { return code; } -int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) { SRequestObj* pRequest = param; if (TSDB_CODE_MND_DB_NOT_EXIST == code) { @@ -211,7 +211,7 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) { return 0; } -int32_t processCreateSTableRsp(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t processCreateSTableRsp(void* param, SDataBuf* pMsg, int32_t code) { assert(pMsg != NULL && param != NULL); SRequestObj* pRequest = param; @@ -229,7 +229,7 @@ int32_t processCreateSTableRsp(void* param, const SDataBuf* pMsg, int32_t code) return code; } -int32_t processDropDbRsp(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t processDropDbRsp(void* param, SDataBuf* pMsg, int32_t code) { SRequestObj* pRequest = param; if (code != TSDB_CODE_SUCCESS) { setErrno(pRequest, code); @@ -250,7 +250,7 @@ int32_t processDropDbRsp(void* param, const SDataBuf* pMsg, int32_t code) { return code; } -int32_t processAlterStbRsp(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t processAlterStbRsp(void* param, SDataBuf* pMsg, int32_t code) { SRequestObj* pRequest = param; if (code != TSDB_CODE_SUCCESS) { setErrno(pRequest, code); @@ -357,7 +357,7 @@ static int32_t buildShowVariablesRsp(SArray* pVars, SRetrieveTableRsp** pRsp) { return TSDB_CODE_SUCCESS; } -int32_t processShowVariablesRsp(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t processShowVariablesRsp(void* param, SDataBuf* pMsg, int32_t code) { SRequestObj* pRequest = param; if (code != TSDB_CODE_SUCCESS) { setErrno(pRequest, code); diff --git a/source/client/src/tmq.c b/source/client/src/tmq.c index 637a7ee5dd..165deaa6c5 100644 --- a/source/client/src/tmq.c +++ b/source/client/src/tmq.c @@ -372,7 +372,7 @@ int32_t tmqCommitCb(void* param, const SDataBuf* pMsg, int32_t code) { return 0; } -int32_t tmqCommitCb2(void* param, const SDataBuf* pBuf, int32_t code) { +int32_t tmqCommitCb2(void* param, SDataBuf* pBuf, int32_t code) { SMqCommitCbParam2* pParam = (SMqCommitCbParam2*)param; SMqCommitCbParamSet* pParamSet = (SMqCommitCbParamSet*)pParam->params; // push into array @@ -862,7 +862,7 @@ void tmqClearUnhandleMsg(tmq_t* tmq) { } } -int32_t tmqSubscribeCb(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t tmqSubscribeCb(void* param, SDataBuf* pMsg, int32_t code) { SMqSubscribeCbParam* pParam = (SMqSubscribeCbParam*)param; pParam->rspErr = code; /*tmq_t* tmq = pParam->tmq;*/ @@ -1116,7 +1116,7 @@ int32_t tmqGetSkipLogNum(tmq_message_t* tmq_message) { } #endif -int32_t tmqPollCb(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) { SMqPollCbParam* pParam = (SMqPollCbParam*)param; SMqClientVg* pVg = pParam->pVg; SMqClientTopic* pTopic = pParam->pTopic; @@ -1368,7 +1368,7 @@ bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, SMqAskEpRsp* pRsp) { } #endif -int32_t tmqAskEpCb(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t tmqAskEpCb(void* param, SDataBuf* pMsg, int32_t code) { SMqAskEpCbParam* pParam = (SMqAskEpCbParam*)param; tmq_t* tmq = pParam->tmq; int8_t async = pParam->async; diff --git a/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c b/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c index 5911daaa2b..1f22eefddf 100644 --- a/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c +++ b/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c @@ -111,7 +111,7 @@ SArray *qmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SCH_MERGE_QUERY, qmPutNodeMsgToQueryQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_CONTINUE, qmPutNodeMsgToQueryQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_FETCH, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_FETCH_RSP, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SCH_FETCH_RSP, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_HEARTBEAT, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_CANCEL_TASK, qmPutNodeMsgToFetchQueue, 1) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 75e69e3716..4e581fd28e 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -86,7 +86,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { return; case TDMT_MND_SYSTABLE_RETRIEVE_RSP: case TDMT_DND_SYSTABLE_RETRIEVE_RSP: - case TDMT_VND_FETCH_RSP: + case TDMT_SCH_FETCH_RSP: qWorkerProcessFetchRsp(NULL, NULL, pRpc, 0); return; case TDMT_MND_STATUS_RSP: diff --git a/source/dnode/qnode/src/qnode.c b/source/dnode/qnode/src/qnode.c index 5909d6f599..cfc63b083d 100644 --- a/source/dnode/qnode/src/qnode.c +++ b/source/dnode/qnode/src/qnode.c @@ -88,7 +88,7 @@ int32_t qndProcessQueryMsg(SQnode *pQnode, int64_t ts, SRpcMsg *pMsg) { case TDMT_SCH_FETCH: code = qWorkerProcessFetchMsg(pQnode, pQnode->pQuery, pMsg, ts); break; - case TDMT_VND_FETCH_RSP: + case TDMT_SCH_FETCH_RSP: code = qWorkerProcessFetchRsp(pQnode, pQnode->pQuery, pMsg, ts); break; case TDMT_SCH_CANCEL_TASK: diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 64fa6c705d..d0a1b5417f 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -246,7 +246,7 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) { switch (pMsg->msgType) { case TDMT_SCH_FETCH: return qWorkerProcessFetchMsg(pVnode, pVnode->pQuery, pMsg, 0); - case TDMT_VND_FETCH_RSP: + case TDMT_SCH_FETCH_RSP: return qWorkerProcessFetchRsp(pVnode, pVnode->pQuery, pMsg, 0); case TDMT_SCH_CANCEL_TASK: return qWorkerProcessCancelMsg(pVnode, pVnode->pQuery, pMsg, 0); diff --git a/source/libs/catalog/src/ctgRemote.c b/source/libs/catalog/src/ctgRemote.c index 304da88888..59ad009527 100644 --- a/source/libs/catalog/src/ctgRemote.c +++ b/source/libs/catalog/src/ctgRemote.c @@ -241,7 +241,7 @@ int32_t ctgProcessRspMsg(void* out, int32_t reqType, char* msg, int32_t msgSize, } -int32_t ctgHandleMsgCallback(void *param, const SDataBuf *pMsg, int32_t rspCode) { +int32_t ctgHandleMsgCallback(void *param, SDataBuf *pMsg, int32_t rspCode) { SCtgTaskCallbackParam* cbParam = (SCtgTaskCallbackParam*)param; int32_t code = 0; diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 9b38f46ca6..c6f1096bfe 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1933,7 +1933,7 @@ typedef struct SFetchRspHandleWrapper { int32_t sourceIndex; } SFetchRspHandleWrapper; -int32_t loadRemoteDataCallback(void* param, const SDataBuf* pMsg, int32_t code) { +int32_t loadRemoteDataCallback(void* param, SDataBuf* pMsg, int32_t code) { SFetchRspHandleWrapper* pWrapper = (SFetchRspHandleWrapper*)param; SExchangeInfo* pExchangeInfo = taosAcquireRef(exchangeObjRefPool, pWrapper->exchangeId); diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index c51ef44154..146b6ca76b 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1322,7 +1322,7 @@ static void getDBNameFromCondition(SNode* pCondition, const char* dbName) { nodesWalkExpr(pCondition, getDBNameFromConditionWalker, (char*)dbName); } -static int32_t loadSysTableCallback(void* param, const SDataBuf* pMsg, int32_t code) { +static int32_t loadSysTableCallback(void* param, SDataBuf* pMsg, int32_t code) { SOperatorInfo* operator=(SOperatorInfo*) param; SSysTableScanInfo* pScanResInfo = (SSysTableScanInfo*)operator->info; if (TSDB_CODE_SUCCESS == code) { diff --git a/source/libs/qworker/inc/qwInt.h b/source/libs/qworker/inc/qwInt.h index 2368b13dd6..4edd7a8a6e 100644 --- a/source/libs/qworker/inc/qwInt.h +++ b/source/libs/qworker/inc/qwInt.h @@ -82,6 +82,7 @@ extern SQWDebug gQWDebug; typedef struct SQWMsg { void *node; int32_t code; + int32_t msgType; char *msg; int32_t msgLen; SRpcHandleInfo connInfo; @@ -100,6 +101,7 @@ typedef struct SQWHbInfo { typedef struct SQWPhaseInput { int32_t code; + int32_t msgType; } SQWPhaseInput; typedef struct SQWPhaseOutput { @@ -119,6 +121,7 @@ typedef struct SQWTaskCtx { int8_t phase; int8_t taskType; int8_t explain; + int32_t queryType; bool queryFetched; bool queryEnd; diff --git a/source/libs/qworker/inc/qwMsg.h b/source/libs/qworker/inc/qwMsg.h index 8c7c030dce..9e9d1f44cb 100644 --- a/source/libs/qworker/inc/qwMsg.h +++ b/source/libs/qworker/inc/qwMsg.h @@ -39,7 +39,7 @@ int32_t qwBuildAndSendFetchRsp(SRpcHandleInfo *pConn, SRetrieveTableRsp *pRsp, i int32_t code); void qwBuildFetchRsp(void *msg, SOutputData *input, int32_t len, bool qComplete); int32_t qwBuildAndSendCQueryMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn); -int32_t qwBuildAndSendQueryRsp(SRpcHandleInfo *pConn, int32_t code, STbVerInfo* tbInfo); +int32_t qwBuildAndSendQueryRsp(int32_t rspType, SRpcHandleInfo *pConn, int32_t code, STbVerInfo* tbInfo); int32_t qwBuildAndSendExplainRsp(SRpcHandleInfo *pConn, SExplainExecInfo *execInfo, int32_t num); void qwFreeFetchRsp(void *msg); int32_t qwMallocFetchRsp(int32_t length, SRetrieveTableRsp **rsp); diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c index 8c1371fce9..70a6a70c44 100644 --- a/source/libs/qworker/src/qwMsg.c +++ b/source/libs/qworker/src/qwMsg.c @@ -43,7 +43,7 @@ void qwFreeFetchRsp(void *msg) { } } -int32_t qwBuildAndSendQueryRsp(SRpcHandleInfo *pConn, int32_t code, STbVerInfo* tbInfo) { +int32_t qwBuildAndSendQueryRsp(int32_t rspType, SRpcHandleInfo *pConn, int32_t code, STbVerInfo* tbInfo) { SQueryTableRsp *pRsp = (SQueryTableRsp *)rpcMallocCont(sizeof(SQueryTableRsp)); pRsp->code = code; if (tbInfo) { @@ -53,7 +53,7 @@ int32_t qwBuildAndSendQueryRsp(SRpcHandleInfo *pConn, int32_t code, STbVerInfo* } SRpcMsg rpcRsp = { - .msgType = TDMT_VND_QUERY_RSP, + .msgType = rspType, .pCont = pRsp, .contLen = sizeof(*pRsp), .code = code, @@ -73,7 +73,7 @@ int32_t qwBuildAndSendExplainRsp(SRpcHandleInfo *pConn, SExplainExecInfo *execIn tSerializeSExplainRsp(pRsp, contLen, &rsp); SRpcMsg rpcRsp = { - .msgType = TDMT_VND_EXPLAIN_RSP, + .msgType = TDMT_SCH_EXPLAIN_RSP, .pCont = pRsp, .contLen = contLen, .code = 0, @@ -92,7 +92,7 @@ int32_t qwBuildAndSendHbRsp(SRpcHandleInfo *pConn, SSchedulerHbRsp *pStatus, int tSerializeSSchedulerHbRsp(pRsp, contLen, pStatus); SRpcMsg rpcRsp = { - .msgType = TDMT_VND_QUERY_HEARTBEAT_RSP, + .msgType = TDMT_SCH_QUERY_HEARTBEAT_RSP, .contLen = contLen, .pCont = pRsp, .code = code, @@ -112,7 +112,7 @@ int32_t qwBuildAndSendFetchRsp(SRpcHandleInfo *pConn, SRetrieveTableRsp *pRsp, i } SRpcMsg rpcRsp = { - .msgType = TDMT_VND_FETCH_RSP, + .msgType = TDMT_SCH_FETCH_RSP, .pCont = pRsp, .contLen = sizeof(*pRsp) + dataLength, .code = code, @@ -129,7 +129,7 @@ int32_t qwBuildAndSendCancelRsp(SRpcHandleInfo *pConn, int32_t code) { pRsp->code = code; SRpcMsg rpcRsp = { - .msgType = TDMT_VND_CANCEL_TASK_RSP, + .msgType = TDMT_SCH_CANCEL_TASK_RSP, .pCont = pRsp, .contLen = sizeof(*pRsp), .code = code, @@ -145,7 +145,7 @@ int32_t qwBuildAndSendDropRsp(SRpcHandleInfo *pConn, int32_t code) { pRsp->code = code; SRpcMsg rpcRsp = { - .msgType = TDMT_VND_DROP_TASK_RSP, + .msgType = TDMT_SCH_DROP_TASK_RSP, .pCont = pRsp, .contLen = sizeof(*pRsp), .code = code, @@ -325,9 +325,9 @@ int32_t qWorkerProcessQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int uint64_t tId = msg->taskId; int64_t rId = msg->refId; - SQWMsg qwMsg = {.node = node, .msg = msg->msg + msg->sqlLen, .msgLen = msg->phyLen, .connInfo = pMsg->info}; + SQWMsg qwMsg = {.node = node, .msg = msg->msg + msg->sqlLen, .msgLen = msg->phyLen, .connInfo = pMsg->info, .msgType = pMsg->msgType}; char * sql = strndup(msg->msg, msg->sqlLen); - QW_SCH_TASK_DLOG("processQuery start, node:%p, handle:%p, sql:%s", node, pMsg->info.handle, sql); + QW_SCH_TASK_DLOG("processQuery start, node:%p, type:%s, handle:%p, sql:%s", node, TMSG_INFO(pMsg->msgType), pMsg->info.handle, sql); QW_ERR_RET(qwProcessQuery(QW_FPARAMS(), &qwMsg, msg->taskType, msg->explain, sql)); QW_SCH_TASK_DLOG("processQuery end, node:%p", node); diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index 4250785f7c..8ab293d0ad 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -417,17 +417,10 @@ int32_t qwHandlePostPhaseEvents(QW_FPARAMS_DEF, int8_t phase, SQWPhaseInput *inp } if (QW_PHASE_POST_QUERY == phase) { -#if 0 - if (QW_IS_EVENT_RECEIVED(ctx, QW_EVENT_READY)) { - readyConnection = &ctx->connInfo; - QW_SET_EVENT_PROCESSED(ctx, QW_EVENT_READY); - } -#else connInfo = ctx->ctrlConnInfo; rspConnection = &connInfo; QW_SET_EVENT_PROCESSED(ctx, QW_EVENT_READY); -#endif } if (QW_IS_EVENT_RECEIVED(ctx, QW_EVENT_DROP)) { @@ -458,8 +451,8 @@ _return: } if (rspConnection) { - qwBuildAndSendQueryRsp(rspConnection, code, ctx ? &ctx->tbInfo : NULL); - QW_TASK_DLOG("ready msg rsped, handle:%p, code:%x - %s", rspConnection->handle, code, tstrerror(code)); + qwBuildAndSendQueryRsp(input->msgType + 1, rspConnection, code, ctx ? &ctx->tbInfo : NULL); + QW_TASK_DLOG("query msg rsped, handle:%p, code:%x - %s", rspConnection->handle, code, tstrerror(code)); } if (ctx) { @@ -530,8 +523,9 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex QW_ERR_JRET(qwGetTaskCtx(QW_FPARAMS(), &ctx)); - atomic_store_8(&ctx->taskType, taskType); - atomic_store_8(&ctx->explain, explain); + ctx->taskType = taskType; + ctx->explain = explain; + ctx->queryType = qwMsg->msgType; QW_TASK_DLOGL("subplan json string, len:%d, %s", qwMsg->msgLen, qwMsg->msg); @@ -571,6 +565,7 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex _return: input.code = code; + input.msgType = qwMsg->msgType; code = qwHandlePostPhaseEvents(QW_FPARAMS(), QW_PHASE_POST_QUERY, &input, NULL); // if (!queryRsped) { diff --git a/source/libs/qworker/test/qworkerTests.cpp b/source/libs/qworker/test/qworkerTests.cpp index 7c7d262167..bc37400249 100644 --- a/source/libs/qworker/test/qworkerTests.cpp +++ b/source/libs/qworker/test/qworkerTests.cpp @@ -202,7 +202,8 @@ void qwtSendReqToDnode(void* pVnode, struct SEpSet* epSet, struct SRpcMsg* pReq) void qwtRpcSendResponse(const SRpcMsg *pRsp) { switch (pRsp->msgType) { - case TDMT_VND_QUERY_RSP: { + case TDMT_SCH_QUERY_RSP: + case TDMT_SCH_MERGE_QUERY_RSP: { SQueryTableRsp *rsp = (SQueryTableRsp *)pRsp->pCont; if (pRsp->code) { @@ -213,7 +214,7 @@ void qwtRpcSendResponse(const SRpcMsg *pRsp) { rpcFreeCont(rsp); break; } - case TDMT_VND_FETCH_RSP: { + case TDMT_SCH_FETCH_RSP: { SRetrieveTableRsp *rsp = (SRetrieveTableRsp *)pRsp->pCont; if (0 == pRsp->code && 0 == rsp->completed) { @@ -229,7 +230,7 @@ void qwtRpcSendResponse(const SRpcMsg *pRsp) { break; } - case TDMT_VND_DROP_TASK_RSP: { + case TDMT_SCH_DROP_TASK_RSP: { STaskDropRsp *rsp = (STaskDropRsp *)pRsp->pCont; rpcFreeCont(rsp); diff --git a/source/libs/scheduler/inc/schedulerInt.h b/source/libs/scheduler/inc/schedulerInt.h index 4e36bd3f10..fb0c43b0ff 100644 --- a/source/libs/scheduler/inc/schedulerInt.h +++ b/source/libs/scheduler/inc/schedulerInt.h @@ -353,7 +353,7 @@ void schFreeJobImpl(void *job); int32_t schMakeHbRpcCtx(SSchJob *pJob, SSchTask *pTask, SRpcCtx *pCtx); int32_t schEnsureHbConnection(SSchJob *pJob, SSchTask *pTask); int32_t schUpdateHbConnection(SQueryNodeEpId *epId, SSchTrans *trans); -int32_t schHandleHbCallback(void *param, const SDataBuf *pMsg, int32_t code); +int32_t schHandleHbCallback(void *param, SDataBuf *pMsg, int32_t code); void schFreeRpcCtx(SRpcCtx *pCtx); int32_t schGetCallbackFp(int32_t msgType, __async_send_cb_fn_t *fp); bool schJobNeedToStop(SSchJob *pJob, int8_t *pStatus); @@ -383,7 +383,8 @@ char* schGetOpStr(SCH_OP_TYPE type); int32_t schBeginOperation(SSchJob *pJob, SCH_OP_TYPE type, bool sync); int32_t schInitJob(SSchedulerReq *pReq, SSchJob **pSchJob); int32_t schSetJobQueryRes(SSchJob* pJob, SQueryResult* pRes); -int32_t schUpdateTaskCandidateAddr(SSchTask *pTask, SEpSet* pEpSet); +int32_t schUpdateTaskCandidateAddr(SSchJob *pJob, SSchTask *pTask, SEpSet* pEpSet); +int32_t schHandleRedirect(SSchJob *pJob, SSchTask *pTask, SDataBuf* pData, int32_t rspCode); #ifdef __cplusplus diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index fd27193b0f..643594f4e0 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -682,9 +682,9 @@ int32_t schSetTaskCandidateAddrs(SSchJob *pJob, SSchTask *pTask) { return TSDB_CODE_SUCCESS; } -int32_t schUpdateTaskCandidateAddr(SSchTask *pTask, SEpSet* pEpSet) { +int32_t schUpdateTaskCandidateAddr(SSchJob *pJob, SSchTask *pTask, SEpSet* pEpSet) { if (NULL == pTask->candidateAddrs || 1 != taosArrayGetSize(pTask->candidateAddrs)) { - SCH_TASK_ELOG("not able to update cndidate addr, addr num %d", (pTask->candidateAddrs ? taosArrayGetSize(pTask->candidateAddrs): 0)); + SCH_TASK_ELOG("not able to update cndidate addr, addr num %d", (int32_t)(pTask->candidateAddrs ? taosArrayGetSize(pTask->candidateAddrs): 0)); SCH_ERR_RET(TSDB_CODE_APP_ERROR); } @@ -1685,7 +1685,7 @@ int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, int32_t rspCode) { return TSDB_CODE_SUCCESS; } - SCH_TASK_DLOG("task will be redirected now, status:%d", SCH_GET_TASK_STATUS_STR(pTask)); + SCH_TASK_DLOG("task will be redirected now, status:%s", SCH_GET_TASK_STATUS_STR(pTask)); schDropTaskOnExecNode(pJob, pTask); taosHashClear(pTask->execNodes); @@ -1735,7 +1735,7 @@ _return: SCH_RET(code); } -int32_t schHandleRedirect(SSchJob *pJob, SSchTask *pTask, int32_t msgType, SDataBuf* pData, int32_t rspCode) { +int32_t schHandleRedirect(SSchJob *pJob, SSchTask *pTask, SDataBuf* pData, int32_t rspCode) { int32_t code = 0; if (SCH_IS_DATA_SRC_QRY_TASK(pTask)) { @@ -1744,7 +1744,7 @@ int32_t schHandleRedirect(SSchJob *pJob, SSchTask *pTask, int32_t msgType, SData SCH_ERR_JRET(rspCode); } - SCH_ERR_JRET(schUpdateTaskCandidateAddr(pTask, pData->pEpSet)); + SCH_ERR_JRET(schUpdateTaskCandidateAddr(pJob, pTask, pData->pEpSet)); } schDoTaskRedirect(pJob, pTask, rspCode); diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index 76d2061936..91f5ff979c 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -28,9 +28,10 @@ int32_t schValidateReceivedMsgType(SSchJob *pJob, SSchTask *pTask, int32_t msgTy int32_t reqMsgType = msgType - 1; switch (msgType) { case TDMT_SCH_LINK_BROKEN: - case TDMT_VND_EXPLAIN_RSP: + case TDMT_SCH_EXPLAIN_RSP: return TSDB_CODE_SUCCESS; - case TDMT_VND_QUERY_RSP: // query_rsp may be processed later than ready_rsp + case TDMT_SCH_MERGE_QUERY_RSP: + case TDMT_SCH_QUERY_RSP: // query_rsp may be processed later than ready_rsp if (lastMsgType != reqMsgType && -1 != lastMsgType) { SCH_TASK_DLOG("rsp msg type mis-match, last sent msgType:%s, rspType:%s", TMSG_INFO(lastMsgType), TMSG_INFO(msgType)); @@ -43,7 +44,7 @@ int32_t schValidateReceivedMsgType(SSchJob *pJob, SSchTask *pTask, int32_t msgTy SCH_SET_TASK_LASTMSG_TYPE(pTask, -1); return TSDB_CODE_SUCCESS; - case TDMT_VND_FETCH_RSP: + case TDMT_SCH_FETCH_RSP: if (lastMsgType != reqMsgType && -1 != lastMsgType) { SCH_TASK_ELOG("rsp msg type mis-match, last sent msgType:%s, rspType:%s", TMSG_INFO(lastMsgType), TMSG_INFO(msgType)); @@ -238,7 +239,8 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch break; } - case TDMT_VND_QUERY_RSP: { + case TDMT_SCH_QUERY_RSP: + case TDMT_SCH_MERGE_QUERY_RSP: { SQueryTableRsp *rsp = (SQueryTableRsp *)msg; SCH_ERR_JRET(rspCode); @@ -255,7 +257,7 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch break; } - case TDMT_VND_EXPLAIN_RSP: { + case TDMT_SCH_EXPLAIN_RSP: { SCH_ERR_JRET(rspCode); if (NULL == msg) { SCH_ERR_JRET(TSDB_CODE_QRY_INVALID_INPUT); @@ -285,7 +287,7 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch } break; } - case TDMT_VND_FETCH_RSP: { + case TDMT_SCH_FETCH_RSP: { SRetrieveTableRsp *rsp = (SRetrieveTableRsp *)msg; SCH_ERR_JRET(rspCode); @@ -333,8 +335,8 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch schProcessOnDataFetched(pJob); break; } - case TDMT_VND_DROP_TASK_RSP: { - // SHOULD NEVER REACH HERE + case TDMT_SCH_DROP_TASK_RSP: { + // NEVER REACH HERE SCH_TASK_ELOG("invalid status to handle drop task rsp, refId:0x%" PRIx64, pJob->refId); SCH_ERR_JRET(TSDB_CODE_SCH_INTERNAL_ERROR); break; @@ -358,8 +360,9 @@ _return: } -int32_t schHandleCallback(void *param, const SDataBuf *pMsg, int32_t msgType, int32_t rspCode) { +int32_t schHandleCallback(void *param, SDataBuf *pMsg, int32_t rspCode) { int32_t code = 0; + int32_t msgType = pMsg->msgType; SSchTaskCallbackParam *pParam = (SSchTaskCallbackParam *)param; SSchTask *pTask = NULL; @@ -393,8 +396,8 @@ int32_t schHandleCallback(void *param, const SDataBuf *pMsg, int32_t msgType, in SCH_ERR_JRET(schValidateReceivedMsgType(pJob, pTask, msgType)); - if (NEED_SCHEDULER_REDIRECT_ERROR(rspCode) || ((rspCode == TSDB_CODE_RPC_NETWORK_UNAVAIL) && msgSize > 0)) { - code = schHandleRedirect(pJob, pTask, msgType, pMsg, rspCode); + if (NEED_SCHEDULER_REDIRECT_ERROR(rspCode) || ((rspCode == TSDB_CODE_RPC_NETWORK_UNAVAIL) && pMsg->len > 0)) { + code = schHandleRedirect(pJob, pTask, (SDataBuf *)pMsg, rspCode); goto _return; } @@ -416,46 +419,14 @@ _return: SCH_RET(code); } -int32_t schHandleSubmitCallback(void *param, const SDataBuf *pMsg, int32_t code) { - return schHandleCallback(param, pMsg, TDMT_VND_SUBMIT_RSP, code); -} - -int32_t schHandleCreateTbCallback(void *param, const SDataBuf *pMsg, int32_t code) { - return schHandleCallback(param, pMsg, TDMT_VND_CREATE_TABLE_RSP, code); -} - -int32_t schHandleDropTbCallback(void *param, const SDataBuf *pMsg, int32_t code) { - return schHandleCallback(param, pMsg, TDMT_VND_DROP_TABLE_RSP, code); -} - -int32_t schHandleAlterTbCallback(void *param, const SDataBuf *pMsg, int32_t code) { - return schHandleCallback(param, pMsg, TDMT_VND_ALTER_TABLE_RSP, code); -} - -int32_t schHandleQueryCallback(void *param, const SDataBuf *pMsg, int32_t code) { - return schHandleCallback(param, pMsg, TDMT_VND_QUERY_RSP, code); -} - -int32_t schHandleDeleteCallback(void *param, const SDataBuf *pMsg, int32_t code) { - return schHandleCallback(param, pMsg, TDMT_VND_DELETE_RSP, code); -} - -int32_t schHandleFetchCallback(void *param, const SDataBuf *pMsg, int32_t code) { - return schHandleCallback(param, pMsg, TDMT_VND_FETCH_RSP, code); -} - -int32_t schHandleExplainCallback(void *param, const SDataBuf *pMsg, int32_t code) { - return schHandleCallback(param, pMsg, TDMT_VND_EXPLAIN_RSP, code); -} - -int32_t schHandleDropCallback(void *param, const SDataBuf *pMsg, int32_t code) { +int32_t schHandleDropCallback(void *param, SDataBuf *pMsg, int32_t code) { SSchTaskCallbackParam *pParam = (SSchTaskCallbackParam *)param; qDebug("QID:0x%" PRIx64 ",TID:0x%" PRIx64 " drop task rsp received, code:0x%x", pParam->queryId, pParam->taskId, code); taosMemoryFreeClear(param); return TSDB_CODE_SUCCESS; } -int32_t schHandleLinkBrokenCallback(void *param, const SDataBuf *pMsg, int32_t code) { +int32_t schHandleLinkBrokenCallback(void *param, SDataBuf *pMsg, int32_t code) { SSchCallbackParamHeader *head = (SSchCallbackParamHeader *)param; rpcReleaseHandle(pMsg->handle, TAOS_CONN_CLIENT); @@ -468,7 +439,7 @@ int32_t schHandleLinkBrokenCallback(void *param, const SDataBuf *pMsg, int32_t c SCH_ERR_RET(schBuildAndSendHbMsg(&hbParam->nodeEpId, NULL)); } else { - SCH_ERR_RET(schHandleCallback(param, pMsg, TDMT_SCH_LINK_BROKEN, code)); + SCH_ERR_RET(schHandleCallback(param, pMsg, code)); } return TSDB_CODE_SUCCESS; @@ -564,29 +535,15 @@ _return: int32_t schGetCallbackFp(int32_t msgType, __async_send_cb_fn_t *fp) { switch (msgType) { case TDMT_VND_CREATE_TABLE: - *fp = schHandleCreateTbCallback; - break; case TDMT_VND_DROP_TABLE: - *fp = schHandleDropTbCallback; - break; case TDMT_VND_ALTER_TABLE: - *fp = schHandleAlterTbCallback; - break; case TDMT_VND_SUBMIT: - *fp = schHandleSubmitCallback; - break; case TDMT_SCH_QUERY: case TDMT_SCH_MERGE_QUERY: - *fp = schHandleQueryCallback; - break; case TDMT_VND_DELETE: - *fp = schHandleDeleteCallback; - break; case TDMT_SCH_EXPLAIN: - *fp = schHandleExplainCallback; - break; case TDMT_SCH_FETCH: - *fp = schHandleFetchCallback; + *fp = schHandleCallback; break; case TDMT_SCH_DROP_TASK: *fp = schHandleDropCallback; @@ -700,7 +657,7 @@ int32_t schMakeHbRpcCtx(SSchJob *pJob, SSchTask *pTask, SRpcCtx *pCtx) { SCH_ERR_JRET(TSDB_CODE_QRY_OUT_OF_MEMORY); } - int32_t msgType = TDMT_VND_QUERY_HEARTBEAT_RSP; + int32_t msgType = TDMT_SCH_QUERY_HEARTBEAT_RSP; __async_send_cb_fn_t fp = NULL; SCH_ERR_JRET(schGetCallbackFp(TDMT_SCH_QUERY_HEARTBEAT, &fp)); @@ -730,7 +687,7 @@ _return: SCH_RET(code); } -int32_t schHandleHbCallback(void *param, const SDataBuf *pMsg, int32_t code) { +int32_t schHandleHbCallback(void *param, SDataBuf *pMsg, int32_t code) { SSchedulerHbRsp rsp = {0}; SSchTaskCallbackParam *pParam = (SSchTaskCallbackParam *)param; @@ -794,7 +751,7 @@ int32_t schMakeQueryRpcCtx(SSchJob *pJob, SSchTask *pTask, SRpcCtx *pCtx) { SSchTrans trans = {.pTrans = pJob->conn.pTrans, .pHandle = SCH_GET_TASK_HANDLE(pTask)}; SCH_ERR_JRET(schGenerateCallBackInfo(pJob, pTask, NULL, 0, TDMT_SCH_EXPLAIN, &trans, false, &pExplainMsgSendInfo)); - int32_t msgType = TDMT_VND_EXPLAIN_RSP; + int32_t msgType = TDMT_SCH_EXPLAIN_RSP; SRpcCtxVal ctxVal = {.val = pExplainMsgSendInfo, .clone = schCloneSMsgSendInfo}; if (taosHashPut(pCtx->args, &msgType, sizeof(msgType), &ctxVal, sizeof(ctxVal))) { SCH_TASK_ELOG("taosHashPut msg %d to rpcCtx failed", msgType); diff --git a/source/libs/scheduler/test/schedulerTests.cpp b/source/libs/scheduler/test/schedulerTests.cpp index 43822e4f5b..22b08e9037 100644 --- a/source/libs/scheduler/test/schedulerTests.cpp +++ b/source/libs/scheduler/test/schedulerTests.cpp @@ -412,7 +412,7 @@ void *schtCreateFetchRspThread(void *param) { rsp->completed = 1; rsp->numOfRows = 10; - code = schHandleResponseMsg(pJob, pJob->fetchTask, TDMT_VND_FETCH_RSP, (char *)rsp, sizeof(*rsp), 0); + code = schHandleResponseMsg(pJob, pJob->fetchTask, TDMT_SCH_FETCH_RSP, (char *)rsp, sizeof(*rsp), 0); schReleaseJob(job); @@ -445,7 +445,7 @@ void *schtFetchRspThread(void *aa) { dataBuf.pData = rsp; dataBuf.len = sizeof(*rsp); - code = schHandleCallback(param, &dataBuf, TDMT_VND_FETCH_RSP, 0); + code = schHandleCallback(param, &dataBuf, TDMT_SCH_FETCH_RSP, 0); assert(code == 0 || code); } @@ -547,7 +547,7 @@ void* schtRunJobThread(void *aa) { dataBuf.pData = &rsp; dataBuf.len = sizeof(rsp); - code = schHandleCallback(param, &dataBuf, TDMT_VND_QUERY_RSP, 0); + code = schHandleCallback(param, &dataBuf, TDMT_SCH_QUERY_RSP, 0); assert(code == 0 || code); pIter = taosHashIterate(execTasks, pIter); @@ -566,7 +566,7 @@ void* schtRunJobThread(void *aa) { dataBuf.pData = &rsp; dataBuf.len = sizeof(rsp); - code = schHandleCallback(param, &dataBuf, TDMT_VND_QUERY_RSP, 0); + code = schHandleCallback(param, &dataBuf, TDMT_SCH_QUERY_RSP, 0); assert(code == 0 || code); pIter = taosHashIterate(execTasks, pIter); @@ -677,7 +677,7 @@ TEST(queryTest, normalCase) { SSchTask *task = *(SSchTask **)pIter; SQueryTableRsp rsp = {0}; - code = schHandleResponseMsg(pJob, task, TDMT_VND_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); + code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); ASSERT_EQ(code, 0); pIter = taosHashIterate(pJob->execTasks, pIter); @@ -688,7 +688,7 @@ TEST(queryTest, normalCase) { SSchTask *task = *(SSchTask **)pIter; SQueryTableRsp rsp = {0}; - code = schHandleResponseMsg(pJob, task, TDMT_VND_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); + code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); ASSERT_EQ(code, 0); pIter = taosHashIterate(pJob->execTasks, pIter); @@ -780,7 +780,7 @@ TEST(queryTest, readyFirstCase) { SSchTask *task = *(SSchTask **)pIter; SQueryTableRsp rsp = {0}; - code = schHandleResponseMsg(pJob, task, TDMT_VND_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); + code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); ASSERT_EQ(code, 0); pIter = taosHashIterate(pJob->execTasks, pIter); @@ -791,7 +791,7 @@ TEST(queryTest, readyFirstCase) { SSchTask *task = *(SSchTask **)pIter; SQueryTableRsp rsp = {0}; - code = schHandleResponseMsg(pJob, task, TDMT_VND_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); + code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); ASSERT_EQ(code, 0); pIter = taosHashIterate(pJob->execTasks, pIter); @@ -898,7 +898,7 @@ TEST(queryTest, flowCtrlCase) { if (task->lastMsgType == TDMT_SCH_QUERY) { SQueryTableRsp rsp = {0}; - code = schHandleResponseMsg(pJob, task, TDMT_VND_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); + code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0); ASSERT_EQ(code, 0); } else { diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index f53507c8aa..aacae590a0 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -1114,4 +1114,6 @@ _return2: rpcFreeCont(msg->pCont); } +int transGetConnInfo(void* thandle, STransHandleInfo* pConnInfo) { return -1; } + #endif From 53efe75146118cbd821df10ad52f8f5bad83c263 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 29 Jun 2022 17:56:35 +0800 Subject: [PATCH 11/51] feat: query redirect --- include/libs/qcom/query.h | 7 ++++--- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 2 +- source/libs/function/src/udfd.c | 2 +- source/libs/qworker/src/qwMsg.c | 8 ++++---- source/libs/scheduler/inc/schedulerInt.h | 2 ++ source/libs/scheduler/src/schRemote.c | 4 ++-- source/libs/transport/src/transCli.c | 2 +- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index 92131e354a..9881c8cb44 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -239,7 +239,7 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t #define NEED_REDIRECT_ERROR(_code) \ ((_code) == TSDB_CODE_RPC_REDIRECT || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL || \ (_code) == TSDB_CODE_NODE_NOT_DEPLOYED || (_code) == TSDB_CODE_SYN_NOT_LEADER || \ - (_code) == TSDB_CODE_APP_NOT_READY) + (_code) == TSDB_CODE_APP_NOT_READY || (_code) == TSDB_CODE_RPC_BROKEN_LINK) #define NEED_CLIENT_RM_TBLMETA_REQ(_type) \ ((_type) == TDMT_VND_CREATE_TABLE || (_type) == TDMT_VND_CREATE_STB || (_type) == TDMT_VND_DROP_TABLE || \ @@ -249,8 +249,9 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t ((_code) == TSDB_CODE_RPC_REDIRECT || (_code) == TSDB_CODE_NODE_NOT_DEPLOYED || \ (_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_APP_NOT_READY) -#define NEED_SCHEDULER_RETRY_ERROR(_code) \ - (NEED_SCHEDULER_REDIRECT_ERROR(_code) || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL || (_code) == TSDB_CODE_SCH_TIMEOUT_ERROR) +#define NEED_SCHEDULER_RETRY_ERROR(_code) \ + (NEED_SCHEDULER_REDIRECT_ERROR(_code) || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL || \ + (_code) == TSDB_CODE_SCH_TIMEOUT_ERROR || (_code) == TSDB_CODE_RPC_BROKEN_LINK) diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 4e581fd28e..91912bb764 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -250,7 +250,7 @@ static inline void dmReleaseHandle(SRpcHandleInfo *pHandle, int8_t type) { static bool rpcRfp(int32_t code, tmsg_t msgType) { if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED || - code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) { + code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY || code == TSDB_CODE_RPC_BROKEN_LINK) { if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH) { return false; } diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 4aad544e19..708ea4bd38 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -548,7 +548,7 @@ int32_t udfdLoadUdf(char *udfName, SUdf *udf) { } static bool udfdRpcRfp(int32_t code, tmsg_t msgType) { if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED || - code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) { + code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY || code == TSDB_CODE_RPC_BROKEN_LINK) { if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH) { return false; } diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c index 70a6a70c44..30772ff1ac 100644 --- a/source/libs/qworker/src/qwMsg.c +++ b/source/libs/qworker/src/qwMsg.c @@ -205,7 +205,7 @@ int32_t qwRegisterQueryBrokenLinkArg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) { .msgType = TDMT_SCH_DROP_TASK, .pCont = req, .contLen = sizeof(STaskDropReq), - .code = TSDB_CODE_RPC_NETWORK_UNAVAIL, + .code = TSDB_CODE_RPC_BROKEN_LINK, .info = *pConn, }; @@ -239,7 +239,7 @@ int32_t qwRegisterHbBrokenLinkArg(SQWorker *mgmt, uint64_t sId, SRpcHandleInfo * .msgType = TDMT_SCH_QUERY_HEARTBEAT, .pCont = msg, .contLen = msgSize, - .code = TSDB_CODE_RPC_NETWORK_UNAVAIL, + .code = TSDB_CODE_RPC_BROKEN_LINK, .info = *pConn, }; @@ -484,7 +484,7 @@ int32_t qWorkerProcessDropMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int6 SQWMsg qwMsg = {.node = node, .msg = NULL, .msgLen = 0, .code = pMsg->code, .connInfo = pMsg->info}; - if (TSDB_CODE_RPC_NETWORK_UNAVAIL == pMsg->code) { + if (TSDB_CODE_RPC_BROKEN_LINK == pMsg->code) { QW_SCH_TASK_DLOG("receive drop task due to network broken, error:%s", tstrerror(pMsg->code)); } @@ -522,7 +522,7 @@ int32_t qWorkerProcessHbMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int64_ uint64_t sId = req.sId; SQWMsg qwMsg = {.node = node, .msg = NULL, .msgLen = 0, .code = pMsg->code, .connInfo = pMsg->info}; - if (TSDB_CODE_RPC_NETWORK_UNAVAIL == pMsg->code) { + if (TSDB_CODE_RPC_BROKEN_LINK == pMsg->code) { QW_SCH_DLOG("receive Hb msg due to network broken, error:%s", tstrerror(pMsg->code)); } diff --git a/source/libs/scheduler/inc/schedulerInt.h b/source/libs/scheduler/inc/schedulerInt.h index fb0c43b0ff..8dfc703dd9 100644 --- a/source/libs/scheduler/inc/schedulerInt.h +++ b/source/libs/scheduler/inc/schedulerInt.h @@ -306,6 +306,8 @@ extern SSchedulerMgmt schMgmt; #define SCH_IS_WAIT_ALL_JOB(_job) (!SCH_IS_QUERY_JOB(_job)) #define SCH_IS_NEED_DROP_JOB(_job) (SCH_IS_QUERY_JOB(_job)) #define SCH_IS_EXPLAIN_JOB(_job) (EXPLAIN_MODE_ANALYZE == (_job)->attr.explainMode) +#define SCH_NETWORK_ERR(_code) ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL) +#define SCH_SUB_TASK_NETWORK_ERR(_code, _len) (((_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL || (_code) == TSDB_CODE_RPC_BROKEN_LINK) && ((_len) > 0)) #define SCH_IS_LEVEL_UNFINISHED(_level) ((_level)->taskLaunchedNum < (_level)->taskNum) #define SCH_GET_CUR_EP(_addr) (&(_addr)->epSet.eps[(_addr)->epSet.inUse]) diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index 91f5ff979c..3688cb0240 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -384,7 +384,7 @@ int32_t schHandleCallback(void *param, SDataBuf *pMsg, int32_t rspCode) { goto _return; } - bool dropExecNode = (msgType == TDMT_SCH_LINK_BROKEN || rspCode == TSDB_CODE_RPC_NETWORK_UNAVAIL); + bool dropExecNode = (msgType == TDMT_SCH_LINK_BROKEN || SCH_NETWORK_ERR(rspCode)); SCH_ERR_JRET(schUpdateTaskHandle(pJob, pTask, dropExecNode, pMsg->handle, pParam->execIdx)); int8_t status = 0; @@ -396,7 +396,7 @@ int32_t schHandleCallback(void *param, SDataBuf *pMsg, int32_t rspCode) { SCH_ERR_JRET(schValidateReceivedMsgType(pJob, pTask, msgType)); - if (NEED_SCHEDULER_REDIRECT_ERROR(rspCode) || ((rspCode == TSDB_CODE_RPC_NETWORK_UNAVAIL) && pMsg->len > 0)) { + if (NEED_SCHEDULER_REDIRECT_ERROR(rspCode) || SCH_SUB_TASK_NETWORK_ERR(rspCode, pMsg->len > 0)) { code = schHandleRedirect(pJob, pTask, (SDataBuf *)pMsg, rspCode); goto _return; } diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index e21237ec10..5de907f8cb 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -328,7 +328,7 @@ void cliHandleResp(SCliConn* conn) { tDebug("%s conn %p construct ahandle %p by %s, persist: 1", CONN_GET_INST_LABEL(conn), conn, transMsg.info.ahandle, TMSG_INFO(transMsg.msgType)); if (!CONN_RELEASE_BY_SERVER(conn) && transMsg.info.ahandle == NULL) { - transMsg.code = TSDB_CODE_RPC_NETWORK_UNAVAIL; + transMsg.code = TSDB_CODE_RPC_BROKEN_LINK; transMsg.info.ahandle = transCtxDumpBrokenlinkVal(&conn->ctx, (int32_t*)&(transMsg.msgType)); tDebug("%s conn %p construct ahandle %p due brokenlink, persist: 1", CONN_GET_INST_LABEL(conn), conn, transMsg.info.ahandle); From 5e31c9e8fe664af8be2c4292a65dad9380802e8a Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 29 Jun 2022 17:50:33 +0800 Subject: [PATCH 12/51] refactor(query): function adoption to us/ns db precision TD-16436 --- source/libs/function/src/builtins.c | 4 ++++ source/libs/scalar/src/sclfunc.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 6fa7d10ca3..440e12c3d7 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -1460,6 +1460,10 @@ static int32_t translateToUnixtimestamp(SFunctionNode* pFunc, char* pErrBuf, int return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } + //add database precision as param + uint8_t dbPrec = pFunc->node.resType.precision; + addDbPrecisonParam(pFunc->pParameterList, dbPrec); + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; return TSDB_CODE_SUCCESS; } diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index b7c171db2e..dc4bf33a2b 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -1116,7 +1116,8 @@ int32_t toISO8601Function(SScalarParam *pInput, int32_t inputNum, SScalarParam * int32_t toUnixtimestampFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { int32_t type = GET_PARAM_TYPE(pInput); - int32_t timePrec = GET_PARAM_PRECISON(pInput); + int64_t timePrec; + GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[1]), pInput[1].columnData->pData); for (int32_t i = 0; i < pInput[0].numOfRows; ++i) { if (colDataIsNull_s(pInput[0].columnData, i)) { From 8faf37f1d00a6a3a7f0d864c09cb370047a47985 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 29 Jun 2022 20:30:16 +0800 Subject: [PATCH 13/51] fix:error if num of line is invalid --- source/client/src/clientSml.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 7d2bf019d2..8a9905935a 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -2453,7 +2453,6 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr pTscObj->schemalessType = 1; SSmlMsgBuf msg = {ERROR_MSG_BUF_DEFAULT_SIZE, request->msgBuf}; - int cnt = ceil(((double)numLines) / LINE_BATCH); Params params; params.request = request; tsem_init(¶ms.sem, 0, 0); @@ -2490,6 +2489,15 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr goto end; } + if(protocol == TSDB_SML_JSON_PROTOCOL){ + numLines = 1; + }else if(numLines <= 0){ + request->code = TSDB_CODE_SML_INVALID_DATA; + smlBuildInvalidDataMsg(&msg, "line num is invalid", NULL); + goto end; + } + + int cnt = ceil(((double)numLines) / LINE_BATCH); for (int i = 0; i < cnt; ++i) { SRequestObj* req = (SRequestObj*)createRequest(pTscObj, TSDB_SQL_INSERT); if(!req){ From 0eed30b0f028a68bd08ad23d26e21d5a81509137 Mon Sep 17 00:00:00 2001 From: tomchon Date: Wed, 29 Jun 2022 20:46:42 +0800 Subject: [PATCH 14/51] test:modify testcase of muti-mondes --- .../system-test/6-cluster/5dnode3mnodeStop.py | 14 +-- .../6-cluster/5dnode3mnodeStopLoop.py | 118 ++++++++++++++++++ tests/system-test/fulltest.sh | 5 +- 3 files changed, 122 insertions(+), 15 deletions(-) create mode 100644 tests/system-test/6-cluster/5dnode3mnodeStopLoop.py diff --git a/tests/system-test/6-cluster/5dnode3mnodeStop.py b/tests/system-test/6-cluster/5dnode3mnodeStop.py index 1b55176e1d..f932e5537e 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeStop.py +++ b/tests/system-test/6-cluster/5dnode3mnodeStop.py @@ -88,7 +88,7 @@ class TDTestCase: tdLog.info("Confirm the status of the dnode again") tdSql.error("create mnode on dnode 2") tdSql.query("show dnodes;") - print(tdSql.queryResult) + # print(tdSql.queryResult) clusterComCheck.checkDnodes(dnodenumbers) # restart all taosd tdDnodes=cluster.dnodes @@ -108,18 +108,6 @@ class TDTestCase: tdDnodes[0].starttaosd() clusterComCheck.checkMnodeStatus(3) - tdLog.info("Take turns stopping all dnodes ") - # seperate vnode and mnode in different dnodes. - # create database and stable - stopcount =0 - while stopcount <= 2: - tdLog.info("first restart loop") - for i in range(dnodenumbers): - tdDnodes[i].stoptaosd() - tdDnodes[i].starttaosd() - stopcount+=1 - clusterComCheck.checkDnodes(dnodenumbers) - clusterComCheck.checkMnodeStatus(3) def run(self): # print(self.master_dnode.cfgDict) diff --git a/tests/system-test/6-cluster/5dnode3mnodeStopLoop.py b/tests/system-test/6-cluster/5dnode3mnodeStopLoop.py new file mode 100644 index 0000000000..e0c91e5ac4 --- /dev/null +++ b/tests/system-test/6-cluster/5dnode3mnodeStopLoop.py @@ -0,0 +1,118 @@ +from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE +import taos +import sys +import time +import os + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import * +from util.dnodes import TDDnodes +from util.dnodes import TDDnode +from util.cluster import * +from test import tdDnodes +sys.path.append("./6-cluster") + +from clusterCommonCreate import * +from clusterCommonCheck import * +import time +import socket +import subprocess +from multiprocessing import Process + + +class TDTestCase: + + def init(self,conn ,logSql): + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor()) + self.host = socket.gethostname() + + + def getBuildPath(self): + selfPath = os.path.dirname(os.path.realpath(__file__)) + + if ("community" in selfPath): + projPath = selfPath[:selfPath.find("community")] + else: + projPath = selfPath[:selfPath.find("tests")] + + for root, dirs, files in os.walk(projPath): + if ("taosd" in files): + rootRealPath = os.path.dirname(os.path.realpath(root)) + if ("packaging" not in rootRealPath): + buildPath = root[:len(root) - len("/build/bin")] + break + return buildPath + + def fiveDnodeThreeMnode(self,dnodenumbers,mnodeNums,restartNumber): + tdLog.printNoPrefix("======== test case 1: ") + paraDict = {'dbName': 'db', + 'dropFlag': 1, + 'event': '', + 'vgroups': 4, + 'replica': 1, + 'stbName': 'stb', + 'colPrefix': 'c', + 'tagPrefix': 't', + 'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'ctbPrefix': 'ctb', + 'ctbNum': 1, + 'rowsPerTbl': 10000, + 'batchNum': 10, + 'startTs': 1640966400000, # 2022-01-01 00:00:00.000 + 'pollDelay': 10, + 'showMsg': 1, + 'showRow': 1} + dnodenumbers=int(dnodenumbers) + mnodeNums=int(mnodeNums) + dbNumbers = int(dnodenumbers * restartNumber) + + tdLog.info("first check dnode and mnode") + tdSql.query("show dnodes;") + tdSql.checkData(0,1,'%s:6030'%self.host) + tdSql.checkData(4,1,'%s:6430'%self.host) + clusterComCheck.checkDnodes(dnodenumbers) + clusterComCheck.checkMnodeStatus(1) + + # fisr add three mnodes; + tdLog.info("fisr add three mnodes and check mnode status") + tdSql.execute("create mnode on dnode 2") + clusterComCheck.checkMnodeStatus(2) + tdSql.execute("create mnode on dnode 3") + clusterComCheck.checkMnodeStatus(3) + + # add some error operations and + tdLog.info("Confirm the status of the dnode again") + tdSql.error("create mnode on dnode 2") + tdSql.query("show dnodes;") + # print(tdSql.queryResult) + clusterComCheck.checkDnodes(dnodenumbers) + # restart all taosd + tdDnodes=cluster.dnodes + + tdLog.info("Take turns stopping all dnodes ") + # seperate vnode and mnode in different dnodes. + # create database and stable + stopcount =0 + while stopcount <= 2: + tdLog.info(" restart loop: %d"%stopcount ) + for i in range(dnodenumbers): + tdDnodes[i].stoptaosd() + tdDnodes[i].starttaosd() + stopcount+=1 + clusterComCheck.checkDnodes(dnodenumbers) + clusterComCheck.checkMnodeStatus(3) + + def run(self): + # print(self.master_dnode.cfgDict) + self.fiveDnodeThreeMnode(5,3,1) + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index b76d73b54c..436c2ed349 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -118,15 +118,16 @@ python3 ./test.py -f 2-query/queryQnode.py python3 ./test.py -f 6-cluster/5dnode1mnode.py python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3 python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3 # BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3 # BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3 # BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3 # BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3 # python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3 # BUG python3 ./test.py -f 6-cluster/5dnode3mnodeStopInsert.py # python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 -python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3 +# python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3 python3 ./test.py -f 7-tmq/basic5.py From 4c23223447f7c8d4771939e1b0a740e3f5e3be26 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 29 Jun 2022 17:50:33 +0800 Subject: [PATCH 15/51] refactor(query): function adoption to us/ns db precision TD-16436 --- source/libs/function/src/builtins.c | 39 ++++++++++++++++------------- source/libs/scalar/src/sclfunc.c | 10 ++++++-- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 440e12c3d7..bfb638360d 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -39,6 +39,20 @@ static int32_t invaildFuncParaValueErrMsg(char* pErrBuf, int32_t len, const char return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_PARA_VALUE, "Invalid parameter value : %s", pFuncName); } +void static addDbPrecisonParam(SNodeList** pList, uint8_t precision) { + SValueNode* pVal = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE); + pVal->literal = NULL; + pVal->isDuration = false; + pVal->translate = true; + pVal->node.resType.type = TSDB_DATA_TYPE_TINYINT; + pVal->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_TINYINT].bytes; + pVal->node.resType.precision = precision; + pVal->datum.i = (int64_t)precision; + pVal->typeData = (int64_t)precision; + + nodesListMakeAppend(pList, (SNode*)pVal); +} + // There is only one parameter of numeric type, and the return type is parameter type static int32_t translateInOutNum(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { if (1 != LIST_LENGTH(pFunc->pParameterList)) { @@ -222,6 +236,11 @@ static int32_t translateWduration(SFunctionNode* pFunc, char* pErrBuf, int32_t l static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { // pseudo column do not need to check parameters + + //add database precision as param + uint8_t dbPrec = pFunc->node.resType.precision; + addDbPrecisonParam(&pFunc->pParameterList, dbPrec); + pFunc->node.resType = (SDataType){.bytes = sizeof(int64_t), .type = TSDB_DATA_TYPE_TIMESTAMP}; return TSDB_CODE_SUCCESS; } @@ -1379,20 +1398,6 @@ static bool validateTimezoneFormat(const SValueNode* pVal) { return true; } -void static addDbPrecisonParam(SNodeList* pList, uint8_t precision) { - SValueNode* pVal = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE); - pVal->literal = NULL; - pVal->isDuration = false; - pVal->translate = true; - pVal->node.resType.type = TSDB_DATA_TYPE_TINYINT; - pVal->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_TINYINT].bytes; - pVal->node.resType.precision = precision; - pVal->datum.i = (int64_t)precision; - pVal->typeData = (int64_t)precision; - - nodesListAppend(pList, (SNode*)pVal); -} - void static addTimezoneParam(SNodeList* pList) { char buf[6] = {0}; time_t t = taosTime(NULL); @@ -1462,7 +1467,7 @@ static int32_t translateToUnixtimestamp(SFunctionNode* pFunc, char* pErrBuf, int //add database precision as param uint8_t dbPrec = pFunc->node.resType.precision; - addDbPrecisonParam(pFunc->pParameterList, dbPrec); + addDbPrecisonParam(&pFunc->pParameterList, dbPrec); pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; return TSDB_CODE_SUCCESS; @@ -1482,7 +1487,7 @@ static int32_t translateTimeTruncate(SFunctionNode* pFunc, char* pErrBuf, int32_ //add database precision as param uint8_t dbPrec = pFunc->node.resType.precision; - addDbPrecisonParam(pFunc->pParameterList, dbPrec); + addDbPrecisonParam(&pFunc->pParameterList, dbPrec); pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes, .type = TSDB_DATA_TYPE_TIMESTAMP}; @@ -1510,7 +1515,7 @@ static int32_t translateTimeDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t le //add database precision as param uint8_t dbPrec = pFunc->node.resType.precision; - addDbPrecisonParam(pFunc->pParameterList, dbPrec); + addDbPrecisonParam(&pFunc->pParameterList, dbPrec); pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; return TSDB_CODE_SUCCESS; diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index dc4bf33a2b..d350a380e0 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -1515,7 +1515,10 @@ int32_t timeDiffFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *p } int32_t nowFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { - int64_t ts = taosGetTimestamp(TSDB_TIME_PRECISION_MILLI); + int64_t timePrec; + GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[0]), pInput[0].columnData->pData); + + int64_t ts = taosGetTimestamp(timePrec); for (int32_t i = 0; i < pInput->numOfRows; ++i) { colDataAppendInt64(pOutput->columnData, i, &ts); } @@ -1524,7 +1527,10 @@ int32_t nowFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutpu } int32_t todayFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { - int64_t ts = taosGetTimestampToday(TSDB_TIME_PRECISION_MILLI); + int64_t timePrec; + GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[1]), pInput[1].columnData->pData); + + int64_t ts = taosGetTimestampToday(timePrec); for (int32_t i = 0; i < pInput->numOfRows; ++i) { colDataAppendInt64(pOutput->columnData, i, &ts); } From b1670f8b82efad7c24e964e5c8ae35e83c484f0e Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 29 Jun 2022 17:50:33 +0800 Subject: [PATCH 16/51] refactor(query): function adoption to us/ns db precision TD-16436 --- source/libs/scalar/src/sclfunc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index d350a380e0..76c0e48740 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -1528,7 +1528,7 @@ int32_t nowFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutpu int32_t todayFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { int64_t timePrec; - GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[1]), pInput[1].columnData->pData); + GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[0]), pInput[0].columnData->pData); int64_t ts = taosGetTimestampToday(timePrec); for (int32_t i = 0; i < pInput->numOfRows; ++i) { From cf35174d539d5b0b59ff6776af9121ce5c5d95c7 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 30 Jun 2022 10:23:35 +0800 Subject: [PATCH 17/51] feat: the last_row function supports all scenes --- include/libs/function/functionMgt.h | 1 + include/libs/nodes/plannodes.h | 1 + source/libs/function/src/builtins.c | 13 +++++++ source/libs/planner/src/planLogicCreater.c | 8 ++-- source/libs/planner/src/planOptimizer.c | 43 +++++++++++++++++++++- source/libs/planner/src/planSpliter.c | 2 + source/libs/planner/test/planBasicTest.cpp | 2 + 7 files changed, 66 insertions(+), 4 deletions(-) diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index 1ed78750d1..7697dd5047 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -125,6 +125,7 @@ typedef enum EFunctionType { FUNCTION_TYPE_BLOCK_DIST_INFO, // block distribution pseudo column function FUNCTION_TYPE_TO_COLUMN, FUNCTION_TYPE_GROUP_KEY, + FUNCTION_TYPE_CACHE_LAST_ROW, // distributed splitting functions FUNCTION_TYPE_APERCENTILE_PARTIAL = 4000, diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 4671c8b81e..f8d79a863f 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -91,6 +91,7 @@ typedef struct SAggLogicNode { SLogicNode node; SNodeList* pGroupKeys; SNodeList* pAggFuncs; + bool hasLastRow; } SAggLogicNode; typedef struct SProjectLogicNode { diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index fbebb12cc3..85a2ab22b6 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -1882,6 +1882,19 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .name = "last_row", .type = FUNCTION_TYPE_LAST_ROW, .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC | FUNC_MGT_TIMELINE_FUNC, + .translateFunc = translateFirstLast, + .getEnvFunc = getFirstLastFuncEnv, + .initFunc = functionSetup, + .processFunc = lastFunction, + .finalizeFunc = firstLastFinalize, + .pPartialFunc = "_last_partial", + .pMergeFunc = "_last_merge", + .combineFunc = lastCombine, + }, + { + .name = "_cache_last_row", + .type = FUNCTION_TYPE_CACHE_LAST_ROW, + .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC | FUNC_MGT_TIMELINE_FUNC, .translateFunc = translateLastRow, .getEnvFunc = getMinmaxFuncEnv, .initFunc = minmaxFunctionSetup, diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index ef8b109b62..05256e2696 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -160,9 +160,9 @@ static EScanType getScanType(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SNod return SCAN_TYPE_STREAM; } - if (pSelect->hasLastRowFunc) { - return SCAN_TYPE_LAST_ROW; - } + // if (pSelect->hasLastRowFunc) { + // return SCAN_TYPE_LAST_ROW; + // } if (NULL == pScanCols) { // select count(*) from t @@ -474,6 +474,8 @@ static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, return TSDB_CODE_OUT_OF_MEMORY; } + pAgg->hasLastRow = pSelect->hasLastRowFunc; + int32_t code = TSDB_CODE_SUCCESS; // set grouyp keys, agg funcs and having conditions diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 42f7f744c5..b733d75fb2 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -1616,6 +1616,46 @@ static int32_t rewriteUniqueOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLog return rewriteUniqueOptimizeImpl(pCxt, pLogicSubplan, pIndef); } +static bool lastRowScanOptMayBeOptimized(SLogicNode* pNode) { + if (QUERY_NODE_LOGIC_PLAN_AGG != nodeType(pNode) || !(((SAggLogicNode*)pNode)->hasLastRow) || + NULL != ((SAggLogicNode*)pNode)->pGroupKeys || 1 != LIST_LENGTH(pNode->pChildren) || + QUERY_NODE_LOGIC_PLAN_SCAN != nodeType(nodesListGetNode(pNode->pChildren, 0)) || + NULL != ((SScanLogicNode*)nodesListGetNode(pNode->pChildren, 0))->node.pConditions) { + return false; + } + + SNode* pFunc = NULL; + FOREACH(pFunc, ((SAggLogicNode*)pNode)->pAggFuncs) { + if (FUNCTION_TYPE_LAST_ROW != ((SFunctionNode*)pFunc)->funcType) { + return false; + } + } + + return true; +} + +static int32_t lastRowScanOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan) { + SAggLogicNode* pAgg = (SAggLogicNode*)optFindPossibleNode(pLogicSubplan->pNode, lastRowScanOptMayBeOptimized); + + if (NULL == pAgg) { + return TSDB_CODE_SUCCESS; + } + + SNode* pNode = NULL; + FOREACH(pNode, pAgg->pAggFuncs) { + SFunctionNode* pFunc = (SFunctionNode*)pNode; + int32_t len = snprintf(pFunc->functionName, sizeof(pFunc->functionName), "_cache_last_row"); + pFunc->functionName[len] = '\0'; + fmGetFuncInfo(pFunc, NULL, 0); + } + pAgg->hasLastRow = false; + + ((SScanLogicNode*)nodesListGetNode(pAgg->node.pChildren, 0))->scanType = SCAN_TYPE_LAST_ROW; + + pCxt->optimized = true; + return TSDB_CODE_SUCCESS; +} + // merge projects static bool mergeProjectsMayBeOptimized(SLogicNode* pNode) { if (QUERY_NODE_LOGIC_PLAN_PROJECT != nodeType(pNode) || 1 != LIST_LENGTH(pNode->pChildren)) { @@ -1704,7 +1744,8 @@ static const SOptimizeRule optimizeRuleSet[] = { {.pName = "EliminateProject", .optimizeFunc = eliminateProjOptimize}, {.pName = "EliminateSetOperator", .optimizeFunc = eliminateSetOpOptimize}, {.pName = "RewriteTail", .optimizeFunc = rewriteTailOptimize}, - {.pName = "RewriteUnique", .optimizeFunc = rewriteUniqueOptimize} + {.pName = "RewriteUnique", .optimizeFunc = rewriteUniqueOptimize}, + {.pName = "LastRowScan", .optimizeFunc = lastRowScanOptimize} }; // clang-format on diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index 9d23df5bda..2bc226804f 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -197,6 +197,8 @@ static bool stbSplNeedSplit(bool streamQuery, SLogicNode* pNode) { return stbSplIsMultiTbScan(streamQuery, (SScanLogicNode*)pNode); case QUERY_NODE_LOGIC_PLAN_JOIN: return !(((SJoinLogicNode*)pNode)->isSingleTableJoin); + // case QUERY_NODE_LOGIC_PLAN_PARTITION: + // return stbSplHasMultiTbScan(streamQuery, pNode); case QUERY_NODE_LOGIC_PLAN_AGG: return !stbSplHasGatherExecFunc(((SAggLogicNode*)pNode)->pAggFuncs) && stbSplHasMultiTbScan(streamQuery, pNode); case QUERY_NODE_LOGIC_PLAN_WINDOW: diff --git a/source/libs/planner/test/planBasicTest.cpp b/source/libs/planner/test/planBasicTest.cpp index ff725c444e..b886fca2af 100644 --- a/source/libs/planner/test/planBasicTest.cpp +++ b/source/libs/planner/test/planBasicTest.cpp @@ -99,6 +99,8 @@ TEST_F(PlanBasicTest, lastRowFunc) { run("SELECT LAST_ROW(c1, c2) FROM t1"); run("SELECT LAST_ROW(c1) FROM st1"); + + run("SELECT LAST_ROW(c1), SUM(c3) FROM t1"); } TEST_F(PlanBasicTest, sampleFunc) { From e389dcedc8fb3bdebd20b107c0f446e62d4df56a Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 30 Jun 2022 10:30:36 +0800 Subject: [PATCH 18/51] add query epset --- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 1 + source/dnode/mnode/impl/src/mndMain.c | 23 ++++++++++--------- source/dnode/vnode/src/vnd/vnodeSync.c | 10 ++++---- source/libs/transport/src/transCli.c | 23 +++++++++++++------ 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 91912bb764..939d6f52f3 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -41,6 +41,7 @@ static inline void dmBuildMnodeRedirectRsp(SDnode *pDnode, SRpcMsg *pMsg) { } static inline void dmSendRedirectRsp(SRpcMsg *pMsg, const SEpSet *pNewEpSet) { + pMsg->info.hasEpSet = 1; SRpcMsg rsp = {.code = TSDB_CODE_RPC_REDIRECT, .info = pMsg->info}; int32_t contLen = tSerializeSEpSet(NULL, 0, pNewEpSet); diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index ff237c5a0c..c39c9847a9 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -58,7 +58,7 @@ static void *mndBuildTimerMsg(int32_t *pContLen) { static void mndPullupTrans(SMnode *pMnode) { int32_t contLen = 0; - void *pReq = mndBuildTimerMsg(&contLen); + void * pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { SRpcMsg rpcMsg = {.msgType = TDMT_MND_TRANS_TIMER, .pCont = pReq, .contLen = contLen}; tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); @@ -67,14 +67,14 @@ static void mndPullupTrans(SMnode *pMnode) { static void mndTtlTimer(SMnode *pMnode) { int32_t contLen = 0; - void *pReq = mndBuildTimerMsg(&contLen); + void * pReq = mndBuildTimerMsg(&contLen); SRpcMsg rpcMsg = {.msgType = TDMT_MND_TTL_TIMER, .pCont = pReq, .contLen = contLen}; tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); } static void mndCalMqRebalance(SMnode *pMnode) { int32_t contLen = 0; - void *pReq = mndBuildTimerMsg(&contLen); + void * pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { SRpcMsg rpcMsg = {.msgType = TDMT_MND_MQ_TIMER, .pCont = pReq, .contLen = contLen}; tmsgPutToQueue(&pMnode->msgCb, READ_QUEUE, &rpcMsg); @@ -83,7 +83,7 @@ static void mndCalMqRebalance(SMnode *pMnode) { static void mndPullupTelem(SMnode *pMnode) { int32_t contLen = 0; - void *pReq = mndBuildTimerMsg(&contLen); + void * pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { SRpcMsg rpcMsg = {.msgType = TDMT_MND_TELEM_TIMER, .pCont = pReq, .contLen = contLen}; tmsgPutToQueue(&pMnode->msgCb, READ_QUEUE, &rpcMsg); @@ -395,7 +395,7 @@ void mndStop(SMnode *pMnode) { } int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { - SMnode *pMnode = pMsg->info.node; + SMnode * pMnode = pMsg->info.node; SSyncMgmt *pMgmt = &pMnode->syncMgmt; int32_t code = 0; @@ -413,7 +413,7 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { } do { - char *syncNodeStr = sync2SimpleStr(pMgmt->sync); + char * syncNodeStr = sync2SimpleStr(pMgmt->sync); static int64_t mndTick = 0; if (++mndTick % 10 == 1) { mTrace("vgId:%d, sync trace msg:%s, %s", syncGetVgId(pMgmt->sync), TMSG_INFO(pMsg->msgType), syncNodeStr); @@ -527,8 +527,8 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { static int32_t mndCheckMnodeState(SRpcMsg *pMsg) { if (!IsReq(pMsg)) return 0; - if (pMsg->msgType == TDMT_SCH_QUERY || pMsg->msgType == TDMT_SCH_MERGE_QUERY || - pMsg->msgType == TDMT_SCH_QUERY_CONTINUE || pMsg->msgType == TDMT_SCH_QUERY_HEARTBEAT || + if (pMsg->msgType == TDMT_SCH_QUERY || pMsg->msgType == TDMT_SCH_MERGE_QUERY || + pMsg->msgType == TDMT_SCH_QUERY_CONTINUE || pMsg->msgType == TDMT_SCH_QUERY_HEARTBEAT || pMsg->msgType == TDMT_SCH_FETCH || pMsg->msgType == TDMT_SCH_DROP_TASK) { return 0; } @@ -552,6 +552,7 @@ static int32_t mndCheckMnodeState(SRpcMsg *pMsg) { int32_t contLen = tSerializeSEpSet(NULL, 0, &epSet); pMsg->info.rsp = rpcMallocCont(contLen); + pMsg->info.hasEpSet = 1; if (pMsg->info.rsp != NULL) { tSerializeSEpSet(pMsg->info.rsp, contLen, &epSet); pMsg->info.rspLen = contLen; @@ -578,7 +579,7 @@ static int32_t mndCheckMsgContent(SRpcMsg *pMsg) { } int32_t mndProcessRpcMsg(SRpcMsg *pMsg) { - SMnode *pMnode = pMsg->info.node; + SMnode * pMnode = pMsg->info.node; const STraceId *trace = &pMsg->info.traceId; MndMsgFp fp = pMnode->msgFp[TMSG_INDEX(pMsg->msgType)]; @@ -631,7 +632,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr SMonStbInfo *pStbInfo, SMonGrantInfo *pGrantInfo) { if (mndAcquireRpcRef(pMnode) != 0) return -1; - SSdb *pSdb = pMnode->pSdb; + SSdb * pSdb = pMnode->pSdb; int64_t ms = taosGetTimestampMs(); pClusterInfo->dnodes = taosArrayInit(sdbGetSize(pSdb, SDB_DNODE), sizeof(SMonDnodeDesc)); @@ -712,7 +713,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr pGrantInfo->timeseries_used += pVgroup->numOfTimeSeries; tstrncpy(desc.status, "unsynced", sizeof(desc.status)); for (int32_t i = 0; i < pVgroup->replica; ++i) { - SVnodeGid *pVgid = &pVgroup->vnodeGid[i]; + SVnodeGid * pVgid = &pVgroup->vnodeGid[i]; SMonVnodeDesc *pVnDesc = &desc.vnodes[i]; pVnDesc->dnode_id = pVgid->dnodeId; tstrncpy(pVnDesc->vnode_role, syncStr(pVgid->role), sizeof(pVnDesc->vnode_role)); diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index d324a76438..67e507858f 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -119,7 +119,7 @@ static int32_t vnodeProcessAlterReplicaReq(SVnode *pVnode, SRpcMsg *pMsg) { } void vnodeProposeMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) { - SVnode *pVnode = pInfo->ahandle; + SVnode * pVnode = pInfo->ahandle; int32_t vgId = pVnode->config.vgId; int32_t code = 0; SRpcMsg *pMsg = NULL; @@ -178,7 +178,7 @@ void vnodeProposeMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) { for (int32_t i = 0; i < newEpSet.numOfEps; ++i) { vGTrace("vgId:%d, msg:%p redirect:%d ep:%s:%u", vgId, pMsg, i, newEpSet.eps[i].fqdn, newEpSet.eps[i].port); } - + pMsg->info.hasEpSet = 1; SRpcMsg rsp = {.code = TSDB_CODE_RPC_REDIRECT, .info = pMsg->info}; tmsgSendRedirectRsp(&rsp, &newEpSet); } else { @@ -199,7 +199,7 @@ void vnodeProposeMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) { } void vnodeApplyMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) { - SVnode *pVnode = pInfo->ahandle; + SVnode * pVnode = pInfo->ahandle; int32_t vgId = pVnode->config.vgId; int32_t code = 0; SRpcMsg *pMsg = NULL; @@ -240,7 +240,7 @@ int32_t vnodeProcessSyncReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) { STraceId *trace = &pMsg->info.traceId; do { - char *syncNodeStr = sync2SimpleStr(pVnode->sync); + char * syncNodeStr = sync2SimpleStr(pVnode->sync); static int64_t vndTick = 0; if (++vndTick % 10 == 1) { vGTrace("vgId:%d, sync trace msg:%s, %s", syncGetVgId(pVnode->sync), TMSG_INFO(pMsg->msgType), syncNodeStr); @@ -375,7 +375,7 @@ static void vnodeSyncReconfig(struct SSyncFSM *pFsm, const SRpcMsg *pMsg, SReCon } static void vnodeSyncCommitMsg(SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta cbMeta) { - SVnode *pVnode = pFsm->data; + SVnode * pVnode = pFsm->data; SSnapshot snapshot = {0}; SyncIndex beginIndex = SYNC_INDEX_INVALID; char logBuf[256] = {0}; diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 5de907f8cb..b48939f9f9 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -1014,19 +1014,28 @@ void cliCompareAndSwap(int8_t* val, int8_t exp, int8_t newVal) { } bool cliTryToExtractEpSet(STransMsg* pResp, SEpSet* dst) { - if (pResp == NULL || pResp->info.hasEpSet == 0) { + if ((pResp == NULL || pResp->info.hasEpSet == 0)) { + return false; + } + // rebuild resp msg + SEpSet epset; + if (tDeserializeSEpSet(pResp->pCont, pResp->contLen, &epset) < 0) { return false; } - tDeserializeSEpSet(pResp->pCont, pResp->contLen, dst); int32_t tlen = tSerializeSEpSet(NULL, 0, dst); - int32_t bufLen = pResp->contLen - tlen; - char* buf = rpcMallocCont(bufLen); - - memcpy(buf, (char*)pResp->pCont + tlen, bufLen); + char* buf = NULL; + int32_t len = pResp->contLen - tlen; + if (len != 0) { + buf = rpcMallocCont(len); + memcpy(buf, (char*)pResp->pCont + tlen, len); + } + rpcFreeCont(pResp->pCont); pResp->pCont = buf; - pResp->contLen = bufLen; + pResp->contLen = len; + + *dst = epset; return true; } int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { From 2caa9fdf7dc5ed1b5b364a0303c5d8342fa0844a Mon Sep 17 00:00:00 2001 From: plum-lihui Date: Thu, 30 Jun 2022 10:53:15 +0800 Subject: [PATCH 19/51] test: add test case --- tests/system-test/7-tmq/tmqCommon.py | 16 +++++++++++++ tests/test/c/tmqSim.c | 34 ++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/tests/system-test/7-tmq/tmqCommon.py b/tests/system-test/7-tmq/tmqCommon.py index 9254f57c40..b545340153 100644 --- a/tests/system-test/7-tmq/tmqCommon.py +++ b/tests/system-test/7-tmq/tmqCommon.py @@ -76,6 +76,22 @@ class TMQCom: resultList.append(tdSql.getData(i , 3)) return resultList + + def selectConsumeMsgResult(self,expectRows,cdbName='cdb'): + resultList=[] + while 1: + tdSql.query("select * from %s.consumeresult"%cdbName) + #tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3)) + if tdSql.getRows() == expectRows: + break + else: + time.sleep(5) + + for i in range(expectRows): + tdLog.info ("consume id: %d, consume msgs: %d, consume rows: %d"%(tdSql.getData(i , 1), tdSql.getData(i , 2), tdSql.getData(i , 3))) + resultList.append(tdSql.getData(i , 2)) + + return resultList def startTmqSimProcess(self,pollDelay,dbName,showMsg=1,showRow=1,cdbName='cdb',valgrind=0,alias=0): buildPath = tdCom.getBuildPath() diff --git a/tests/test/c/tmqSim.c b/tests/test/c/tmqSim.c index 81fa72d15a..d21b1faba4 100644 --- a/tests/test/c/tmqSim.c +++ b/tests/test/c/tmqSim.c @@ -635,6 +635,9 @@ void loop_consume(SThreadInfo* pInfo) { } } + uint64_t lastPrintTime = taosGetTimestampMs(); + uint64_t startTs = taosGetTimestampMs(); + int32_t consumeDelay = g_stConfInfo.consumeDelay == -1 ? -1 : (g_stConfInfo.consumeDelay * 1000); while (running) { TAOS_RES* tmqMsg = tmq_consumer_poll(pInfo->tmq, consumeDelay); @@ -646,7 +649,15 @@ void loop_consume(SThreadInfo* pInfo) { taos_free_result(tmqMsg); totalMsgs++; - + + int64_t currentPrintTime = taosGetTimestampMs(); + if (currentPrintTime - lastPrintTime > 10 * 1000) { + taosFprintfFile(g_fp, + "consumer id %d has currently poll total msgs: %" PRId64 "\n", + pInfo->consumerId, totalMsgs); + lastPrintTime = currentPrintTime; + } + if (0 == once_flag) { once_flag = 1; notifyMainScript(pInfo, NOTIFY_CMD_START_CONSUM); @@ -663,7 +674,7 @@ void loop_consume(SThreadInfo* pInfo) { break; } } - + if (0 == running) { taosFprintfFile(g_fp, "receive stop signal and not continue consume\n"); } @@ -676,8 +687,6 @@ void loop_consume(SThreadInfo* pInfo) { } void* consumeThreadFunc(void* param) { - int32_t totalMsgs = 0; - SThreadInfo* pInfo = (SThreadInfo*)param; pInfo->taos = taos_connect(NULL, "root", "taosdata", NULL, 0); @@ -859,12 +868,27 @@ int main(int32_t argc, char* argv[]) { (void*)(&(g_stConfInfo.stThreads[i]))); } + int64_t start = taosGetTimestampUs(); + for (int32_t i = 0; i < g_stConfInfo.numOfThread; i++) { taosThreadJoin(g_stConfInfo.stThreads[i].thread, NULL); taosThreadClear(&g_stConfInfo.stThreads[i].thread); } - // printf("consumer: %d, cosumer1: %d\n", totalMsgs, pInfo->consumeMsgCnt); + int64_t end = taosGetTimestampUs(); + + int64_t totalMsgs = 0; + for (int32_t i = 0; i < g_stConfInfo.numOfThread; i++) { + totalMsgs += g_stConfInfo.stThreads[i].consumeMsgCnt; + } + + int64_t t = end - start; + if (0 == t) t = 1; + + double tInMs = (double)t / 1000000.0; + taosFprintfFile(g_fp, + "Spent %.4f seconds to poll msgs: %" PRIu64 " with %d thread(s), throughput: %.2f msgs/second\n\n", + tInMs, totalMsgs, g_stConfInfo.numOfThread, (double)(totalMsgs / tInMs)); taosFprintfFile(g_fp, "==== close tmqlog ====\n"); taosCloseFile(&g_fp); From 2ad65998107b88498917bcb902500e9912c4efef Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 30 Jun 2022 11:04:24 +0800 Subject: [PATCH 20/51] feat: partition by distributed split --- source/libs/planner/src/planLogicCreater.c | 10 +++------- source/libs/planner/src/planPhysiCreater.c | 2 +- source/libs/planner/src/planSpliter.c | 19 ++++++++++++++++--- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 05256e2696..d170482c48 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -154,16 +154,12 @@ static int32_t createSelectRootLogicNode(SLogicPlanContext* pCxt, SSelectStmt* p return createRootLogicNode(pCxt, pSelect, pSelect->precision, (FCreateLogicNode)func, pRoot); } -static EScanType getScanType(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SNodeList* pScanPseudoCols, - SNodeList* pScanCols, int8_t tableType) { +static EScanType getScanType(SLogicPlanContext* pCxt, SNodeList* pScanPseudoCols, SNodeList* pScanCols, + int8_t tableType) { if (pCxt->pPlanCxt->topicQuery || pCxt->pPlanCxt->streamQuery) { return SCAN_TYPE_STREAM; } - // if (pSelect->hasLastRowFunc) { - // return SCAN_TYPE_LAST_ROW; - // } - if (NULL == pScanCols) { // select count(*) from t return NULL == pScanPseudoCols @@ -279,7 +275,7 @@ static int32_t createScanLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect code = rewriteExprsForSelect(pScan->pScanPseudoCols, pSelect, SQL_CLAUSE_FROM); } - pScan->scanType = getScanType(pCxt, pSelect, pScan->pScanPseudoCols, pScan->pScanCols, pScan->tableType); + pScan->scanType = getScanType(pCxt, pScan->pScanPseudoCols, pScan->pScanCols, pScan->tableType); if (TSDB_CODE_SUCCESS == code) { code = addPrimaryKeyCol(pScan->tableId, &pScan->pScanCols); diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 46747af3a9..0f19db26a5 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1344,7 +1344,7 @@ static int32_t createMergePhysiNode(SPhysiPlanContext* pCxt, SMergeLogicNode* pM } } - if (TSDB_CODE_SUCCESS == code) { + if (TSDB_CODE_SUCCESS == code && NULL != pMergeLogicNode->pMergeKeys) { code = setListSlotId(pCxt, pMerge->node.pOutputDataBlockDesc->dataBlockId, -1, pMergeLogicNode->pMergeKeys, &pMerge->pMergeKeys); } diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index 2bc226804f..60c04c2c30 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -197,8 +197,8 @@ static bool stbSplNeedSplit(bool streamQuery, SLogicNode* pNode) { return stbSplIsMultiTbScan(streamQuery, (SScanLogicNode*)pNode); case QUERY_NODE_LOGIC_PLAN_JOIN: return !(((SJoinLogicNode*)pNode)->isSingleTableJoin); - // case QUERY_NODE_LOGIC_PLAN_PARTITION: - // return stbSplHasMultiTbScan(streamQuery, pNode); + case QUERY_NODE_LOGIC_PLAN_PARTITION: + return stbSplHasMultiTbScan(streamQuery, pNode); case QUERY_NODE_LOGIC_PLAN_AGG: return !stbSplHasGatherExecFunc(((SAggLogicNode*)pNode)->pAggFuncs) && stbSplHasMultiTbScan(streamQuery, pNode); case QUERY_NODE_LOGIC_PLAN_WINDOW: @@ -433,7 +433,7 @@ static int32_t stbSplSplitIntervalForBatch(SSplitContext* pCxt, SStableSplitInfo SNodeList* pMergeKeys = NULL; code = stbSplCreateMergeKeysByPrimaryKey(((SWindowLogicNode*)pInfo->pSplitNode)->pTspk, &pMergeKeys); if (TSDB_CODE_SUCCESS == code) { - code = stbSplCreateMergeNode(pCxt, NULL, pInfo->pSplitNode, pMergeKeys, pPartWindow, false); + code = stbSplCreateMergeNode(pCxt, NULL, pInfo->pSplitNode, pMergeKeys, pPartWindow, true); } if (TSDB_CODE_SUCCESS != code) { nodesDestroyList(pMergeKeys); @@ -889,6 +889,16 @@ static int32_t stbSplSplitJoinNode(SSplitContext* pCxt, SStableSplitInfo* pInfo) return code; } +static int32_t stbSplSplitPartitionNode(SSplitContext* pCxt, SStableSplitInfo* pInfo) { + int32_t code = stbSplCreateMergeNode(pCxt, pInfo->pSubplan, pInfo->pSplitNode, NULL, pInfo->pSplitNode, true); + if (TSDB_CODE_SUCCESS == code) { + code = nodesListMakeStrictAppend(&pInfo->pSubplan->pChildren, + (SNode*)splCreateScanSubplan(pCxt, pInfo->pSplitNode, SPLIT_FLAG_STABLE_SPLIT)); + } + ++(pCxt->groupId); + return code; +} + static int32_t stableSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan) { if (pCxt->pPlanCxt->rSmaQuery) { return TSDB_CODE_SUCCESS; @@ -907,6 +917,9 @@ static int32_t stableSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan) { case QUERY_NODE_LOGIC_PLAN_JOIN: code = stbSplSplitJoinNode(pCxt, &info); break; + case QUERY_NODE_LOGIC_PLAN_PARTITION: + code = stbSplSplitPartitionNode(pCxt, &info); + break; case QUERY_NODE_LOGIC_PLAN_AGG: code = stbSplSplitAggNode(pCxt, &info); break; From a535df75902d2fb9326012a5e4c7376ac45c86de Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 30 Jun 2022 11:04:49 +0800 Subject: [PATCH 21/51] feat: query redirect --- include/common/tmsg.h | 5 ++ include/libs/nodes/plannodes.h | 1 + source/common/src/tmsg.c | 2 + source/libs/executor/src/executorimpl.c | 35 ++++---- source/libs/nodes/src/nodesCloneFuncs.c | 1 + source/libs/nodes/src/nodesCodeFuncs.c | 6 ++ source/libs/qworker/inc/qwInt.h | 27 +++--- source/libs/qworker/src/qwDbg.c | 59 ++++++++++++- source/libs/qworker/src/qwMsg.c | 46 ++++++++++ source/libs/qworker/src/qwUtil.c | 28 +++--- source/libs/qworker/src/qworker.c | 35 +++++++- source/libs/scheduler/inc/schedulerInt.h | 27 +++--- source/libs/scheduler/src/schJob.c | 106 +++++++++++++---------- source/libs/scheduler/src/schRemote.c | 15 ++-- 14 files changed, 282 insertions(+), 111 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index c5b0b89311..2876105748 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1494,6 +1494,7 @@ typedef struct SSubQueryMsg { uint64_t queryId; uint64_t taskId; int64_t refId; + int32_t execId; int8_t taskType; int8_t explain; uint32_t sqlLen; // the query sql, @@ -1513,6 +1514,7 @@ typedef struct { uint64_t sId; uint64_t queryId; uint64_t taskId; + int32_t execId; } SQueryContinueReq; typedef struct { @@ -1534,6 +1536,7 @@ typedef struct { uint64_t sId; uint64_t queryId; uint64_t taskId; + int32_t execId; } SResFetchReq; typedef struct { @@ -1545,6 +1548,7 @@ typedef struct { uint64_t queryId; uint64_t taskId; int64_t refId; + int32_t execId; int8_t status; } STaskStatus; @@ -1602,6 +1606,7 @@ typedef struct { uint64_t queryId; uint64_t taskId; int64_t refId; + int32_t execId; } STaskDropReq; typedef struct { diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 4671c8b81e..8031b16d93 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -346,6 +346,7 @@ typedef struct SDownstreamSourceNode { SQueryNodeAddr addr; uint64_t taskId; uint64_t schedId; + int32_t execId; } SDownstreamSourceNode; typedef struct SExchangePhysiNode { diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index e9b5c67d76..23b33674e4 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -4312,6 +4312,7 @@ int32_t tSerializeSSchedulerHbRsp(void *buf, int32_t bufLen, SSchedulerHbRsp *pR if (tEncodeU64(&encoder, status->queryId) < 0) return -1; if (tEncodeU64(&encoder, status->taskId) < 0) return -1; if (tEncodeI64(&encoder, status->refId) < 0) return -1; + if (tEncodeI32(&encoder, status->execId) < 0) return -1; if (tEncodeI8(&encoder, status->status) < 0) return -1; } } else { @@ -4342,6 +4343,7 @@ int32_t tDeserializeSSchedulerHbRsp(void *buf, int32_t bufLen, SSchedulerHbRsp * if (tDecodeU64(&decoder, &status.queryId) < 0) return -1; if (tDecodeU64(&decoder, &status.taskId) < 0) return -1; if (tDecodeI64(&decoder, &status.refId) < 0) return -1; + if (tDecodeI32(&decoder, &status.execId) < 0) return -1; if (tDecodeI8(&decoder, &status.status) < 0) return -1; taosArrayPush(pRsp->taskStatus, &status); } diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index c6f1096bfe..535272bc42 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -2010,13 +2010,14 @@ static int32_t doSendFetchDataRequest(SExchangeInfo* pExchangeInfo, SExecTaskInf ASSERT(pDataInfo->status == EX_SOURCE_DATA_NOT_READY); - qDebug("%s build fetch msg and send to vgId:%d, ep:%s, taskId:0x%" PRIx64 ", %d/%" PRIzu, GET_TASKID(pTaskInfo), - pSource->addr.nodeId, pSource->addr.epSet.eps[0].fqdn, pSource->taskId, sourceIndex, totalSources); + qDebug("%s build fetch msg and send to vgId:%d, ep:%s, taskId:0x%" PRIx64 ", execId:%d, %d/%" PRIzu, GET_TASKID(pTaskInfo), + pSource->addr.nodeId, pSource->addr.epSet.eps[0].fqdn, pSource->taskId, pSource->execId, sourceIndex, totalSources); pMsg->header.vgId = htonl(pSource->addr.nodeId); pMsg->sId = htobe64(pSource->schedId); pMsg->taskId = htobe64(pSource->taskId); pMsg->queryId = htobe64(pTaskInfo->id.queryId); + pMsg->execId = htonl(pSource->execId); // send the fetch remote task result reques SMsgSendInfo* pMsgSendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo)); @@ -2145,9 +2146,9 @@ static SSDataBlock* concurrentlyLoadRemoteDataImpl(SOperatorInfo* pOperator, SEx SSDataBlock* pRes = pExchangeInfo->pResult; SLoadRemoteDataInfo* pLoadInfo = &pExchangeInfo->loadInfo; if (pRsp->numOfRows == 0) { - qDebug("%s vgId:%d, taskId:0x%" PRIx64 " index:%d completed, rowsOfSource:%" PRIu64 ", totalRows:%" PRIu64 + qDebug("%s vgId:%d, taskId:0x%" PRIx64 " execId:%d index:%d completed, rowsOfSource:%" PRIu64 ", totalRows:%" PRIu64 ", completed:%d try next %d/%" PRIzu, - GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, i, pDataInfo->totalRows, + GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pSource->execId, i, pDataInfo->totalRows, pExchangeInfo->loadInfo.totalRows, completed + 1, i + 1, totalSources); pDataInfo->status = EX_SOURCE_DATA_EXHAUSTED; completed += 1; @@ -2165,17 +2166,17 @@ static SSDataBlock* concurrentlyLoadRemoteDataImpl(SOperatorInfo* pOperator, SEx } if (pRsp->completed == 1) { - qDebug("%s fetch msg rsp from vgId:%d, taskId:0x%" PRIx64 + qDebug("%s fetch msg rsp from vgId:%d, taskId:0x%" PRIx64 " execId:%d" " index:%d completed, numOfRows:%d, rowsOfSource:%" PRIu64 ", totalRows:%" PRIu64 ", totalBytes:%" PRIu64 ", completed:%d try next %d/%" PRIzu, - GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, i, pRes->info.rows, pDataInfo->totalRows, + GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pSource->execId, i, pRes->info.rows, pDataInfo->totalRows, pLoadInfo->totalRows, pLoadInfo->totalSize, completed + 1, i + 1, totalSources); completed += 1; pDataInfo->status = EX_SOURCE_DATA_EXHAUSTED; } else { - qDebug("%s fetch msg rsp from vgId:%d, taskId:0x%" PRIx64 " numOfRows:%d, totalRows:%" PRIu64 + qDebug("%s fetch msg rsp from vgId:%d, taskId:0x%" PRIx64 " execId:%d numOfRows:%d, totalRows:%" PRIu64 ", totalBytes:%" PRIu64, - GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pRes->info.rows, pLoadInfo->totalRows, + GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pSource->execId, pRes->info.rows, pLoadInfo->totalRows, pLoadInfo->totalSize); } @@ -2249,8 +2250,8 @@ static SSDataBlock* seqLoadRemoteData(SOperatorInfo* pOperator) { SDownstreamSourceNode* pSource = taosArrayGet(pExchangeInfo->pSources, pExchangeInfo->current); if (pDataInfo->code != TSDB_CODE_SUCCESS) { - qError("%s vgId:%d, taskID:0x%" PRIx64 " error happens, code:%s", GET_TASKID(pTaskInfo), pSource->addr.nodeId, - pSource->taskId, tstrerror(pDataInfo->code)); + qError("%s vgId:%d, taskID:0x%" PRIx64 " execId:%d error happens, code:%s", GET_TASKID(pTaskInfo), pSource->addr.nodeId, + pSource->taskId, pSource->execId, tstrerror(pDataInfo->code)); pOperator->pTaskInfo->code = pDataInfo->code; return NULL; } @@ -2258,9 +2259,9 @@ static SSDataBlock* seqLoadRemoteData(SOperatorInfo* pOperator) { SRetrieveTableRsp* pRsp = pDataInfo->pRsp; SLoadRemoteDataInfo* pLoadInfo = &pExchangeInfo->loadInfo; if (pRsp->numOfRows == 0) { - qDebug("%s vgId:%d, taskID:0x%" PRIx64 " %d of total completed, rowsOfSource:%" PRIu64 ", totalRows:%" PRIu64 + qDebug("%s vgId:%d, taskID:0x%" PRIx64 " execId:%d %d of total completed, rowsOfSource:%" PRIu64 ", totalRows:%" PRIu64 " try next", - GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pExchangeInfo->current + 1, + GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pSource->execId, pExchangeInfo->current + 1, pDataInfo->totalRows, pLoadInfo->totalRows); pDataInfo->status = EX_SOURCE_DATA_EXHAUSTED; @@ -2276,17 +2277,17 @@ static SSDataBlock* seqLoadRemoteData(SOperatorInfo* pOperator) { pTableRsp->compLen, pTableRsp->numOfCols, startTs, &pDataInfo->totalRows, NULL); if (pRsp->completed == 1) { - qDebug("%s fetch msg rsp from vgId:%d, taskId:0x%" PRIx64 " numOfRows:%d, rowsOfSource:%" PRIu64 + qDebug("%s fetch msg rsp from vgId:%d, taskId:0x%" PRIx64 " execId:%d numOfRows:%d, rowsOfSource:%" PRIu64 ", totalRows:%" PRIu64 ", totalBytes:%" PRIu64 " try next %d/%" PRIzu, - GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pRes->info.rows, pDataInfo->totalRows, + GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pSource->execId, pRes->info.rows, pDataInfo->totalRows, pLoadInfo->totalRows, pLoadInfo->totalSize, pExchangeInfo->current + 1, totalSources); pDataInfo->status = EX_SOURCE_DATA_EXHAUSTED; pExchangeInfo->current += 1; } else { - qDebug("%s fetch msg rsp from vgId:%d, taskId:0x%" PRIx64 " numOfRows:%d, totalRows:%" PRIu64 + qDebug("%s fetch msg rsp from vgId:%d, taskId:0x%" PRIx64 " execId:%d numOfRows:%d, totalRows:%" PRIu64 ", totalBytes:%" PRIu64, - GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pRes->info.rows, pLoadInfo->totalRows, + GET_TASKID(pTaskInfo), pSource->addr.nodeId, pSource->taskId, pSource->execId, pRes->info.rows, pLoadInfo->totalRows, pLoadInfo->totalSize); } @@ -2378,7 +2379,7 @@ static int32_t initExchangeOperator(SExchangePhysiNode* pExNode, SExchangeInfo* } for (int32_t i = 0; i < numOfSources; ++i) { - SNodeListNode* pNode = (SNodeListNode*)nodesListGetNode((SNodeList*)pExNode->pSrcEndPoints, i); + SDownstreamSourceNode* pNode = (SDownstreamSourceNode*)nodesListGetNode((SNodeList*)pExNode->pSrcEndPoints, i); taosArrayPush(pInfo->pSources, pNode); } diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index b372bf75fc..97b8baec58 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -582,6 +582,7 @@ static int32_t downstreamSourceCopy(const SDownstreamSourceNode* pSrc, SDownstre COPY_OBJECT_FIELD(addr, sizeof(SQueryNodeAddr)); COPY_SCALAR_FIELD(taskId); COPY_SCALAR_FIELD(schedId); + COPY_SCALAR_FIELD(execId); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index df7429bd88..4375a7b04c 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -3441,6 +3441,9 @@ static int32_t downstreamSourceNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkDownstreamSourceSchedId, pNode->schedId); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkDownstreamSourceSchedId, pNode->execId); + } return code; } @@ -3455,6 +3458,9 @@ static int32_t jsonToDownstreamSourceNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = tjsonGetUBigIntValue(pJson, jkDownstreamSourceSchedId, &pNode->schedId); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkDownstreamSourceSchedId, &pNode->execId); + } return code; } diff --git a/source/libs/qworker/inc/qwInt.h b/source/libs/qworker/inc/qwInt.h index 4edd7a8a6e..4fa2615470 100644 --- a/source/libs/qworker/inc/qwInt.h +++ b/source/libs/qworker/inc/qwInt.h @@ -75,6 +75,7 @@ typedef struct SQWDebug { bool lockEnable; bool statusEnable; bool dumpEnable; + bool tmp; } SQWDebug; extern SQWDebug gQWDebug; @@ -122,6 +123,7 @@ typedef struct SQWTaskCtx { int8_t taskType; int8_t explain; int32_t queryType; + int32_t execId; bool queryFetched; bool queryEnd; @@ -200,8 +202,8 @@ typedef struct SQWorkerMgmt { int32_t paramIdx; } SQWorkerMgmt; -#define QW_FPARAMS_DEF SQWorker *mgmt, uint64_t sId, uint64_t qId, uint64_t tId, int64_t rId -#define QW_IDS() sId, qId, tId, rId +#define QW_FPARAMS_DEF SQWorker *mgmt, uint64_t sId, uint64_t qId, uint64_t tId, int64_t rId, int32_t eId +#define QW_IDS() sId, qId, tId, rId, eId #define QW_FPARAMS() mgmt, QW_IDS() #define QW_STAT_INC(_item, _n) atomic_add_fetch_64(&(_item), _n) @@ -226,15 +228,18 @@ typedef struct SQWorkerMgmt { #define QW_TASK_READY(status) \ (status == JOB_TASK_STATUS_SUCCEED || status == JOB_TASK_STATUS_FAILED || status == JOB_TASK_STATUS_CANCELLED || \ status == JOB_TASK_STATUS_PARTIAL_SUCCEED) -#define QW_SET_QTID(id, qId, tId) \ - do { \ - *(uint64_t *)(id) = (qId); \ - *(uint64_t *)((char *)(id) + sizeof(qId)) = (tId); \ +#define QW_SET_QTID(id, qId, tId, eId) \ + do { \ + *(uint64_t *)(id) = (qId); \ + *(uint64_t *)((char *)(id) + sizeof(qId)) = (tId); \ + *(int32_t *)((char *)(id) + sizeof(qId) + sizeof(tId)) = (eId); \ } while (0) -#define QW_GET_QTID(id, qId, tId) \ - do { \ - (qId) = *(uint64_t *)(id); \ - (tId) = *(uint64_t *)((char *)(id) + sizeof(qId)); \ + +#define QW_GET_QTID(id, qId, tId, eId) \ + do { \ + (qId) = *(uint64_t *)(id); \ + (tId) = *(uint64_t *)((char *)(id) + sizeof(qId)); \ + (eId) = *(int32_t *)((char *)(id) + sizeof(qId) + sizeof(tId)); \ } while (0) #define QW_ERR_RET(c) \ @@ -365,6 +370,8 @@ void qwFreeTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx *ctx); void qwDbgDumpMgmtInfo(SQWorker *mgmt); int32_t qwDbgValidateStatus(QW_FPARAMS_DEF, int8_t oriStatus, int8_t newStatus, bool *ignore); +int32_t qwDbgBuildAndSendRedirectRsp(int32_t rspType, SRpcHandleInfo *pConn, int32_t code, SEpSet *pEpSet); +int32_t qwAddTaskCtx(QW_FPARAMS_DEF); #ifdef __cplusplus diff --git a/source/libs/qworker/src/qwDbg.c b/source/libs/qworker/src/qwDbg.c index add9700a3a..0fa01a304c 100644 --- a/source/libs/qworker/src/qwDbg.c +++ b/source/libs/qworker/src/qwDbg.c @@ -9,7 +9,7 @@ #include "tmsg.h" #include "tname.h" -SQWDebug gQWDebug = {.statusEnable = true, .dumpEnable = false}; +SQWDebug gQWDebug = {.statusEnable = true, .dumpEnable = false, .tmp = true}; int32_t qwDbgValidateStatus(QW_FPARAMS_DEF, int8_t oriStatus, int8_t newStatus, bool *ignore) { if (!gQWDebug.statusEnable) { @@ -121,3 +121,60 @@ void qwDbgDumpMgmtInfo(SQWorker *mgmt) { } +int32_t qwDbgBuildAndSendRedirectRsp(int32_t rspType, SRpcHandleInfo *pConn, int32_t code, SEpSet *pEpSet) { + int32_t contLen = 0; + char* rsp = NULL; + + if (pEpSet) { + contLen = tSerializeSEpSet(NULL, 0, pEpSet); + rsp = rpcMallocCont(contLen); + tSerializeSEpSet(rsp, contLen, pEpSet); + } + + SRpcMsg rpcRsp = { + .msgType = rspType, + .pCont = rsp, + .contLen = contLen, + .code = code, + .info = *pConn, + }; + + tmsgSendRsp(&rpcRsp); + + qDebug("response %s msg, code: %s", TMSG_INFO(rspType), tstrerror(code)); + + return TSDB_CODE_SUCCESS; +} + + +int32_t qwDbgEnableDebug(char *option) { + if (0 == strcasecmp(option, "lock")) { + gQWDebug.lockEnable = true; + qDebug("qw lock debug enabled"); + return TSDB_CODE_SUCCESS; + } + + if (0 == strcasecmp(option, "status")) { + gQWDebug.statusEnable = true; + qDebug("qw status debug enabled"); + return TSDB_CODE_SUCCESS; + } + + if (0 == strcasecmp(option, "dump")) { + gQWDebug.dumpEnable = true; + qDebug("qw dump debug enabled"); + return TSDB_CODE_SUCCESS; + } + + if (0 == strcasecmp(option, "tmp")) { + gQWDebug.tmp = true; + qDebug("qw tmp debug enabled"); + return TSDB_CODE_SUCCESS; + } + + qError("invalid qw debug option:%s", option); + + return TSDB_CODE_APP_ERROR; +} + + diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c index 30772ff1ac..cc642caa70 100644 --- a/source/libs/qworker/src/qwMsg.c +++ b/source/libs/qworker/src/qwMsg.c @@ -156,6 +156,41 @@ int32_t qwBuildAndSendDropRsp(SRpcHandleInfo *pConn, int32_t code) { return TSDB_CODE_SUCCESS; } +int32_t qwBuildAndSendDropMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) { + STaskDropReq *req = (STaskDropReq *)rpcMallocCont(sizeof(STaskDropReq)); + if (NULL == req) { + QW_SCH_TASK_ELOG("rpcMallocCont %d failed", (int32_t)sizeof(STaskDropReq)); + QW_ERR_RET(TSDB_CODE_QRY_OUT_OF_MEMORY); + } + + req->header.vgId = mgmt->nodeId; + req->sId = sId; + req->queryId = qId; + req->taskId = tId; + req->refId = rId; + req->execId = eId; + + SRpcMsg pNewMsg = { + .msgType = TDMT_SCH_DROP_TASK, + .pCont = req, + .contLen = sizeof(STaskDropReq), + .code = 0, + .info = *pConn, + }; + + int32_t code = tmsgPutToQueue(&mgmt->msgCb, FETCH_QUEUE, &pNewMsg); + if (TSDB_CODE_SUCCESS != code) { + QW_SCH_TASK_ELOG("put drop task msg to queue failed, vgId:%d, code:%s", mgmt->nodeId, tstrerror(code)); + rpcFreeCont(req); + QW_ERR_RET(code); + } + + QW_SCH_TASK_DLOG("drop task msg put to queue, vgId:%d", mgmt->nodeId); + + return TSDB_CODE_SUCCESS; +} + + int32_t qwBuildAndSendCQueryMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) { SQueryContinueReq *req = (SQueryContinueReq *)rpcMallocCont(sizeof(SQueryContinueReq)); if (NULL == req) { @@ -167,6 +202,7 @@ int32_t qwBuildAndSendCQueryMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) { req->sId = sId; req->queryId = qId; req->taskId = tId; + req->execId = eId; SRpcMsg pNewMsg = { .msgType = TDMT_SCH_QUERY_CONTINUE, @@ -266,6 +302,7 @@ int32_t qWorkerPreprocessQueryMsg(void *qWorkerMgmt, SRpcMsg *pMsg) { msg->queryId = be64toh(msg->queryId); msg->taskId = be64toh(msg->taskId); msg->refId = be64toh(msg->refId); + msg->execId = ntohl(msg->execId); msg->phyLen = ntohl(msg->phyLen); msg->sqlLen = ntohl(msg->sqlLen); @@ -273,6 +310,7 @@ int32_t qWorkerPreprocessQueryMsg(void *qWorkerMgmt, SRpcMsg *pMsg) { uint64_t qId = msg->queryId; uint64_t tId = msg->taskId; int64_t rId = msg->refId; + int32_t eId = msg->execId; SQWMsg qwMsg = {.msg = msg->msg + msg->sqlLen, .msgLen = msg->phyLen, .connInfo = pMsg->info}; @@ -295,6 +333,7 @@ int32_t qWorkerAbortPreprocessQueryMsg(void *qWorkerMgmt, SRpcMsg *pMsg) { uint64_t qId = msg->queryId; uint64_t tId = msg->taskId; int64_t rId = msg->refId; + int32_t eId = msg->execId; QW_SCH_TASK_DLOG("Abort prerocessQuery start, handle:%p", pMsg->info.handle); qwAbortPrerocessQuery(QW_FPARAMS()); @@ -324,6 +363,7 @@ int32_t qWorkerProcessQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int uint64_t qId = msg->queryId; uint64_t tId = msg->taskId; int64_t rId = msg->refId; + int32_t eId = msg->execId; SQWMsg qwMsg = {.node = node, .msg = msg->msg + msg->sqlLen, .msgLen = msg->phyLen, .connInfo = pMsg->info, .msgType = pMsg->msgType}; char * sql = strndup(msg->msg, msg->sqlLen); @@ -356,6 +396,7 @@ int32_t qWorkerProcessCQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, in uint64_t qId = msg->queryId; uint64_t tId = msg->taskId; int64_t rId = 0; + int32_t eId = msg->execId; SQWMsg qwMsg = {.node = node, .msg = NULL, .msgLen = 0, .connInfo = pMsg->info}; @@ -387,11 +428,13 @@ int32_t qWorkerProcessFetchMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int msg->sId = be64toh(msg->sId); msg->queryId = be64toh(msg->queryId); msg->taskId = be64toh(msg->taskId); + msg->execId = ntohl(msg->execId); uint64_t sId = msg->sId; uint64_t qId = msg->queryId; uint64_t tId = msg->taskId; int64_t rId = 0; + int32_t eId = msg->execId; SQWMsg qwMsg = {.node = node, .msg = NULL, .msgLen = 0, .connInfo = pMsg->info}; @@ -476,11 +519,13 @@ int32_t qWorkerProcessDropMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int6 msg->queryId = be64toh(msg->queryId); msg->taskId = be64toh(msg->taskId); msg->refId = be64toh(msg->refId); + msg->execId = ntohl(msg->execId); uint64_t sId = msg->sId; uint64_t qId = msg->queryId; uint64_t tId = msg->taskId; int64_t rId = msg->refId; + int32_t eId = msg->execId; SQWMsg qwMsg = {.node = node, .msg = NULL, .msgLen = 0, .code = pMsg->code, .connInfo = pMsg->info}; @@ -553,6 +598,7 @@ int32_t qWorkerProcessDeleteMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, SR uint64_t qId = req.queryId; uint64_t tId = req.taskId; int64_t rId = 0; + int32_t eId = 0; SQWMsg qwMsg = {.node = node, .msg = req.msg, .msgLen = req.phyLen, .connInfo = pMsg->info}; QW_SCH_TASK_DLOG("processDelete start, node:%p, handle:%p, sql:%s", node, pMsg->info.handle, req.sql); diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index 0759cf360a..1fb0a34314 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -135,8 +135,8 @@ int32_t qwAcquireScheduler(SQWorker *mgmt, uint64_t sId, int32_t rwType, SQWSchS void qwReleaseScheduler(int32_t rwType, SQWorker *mgmt) { QW_UNLOCK(rwType, &mgmt->schLock); } int32_t qwAcquireTaskStatus(QW_FPARAMS_DEF, int32_t rwType, SQWSchStatus *sch, SQWTaskStatus **task) { - char id[sizeof(qId) + sizeof(tId)] = {0}; - QW_SET_QTID(id, qId, tId); + char id[sizeof(qId) + sizeof(tId) + sizeof(eId)] = {0}; + QW_SET_QTID(id, qId, tId, eId); QW_LOCK(rwType, &sch->tasksLock); *task = taosHashGet(sch->tasksHash, id, sizeof(id)); @@ -151,8 +151,8 @@ int32_t qwAcquireTaskStatus(QW_FPARAMS_DEF, int32_t rwType, SQWSchStatus *sch, S int32_t qwAddTaskStatusImpl(QW_FPARAMS_DEF, SQWSchStatus *sch, int32_t rwType, int32_t status, SQWTaskStatus **task) { int32_t code = 0; - char id[sizeof(qId) + sizeof(tId)] = {0}; - QW_SET_QTID(id, qId, tId); + char id[sizeof(qId) + sizeof(tId) + sizeof(eId)] = {0}; + QW_SET_QTID(id, qId, tId, eId); SQWTaskStatus ntask = {0}; ntask.status = status; @@ -207,8 +207,8 @@ int32_t qwAddAcquireTaskStatus(QW_FPARAMS_DEF, int32_t rwType, SQWSchStatus *sch void qwReleaseTaskStatus(int32_t rwType, SQWSchStatus *sch) { QW_UNLOCK(rwType, &sch->tasksLock); } int32_t qwAcquireTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx **ctx) { - char id[sizeof(qId) + sizeof(tId)] = {0}; - QW_SET_QTID(id, qId, tId); + char id[sizeof(qId) + sizeof(tId) + sizeof(eId)] = {0}; + QW_SET_QTID(id, qId, tId, eId); *ctx = taosHashAcquire(mgmt->ctxHash, id, sizeof(id)); if (NULL == (*ctx)) { @@ -220,8 +220,8 @@ int32_t qwAcquireTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx **ctx) { } int32_t qwGetTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx **ctx) { - char id[sizeof(qId) + sizeof(tId)] = {0}; - QW_SET_QTID(id, qId, tId); + char id[sizeof(qId) + sizeof(tId) + sizeof(eId)] = {0}; + QW_SET_QTID(id, qId, tId, eId); *ctx = taosHashGet(mgmt->ctxHash, id, sizeof(id)); if (NULL == (*ctx)) { @@ -233,8 +233,8 @@ int32_t qwGetTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx **ctx) { } int32_t qwAddTaskCtxImpl(QW_FPARAMS_DEF, bool acquire, SQWTaskCtx **ctx) { - char id[sizeof(qId) + sizeof(tId)] = {0}; - QW_SET_QTID(id, qId, tId); + char id[sizeof(qId) + sizeof(tId) + sizeof(eId)] = {0}; + QW_SET_QTID(id, qId, tId, eId); SQWTaskCtx nctx = {0}; @@ -314,8 +314,8 @@ void qwFreeTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx *ctx) { } int32_t qwDropTaskCtx(QW_FPARAMS_DEF) { - char id[sizeof(qId) + sizeof(tId)] = {0}; - QW_SET_QTID(id, qId, tId); + char id[sizeof(qId) + sizeof(tId) + sizeof(eId)] = {0}; + QW_SET_QTID(id, qId, tId, eId); SQWTaskCtx octx; SQWTaskCtx *ctx = taosHashGet(mgmt->ctxHash, id, sizeof(id)); @@ -348,8 +348,8 @@ int32_t qwDropTaskStatus(QW_FPARAMS_DEF) { SQWTaskStatus *task = NULL; int32_t code = 0; - char id[sizeof(qId) + sizeof(tId)] = {0}; - QW_SET_QTID(id, qId, tId); + char id[sizeof(qId) + sizeof(tId) + sizeof(eId)] = {0}; + QW_SET_QTID(id, qId, tId, eId); if (qwAcquireScheduler(mgmt, sId, QW_WRITE, &sch)) { QW_TASK_WLOG_E("scheduler does not exist"); diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index 8ab293d0ad..2b23f7a27f 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -168,7 +168,7 @@ int32_t qwGenerateSchHbRsp(SQWorker *mgmt, SQWSchStatus *sch, SQWHbInfo *hbInfo) // TODO GET EXECUTOR API TO GET MORE INFO - QW_GET_QTID(key, status.queryId, status.taskId); + QW_GET_QTID(key, status.queryId, status.taskId, status.execId); status.status = taskStatus->status; status.refId = taskStatus->refId; @@ -493,7 +493,9 @@ int32_t qwPrerocessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { QW_ERR_JRET(qwRegisterQueryBrokenLinkArg(QW_FPARAMS(), &qwMsg->connInfo)); - QW_ERR_JRET(qwAddAcquireTaskCtx(QW_FPARAMS(), &ctx)); + QW_ERR_JRET(qwAddTaskCtx(QW_FPARAMS())); + + QW_ERR_JRET(qwAcquireTaskCtx(QW_FPARAMS(), &ctx)); ctx->ctrlConnInfo = qwMsg->connInfo; @@ -562,6 +564,33 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex QW_ERR_JRET(qwExecTask(QW_FPARAMS(), ctx, NULL)); } + + if (gQWDebug.tmp) { +#if 0 + SEpSet epSet = {0}; + epSet.inUse = 1; + epSet.numOfEps = 3; + strcpy(epSet.eps[0].fqdn, "localhost"); + epSet.eps[0].port = 7100; + strcpy(epSet.eps[1].fqdn, "localhost"); + epSet.eps[1].port = 7200; + strcpy(epSet.eps[2].fqdn, "localhost"); + epSet.eps[2].port = 7300; + + qwDbgBuildAndSendRedirectRsp(pMsg->msgType + 1, &pMsg->info, TSDB_CODE_RPC_REDIRECT, &epSet); + gQWDebug.tmp = false; + return TSDB_CODE_SUCCESS; +#else + if (TDMT_SCH_MERGE_QUERY == qwMsg->msgType) { + ctx->phase = QW_PHASE_POST_QUERY; + qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_RPC_REDIRECT, NULL); + gQWDebug.tmp = false; + return TSDB_CODE_SUCCESS; + } +#endif + } + + _return: input.code = code; @@ -734,8 +763,6 @@ int32_t qwProcessDrop(QW_FPARAMS_DEF, SQWMsg *qwMsg) { SQWTaskCtx *ctx = NULL; bool locked = false; - // TODO : TASK ALREADY REMOVED AND A NEW DROP MSG RECEIVED - QW_ERR_JRET(qwAcquireTaskCtx(QW_FPARAMS(), &ctx)); QW_LOCK(QW_WRITE, &ctx->lock); diff --git a/source/libs/scheduler/inc/schedulerInt.h b/source/libs/scheduler/inc/schedulerInt.h index 8dfc703dd9..8595e41640 100644 --- a/source/libs/scheduler/inc/schedulerInt.h +++ b/source/libs/scheduler/inc/schedulerInt.h @@ -125,7 +125,7 @@ typedef struct SSchTaskCallbackParam { uint64_t queryId; int64_t refId; uint64_t taskId; - int32_t execIdx; + int32_t execId; void *pTrans; } SSchTaskCallbackParam; @@ -171,7 +171,7 @@ typedef struct SSchTask { uint64_t taskId; // task id SRWLatch lock; // task lock int32_t maxExecTimes; // task may exec times - int32_t execIdx; // task current execute try index + int32_t execId; // task current execute try index SSchLevel *level; // level SRWLatch planLock; // task update plan lock SSubplan *plan; // subplan @@ -243,9 +243,9 @@ extern SSchedulerMgmt schMgmt; #define SCH_LOG_TASK_START_TS(_task) \ do { \ int64_t us = taosGetTimestampUs(); \ - int32_t idx = (_task)->execIdx % SCH_TASK_MAX_EXEC_TIMES; \ + int32_t idx = (_task)->execId % SCH_TASK_MAX_EXEC_TIMES; \ (_task)->profile.execUseTime[idx] = us; \ - if (0 == (_task)->execIdx) { \ + if (0 == (_task)->execId) { \ (_task)->profile.startTs = us; \ } \ } while (0) @@ -253,7 +253,7 @@ extern SSchedulerMgmt schMgmt; #define SCH_LOG_TASK_WAIT_TS(_task) \ do { \ int64_t us = taosGetTimestampUs(); \ - int32_t idx = (_task)->execIdx % SCH_TASK_MAX_EXEC_TIMES; \ + int32_t idx = (_task)->execId % SCH_TASK_MAX_EXEC_TIMES; \ (_task)->profile.waitTime += us - (_task)->profile.execUseTime[idx]; \ } while (0) @@ -261,12 +261,12 @@ extern SSchedulerMgmt schMgmt; #define SCH_LOG_TASK_END_TS(_task) \ do { \ int64_t us = taosGetTimestampUs(); \ - int32_t idx = (_task)->execIdx % SCH_TASK_MAX_EXEC_TIMES; \ + int32_t idx = (_task)->execId % SCH_TASK_MAX_EXEC_TIMES; \ (_task)->profile.execUseTime[idx] = us - (_task)->profile.execUseTime[idx]; \ (_task)->profile.endTs = us; \ } while (0) -#define SCH_TASK_TIMEOUT(_task) ((taosGetTimestampUs() - (_task)->profile.execUseTime[(_task)->execIdx % SCH_TASK_MAX_EXEC_TIMES]) > (_task)->timeoutUsec) +#define SCH_TASK_TIMEOUT(_task) ((taosGetTimestampUs() - (_task)->profile.execUseTime[(_task)->execId % SCH_TASK_MAX_EXEC_TIMES]) > (_task)->timeoutUsec) #define SCH_TASK_READY_FOR_LAUNCH(readyNum, task) ((readyNum) >= taosArrayGetSize((task)->children)) @@ -274,6 +274,7 @@ extern SSchedulerMgmt schMgmt; #define SCH_UNLOCK_TASK(_task) SCH_UNLOCK(SCH_WRITE, &(_task)->lock) #define SCH_TASK_ID(_task) ((_task) ? (_task)->taskId : -1) +#define SCH_TASK_EID(_task) ((_task) ? (_task)->execId : -1) #define SCH_SET_TASK_LASTMSG_TYPE(_task, _type) do { if(_task) { atomic_store_32(&(_task)->lastMsgType, _type); } } while (0) #define SCH_GET_TASK_LASTMSG_TYPE(_task) ((_task) ? atomic_load_32(&(_task)->lastMsgType) : -1) @@ -318,13 +319,13 @@ extern SSchedulerMgmt schMgmt; #define SCH_JOB_DLOG(param, ...) qDebug("QID:0x%" PRIx64 " " param, pJob->queryId, __VA_ARGS__) #define SCH_TASK_ELOG(param, ...) \ - qError("QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, pJob->queryId, SCH_TASK_ID(pTask), __VA_ARGS__) + qError("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, pJob->queryId, SCH_TASK_ID(pTask), SCH_TASK_EID(pTask),__VA_ARGS__) #define SCH_TASK_DLOG(param, ...) \ - qDebug("QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, pJob->queryId, SCH_TASK_ID(pTask), __VA_ARGS__) + qDebug("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, pJob->queryId, SCH_TASK_ID(pTask), SCH_TASK_EID(pTask),__VA_ARGS__) #define SCH_TASK_DLOGL(param, ...) \ - qDebugL("QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, pJob->queryId, SCH_TASK_ID(pTask), __VA_ARGS__) + qDebugL("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, pJob->queryId, SCH_TASK_ID(pTask), SCH_TASK_EID(pTask),__VA_ARGS__) #define SCH_TASK_WLOG(param, ...) \ - qWarn("QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, pJob->queryId, SCH_TASK_ID(pTask), __VA_ARGS__) + qWarn("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, pJob->queryId, SCH_TASK_ID(pTask), SCH_TASK_EID(pTask),__VA_ARGS__) #define SCH_ERR_RET(c) do { int32_t _code = c; if (_code != TSDB_CODE_SUCCESS) { terrno = _code; return _code; } } while (0) #define SCH_RET(c) do { int32_t _code = c; if (_code != TSDB_CODE_SUCCESS) { terrno = _code; } return _code; } while (0) @@ -366,7 +367,7 @@ void schProcessOnDataFetched(SSchJob *job); int32_t schGetTaskInJob(SSchJob *pJob, uint64_t taskId, SSchTask **pTask); void schFreeRpcCtxVal(const void *arg); int32_t schMakeBrokenLinkVal(SSchJob *pJob, SSchTask *pTask, SRpcBrokenlinkVal *brokenVal, bool isHb); -int32_t schAppendTaskExecNode(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, int32_t execIdx); +int32_t schAppendTaskExecNode(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, int32_t execId); int32_t schExecStaticExplainJob(SSchedulerReq *pReq, int64_t *job, bool sync); int32_t schExecJobImpl(SSchedulerReq *pReq, SSchJob *pJob, bool sync); int32_t schUpdateJobStatus(SSchJob *pJob, int8_t newStatus); @@ -378,7 +379,7 @@ int32_t schExecJob(SSchedulerReq *pReq, int64_t *pJob, SQueryResult *pRes); int32_t schAsyncExecJob(SSchedulerReq *pReq, int64_t *pJob); int32_t schFetchRows(SSchJob *pJob); int32_t schAsyncFetchRows(SSchJob *pJob); -int32_t schUpdateTaskHandle(SSchJob *pJob, SSchTask *pTask, bool dropExecNode, void *handle, int32_t execIdx); +int32_t schUpdateTaskHandle(SSchJob *pJob, SSchTask *pTask, bool dropExecNode, void *handle, int32_t execId); int32_t schProcessOnTaskStatusRsp(SQueryNodeEpId* pEpId, SArray* pStatusList); void schFreeSMsgSendInfo(SMsgSendInfo *msgSendInfo); char* schGetOpStr(SCH_OP_TYPE type); diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 643594f4e0..26824738e9 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -28,7 +28,7 @@ FORCE_INLINE int32_t schReleaseJob(int64_t refId) { qDebug("sch release jobId:0x int32_t schInitTask(SSchJob *pJob, SSchTask *pTask, SSubplan *pPlan, SSchLevel *pLevel) { pTask->plan = pPlan; pTask->level = pLevel; - pTask->execIdx = -1; + pTask->execId = -1; pTask->maxExecTimes = SCH_TASK_MAX_EXEC_TIMES; pTask->timeoutUsec = SCH_DEFAULT_TASK_TIMEOUT_USEC; SCH_SET_TASK_STATUS(pTask, JOB_TASK_STATUS_NOT_START); @@ -428,59 +428,59 @@ int32_t schRecordTaskSucceedNode(SSchJob *pJob, SSchTask *pTask) { return TSDB_CODE_SUCCESS; } -int32_t schAppendTaskExecNode(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, int32_t execIdx) { +int32_t schAppendTaskExecNode(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, int32_t execId) { SSchNodeInfo nodeInfo = {.addr = *addr, .handle = NULL}; - if (taosHashPut(pTask->execNodes, &execIdx, sizeof(execIdx), &nodeInfo, sizeof(nodeInfo))) { + if (taosHashPut(pTask->execNodes, &execId, sizeof(execId), &nodeInfo, sizeof(nodeInfo))) { SCH_TASK_ELOG("taosHashPut nodeInfo to execNodes failed, errno:%d", errno); SCH_ERR_RET(TSDB_CODE_QRY_OUT_OF_MEMORY); } - SCH_TASK_DLOG("task execNode added, execIdx:%d", execIdx); + SCH_TASK_DLOG("task execNode added, execId:%d", execId); return TSDB_CODE_SUCCESS; } -int32_t schDropTaskExecNode(SSchJob *pJob, SSchTask *pTask, void *handle, int32_t execIdx) { +int32_t schDropTaskExecNode(SSchJob *pJob, SSchTask *pTask, void *handle, int32_t execId) { if (NULL == pTask->execNodes) { return TSDB_CODE_SUCCESS; } - if (taosHashRemove(pTask->execNodes, &execIdx, sizeof(execIdx))) { - SCH_TASK_ELOG("fail to remove execIdx %d from execNodeList", execIdx); + if (taosHashRemove(pTask->execNodes, &execId, sizeof(execId))) { + SCH_TASK_ELOG("fail to remove execId %d from execNodeList", execId); } else { - SCH_TASK_DLOG("execIdx %d removed from execNodeList", execIdx); + SCH_TASK_DLOG("execId %d removed from execNodeList", execId); } - if (execIdx != pTask->execIdx) { // ignore it - SCH_TASK_DLOG("execIdx %d is not current execIdx %d", execIdx, pTask->execIdx); + if (execId != pTask->execId) { // ignore it + SCH_TASK_DLOG("execId %d is not current execId %d", execId, pTask->execId); SCH_RET(TSDB_CODE_SCH_IGNORE_ERROR); } return TSDB_CODE_SUCCESS; } -int32_t schUpdateTaskExecNode(SSchJob *pJob, SSchTask *pTask, void *handle, int32_t execIdx) { +int32_t schUpdateTaskExecNode(SSchJob *pJob, SSchTask *pTask, void *handle, int32_t execId) { if (taosHashGetSize(pTask->execNodes) <= 0) { return TSDB_CODE_SUCCESS; } - SSchNodeInfo *nodeInfo = taosHashGet(pTask->execNodes, &execIdx, sizeof(execIdx)); + SSchNodeInfo *nodeInfo = taosHashGet(pTask->execNodes, &execId, sizeof(execId)); nodeInfo->handle = handle; - SCH_TASK_DLOG("handle updated to %p for execIdx %d", handle, execIdx); + SCH_TASK_DLOG("handle updated to %p for execId %d", handle, execId); return TSDB_CODE_SUCCESS; } -int32_t schUpdateTaskHandle(SSchJob *pJob, SSchTask *pTask, bool dropExecNode, void *handle, int32_t execIdx) { +int32_t schUpdateTaskHandle(SSchJob *pJob, SSchTask *pTask, bool dropExecNode, void *handle, int32_t execId) { if (dropExecNode) { - SCH_RET(schDropTaskExecNode(pJob, pTask, handle, execIdx)); + SCH_RET(schDropTaskExecNode(pJob, pTask, handle, execId)); } SCH_SET_TASK_HANDLE(pTask, handle); - schUpdateTaskExecNode(pJob, pTask, handle, execIdx); + schUpdateTaskExecNode(pJob, pTask, handle, execId); return TSDB_CODE_SUCCESS; } @@ -828,9 +828,9 @@ int32_t schTaskCheckSetRetry(SSchJob *pJob, SSchTask *pTask, int32_t errCode, bo } } - if ((pTask->execIdx + 1) >= pTask->maxExecTimes) { + if ((pTask->execId + 1) >= pTask->maxExecTimes) { *needRetry = false; - SCH_TASK_DLOG("task no more retry since reach max try times, execIdx:%d", pTask->execIdx); + SCH_TASK_DLOG("task no more retry since reach max try times, execId:%d", pTask->execId); return TSDB_CODE_SUCCESS; } @@ -841,9 +841,9 @@ int32_t schTaskCheckSetRetry(SSchJob *pJob, SSchTask *pTask, int32_t errCode, bo } if (SCH_IS_DATA_SRC_TASK(pTask)) { - if ((pTask->execIdx + 1) >= SCH_TASK_NUM_OF_EPS(&pTask->plan->execNode)) { + if ((pTask->execId + 1) >= SCH_TASK_NUM_OF_EPS(&pTask->plan->execNode)) { *needRetry = false; - SCH_TASK_DLOG("task no more retry since all ep tried, execIdx:%d, epNum:%d", pTask->execIdx, + SCH_TASK_DLOG("task no more retry since all ep tried, execId:%d, epNum:%d", pTask->execId, SCH_TASK_NUM_OF_EPS(&pTask->plan->execNode)); return TSDB_CODE_SUCCESS; } @@ -859,7 +859,7 @@ int32_t schTaskCheckSetRetry(SSchJob *pJob, SSchTask *pTask, int32_t errCode, bo } *needRetry = true; - SCH_TASK_DLOG("task need the %dth retry, errCode:%x - %s", pTask->execIdx + 1, errCode, tstrerror(errCode)); + SCH_TASK_DLOG("task need the %dth retry, errCode:%x - %s", pTask->execId + 1, errCode, tstrerror(errCode)); return TSDB_CODE_SUCCESS; } @@ -1171,6 +1171,7 @@ int32_t schProcessOnTaskSuccess(SSchJob *pJob, SSchTask *pTask) { SDownstreamSourceNode source = {.type = QUERY_NODE_DOWNSTREAM_SOURCE, .taskId = pTask->taskId, .schedId = schMgmt.sId, + .execId = pTask->execId, .addr = pTask->succeedAddr}; qSetSubplanExecutionNode(parent->plan, pTask->plan->id.groupId, &source); SCH_UNLOCK(SCH_WRITE, &parent->lock); @@ -1256,7 +1257,7 @@ int32_t schRescheduleTask(SSchJob *pJob, SSchTask *pTask) { SCH_LOCK_TASK(pTask); if (SCH_TASK_TIMEOUT(pTask) && JOB_TASK_STATUS_EXECUTING == pTask->status && pJob->fetchTask != pTask && taosArrayGetSize(pTask->candidateAddrs) > 1) { - SCH_TASK_DLOG("task execIdx %d will be rescheduled now", pTask->execIdx); + SCH_TASK_DLOG("task execId %d will be rescheduled now", pTask->execId); schDropTaskOnExecNode(pJob, pTask); taosHashClear(pTask->execNodes); schProcessOnTaskFailure(pJob, pTask, TSDB_CODE_SCH_TIMEOUT_ERROR); @@ -1283,7 +1284,7 @@ int32_t schProcessOnTaskStatusRsp(SQueryNodeEpId* pEpId, SArray* pStatusList) { continue; } - SCH_JOB_DLOG("TID:0x%" PRIx64 " task status in server: %s", taskStatus->taskId, jobTaskStatusStr(taskStatus->status)); + SCH_JOB_DLOG("TID:0x%" PRIx64 "EID:%d task status in server: %s", taskStatus->taskId, taskStatus->execId, jobTaskStatusStr(taskStatus->status)); pTask = NULL; schGetTaskInJob(pJob, taskStatus->taskId, &pTask); @@ -1292,6 +1293,13 @@ int32_t schProcessOnTaskStatusRsp(SQueryNodeEpId* pEpId, SArray* pStatusList) { schReleaseJob(taskStatus->refId); continue; } + + if (taskStatus->execId != pTask->execId) { + // TODO DROP TASK FROM SERVER!!!! + SCH_TASK_DLOG("EID %d in hb rsp mis-match", taskStatus->execId); + schReleaseJob(taskStatus->refId); + continue; + } if (taskStatus->status == JOB_TASK_STATUS_FAILED) { // RECORD AND HANDLE ERROR!!!! @@ -1362,9 +1370,9 @@ int32_t schLaunchTaskImpl(SSchJob *pJob, SSchTask *pTask) { int32_t code = 0; atomic_add_fetch_32(&pTask->level->taskLaunchedNum, 1); - pTask->execIdx++; + pTask->execId++; - SCH_TASK_DLOG("start to launch task's %dth exec", pTask->execIdx); + SCH_TASK_DLOG("start to launch task's %dth exec", pTask->execId); SCH_LOG_TASK_START_TS(pTask); @@ -1677,10 +1685,14 @@ _return: int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, int32_t rspCode) { int32_t code = 0; + int8_t status = 0; + if (schJobNeedToStop(pJob, &status)) { + SCH_TASK_ELOG("redirect will no continue cause of job status %s", jobTaskStatusStr(status)); + SCH_RET(atomic_load_32(&pJob->errCode)); + } - if ((pTask->execIdx + 1) >= pTask->maxExecTimes) { - SCH_TASK_DLOG("task no more retry since reach max try times, execIdx:%d", pTask->execIdx); - SCH_UNLOCK_TASK(pTask); + if ((pTask->execId + 1) >= pTask->maxExecTimes) { + SCH_TASK_DLOG("task no more retry since reach max try times, execId:%d", pTask->execId); schProcessOnJobFailure(pJob, rspCode); return TSDB_CODE_SUCCESS; } @@ -1703,34 +1715,36 @@ int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, int32_t rspCode) { SCH_ERR_JRET(schLaunchTasksInFlowCtrlList(pJob, pTask)); } } - } else { - pTask->childReady = 0; + + SCH_SET_TASK_STATUS(pTask, JOB_TASK_STATUS_NOT_START); - int32_t childrenNum = taosArrayGetSize(pTask->children); - for (int32_t i = 0; i < childrenNum; ++i) { - SSchTask* pChild = taosArrayGetP(pTask->children, i); - SCH_LOCK_TASK(pChild); - code = schDoTaskRedirect(pJob, pChild, rspCode); - SCH_UNLOCK_TASK(pChild); - SCH_ERR_JRET(code); - } - - qClearSubplanExecutionNode(pTask->plan); + SCH_ERR_JRET(schLaunchTask(pJob, pTask)); + + return TSDB_CODE_SUCCESS; } + + // merge plan + + pTask->childReady = 0; + + qClearSubplanExecutionNode(pTask->plan); + SCH_SET_TASK_STATUS(pTask, JOB_TASK_STATUS_NOT_START); - SCH_ERR_JRET(schLaunchTask(pJob, pTask)); - - SCH_UNLOCK_TASK(pTask); + int32_t childrenNum = taosArrayGetSize(pTask->children); + for (int32_t i = 0; i < childrenNum; ++i) { + SSchTask* pChild = taosArrayGetP(pTask->children, i); + SCH_LOCK_TASK(pChild); + schDoTaskRedirect(pJob, pChild, rspCode); + SCH_UNLOCK_TASK(pChild); + } return TSDB_CODE_SUCCESS; _return: code = schProcessOnTaskFailure(pJob, pTask, code); - - SCH_UNLOCK_TASK(pTask); SCH_RET(code); } @@ -1747,7 +1761,7 @@ int32_t schHandleRedirect(SSchJob *pJob, SSchTask *pTask, SDataBuf* pData, int32 SCH_ERR_JRET(schUpdateTaskCandidateAddr(pJob, pTask, pData->pEpSet)); } - schDoTaskRedirect(pJob, pTask, rspCode); + SCH_RET(schDoTaskRedirect(pJob, pTask, rspCode)); _return: diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index 3688cb0240..3d547ffbf8 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -379,13 +379,13 @@ int32_t schHandleCallback(void *param, SDataBuf *pMsg, int32_t rspCode) { SCH_TASK_DLOG("rsp msg received, type:%s, handle:%p, code:%s", TMSG_INFO(msgType), pMsg->handle, tstrerror(rspCode)); - if (pParam->execIdx != pTask->execIdx) { - SCH_TASK_DLOG("execIdx %d mis-match current execIdx %d", pParam->execIdx, pTask->execIdx); + if (pParam->execId != pTask->execId) { + SCH_TASK_DLOG("execId %d mis-match current execId %d", pParam->execId, pTask->execId); goto _return; } bool dropExecNode = (msgType == TDMT_SCH_LINK_BROKEN || SCH_NETWORK_ERR(rspCode)); - SCH_ERR_JRET(schUpdateTaskHandle(pJob, pTask, dropExecNode, pMsg->handle, pParam->execIdx)); + SCH_ERR_JRET(schUpdateTaskHandle(pJob, pTask, dropExecNode, pMsg->handle, pParam->execId)); int8_t status = 0; if (schJobNeedToStop(pJob, &status)) { @@ -401,7 +401,7 @@ int32_t schHandleCallback(void *param, SDataBuf *pMsg, int32_t rspCode) { goto _return; } - SCH_ERR_JRET(schHandleResponseMsg(pJob, pTask, msgType, pMsg->pData, pMsg->len, rspCode)); + code = schHandleResponseMsg(pJob, pTask, msgType, pMsg->pData, pMsg->len, rspCode); pMsg->pData = NULL; _return: @@ -458,7 +458,7 @@ int32_t schMakeCallbackParam(SSchJob *pJob, SSchTask *pTask, int32_t msgType, bo param->refId = pJob->refId; param->taskId = SCH_TASK_ID(pTask); param->pTrans = pJob->conn.pTrans; - param->execIdx = pTask->execIdx; + param->execId = pTask->execId; *pParam = param; return TSDB_CODE_SUCCESS; @@ -1015,6 +1015,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, pMsg->queryId = htobe64(pJob->queryId); pMsg->taskId = htobe64(pTask->taskId); pMsg->refId = htobe64(pJob->refId); + pMsg->execId = htonl(pTask->execId); pMsg->taskType = TASK_TYPE_TEMP; pMsg->explain = SCH_IS_EXPLAIN_JOB(pJob); pMsg->phyLen = htonl(pTask->msgLen); @@ -1041,6 +1042,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, pMsg->sId = htobe64(schMgmt.sId); pMsg->queryId = htobe64(pJob->queryId); pMsg->taskId = htobe64(pTask->taskId); + pMsg->execId = htonl(pTask->execId); break; } @@ -1060,6 +1062,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, pMsg->queryId = htobe64(pJob->queryId); pMsg->taskId = htobe64(pTask->taskId); pMsg->refId = htobe64(pJob->refId); + pMsg->execId = htobe64(pTask->execId); break; } case TDMT_SCH_QUERY_HEARTBEAT: { @@ -1102,7 +1105,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, (rpcCtx.args ? &rpcCtx : NULL))); if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY) { - SCH_ERR_RET(schAppendTaskExecNode(pJob, pTask, addr, pTask->execIdx)); + SCH_ERR_RET(schAppendTaskExecNode(pJob, pTask, addr, pTask->execId)); } return TSDB_CODE_SUCCESS; From d53e1982add2e668b818eab16529003a6324d702 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 30 Jun 2022 11:18:21 +0800 Subject: [PATCH 22/51] refactor: tref used for rsma fetch task --- source/dnode/vnode/src/inc/sma.h | 13 ++-- source/dnode/vnode/src/sma/smaEnv.c | 2 +- source/dnode/vnode/src/sma/smaRollup.c | 95 ++++++++++++++------------ 3 files changed, 57 insertions(+), 53 deletions(-) diff --git a/source/dnode/vnode/src/inc/sma.h b/source/dnode/vnode/src/inc/sma.h index 3e15fd9c57..b455d779c1 100644 --- a/source/dnode/vnode/src/inc/sma.h +++ b/source/dnode/vnode/src/inc/sma.h @@ -48,7 +48,6 @@ struct SSmaEnv { typedef struct { int32_t smaRef; - int32_t refId; } SSmaMgmt; #define SMA_ENV_LOCK(env) ((env)->lock) @@ -63,12 +62,12 @@ struct STSmaStat { struct SRSmaStat { SSma *pSma; - int64_t refId; - void *tmrHandle; - tmr_h tmrId; - int32_t tmrSeconds; - int8_t triggerStat; - int8_t runningStat; + int64_t refId; // shared by persistence/fetch tasks + void *tmrHandle; // for persistence task + tmr_h tmrId; // for persistence task + int32_t tmrSeconds; // for persistence task + int8_t triggerStat; // for persistence task + int8_t runningStat; // for persistence task SHashObj *rsmaInfoHash; // key: stbUid, value: SRSmaInfo; }; diff --git a/source/dnode/vnode/src/sma/smaEnv.c b/source/dnode/vnode/src/sma/smaEnv.c index e70e79fb6f..120d6612a2 100644 --- a/source/dnode/vnode/src/sma/smaEnv.c +++ b/source/dnode/vnode/src/sma/smaEnv.c @@ -135,7 +135,7 @@ static int32_t tdInitSmaStat(SSmaStat **pSmaStat, int8_t smaType, const SSma *pS // init smaMgmt smaMgmt.smaRef = taosOpenRef(SMA_MGMT_REF_NUM, tdDestroyRSmaStat); - if (smaMgmt.refId < 0) { + if (smaMgmt.smaRef < 0) { smaError("init smaRef failed, num:%d", SMA_MGMT_REF_NUM); terrno = TSDB_CODE_OUT_OF_MEMORY; return TSDB_CODE_FAILED; diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index bd74bbd639..bf662ddc05 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -50,6 +50,7 @@ static int32_t tdRSmaRestoreTSDataReload(SSma *pSma); struct SRSmaInfoItem { SRSmaInfo *pRsmaInfo; + int64_t refId; void *taskInfo; // qTaskInfo_t tmr_h tmrId; int8_t level; @@ -60,11 +61,14 @@ struct SRSmaInfoItem { struct SRSmaInfo { STSchema *pTSchema; - SSma *pSma; + SRSmaStat *pStat; int64_t suid; SRSmaInfoItem items[TSDB_RETENTION_L2]; }; +#define RSMA_INFO_SMA(r) ((r)->pStat->pSma) +#define RSMA_INFO_STAT(r) ((r)->pStat) + struct SRSmaQTaskInfoItem { int32_t len; int8_t type; @@ -107,22 +111,21 @@ static FORCE_INLINE void tdFreeTaskHandle(qTaskInfo_t *taskHandle, int32_t vgId, void *tdFreeRSmaInfo(SRSmaInfo *pInfo) { if (pInfo) { + SSma *pSma = RSMA_INFO_SMA(pInfo); for (int32_t i = 0; i < TSDB_RETENTION_L2; ++i) { SRSmaInfoItem *pItem = &pInfo->items[i]; if (pItem->taskInfo) { - smaDebug("vgId:%d, stb %" PRIi64 " stop fetch-timer %p level %d", SMA_VID(pInfo->pSma), pInfo->suid, - pItem->tmrId, i + 1); + smaDebug("vgId:%d, stb %" PRIi64 " stop fetch-timer %p level %d", SMA_VID(pSma), pInfo->suid, pItem->tmrId, + i + 1); taosTmrStopA(&pItem->tmrId); - tdFreeTaskHandle(&pItem->taskInfo, SMA_VID(pInfo->pSma), i + 1); + tdFreeTaskHandle(&pItem->taskInfo, SMA_VID(pSma), i + 1); } else { - smaDebug("vgId:%d, stb %" PRIi64 " no need to destroy rsma info level %d since empty taskInfo", - SMA_VID(pInfo->pSma), pInfo->suid, i + 1); + smaDebug("vgId:%d, stb %" PRIi64 " no need to destroy rsma info level %d since empty taskInfo", SMA_VID(pSma), + pInfo->suid, i + 1); } } taosMemoryFree(pInfo->pTSchema); taosMemoryFree(pInfo); - } else { - smaDebug("vgId:%d, stb %" PRIi64 " no need to destroy rsma info since empty", SMA_VID(pInfo->pSma), pInfo->suid); } return NULL; @@ -255,6 +258,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaInfo if (param->qmsg[idx]) { SRSmaInfoItem *pItem = &(pRSmaInfo->items[idx]); + pItem->refId = RSMA_REF_ID(pRSmaInfo->pStat); pItem->pRsmaInfo = pRSmaInfo; pItem->taskInfo = qCreateStreamExecTaskInfo(param->qmsg[idx], pReadHandle); if (!pItem->taskInfo) { @@ -340,7 +344,7 @@ int32_t tdProcessRSmaCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, con goto _err; } pRSmaInfo->pTSchema = pTSchema; - pRSmaInfo->pSma = pSma; + pRSmaInfo->pStat = pStat; pRSmaInfo->suid = suid; if (tdSetRSmaInfoItemParams(pSma, param, pRSmaInfo, &handle, 0) < 0) { @@ -522,7 +526,7 @@ static void tdDestroySDataBlockArray(SArray *pArray) { static int32_t tdFetchAndSubmitRSmaResult(SRSmaInfoItem *pItem, int8_t blkType) { SArray *pResult = NULL; SRSmaInfo *pRSmaInfo = pItem->pRsmaInfo; - SSma *pSma = pRSmaInfo->pSma; + SSma *pSma = RSMA_INFO_SMA(pRSmaInfo); while (1) { SSDataBlock *output = NULL; @@ -585,21 +589,29 @@ _err: */ static void tdRSmaFetchTrigger(void *param, void *tmrId) { SRSmaInfoItem *pItem = param; - SSma *pSma = pItem->pRsmaInfo->pSma; - SRSmaStat *pStat = (SRSmaStat *)SMA_ENV_STAT((SSmaEnv *)pSma->pRSmaEnv); + SSma *pSma = NULL; + SRSmaStat *pStat = (SRSmaStat *)taosAcquireRef(smaMgmt.smaRef, pItem->refId); + if (!pStat) { + smaDebug("rsma fetch task not start since already destroyed"); + return; + } + pSma = RSMA_INFO_SMA(pItem->pRsmaInfo); + + // if rsma trigger stat in cancelled or finished, not start fetch task anymore int8_t rsmaTriggerStat = atomic_load_8(RSMA_TRIGGER_STAT(pStat)); if (rsmaTriggerStat == TASK_TRIGGER_STAT_CANCELLED || rsmaTriggerStat == TASK_TRIGGER_STAT_FINISHED) { - smaDebug("vgId:%d, level %" PRIi8 " not fetch since stat is cancelled for table suid:%" PRIi64, SMA_VID(pSma), - pItem->level, pItem->pRsmaInfo->suid); + taosReleaseRef(smaMgmt.smaRef, pItem->refId); + smaDebug("vgId:%d, not fetch rsma level %" PRIi8 " data for table:%" PRIi64 " since stat is cancelled", + SMA_VID(pSma), pItem->level, pItem->pRsmaInfo->suid); return; } int8_t fetchTriggerStat = atomic_val_compare_exchange_8(&pItem->triggerStat, TASK_TRIGGER_STAT_ACTIVE, TASK_TRIGGER_STAT_INACTIVE); if (fetchTriggerStat == TASK_TRIGGER_STAT_ACTIVE) { - smaDebug("vgId:%d, level %" PRIi8 " stat is active for table suid:%" PRIi64, SMA_VID(pSma), pItem->level, - pItem->pRsmaInfo->suid); + smaDebug("vgId:%d, fetch rsma level %" PRIi8 " data for table:%" PRIi64 " since stat is active", SMA_VID(pSma), + pItem->level, pItem->pRsmaInfo->suid); tdRefSmaStat(pSma, (SSmaStat *)pStat); @@ -610,9 +622,11 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) { tdUnRefSmaStat(pSma, (SSmaStat *)pStat); } else { - smaDebug("vgId:%d, level %" PRIi8 " stat is inactive for table suid:%" PRIi64, SMA_VID(pSma), pItem->level, - pItem->pRsmaInfo->suid); + smaDebug("vgId:%d, not fetch rsma level %" PRIi8 " data for table:%" PRIi64 " since stat is inactive", + SMA_VID(pSma), pItem->level, pItem->pRsmaInfo->suid); } +_end: + taosReleaseRef(smaMgmt.smaRef, pItem->refId); } static int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int32_t inputType, SRSmaInfoItem *pItem, tb_uid_t suid, @@ -632,7 +646,6 @@ static int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int32_t inputType tdFetchAndSubmitRSmaResult(pItem, STREAM_DATA_TYPE_SUBMIT_BLOCK); atomic_store_8(&pItem->triggerStat, TASK_TRIGGER_STAT_ACTIVE); - smaDebug("vgId:%d, process rsma insert", SMA_VID(pSma)); SSmaEnv *pEnv = SMA_RSMA_ENV(pSma); SRSmaStat *pStat = SMA_RSMA_STAT(pEnv->pStat); @@ -1036,7 +1049,7 @@ static void *tdRSmaPersistExec(void *param) { for (int32_t i = 0; i < TSDB_RETENTION_L2; ++i) { qTaskInfo_t taskInfo = pRSmaInfo->items[i].taskInfo; if (!taskInfo) { - smaDebug("vgId:%d, table %" PRIi64 " level %d qTaskInfo is NULL", vid, pRSmaInfo->suid, i + 1); + smaDebug("vgId:%d, rsma, table %" PRIi64 " level %d qTaskInfo is NULL", vid, pRSmaInfo->suid, i + 1); continue; } @@ -1044,27 +1057,20 @@ static void *tdRSmaPersistExec(void *param) { int32_t len = 0; int8_t type = (int8_t)(i + 1); if (qSerializeTaskStatus(taskInfo, &pOutput, &len) < 0) { - smaError("vgId:%d, table %" PRIi64 " level %d serialize rsma task failed since %s", vid, pRSmaInfo->suid, i + 1, - terrstr(terrno)); + smaError("vgId:%d, rsma, table %" PRIi64 " level %d serialize qTaskInfo failed since %s", vid, pRSmaInfo->suid, + i + 1, terrstr(terrno)); goto _err; } if (!pOutput || len <= 0) { - smaDebug("vgId:%d, table %" PRIi64 " level %d serialize rsma task success but no output(len %d), not persist", + smaDebug("vgId:%d, rsma, table %" PRIi64 + " level %d serialize qTaskInfo success but no output(len %d), not persist", vid, pRSmaInfo->suid, i + 1, len); taosMemoryFreeClear(pOutput); continue; } - smaDebug("vgId:%d, table %" PRIi64 " level %d serialize rsma task success with len %d, need persist", vid, + smaDebug("vgId:%d, rsma, table %" PRIi64 " level %d serialize qTaskInfo success with len %d, need persist", vid, pRSmaInfo->suid, i + 1, len); -#if 0 - if (qDeserializeTaskStatus(taskInfo, pOutput, len) < 0) { - smaError("vgId:%d, table %" PRIi64 "level %d deserialize rsma task failed since %s", vid, pRSmaInfo->suid, - i + 1, terrstr(terrno)); - } else { - smaDebug("vgId:%d, table %" PRIi64 " level %d deserialize rsma task success", vid, pRSmaInfo->suid, i + 1); - } -#endif if (!isFileCreated) { char qTaskInfoFName[TSDB_FILENAME_LEN]; @@ -1084,11 +1090,11 @@ static void *tdRSmaPersistExec(void *param) { ASSERT(headLen <= RSMA_QTASKINFO_HEAD_LEN); tdAppendTFile(&tFile, (void *)&tmpBuf, headLen, &toffset); - smaDebug("vgId:%d, table %" PRIi64 " level %d head part(len:%d) appended to offset:%" PRIi64, vid, + smaDebug("vgId:%d, rsma, table %" PRIi64 " level %d head part(len:%d) appended to offset:%" PRIi64, vid, pRSmaInfo->suid, i + 1, headLen, toffset); tdAppendTFile(&tFile, pOutput, len, &toffset); - smaDebug("vgId:%d, table %" PRIi64 " level %d body part len:%d appended to offset:%" PRIi64, vid, pRSmaInfo->suid, - i + 1, len, toffset); + smaDebug("vgId:%d, rsma, table %" PRIi64 " level %d body part len:%d appended to offset:%" PRIi64, vid, + pRSmaInfo->suid, i + 1, len, toffset); taosMemoryFree(pOutput); } @@ -1098,13 +1104,13 @@ static void *tdRSmaPersistExec(void *param) { _normal: if (isFileCreated) { if (tdUpdateTFileHeader(&tFile) < 0) { - smaError("vgId:%d, failed to update tfile %s header since %s", vid, TD_TFILE_FULL_NAME(&tFile), + smaError("vgId:%d, rsma, failed to update tfile %s header since %s", vid, TD_TFILE_FULL_NAME(&tFile), tstrerror(terrno)); tdCloseTFile(&tFile); tdRemoveTFile(&tFile); goto _err; } else { - smaDebug("vgId:%d, succeed to update tfile %s header", vid, TD_TFILE_FULL_NAME(&tFile)); + smaDebug("vgId:%d, rsma, succeed to update tfile %s header", vid, TD_TFILE_FULL_NAME(&tFile)); } tdCloseTFile(&tFile); @@ -1114,10 +1120,10 @@ _normal: char *pos = strstr(newFName, tdQTaskInfoFname[TD_QTASK_TMP_F]); strncpy(pos, tdQTaskInfoFname[TD_QTASK_TMP_F], TSDB_FILENAME_LEN - POINTER_DISTANCE(pos, newFName)); if (taosRenameFile(TD_TFILE_FULL_NAME(&tFile), newFName) != 0) { - smaError("vgId:%d, failed to rename %s to %s", vid, TD_TFILE_FULL_NAME(&tFile), newFName); + smaError("vgId:%d, rsma, failed to rename %s to %s", vid, TD_TFILE_FULL_NAME(&tFile), newFName); goto _err; } else { - smaDebug("vgId:%d, succeed to rename %s to %s", vid, TD_TFILE_FULL_NAME(&tFile), newFName); + smaDebug("vgId:%d, rsma, succeed to rename %s to %s", vid, TD_TFILE_FULL_NAME(&tFile), newFName); } } goto _end; @@ -1129,13 +1135,13 @@ _end: if (TASK_TRIGGER_STAT_INACTIVE == atomic_val_compare_exchange_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_INACTIVE, TASK_TRIGGER_STAT_ACTIVE)) { - smaDebug("vgId:%d, persist task is active again", vid); + smaDebug("vgId:%d, rsma persist task is active again", vid); } else if (TASK_TRIGGER_STAT_CANCELLED == atomic_val_compare_exchange_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_CANCELLED, TASK_TRIGGER_STAT_FINISHED)) { - smaDebug("vgId:%d, persist task is cancelled", vid); + smaDebug("vgId:%d, rsma persist task is cancelled", vid); } else { - smaWarn("vgId:%d, persist task in abnormal stat %" PRIi8, vid, atomic_load_8(RSMA_TRIGGER_STAT(pRSmaStat))); + smaWarn("vgId:%d, rsma persist task in abnormal stat %" PRIi8, vid, atomic_load_8(RSMA_TRIGGER_STAT(pRSmaStat))); ASSERT(0); } atomic_store_8(RSMA_RUNNING_STAT(pRSmaStat), 0); @@ -1179,9 +1185,8 @@ static void tdRSmaPersistTask(SRSmaStat *pRSmaStat) { */ static void tdRSmaPersistTrigger(void *param, void *tmrId) { SRSmaStat *rsmaStat = param; - int64_t refId = rsmaStat->refId; + SRSmaStat *pRSmaStat = (SRSmaStat *)taosAcquireRef(smaMgmt.smaRef, rsmaStat->refId); - SRSmaStat *pRSmaStat = (SRSmaStat *)taosAcquireRef(smaMgmt.smaRef, refId); if (!pRSmaStat) { smaDebug("rsma persistence task not start since already destroyed"); return; @@ -1221,5 +1226,5 @@ static void tdRSmaPersistTrigger(void *param, void *tmrId) { smaWarn("rsma persistence not start since unknown stat %" PRIi8, tmrStat); } break; } - taosReleaseRef(smaMgmt.smaRef, refId); + taosReleaseRef(smaMgmt.smaRef, rsmaStat->refId); } From 63d799feebe277a674818df76291984303d0dc01 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Thu, 30 Jun 2022 11:32:00 +0800 Subject: [PATCH 23/51] refactor(query): set stateduration function default time unit as db precision --- source/libs/function/src/builtinsimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index e40ab3784d..a75d5a2ecb 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -4283,7 +4283,7 @@ int32_t stateDurationFunction(SqlFunctionCtx* pCtx) { SColumnInfoData* pOutput = (SColumnInfoData*)pCtx->pOutput; // TODO: process timeUnit for different db precisions - int32_t timeUnit = 1000; + int32_t timeUnit = 1; if (pCtx->numOfParams == 5) { // TODO: param number incorrect timeUnit = pCtx->param[3].param.i; } From b0b5d417af60221264a34c9ea2d233b463414f9d Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Thu, 30 Jun 2022 11:33:06 +0800 Subject: [PATCH 24/51] modify test case --- tests/system-test/2-query/stateduration.py | 72 +++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/system-test/2-query/stateduration.py b/tests/system-test/2-query/stateduration.py index fa71009ef2..23169553dc 100644 --- a/tests/system-test/2-query/stateduration.py +++ b/tests/system-test/2-query/stateduration.py @@ -38,15 +38,15 @@ class TDTestCase: tdSql.query(f"select stateduration(col{i},'{j}',5) from test") tdSql.checkRows(10) if j in ['LT' ,'lt','Lt','lT']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (0,), (0,), (0,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,)]) + tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,)]) elif j in ['GT','gt', 'Gt','gT']: - tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (0,), (0,), (0,), (0,), (0,)]) + tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (0,), (1,), (2,), (3,), (4,)]) elif j in ['LE','le','Le','lE']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (0,), (0,), (0,), (0,), (-1,), (-1,), (-1,), (-1,), (-1,)]) + tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (4,), (-1,), (-1,), (-1,), (-1,), (-1,)]) elif j in [ 'GE','ge','Ge','gE']: - tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (0,), (0,), (0,), (0,), (0,)]) + tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (1,), (2,), (3,), (4,), (5,)]) elif j in ['NE','ne','Ne','nE']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (0,), (0,), (0,), (-1,), (0,), (0,), (0,), (0,), (0,)]) + tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (-1,), (0,), (1,), (2,), (3,), (4,)]) elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (-1,), (-1,), (-1,), (-1,), (-1,)]) for i in float_list: @@ -54,11 +54,11 @@ class TDTestCase: tdSql.query(f"select stateduration(col{i},'{j}',5) from test") tdSql.checkRows(10) if j in ['LT','lt','Lt','lT','LE','le','Le','lE']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (0,), (0,), (0,), (0,), (-1,), (-1,), (-1,), (-1,), (-1,)]) + tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (4,), (-1,), (-1,), (-1,), (-1,), (-1,)]) elif j in ['GE','ge','Ge','gE','GT','gt','Gt','gT']: - tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (0,), (0,), (0,), (0,), (0,)]) + tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (0,), (1,), (2,), (3,), (4,)]) elif j in ['NE','ne','Ne','nE']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (0,), (0,), (0,), (0,), (0,), (0,), (0,), (0,), (0,)]) + tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,), (9,)]) elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,)]) @@ -66,34 +66,34 @@ class TDTestCase: for i in error_column_list: for j in self.param_list: tdSql.error(f"select stateduration({i},{j},5) from test") - + error_param_list = ['a',1] for i in error_param_list: tdSql.error(f"select stateduration(col1,{i},5) from test") - + # timestamp = 1s, time_unit =1s tdSql.execute('''create table test1(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''') for i in range(self.row_num): tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" % (self.ts + i*1000, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1)) - + for i in integer_list: for j in self.param_list: tdSql.query(f"select stateduration(col{i},'{j}',5) from test1") tdSql.checkRows(10) # print(tdSql.queryResult) if j in ['LT' ,'lt','Lt','lT']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,)]) + tdSql.checkEqual(tdSql.queryResult,[(0,), (1000,), (2000,), (3000,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,)]) elif j in ['GT','gt', 'Gt','gT']: - tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (0,), (1,), (2,), (3,), (4,)]) + tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (0,), (1000,), (2000,), (3000,), (4000,)]) elif j in ['LE','le','Le','lE']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (4,), (-1,), (-1,), (-1,), (-1,), (-1,)]) + tdSql.checkEqual(tdSql.queryResult,[(0,), (1000,), (2000,), (3000,), (4000,), (-1,), (-1,), (-1,), (-1,), (-1,)]) elif j in [ 'GE','ge','Ge','gE']: - tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (1,), (2,), (3,), (4,), (5,)]) + tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (1000,), (2000,), (3000,), (4000,), (5000,)]) elif j in ['NE','ne','Ne','nE']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (-1,), (0,), (1,), (2,), (3,), (4,)]) - elif j in ['EQ','eq','Eq','eQ']: + tdSql.checkEqual(tdSql.queryResult,[(0,), (1000,), (2000,), (3000,), (-1,), (0,), (1000,), (2000,), (3000,), (4000,)]) + elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (-1,), (-1,), (-1,), (-1,), (-1,)]) for i in float_list: for j in self.param_list: @@ -101,22 +101,22 @@ class TDTestCase: tdSql.checkRows(10) print(tdSql.queryResult) if j in ['LT','lt','Lt','lT','LE','le','Le','lE']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (4,), (-1,), (-1,), (-1,), (-1,), (-1,)]) + tdSql.checkEqual(tdSql.queryResult,[(0,), (1000,), (2000,), (3000,), (4000,), (-1,), (-1,), (-1,), (-1,), (-1,)]) elif j in ['GE','ge','Ge','gE','GT','gt','Gt','gT']: - tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (0,), (1,), (2,), (3,), (4,)]) + tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (0,), (1000,), (2000,), (3000,), (4000,)]) elif j in ['NE','ne','Ne','nE']: - tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,), (9,)]) + tdSql.checkEqual(tdSql.queryResult,[(0,), (1000,), (2000,), (3000,), (4000,), (5000,), (6000,), (7000,), (8000,), (9000,)]) elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,)]) # timestamp = 1m, time_unit =1m - tdSql.execute('''create table test2(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, + tdSql.execute('''create table test2(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''') for i in range(self.row_num): - tdSql.execute("insert into test2 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" + tdSql.execute("insert into test2 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" % (self.ts + i*1000*60, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1)) - + for i in integer_list: for j in self.param_list: tdSql.query(f"select stateduration(col{i},'{j}',5,1m) from test2") @@ -132,7 +132,7 @@ class TDTestCase: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (1,), (2,), (3,), (4,), (5,)]) elif j in ['NE','ne','Ne','nE']: tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (-1,), (0,), (1,), (2,), (3,), (4,)]) - elif j in ['EQ','eq','Eq','eQ']: + elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (-1,), (-1,), (-1,), (-1,), (-1,)]) for i in float_list: for j in self.param_list: @@ -147,14 +147,14 @@ class TDTestCase: tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,), (9,)]) elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,)]) - + # timestamp = 1h, time_unit =1h - tdSql.execute('''create table test3(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, + tdSql.execute('''create table test3(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''') for i in range(self.row_num): - tdSql.execute("insert into test3 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" + tdSql.execute("insert into test3 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" % (self.ts + i*1000*60*60, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1)) - + for i in integer_list: for j in self.param_list: tdSql.query(f"select stateduration(col{i},'{j}',5,1h) from test3") @@ -170,7 +170,7 @@ class TDTestCase: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (1,), (2,), (3,), (4,), (5,)]) elif j in ['NE','ne','Ne','nE']: tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (-1,), (0,), (1,), (2,), (3,), (4,)]) - elif j in ['EQ','eq','Eq','eQ']: + elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (-1,), (-1,), (-1,), (-1,), (-1,)]) for i in float_list: for j in self.param_list: @@ -202,7 +202,7 @@ class TDTestCase: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (60,), (120,), (180,), (240,), (300,)]) elif j in ['NE','ne','Ne','nE']: tdSql.checkEqual(tdSql.queryResult,[(0,), (60,), (120,), (180,), (-1,), (0,), (60,), (120,), (180,), (240,)]) - elif j in ['EQ','eq','Eq','eQ']: + elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (-1,), (-1,), (-1,), (-1,), (-1,)]) for i in float_list: for j in self.param_list: @@ -219,13 +219,13 @@ class TDTestCase: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,)]) # for stb - tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, + tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(t0 int)''') tdSql.execute('create table stb_1 using stb tags(1)') for i in range(self.row_num): - tdSql.execute("insert into stb_1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" + tdSql.execute("insert into stb_1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" % (self.ts + i*1000*60*60, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1)) - + for i in integer_list: for j in self.param_list: tdSql.query(f"select stateduration(col{i},'{j}',5,1h) from stb") @@ -241,7 +241,7 @@ class TDTestCase: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (1,), (2,), (3,), (4,), (5,)]) elif j in ['NE','ne','Ne','nE']: tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (-1,), (0,), (1,), (2,), (3,), (4,)]) - elif j in ['EQ','eq','Eq','eQ']: + elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (0,), (-1,), (-1,), (-1,), (-1,), (-1,)]) for i in float_list: for j in self.param_list: @@ -256,10 +256,10 @@ class TDTestCase: tdSql.checkEqual(tdSql.queryResult,[(0,), (1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,), (9,)]) elif j in ['EQ','eq','Eq','eQ']: tdSql.checkEqual(tdSql.queryResult,[(-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,), (-1,)]) - + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) tdCases.addWindows(__file__, TDTestCase()) -tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file +tdCases.addLinux(__file__, TDTestCase()) From 5d694bc5d72544ba428868c6ee3063ace6a6f37a Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Thu, 30 Jun 2022 11:45:11 +0800 Subject: [PATCH 25/51] fix translate function for now/today --- source/libs/function/src/builtins.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 1f89538447..b61f95f9a0 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -234,7 +234,7 @@ static int32_t translateWduration(SFunctionNode* pFunc, char* pErrBuf, int32_t l return TSDB_CODE_SUCCESS; } -static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { +static int32_t translateNowToday(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { // pseudo column do not need to check parameters //add database precision as param @@ -245,6 +245,13 @@ static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, in return TSDB_CODE_SUCCESS; } +static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + // pseudo column do not need to check parameters + + pFunc->node.resType = (SDataType){.bytes = sizeof(int64_t), .type = TSDB_DATA_TYPE_TIMESTAMP}; + return TSDB_CODE_SUCCESS; +} + static int32_t translateTimezone(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { pFunc->node.resType = (SDataType){.bytes = TD_TIMEZONE_LEN, .type = TSDB_DATA_TYPE_BINARY}; return TSDB_CODE_SUCCESS; @@ -2471,7 +2478,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .name = "now", .type = FUNCTION_TYPE_NOW, .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC, - .translateFunc = translateTimePseudoColumn, + .translateFunc = translateNowToday, .getEnvFunc = NULL, .initFunc = NULL, .sprocessFunc = nowFunction, @@ -2481,7 +2488,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .name = "today", .type = FUNCTION_TYPE_TODAY, .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_DATETIME_FUNC, - .translateFunc = translateTimePseudoColumn, + .translateFunc = translateNowToday, .getEnvFunc = NULL, .initFunc = NULL, .sprocessFunc = todayFunction, From 80934e48220fde7fc3d8a4e629fbd94d79273762 Mon Sep 17 00:00:00 2001 From: plum-lihui Date: Thu, 30 Jun 2022 13:22:54 +0800 Subject: [PATCH 26/51] test: add test case for tmq --- tests/system-test/7-tmq/subscribeDb4.py | 47 ++++++++++++++----------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/tests/system-test/7-tmq/subscribeDb4.py b/tests/system-test/7-tmq/subscribeDb4.py index de475803fe..b30f99b542 100644 --- a/tests/system-test/7-tmq/subscribeDb4.py +++ b/tests/system-test/7-tmq/subscribeDb4.py @@ -14,19 +14,24 @@ sys.path.append("./7-tmq") from tmqCommon import * class TDTestCase: - paraDict = {'dbName': 'db12', - 'dropFlag':1, - 'vgroups': 4, - 'precision': 'ms', - 'stbName': 'stb0', - 'ctbNum': 10, + paraDict = {'dbName': 'db12', + 'dropFlag': 1, + 'event': '', + 'vgroups': 4, + 'stbName': 'stb0', + 'colPrefix': 'c', + 'tagPrefix': 't', + 'colSchema': [{'type': 'INT', 'count':2}, {'type': 'binary', 'len':16, 'count':1}, {'type': 'timestamp','count':1}], + 'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'ctbPrefix': 'ctb', + 'ctbStartIdx': 0, + 'ctbNum': 10, 'rowsPerTbl': 10000, - 'batchNum': 10, - 'startTs': 0, # 1640966400000 ----> 2022-01-01 00:00:00.000 - 'event':'', - 'columnDict': {'int':2}, - 'tagDict': {'int':1} - } + 'batchNum': 10, + 'startTs': 1640966400000, # 2022-01-01 00:00:00.000 + 'pollDelay': 20, + 'showMsg': 1, + 'showRow': 1} cdbName = 'cdb' # some parameter to consumer processor @@ -57,17 +62,19 @@ class TDTestCase: tmqCom.initConsumerTable(self.cdbName) - tdCom.create_database(tdSql,self.paraDict["dbName"],self.paraDict["dropFlag"], self.paraDict['precision']) + tdCom.create_database(tdSql,self.paraDict["dbName"],self.paraDict["dropFlag"]) self.paraDict["stbName"] = 'stb1' - tdCom.create_stable(tdSql,self.paraDict["dbName"],self.paraDict["stbName"],self.paraDict["columnDict"],self.paraDict["tagDict"]) - tdCom.create_ctables(tdSql,self.paraDict["dbName"],self.paraDict["stbName"],self.paraDict["ctbNum"],self.paraDict["tagDict"]) - tdCom.insert_data(tdSql,self.paraDict["dbName"],self.paraDict["stbName"],self.paraDict["ctbNum"],self.paraDict["rowsPerTbl"],self.paraDict["batchNum"]) + tdCom.create_stable(tdSql,dbname=self.paraDict["dbName"],stbname=self.paraDict["stbName"],column_elm_list=self.paraDict["colSchema"],tag_elm_list=self.paraDict["tagSchema"],count=1, default_stbname_prefix=self.paraDict["stbName"]) + tdCom.create_ctable(tdSql,dbname=self.paraDict["dbName"],stbname=self.paraDict["stbName"],tag_elm_list=self.paraDict['tagSchema'],count=self.paraDict["ctbNum"],default_ctbname_prefix=self.paraDict["ctbPrefix"]) + tmqCom.insert_data_2(tdSql,self.paraDict["dbName"],self.paraDict["ctbPrefix"],self.paraDict["ctbNum"],self.paraDict["rowsPerTbl"],self.paraDict["batchNum"],self.paraDict["startTs"],self.paraDict["ctbStartIdx"]) + tdLog.info("22222222222222222") self.paraDict["stbName"] = 'stb2' - tdCom.create_stable(tdSql,self.paraDict["dbName"],self.paraDict["stbName"],self.paraDict["columnDict"],self.paraDict["tagDict"]) - tdCom.create_ctables(tdSql,self.paraDict["dbName"],self.paraDict["stbName"],self.paraDict["ctbNum"],self.paraDict["tagDict"]) - tdCom.insert_data(tdSql,self.paraDict["dbName"],self.paraDict["stbName"],self.paraDict["ctbNum"],self.paraDict["rowsPerTbl"],self.paraDict["batchNum"]) + self.paraDict["ctbPrefix"] = 'newctb' + tdCom.create_stable(tdSql,dbname=self.paraDict["dbName"],stbname=self.paraDict["stbName"],column_elm_list=self.paraDict["colSchema"],tag_elm_list=self.paraDict["tagSchema"],count=1, default_stbname_prefix=self.paraDict["stbName"]) + tdCom.create_ctable(tdSql,dbname=self.paraDict["dbName"],stbname=self.paraDict["stbName"],tag_elm_list=self.paraDict['tagSchema'],count=self.paraDict["ctbNum"],default_ctbname_prefix=self.paraDict["ctbPrefix"]) + tmqCom.insert_data_2(tdSql,self.paraDict["dbName"],self.paraDict["ctbPrefix"],self.paraDict["ctbNum"],self.paraDict["rowsPerTbl"],self.paraDict["batchNum"],self.paraDict["startTs"],self.paraDict["ctbStartIdx"]) tdLog.info("create topics from db") topicName1 = 'topic_%s'%(self.paraDict['dbName']) @@ -97,7 +104,7 @@ class TDTestCase: tdLog.info("act consume rows: %d, expect consume rows: between %d and %d"%(totalConsumeRows, self.expectrowcnt/2, self.expectrowcnt)) tdLog.exit("tmq consume rows error!") - time.sleep(15) + time.sleep(10) tdSql.query("drop topic %s"%topicName1) tdLog.printNoPrefix("======== test case 12 end ...... ") From 859d604022f53c1f67e72d6e9ff5fb9e4f7f49c4 Mon Sep 17 00:00:00 2001 From: plum-lihui Date: Thu, 30 Jun 2022 13:24:08 +0800 Subject: [PATCH 27/51] test:add test case --- tests/system-test/fulltest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index d0fee5c49c..73bd21470e 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -135,6 +135,7 @@ python3 ./test.py -f 7-tmq/subscribeDb0.py python3 ./test.py -f 7-tmq/subscribeDb1.py python3 ./test.py -f 7-tmq/subscribeDb2.py python3 ./test.py -f 7-tmq/subscribeDb3.py +#python3 ./test.py -f 7-tmq/subscribeDb4.py python3 ./test.py -f 7-tmq/subscribeStb.py python3 ./test.py -f 7-tmq/subscribeStb0.py python3 ./test.py -f 7-tmq/subscribeStb1.py From 47bc36872f47cb2338e29f3f24a4f90ea1bf09d1 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 30 Jun 2022 13:44:26 +0800 Subject: [PATCH 28/51] feat: query redirect --- include/common/tmsg.h | 1 + source/client/src/clientImpl.c | 4 ++-- source/libs/nodes/src/nodesCodeFuncs.c | 5 +++-- source/libs/qworker/inc/qwInt.h | 20 ++++++++--------- source/libs/qworker/src/qwMsg.c | 4 +++- source/libs/qworker/src/qworker.c | 30 ++++++++++++++------------ source/libs/scheduler/src/schJob.c | 5 +++-- source/libs/scheduler/src/schRemote.c | 2 +- 8 files changed, 39 insertions(+), 32 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 2876105748..4ba668cbf5 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1594,6 +1594,7 @@ typedef struct { uint64_t queryId; uint64_t taskId; int64_t refId; + int32_t execId; } STaskCancelReq; typedef struct { diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index b20fd4b9b0..51e43f927b 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -1294,10 +1294,10 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) { */ int32_t elapsed = pRequest->metric.rsp - pRequest->metric.start; if (pMsg->code == TSDB_CODE_SUCCESS) { - tscDebug("0x%" PRIx64 " message:%s, code:%s rspLen:%d, elapsed:%d ms, reqId:0x%" PRIx64, pRequest->self, + tscDebug("0x%" PRIx64 " rsp msg:%s, code:%s rspLen:%d, elapsed:%d ms, reqId:0x%" PRIx64, pRequest->self, TMSG_INFO(pMsg->msgType), tstrerror(pMsg->code), pMsg->contLen, elapsed / 1000, pRequest->requestId); } else { - tscError("0x%" PRIx64 " SQL cmd:%s, code:%s rspLen:%d, elapsed time:%d ms, reqId:0x%" PRIx64, pRequest->self, + tscError("0x%" PRIx64 " rsp msg:%s, code:%s rspLen:%d, elapsed time:%d ms, reqId:0x%" PRIx64, pRequest->self, TMSG_INFO(pMsg->msgType), tstrerror(pMsg->code), pMsg->contLen, elapsed / 1000, pRequest->requestId); } diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 4375a7b04c..72263feea1 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -3430,6 +3430,7 @@ static int32_t jsonToSlotDescNode(const SJson* pJson, void* pObj) { static const char* jkDownstreamSourceAddr = "Addr"; static const char* jkDownstreamSourceTaskId = "TaskId"; static const char* jkDownstreamSourceSchedId = "SchedId"; +static const char* jkDownstreamSourceExecId = "ExecId"; static int32_t downstreamSourceNodeToJson(const void* pObj, SJson* pJson) { const SDownstreamSourceNode* pNode = (const SDownstreamSourceNode*)pObj; @@ -3442,7 +3443,7 @@ static int32_t downstreamSourceNodeToJson(const void* pObj, SJson* pJson) { code = tjsonAddIntegerToObject(pJson, jkDownstreamSourceSchedId, pNode->schedId); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonAddIntegerToObject(pJson, jkDownstreamSourceSchedId, pNode->execId); + code = tjsonAddIntegerToObject(pJson, jkDownstreamSourceExecId, pNode->execId); } return code; @@ -3459,7 +3460,7 @@ static int32_t jsonToDownstreamSourceNode(const SJson* pJson, void* pObj) { code = tjsonGetUBigIntValue(pJson, jkDownstreamSourceSchedId, &pNode->schedId); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetIntValue(pJson, jkDownstreamSourceSchedId, &pNode->execId); + code = tjsonGetIntValue(pJson, jkDownstreamSourceExecId, &pNode->execId); } return code; diff --git a/source/libs/qworker/inc/qwInt.h b/source/libs/qworker/inc/qwInt.h index 4fa2615470..6faffa13b3 100644 --- a/source/libs/qworker/inc/qwInt.h +++ b/source/libs/qworker/inc/qwInt.h @@ -281,22 +281,22 @@ typedef struct SQWorkerMgmt { #define QW_SCH_ELOG(param, ...) qError("QW:%p SID:%" PRIx64 " " param, mgmt, sId, __VA_ARGS__) #define QW_SCH_DLOG(param, ...) qDebug("QW:%p SID:%" PRIx64 " " param, mgmt, sId, __VA_ARGS__) -#define QW_TASK_ELOG(param, ...) qError("QW:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, tId, __VA_ARGS__) -#define QW_TASK_WLOG(param, ...) qWarn("QW:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, tId, __VA_ARGS__) -#define QW_TASK_DLOG(param, ...) qDebug("QW:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, tId, __VA_ARGS__) +#define QW_TASK_ELOG(param, ...) qError("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, eId, __VA_ARGS__) +#define QW_TASK_WLOG(param, ...) qWarn("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, eId, __VA_ARGS__) +#define QW_TASK_DLOG(param, ...) qDebug("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, eId, __VA_ARGS__) #define QW_TASK_DLOGL(param, ...) \ - qDebugL("QW:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, tId, __VA_ARGS__) + qDebugL("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, eId, __VA_ARGS__) -#define QW_TASK_ELOG_E(param) qError("QW:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, tId) -#define QW_TASK_WLOG_E(param) qWarn("QW:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, tId) -#define QW_TASK_DLOG_E(param) qDebug("QW:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, tId) +#define QW_TASK_ELOG_E(param) qError("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, eId) +#define QW_TASK_WLOG_E(param) qWarn("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, eId) +#define QW_TASK_DLOG_E(param) qDebug("QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, eId) #define QW_SCH_TASK_ELOG(param, ...) \ - qError("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, sId, qId, tId, __VA_ARGS__) + qError("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, mgmt, sId, qId, tId, eId, __VA_ARGS__) #define QW_SCH_TASK_WLOG(param, ...) \ - qWarn("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, sId, qId, tId, __VA_ARGS__) + qWarn("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, mgmt, sId, qId, tId, eId, __VA_ARGS__) #define QW_SCH_TASK_DLOG(param, ...) \ - qDebug("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, sId, qId, tId, __VA_ARGS__) + qDebug("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, mgmt, sId, qId, tId, eId, __VA_ARGS__) #define QW_LOCK_DEBUG(...) \ do { \ diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c index cc642caa70..cc4228f7c7 100644 --- a/source/libs/qworker/src/qwMsg.c +++ b/source/libs/qworker/src/qwMsg.c @@ -480,11 +480,13 @@ int32_t qWorkerProcessCancelMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, in msg->queryId = be64toh(msg->queryId); msg->taskId = be64toh(msg->taskId); msg->refId = be64toh(msg->refId); + msg->execId = ntohl(msg->execId); uint64_t sId = msg->sId; uint64_t qId = msg->queryId; uint64_t tId = msg->taskId; int64_t rId = msg->refId; + int32_t eId = msg->execId; SQWMsg qwMsg = {.node = node, .msg = NULL, .msgLen = 0, .connInfo = pMsg->info}; @@ -598,7 +600,7 @@ int32_t qWorkerProcessDeleteMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, SR uint64_t qId = req.queryId; uint64_t tId = req.taskId; int64_t rId = 0; - int32_t eId = 0; + int32_t eId = -1; SQWMsg qwMsg = {.node = node, .msg = req.msg, .msgLen = req.phyLen, .connInfo = pMsg->info}; QW_SCH_TASK_DLOG("processDelete start, node:%p, handle:%p, sql:%s", node, pMsg->info.handle, req.sql); diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index 2b23f7a27f..cd48452df2 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -566,20 +566,22 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex if (gQWDebug.tmp) { -#if 0 - SEpSet epSet = {0}; - epSet.inUse = 1; - epSet.numOfEps = 3; - strcpy(epSet.eps[0].fqdn, "localhost"); - epSet.eps[0].port = 7100; - strcpy(epSet.eps[1].fqdn, "localhost"); - epSet.eps[1].port = 7200; - strcpy(epSet.eps[2].fqdn, "localhost"); - epSet.eps[2].port = 7300; - - qwDbgBuildAndSendRedirectRsp(pMsg->msgType + 1, &pMsg->info, TSDB_CODE_RPC_REDIRECT, &epSet); - gQWDebug.tmp = false; - return TSDB_CODE_SUCCESS; +#if 1 + if (TDMT_SCH_QUERY == qwMsg->msgType) { + SEpSet epSet = {0}; + epSet.inUse = 1; + epSet.numOfEps = 3; + strcpy(epSet.eps[0].fqdn, "localhost"); + epSet.eps[0].port = 7100; + strcpy(epSet.eps[1].fqdn, "localhost"); + epSet.eps[1].port = 7200; + strcpy(epSet.eps[2].fqdn, "localhost"); + epSet.eps[2].port = 7300; + + qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_RPC_REDIRECT, &epSet); + gQWDebug.tmp = false; + return TSDB_CODE_SUCCESS; + } #else if (TDMT_SCH_MERGE_QUERY == qwMsg->msgType) { ctx->phase = QW_PHASE_POST_QUERY; diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 26824738e9..29179536df 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -1276,6 +1276,9 @@ int32_t schProcessOnTaskStatusRsp(SQueryNodeEpId* pEpId, SArray* pStatusList) { for (int32_t i = 0; i < taskNum; ++i) { STaskStatus *taskStatus = taosArrayGet(pStatusList, i); + qDebug("QID:%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d task status in server: %s", + taskStatus->queryId, taskStatus->taskId, taskStatus->execId, jobTaskStatusStr(taskStatus->status)); + SSchJob *pJob = schAcquireJob(taskStatus->refId); if (NULL == pJob) { qWarn("job not found, refId:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64, taskStatus->refId, @@ -1284,8 +1287,6 @@ int32_t schProcessOnTaskStatusRsp(SQueryNodeEpId* pEpId, SArray* pStatusList) { continue; } - SCH_JOB_DLOG("TID:0x%" PRIx64 "EID:%d task status in server: %s", taskStatus->taskId, taskStatus->execId, jobTaskStatusStr(taskStatus->status)); - pTask = NULL; schGetTaskInJob(pJob, taskStatus->taskId, &pTask); if (NULL == pTask) { diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index 3d547ffbf8..69e41d3111 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -1062,7 +1062,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr, pMsg->queryId = htobe64(pJob->queryId); pMsg->taskId = htobe64(pTask->taskId); pMsg->refId = htobe64(pJob->refId); - pMsg->execId = htobe64(pTask->execId); + pMsg->execId = htonl(pTask->execId); break; } case TDMT_SCH_QUERY_HEARTBEAT: { From ee47df9c2a01363816b9807eb06434d75beabac2 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Thu, 30 Jun 2022 13:46:28 +0800 Subject: [PATCH 29/51] fix(query): support irate function for ms/ns precision db --- source/libs/function/src/builtins.c | 5 +++++ source/libs/function/src/builtinsimpl.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index b61f95f9a0..fcaa695345 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -44,6 +44,7 @@ void static addDbPrecisonParam(SNodeList** pList, uint8_t precision) { pVal->literal = NULL; pVal->isDuration = false; pVal->translate = true; + pVal->notReserved = true; pVal->node.resType.type = TSDB_DATA_TYPE_TINYINT; pVal->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_TINYINT].bytes; pVal->node.resType.precision = precision; @@ -1016,6 +1017,10 @@ static int32_t translateIrate(SFunctionNode* pFunc, char* pErrBuf, int32_t len) return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } + //add database precision as param + uint8_t dbPrec = pFunc->node.resType.precision; + addDbPrecisonParam(&pFunc->pParameterList, dbPrec); + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE}; return TSDB_CODE_SUCCESS; } diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index a75d5a2ecb..07b2a2375f 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -5508,7 +5508,7 @@ int32_t irateFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { pResInfo->isNullRes = (pResInfo->numOfRes == 0) ? 1 : 0; SRateInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); - double result = doCalcRate(pInfo, 1000); + double result = doCalcRate(pInfo, (double)TSDB_TICK_PER_SECOND(pCtx->param[1].param.i)); colDataAppend(pCol, pBlock->info.rows, (const char*)&result, pResInfo->isNullRes); return pResInfo->numOfRes; From 45e9b239015bde25882acd1d7b29a8d2a1889ac3 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 30 Jun 2022 13:53:11 +0800 Subject: [PATCH 30/51] fix: install script for3.0 (#14379) * fix: remove sudo from directory maniplation for 3.0 * fix: remove more sudo from directory maniplation * fix: packaging/release.sh --- packaging/release.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packaging/release.sh b/packaging/release.sh index 1d9f6dfc68..2ac52a0df9 100755 --- a/packaging/release.sh +++ b/packaging/release.sh @@ -111,9 +111,9 @@ else fi csudo="" -if command -v sudo > /dev/null; then - csudo="sudo " -fi +#if command -v sudo > /dev/null; then +# csudo="sudo " +#fi function is_valid_version() { [ -z $1 ] && return 1 || : @@ -181,7 +181,9 @@ cd "${curr_dir}" # 2. cmake executable file compile_dir="${top_dir}/debug" -${csudo}rm -rf ${compile_dir} +if [ -d ${compile_dir} ]; then + rm -rf ${compile_dir} +fi mkdir -p ${compile_dir} cd ${compile_dir} @@ -258,9 +260,9 @@ if [ "$osType" != "Darwin" ]; then if [[ "$pagMode" == "full" ]]; then if [ -d ${top_dir}/tools/taos-tools/packaging/deb ]; then cd ${top_dir}/tools/taos-tools/packaging/deb + taos_tools_ver=$(git describe --tags | sed -e 's/ver-//g' | awk -F '-' '{print $1}') [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" - taos_tools_ver=$(git describe --tags | sed -e 's/ver-//g' | awk -F '-' '{print $1}') ${csudo}./make-taos-tools-deb.sh ${top_dir} \ ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} fi @@ -283,9 +285,9 @@ if [ "$osType" != "Darwin" ]; then if [[ "$pagMode" == "full" ]]; then if [ -d ${top_dir}/tools/taos-tools/packaging/rpm ]; then cd ${top_dir}/tools/taos-tools/packaging/rpm + taos_tools_ver=$(git describe --tags | sed -e 's/ver-//g' | awk -F '-' '{print $1}' | sed -e 's/-/_/g') [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" - taos_tools_ver=$(git describe --tags | sed -e 's/ver-//g' | awk -F '-' '{print $1}' | sed -e 's/-/_/g') ${csudo}./make-taos-tools-rpm.sh ${top_dir} \ ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} fi @@ -300,7 +302,7 @@ if [ "$osType" != "Darwin" ]; then ${csudo}./makepkg.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${verNumberComp} ${dbName} ${csudo}./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName} - # ${csudo}./makearbi.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} + ${csudo}./makearbi.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} else # only make client for Darwin From 25b3f88ebe9f731440c8facee72f0611e585aad4 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 30 Jun 2022 13:55:41 +0800 Subject: [PATCH 31/51] add query epset --- source/libs/transport/src/transCli.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index b48939f9f9..77cc5dbaf7 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -1054,7 +1054,8 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { */ STransConnCtx* pCtx = pMsg->ctx; int32_t code = pResp->code; - if (pTransInst->retry != NULL && pTransInst->retry(code, pResp->msgType - 1)) { + bool retry = (pTransInst->retry != NULL && pTransInst->retry(code, pResp->msgType - 1)) ? true : false; + if (retry) { pMsg->sent = 0; pCtx->retryCnt += 1; if (code == TSDB_CODE_RPC_NETWORK_UNAVAIL) { @@ -1083,11 +1084,13 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { STraceId* trace = &pResp->info.traceId; - if (cliTryToExtractEpSet(pResp, &pCtx->epSet)) { + bool hasEpSet = cliTryToExtractEpSet(pResp, &pCtx->epSet); + if (hasEpSet) { char tbuf[256] = {0}; EPSET_DEBUG_STR(&pCtx->epSet, tbuf); tGTrace("%s conn %p extract epset from msg", CONN_GET_INST_LABEL(pConn), pConn); } + if (pCtx->pSem != NULL) { tGTrace("%s conn %p(sync) handle resp", CONN_GET_INST_LABEL(pConn), pConn); if (pCtx->pRsp == NULL) { @@ -1099,10 +1102,14 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { pCtx->pRsp = NULL; } else { tGTrace("%s conn %p handle resp", CONN_GET_INST_LABEL(pConn), pConn); - if (!cliIsEpsetUpdated(code, pCtx)) { - pTransInst->cfp(pTransInst->parent, pResp, NULL); - } else { + if (retry == false && hasEpSet == true) { pTransInst->cfp(pTransInst->parent, pResp, &pCtx->epSet); + } else { + if (!cliIsEpsetUpdated(code, pCtx)) { + pTransInst->cfp(pTransInst->parent, pResp, NULL); + } else { + pTransInst->cfp(pTransInst->parent, pResp, &pCtx->epSet); + } } } return 0; From e79fcc07f5593b3d7baf2499b9134abe42849631 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 30 Jun 2022 14:00:48 +0800 Subject: [PATCH 32/51] fix: fix stmt async issue --- source/client/src/clientImpl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 09fb73cfba..4a537a3aeb 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -1407,7 +1407,11 @@ void* doAsyncFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertU } SSyncQueryParam* pParam = pRequest->body.param; - + if (NULL == pParam) { + pParam = taosMemoryCalloc(1, sizeof(SSyncQueryParam)); + tsem_init(&pParam->sem, 0, 0); + } + // convert ucs4 to native multi-bytes string pResultInfo->convertUcs4 = convertUcs4; From a8e526a6de3bfd5b59461ccfe81f3e998b0865e7 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 30 Jun 2022 14:31:12 +0800 Subject: [PATCH 33/51] feat: support query redirect --- source/libs/qworker/src/qwDbg.c | 32 +++++++++++++++++++++++++++++- source/libs/qworker/src/qworker.c | 29 --------------------------- source/libs/scheduler/src/schJob.c | 12 ++++++----- 3 files changed, 38 insertions(+), 35 deletions(-) diff --git a/source/libs/qworker/src/qwDbg.c b/source/libs/qworker/src/qwDbg.c index 0fa01a304c..68058334ab 100644 --- a/source/libs/qworker/src/qwDbg.c +++ b/source/libs/qworker/src/qwDbg.c @@ -9,7 +9,7 @@ #include "tmsg.h" #include "tname.h" -SQWDebug gQWDebug = {.statusEnable = true, .dumpEnable = false, .tmp = true}; +SQWDebug gQWDebug = {.statusEnable = true, .dumpEnable = false, .tmp = false}; int32_t qwDbgValidateStatus(QW_FPARAMS_DEF, int8_t oriStatus, int8_t newStatus, bool *ignore) { if (!gQWDebug.statusEnable) { @@ -138,6 +138,7 @@ int32_t qwDbgBuildAndSendRedirectRsp(int32_t rspType, SRpcHandleInfo *pConn, int .code = code, .info = *pConn, }; + rpcRsp.info.hasEpSet = 1; tmsgSendRsp(&rpcRsp); @@ -146,6 +147,35 @@ int32_t qwDbgBuildAndSendRedirectRsp(int32_t rspType, SRpcHandleInfo *pConn, int return TSDB_CODE_SUCCESS; } +int32_t qwDbgResponseREdirect(SQWMsg *qwMsg, SQWTaskCtx *ctx) { + if (gQWDebug.tmp) { + if (TDMT_SCH_QUERY == qwMsg->msgType) { + SEpSet epSet = {0}; + epSet.inUse = 1; + epSet.numOfEps = 3; + strcpy(epSet.eps[0].fqdn, "localhost"); + epSet.eps[0].port = 7100; + strcpy(epSet.eps[1].fqdn, "localhost"); + epSet.eps[1].port = 7200; + strcpy(epSet.eps[2].fqdn, "localhost"); + epSet.eps[2].port = 7300; + + qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_RPC_REDIRECT, &epSet); + gQWDebug.tmp = false; + return TSDB_CODE_SUCCESS; + } + + if (TDMT_SCH_MERGE_QUERY == qwMsg->msgType) { + ctx->phase = QW_PHASE_POST_QUERY; + qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_RPC_REDIRECT, NULL); + gQWDebug.tmp = false; + return TSDB_CODE_SUCCESS; + } + } + + return TSDB_CODE_SUCCESS; +} + int32_t qwDbgEnableDebug(char *option) { if (0 == strcasecmp(option, "lock")) { diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index cd48452df2..949b67249f 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -564,35 +564,6 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex QW_ERR_JRET(qwExecTask(QW_FPARAMS(), ctx, NULL)); } - - if (gQWDebug.tmp) { -#if 1 - if (TDMT_SCH_QUERY == qwMsg->msgType) { - SEpSet epSet = {0}; - epSet.inUse = 1; - epSet.numOfEps = 3; - strcpy(epSet.eps[0].fqdn, "localhost"); - epSet.eps[0].port = 7100; - strcpy(epSet.eps[1].fqdn, "localhost"); - epSet.eps[1].port = 7200; - strcpy(epSet.eps[2].fqdn, "localhost"); - epSet.eps[2].port = 7300; - - qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_RPC_REDIRECT, &epSet); - gQWDebug.tmp = false; - return TSDB_CODE_SUCCESS; - } -#else - if (TDMT_SCH_MERGE_QUERY == qwMsg->msgType) { - ctx->phase = QW_PHASE_POST_QUERY; - qwDbgBuildAndSendRedirectRsp(qwMsg->msgType + 1, &qwMsg->connInfo, TSDB_CODE_RPC_REDIRECT, NULL); - gQWDebug.tmp = false; - return TSDB_CODE_SUCCESS; - } -#endif - } - - _return: input.code = code; diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 29179536df..b2a96cbb23 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -1684,7 +1684,7 @@ _return: SCH_RET(code); } -int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, int32_t rspCode) { +int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, SDataBuf* pData, int32_t rspCode) { int32_t code = 0; int8_t status = 0; if (schJobNeedToStop(pJob, &status)) { @@ -1711,6 +1711,10 @@ int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, int32_t rspCode) { memset(&pTask->succeedAddr, 0, sizeof(pTask->succeedAddr)); if (SCH_IS_DATA_SRC_QRY_TASK(pTask)) { + if (pData) { + SCH_ERR_JRET(schUpdateTaskCandidateAddr(pJob, pTask, pData->pEpSet)); + } + if (SCH_TASK_NEED_FLOW_CTRL(pJob, pTask)) { if (JOB_TASK_STATUS_EXECUTING == SCH_GET_TASK_STATUS(pTask)) { SCH_ERR_JRET(schLaunchTasksInFlowCtrlList(pJob, pTask)); @@ -1737,7 +1741,7 @@ int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, int32_t rspCode) { for (int32_t i = 0; i < childrenNum; ++i) { SSchTask* pChild = taosArrayGetP(pTask->children, i); SCH_LOCK_TASK(pChild); - schDoTaskRedirect(pJob, pChild, rspCode); + schDoTaskRedirect(pJob, pChild, NULL, rspCode); SCH_UNLOCK_TASK(pChild); } @@ -1758,11 +1762,9 @@ int32_t schHandleRedirect(SSchJob *pJob, SSchTask *pTask, SDataBuf* pData, int32 SCH_TASK_ELOG("no epset updated while got error %s", tstrerror(rspCode)); SCH_ERR_JRET(rspCode); } - - SCH_ERR_JRET(schUpdateTaskCandidateAddr(pJob, pTask, pData->pEpSet)); } - SCH_RET(schDoTaskRedirect(pJob, pTask, rspCode)); + SCH_RET(schDoTaskRedirect(pJob, pTask, pData, rspCode)); _return: From 4695dc2dae310bc6011b2f814e92038efb00589e Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Thu, 30 Jun 2022 14:41:50 +0800 Subject: [PATCH 34/51] feat(tmq): add snapshot test --- examples/c/tmq.c | 2 +- include/libs/executor/executor.h | 4 +- source/client/src/tmq.c | 16 +- source/dnode/vnode/inc/vnode.h | 1 + source/dnode/vnode/src/inc/tq.h | 13 +- source/dnode/vnode/src/tq/tq.c | 14 +- source/dnode/vnode/src/tq/tqExec.c | 18 +- source/dnode/vnode/src/tsdb/tsdbRead.c | 55 +++-- source/libs/executor/inc/executorimpl.h | 18 +- source/libs/executor/src/executorMain.c | 13 +- source/libs/executor/src/executorimpl.c | 30 ++- source/libs/executor/src/scanoperator.c | 49 +++- tests/script/jenkins/basic.txt | 1 + tests/script/tsim/tmq/snapshot1.sim | 308 ++++++++++++++++++++++++ tests/test/c/tmqSim.c | 28 +-- 15 files changed, 505 insertions(+), 65 deletions(-) create mode 100644 tests/script/tsim/tmq/snapshot1.sim diff --git a/examples/c/tmq.c b/examples/c/tmq.c index 4226587d56..697a53e570 100644 --- a/examples/c/tmq.c +++ b/examples/c/tmq.c @@ -199,7 +199,7 @@ tmq_t* build_consumer() { tmq_conf_set(conf, "msg.with.table.name", "true"); tmq_conf_set(conf, "enable.auto.commit", "true"); - tmq_conf_set(conf, "experiment.use.snapshot", "false"); + tmq_conf_set(conf, "experimental.snapshot.enable", "true"); tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL); tmq_t* tmq = tmq_consumer_new(conf, NULL, 0); diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h index 6b4772dc2e..d3e3c58622 100644 --- a/include/libs/executor/executor.h +++ b/include/libs/executor/executor.h @@ -36,6 +36,7 @@ typedef struct SReadHandle { void* vnode; void* mnd; SMsgCb* pMsgCb; + bool tqReader; } SReadHandle; typedef enum { @@ -133,7 +134,6 @@ int32_t qKillTask(qTaskInfo_t tinfo); */ int32_t qAsyncKillTask(qTaskInfo_t tinfo); - /** * destroy query info structure * @param qHandle @@ -172,6 +172,8 @@ int32_t qDeserializeTaskStatus(qTaskInfo_t tinfo, const char* pInput, int32_t le */ int32_t qGetStreamScanStatus(qTaskInfo_t tinfo, uint64_t* uid, int64_t* ts); +int32_t qPrepareScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts); + #ifdef __cplusplus } #endif diff --git a/source/client/src/tmq.c b/source/client/src/tmq.c index 5493628e74..aa78649ba7 100644 --- a/source/client/src/tmq.c +++ b/source/client/src/tmq.c @@ -54,7 +54,8 @@ struct tmq_conf_t { int8_t autoCommit; int8_t resetOffset; int8_t withTbName; - int8_t useSnapshot; + int8_t spEnable; + int32_t spBatchSize; uint16_t port; int32_t autoCommitInterval; char* ip; @@ -288,18 +289,23 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value } } - if (strcmp(key, "experiment.use.snapshot") == 0) { + if (strcmp(key, "experimental.snapshot.enable") == 0) { if (strcmp(value, "true") == 0) { - conf->useSnapshot = true; + conf->spEnable = true; return TMQ_CONF_OK; } else if (strcmp(value, "false") == 0) { - conf->useSnapshot = false; + conf->spEnable = false; return TMQ_CONF_OK; } else { return TMQ_CONF_INVALID; } } + if (strcmp(key, "experimental.snapshot.batch.size") == 0) { + conf->spBatchSize = atoi(value); + return TMQ_CONF_OK; + } + if (strcmp(key, "td.connect.ip") == 0) { conf->ip = strdup(value); return TMQ_CONF_OK; @@ -918,7 +924,7 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) { strcpy(pTmq->clientId, conf->clientId); strcpy(pTmq->groupId, conf->groupId); pTmq->withTbName = conf->withTbName; - pTmq->useSnapshot = conf->useSnapshot; + pTmq->useSnapshot = conf->spEnable; pTmq->autoCommit = conf->autoCommit; pTmq->autoCommitInterval = conf->autoCommitInterval; pTmq->commitCb = conf->commitCb; diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index cef0bbbc01..4dc11a4815 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -116,6 +116,7 @@ typedef void *tsdbReaderT; #define BLOCK_LOAD_TABLE_SEQ_ORDER 2 #define BLOCK_LOAD_TABLE_RR_ORDER 3 +int32_t tsdbSetTableId(tsdbReaderT reader, int64_t uid); int32_t tsdbSetTableList(tsdbReaderT reader, SArray *tableList); tsdbReaderT tsdbReaderOpen(SVnode *pVnode, SQueryTableDataCond *pCond, SArray *tableList, uint64_t qId, uint64_t taskId); diff --git a/source/dnode/vnode/src/inc/tq.h b/source/dnode/vnode/src/inc/tq.h index 38a4f28041..cab4805b20 100644 --- a/source/dnode/vnode/src/inc/tq.h +++ b/source/dnode/vnode/src/inc/tq.h @@ -161,7 +161,7 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalHead* // tqExec int32_t tqLogScanExec(STQ* pTq, STqExecHandle* pExec, SSubmitReq* pReq, SMqDataRsp* pRsp, int32_t workerId); -int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, int32_t workerId); +int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, STqOffsetVal offset, int32_t workerId); int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, const SMqDataRsp* pRsp); // tqMeta @@ -183,6 +183,17 @@ int32_t tqOffsetSnapshot(STqOffsetStore* pStore); // tqSink void tqTableSink(SStreamTask* pTask, void* vnode, int64_t ver, void* data); +static FORCE_INLINE void tqOffsetResetToData(STqOffsetVal* pOffsetVal, int64_t uid, int64_t ts) { + pOffsetVal->type = TMQ_OFFSET__SNAPSHOT_DATA; + pOffsetVal->uid = uid; + pOffsetVal->ts = ts; +} + +static FORCE_INLINE void tqOffsetResetToLog(STqOffsetVal* pOffsetVal, int64_t ver) { + pOffsetVal->type = TMQ_OFFSET__LOG; + pOffsetVal->version = ver; +} + #ifdef __cplusplus } #endif diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index a08515ed5c..0563b67f4a 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -228,17 +228,6 @@ static int32_t tqInitDataRsp(SMqDataRsp* pRsp, const SMqPollReq* pReq, int8_t su static int32_t tqInitMetaRsp(SMqMetaRsp* pRsp, const SMqPollReq* pReq) { return 0; } -static FORCE_INLINE void tqOffsetResetToData(STqOffsetVal* pOffsetVal, int64_t uid, int64_t ts) { - pOffsetVal->type = TMQ_OFFSET__SNAPSHOT_DATA; - pOffsetVal->uid = uid; - pOffsetVal->ts = ts; -} - -static FORCE_INLINE void tqOffsetResetToLog(STqOffsetVal* pOffsetVal, int64_t ver) { - pOffsetVal->type = TMQ_OFFSET__LOG; - pOffsetVal->version = ver; -} - int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) { SMqPollReq* pReq = pMsg->pCont; int64_t consumerId = pReq->consumerId; @@ -394,7 +383,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) { char formatBuf[50]; tFormatOffset(formatBuf, 50, &dataRsp.reqOffset); tqInfo("retrieve using snapshot req offset %s", formatBuf); - if (tqScanSnapshot(pTq, &pHandle->execHandle, &dataRsp, workerId) < 0) { + if (tqScanSnapshot(pTq, &pHandle->execHandle, &dataRsp, fetchOffsetNew, workerId) < 0) { ASSERT(0); } @@ -655,6 +644,7 @@ int32_t tqProcessVgChangeReq(STQ* pTq, char* msg, int32_t msgLen) { .reader = pHandle->execHandle.pExecReader[i], .meta = pTq->pVnode->pMeta, .vnode = pTq->pVnode, + .tqReader = true, }; pHandle->execHandle.execCol.task[i] = qCreateStreamExecTaskInfo(pHandle->execHandle.execCol.qmsg, &handle); ASSERT(pHandle->execHandle.execCol.task[i]); diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index eb09199c70..ac6cc2e411 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -59,13 +59,18 @@ static int32_t tqAddTbNameToRsp(const STQ* pTq, int64_t uid, SMqDataRsp* pRsp, i return 0; } -int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, int32_t workerId) { +int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, STqOffsetVal offset, int32_t workerId) { ASSERT(pExec->subType == TOPIC_SUB_TYPE__COLUMN); qTaskInfo_t task = pExec->execCol.task[workerId]; - // TODO set uid and ts + if (qStreamScanSnapshot(task) < 0) { ASSERT(0); } + if (qPrepareScan(task, offset.uid, offset.ts) < 0) { + ASSERT(0); + } + + int32_t rowCnt = 0; while (1) { SSDataBlock* pDataBlock = NULL; uint64_t ts = 0; @@ -86,7 +91,16 @@ int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, i /*tqAddTbNameToRsp(pTq, uid, pRsp, workerId);*/ } pRsp->blockNum++; + + rowCnt += pDataBlock->info.rows; + if (rowCnt >= 4096) break; } + int64_t uid; + int64_t ts; + if (qGetStreamScanStatus(task, &uid, &ts) < 0) { + ASSERT(0); + } + tqOffsetResetToData(&pRsp->rspOffset, uid, ts); return 0; } diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 03f18cc766..e182add5d6 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -112,9 +112,9 @@ typedef struct STsdbReadHandle { STimeWindow window; // the primary query time window that applies to all queries // SColumnDataAgg* statis; // query level statistics, only one table block statistics info exists at any time // SColumnDataAgg** pstatis;// the ptr array list to return to caller - int32_t numOfBlocks; + int32_t numOfBlocks; SSDataBlock* pResBlock; -// SArray* pColumns; // column list, SColumnInfoData array list + // SArray* pColumns; // column list, SColumnInfoData array list bool locateStart; int32_t outputCapacity; int32_t realNumOfRows; @@ -223,6 +223,22 @@ int64_t tsdbGetNumOfRowsInMemTable(tsdbReaderT* pHandle) { return rows; } +static SArray* createCheckInfoFromUid(STsdbReadHandle* pTsdbReadHandle, int64_t uid) { + SArray* pTableCheckInfo = taosArrayInit(1, sizeof(STableCheckInfo)); + if (pTableCheckInfo == NULL) { + return NULL; + } + STableCheckInfo info = { + .tableId = uid, + }; + info.suid = pTsdbReadHandle->suid; + + taosArrayPush(pTableCheckInfo, &info); + tsdbDebug("%p check table uid:%" PRId64 " from lastKey:%" PRId64 " %s", pTsdbReadHandle, info.tableId, info.lastKey, + pTsdbReadHandle->idStr); + return pTableCheckInfo; +} + static SArray* createCheckInfoFromTableGroup(STsdbReadHandle* pTsdbReadHandle, SArray* pTableList) { size_t tableSize = taosArrayGetSize(pTableList); @@ -428,8 +444,8 @@ static STsdbReadHandle* tsdbQueryTablesImpl(SVnode* pVnode, SQueryTableDataCond* for (int32_t i = 0; i < pCond->numOfCols; ++i) { SColumnInfoData colInfo = {.info = pCond->colList[i], 0}; - int32_t code = blockDataAppendColInfo(pReadHandle->pResBlock, &colInfo); - if (code != TSDB_CODE_SUCCESS){ + int32_t code = blockDataAppendColInfo(pReadHandle->pResBlock, &colInfo); + if (code != TSDB_CODE_SUCCESS) { goto _end; } } @@ -494,9 +510,19 @@ static int32_t setCurrentSchema(SVnode* pVnode, STsdbReadHandle* pTsdbReadHandle return TSDB_CODE_SUCCESS; } -int32_t tsdbSetTableList(tsdbReaderT reader, SArray* tableList){ +int32_t tsdbSetTableId(tsdbReaderT reader, int64_t uid) { STsdbReadHandle* pTsdbReadHandle = reader; - if(pTsdbReadHandle->pTableCheckInfo) taosArrayDestroy(pTsdbReadHandle->pTableCheckInfo); + if (pTsdbReadHandle->pTableCheckInfo) taosArrayDestroy(pTsdbReadHandle->pTableCheckInfo); + pTsdbReadHandle->pTableCheckInfo = createCheckInfoFromUid(pTsdbReadHandle, uid); + if (pTsdbReadHandle->pTableCheckInfo == NULL) { + return TSDB_CODE_TDB_OUT_OF_MEMORY; + } + return TDB_CODE_SUCCESS; +} + +int32_t tsdbSetTableList(tsdbReaderT reader, SArray* tableList) { + STsdbReadHandle* pTsdbReadHandle = reader; + if (pTsdbReadHandle->pTableCheckInfo) taosArrayDestroy(pTsdbReadHandle->pTableCheckInfo); pTsdbReadHandle->pTableCheckInfo = createCheckInfoFromTableGroup(pTsdbReadHandle, tableList); if (pTsdbReadHandle->pTableCheckInfo == NULL) { return TSDB_CODE_TDB_OUT_OF_MEMORY; @@ -505,10 +531,10 @@ int32_t tsdbSetTableList(tsdbReaderT reader, SArray* tableList){ } tsdbReaderT tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* tableList, uint64_t qId, - uint64_t taskId) { - if(taosArrayGetSize(tableList) == 0){ - return NULL; - } + uint64_t taskId) { + /*if (taosArrayGetSize(tableList) == 0) {*/ + /*return NULL;*/ + /*}*/ STsdbReadHandle* pTsdbReadHandle = tsdbQueryTablesImpl(pVnode, pCond, qId, taskId); if (pTsdbReadHandle == NULL) { return NULL; @@ -553,8 +579,7 @@ tsdbReaderT tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* t } tsdbDebug("%p total numOfTable:%" PRIzu " in this query, table %" PRIzu " %s", pTsdbReadHandle, - taosArrayGetSize(pTsdbReadHandle->pTableCheckInfo), taosArrayGetSize(tableList), - pTsdbReadHandle->idStr); + taosArrayGetSize(pTsdbReadHandle->pTableCheckInfo), taosArrayGetSize(tableList), pTsdbReadHandle->idStr); return (tsdbReaderT)pTsdbReadHandle; } @@ -1073,7 +1098,7 @@ static int32_t getFileIdFromKey(TSKEY key, int32_t daysPerFile, int32_t precisio } int64_t fid = (int64_t)(key / (daysPerFile * tsTickPerMin[precision])); // set the starting fileId - if (fid < 0LL && llabs(fid) > INT32_MAX) { // data value overflow for INT32 + if (fid < 0LL && llabs(fid) > INT32_MAX) { // data value overflow for INT32 fid = INT32_MIN; } @@ -2612,7 +2637,7 @@ int32_t tsdbGetFileBlocksDistInfo(tsdbReaderT* queryHandle, STableBlockDistInfo* tsdbGetFidKeyRange(pCfg->days, pCfg->precision, pTsdbReadHandle->pFileGroup->fid, &win.skey, &win.ekey); // current file are not overlapped with query time window, ignore remain files - if ((win.skey > pTsdbReadHandle->window.ekey)/* || (!ascTraverse && win.ekey < pTsdbReadHandle->window.ekey)*/) { + if ((win.skey > pTsdbReadHandle->window.ekey) /* || (!ascTraverse && win.ekey < pTsdbReadHandle->window.ekey)*/) { tsdbUnLockFS(REPO_FS(pTsdbReadHandle->pTsdb)); tsdbDebug("%p remain files are not qualified for qrange:%" PRId64 "-%" PRId64 ", ignore, %s", pTsdbReadHandle, pTsdbReadHandle->window.skey, pTsdbReadHandle->window.ekey, pTsdbReadHandle->idStr); @@ -2886,7 +2911,7 @@ int32_t tsdbGetCtbIdList(SMeta* pMeta, int64_t suid, SArray* list) { */ int32_t tsdbGetStbIdList(SMeta* pMeta, int64_t suid, SArray* list) { SMStbCursor* pCur = metaOpenStbCursor(pMeta, suid); - if(!pCur) { + if (!pCur) { return TSDB_CODE_FAILED; } diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 6b5826bf88..618cf50b86 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -248,6 +248,11 @@ typedef struct SSampleExecInfo { uint32_t seed; // random seed value } SSampleExecInfo; +enum { + TABLE_SCAN__TABLE_ORDER = 1, + TABLE_SCAN__BLOCK_ORDER = 1, +}; + typedef struct STableScanInfo { void* dataReader; SReadHandle readHandle; @@ -272,13 +277,21 @@ typedef struct STableScanInfo { int32_t curTWinIdx; int32_t currentGroupId; + int32_t currentTable; uint64_t queryId; // todo remove it uint64_t taskId; // todo remove it struct { uint64_t uid; - int64_t t; - } scanStatus; + int64_t ts; + } lastStatus; + + struct { + uint64_t uid; + int64_t ts; + } expStatus; + + int8_t scanMode; } STableScanInfo; typedef struct STagScanInfo { @@ -713,6 +726,7 @@ void destroyBasicOperatorInfo(void* param, int32_t numOfOutput); void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHandle); void setTbNameColData(void* pMeta, const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, int32_t functionId); +int32_t doPrepareScan(SOperatorInfo* pOperator, uint64_t uid, int64_t ts); int32_t doGetScanStatus(SOperatorInfo* pOperator, uint64_t* uid, int64_t* ts); SSDataBlock* loadNextDataBlock(void* param); diff --git a/source/libs/executor/src/executorMain.c b/source/libs/executor/src/executorMain.c index 0871575d95..deb4f970df 100644 --- a/source/libs/executor/src/executorMain.c +++ b/source/libs/executor/src/executorMain.c @@ -222,7 +222,7 @@ int32_t qSerializeTaskStatus(qTaskInfo_t tinfo, char** pOutput, int32_t* len) { } int32_t qDeserializeTaskStatus(qTaskInfo_t tinfo, const char* pInput, int32_t len) { - SExecTaskInfo* pTaskInfo = (struct SExecTaskInfo*) tinfo; + SExecTaskInfo* pTaskInfo = (struct SExecTaskInfo*)tinfo; if (pTaskInfo == NULL || pInput == NULL || len == 0) { return TSDB_CODE_INVALID_PARA; @@ -231,11 +231,14 @@ int32_t qDeserializeTaskStatus(qTaskInfo_t tinfo, const char* pInput, int32_t le return decodeOperator(pTaskInfo->pRoot, pInput, len); } +int32_t qPrepareScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts) { + SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; -int32_t qGetStreamScanStatus(qTaskInfo_t tinfo, uint64_t* uid, int64_t* ts) { - SExecTaskInfo* pTaskInfo = (SExecTaskInfo*) tinfo; - - return TSDB_CODE_SUCCESS; + return doPrepareScan(pTaskInfo->pRoot, uid, ts); } +int32_t qGetStreamScanStatus(qTaskInfo_t tinfo, uint64_t* uid, int64_t* ts) { + SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; + return doGetScanStatus(pTaskInfo->pRoot, uid, ts); +} diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 95782ce001..6fc1d2b0b4 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1033,7 +1033,7 @@ static uint32_t doFilterByBlockTimeWindow(STableScanInfo* pTableScanInfo, SSData SqlFunctionCtx* pCtx = pTableScanInfo->pCtx; uint32_t status = BLK_DATA_NOT_LOAD; - int32_t numOfOutput = 0;//pTableScanInfo->numOfOutput; + int32_t numOfOutput = 0; // pTableScanInfo->numOfOutput; for (int32_t i = 0; i < numOfOutput; ++i) { int32_t functionId = pCtx[i].functionId; int32_t colId = pTableScanInfo->pExpr[i].base.pParam[0].pCol->colId; @@ -2821,13 +2821,35 @@ int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scan } } +int32_t doPrepareScan(SOperatorInfo* pOperator, uint64_t uid, int64_t ts) { + int32_t type = pOperator->operatorType; + if (type == QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) { + SStreamBlockScanInfo* pScanInfo = pOperator->info; + STableScanInfo* pSnapShotScanInfo = pScanInfo->pSnapshotReadOp->info; + /**uid = pSnapShotScanInfo->scanStatus.uid;*/ + /**ts = pSnapShotScanInfo->scanStatus.t;*/ + if (pSnapShotScanInfo->lastStatus.uid != uid || pSnapShotScanInfo->lastStatus.ts != ts) { + // rebuild scan + // + } + } else { + if (pOperator->pDownstream[0] == NULL) { + return TSDB_CODE_INVALID_PARA; + } else { + doPrepareScan(pOperator->pDownstream[0], uid, ts); + } + } + + return TSDB_CODE_SUCCESS; +} + int32_t doGetScanStatus(SOperatorInfo* pOperator, uint64_t* uid, int64_t* ts) { int32_t type = pOperator->operatorType; if (type == QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) { SStreamBlockScanInfo* pScanInfo = pOperator->info; - STableScanInfo* pSnapShotScanInfo = pScanInfo->pSnapshotReadOp->info; - *uid = pSnapShotScanInfo->scanStatus.uid; - *ts = pSnapShotScanInfo->scanStatus.t; + STableScanInfo* pSnapShotScanInfo = pScanInfo->pSnapshotReadOp->info; + *uid = pSnapShotScanInfo->lastStatus.uid; + *ts = pSnapShotScanInfo->lastStatus.ts; } else { if (pOperator->pDownstream[0] == NULL) { return TSDB_CODE_INVALID_PARA; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index ca4afdeb7f..c057485f51 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -416,8 +416,8 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) { pOperator->cost.totalCost = pTableScanInfo->readRecorder.elapsedTime; // todo refactor - pTableScanInfo->scanStatus.uid = pBlock->info.uid; - pTableScanInfo->scanStatus.t = pBlock->info.window.ekey; + pTableScanInfo->lastStatus.uid = pBlock->info.uid; + pTableScanInfo->lastStatus.ts = pBlock->info.window.ekey; return pBlock; } @@ -513,6 +513,44 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) { STableScanInfo* pInfo = pOperator->info; SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + // if scan table by table + if (pInfo->scanMode == TABLE_SCAN__TABLE_ORDER) { + // check status + if (pInfo->lastStatus.uid == pInfo->expStatus.uid && pInfo->lastStatus.ts == pInfo->expStatus.ts) { + SSDataBlock* result = doTableScanGroup(pOperator); + if (result) { + return result; + } + // if no data, switch to next table and continue scan + pInfo->currentTable++; + if (pInfo->currentTable >= taosArrayGetSize(pTaskInfo->tableqinfoList.pTableList)) { + return NULL; + } + STableKeyInfo* pTableInfo = taosArrayGet(pTaskInfo->tableqinfoList.pTableList, pInfo->currentTable); + /*pTableInfo->uid */ + tsdbSetTableId(pInfo->dataReader, pTableInfo->uid); + tsdbResetReadHandle(pInfo->dataReader, &pInfo->cond, 0); + pInfo->scanTimes = 0; + pInfo->curTWinIdx = 0; + pInfo->lastStatus.ts = pInfo->expStatus.ts; + pInfo->lastStatus.uid = pInfo->expStatus.uid; + return doTableScan(pOperator); + } + // reset to exp table and window start from ts + tsdbSetTableId(pInfo->dataReader, pInfo->expStatus.uid); + SQueryTableDataCond tmpCond = pInfo->cond; + tmpCond.twindows[0] = (STimeWindow){ + .skey = pInfo->expStatus.ts, + .ekey = INT64_MAX, + }; + tsdbResetReadHandle(pInfo->dataReader, &tmpCond, 0); + pInfo->scanTimes = 0; + pInfo->curTWinIdx = 0; + pInfo->lastStatus.ts = pInfo->expStatus.ts; + pInfo->lastStatus.uid = pInfo->expStatus.uid; + return doTableScan(pOperator); + } + if (pInfo->currentGroupId == -1) { pInfo->currentGroupId++; if (pInfo->currentGroupId >= taosArrayGetSize(pTaskInfo->tableqinfoList.pGroupList)) { @@ -1207,6 +1245,13 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys if (pHandle) { SOperatorInfo* pTableScanDummy = createTableScanOperatorInfo(pTableScanNode, pHandle, pTaskInfo, queryId, taskId); STableScanInfo* pSTInfo = (STableScanInfo*)pTableScanDummy->info; + + SArray* tableList = taosArrayGetP(pTaskInfo->tableqinfoList.pGroupList, 0); + if (pHandle->tqReader) { + pSTInfo->scanMode = TABLE_SCAN__TABLE_ORDER; + pSTInfo->dataReader = tsdbReaderOpen(pHandle->vnode, &pSTInfo->cond, tableList, 0, 0); + } + if (pSTInfo->interval.interval > 0) { pInfo->pUpdateInfo = updateInfoInitP(&pSTInfo->interval, pTwSup->waterMark); } else { diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index cc114ac55f..2a3cb88c1f 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -129,6 +129,7 @@ ./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim ./test.sh -f tsim/tmq/topic.sim ./test.sh -f tsim/tmq/snapshot.sim +./test.sh -f tsim/tmq/snapshot1.sim # --- stable ./test.sh -f tsim/stable/disk.sim diff --git a/tests/script/tsim/tmq/snapshot1.sim b/tests/script/tsim/tmq/snapshot1.sim new file mode 100644 index 0000000000..8c4a719006 --- /dev/null +++ b/tests/script/tsim/tmq/snapshot1.sim @@ -0,0 +1,308 @@ +#### test scenario, please refer to https://jira.taosdata.com:18090/pages/viewpage.action?pageId=135120406 +#basic1Of2Cons.sim: vgroups=1, one topic for 2 consumers, firstly insert data, then start consume. Include six topics +#basic2Of2ConsOverlap.sim: vgroups=1, multi topics for 2 consumers, firstly insert data, then start consume. Include six topics +#basic3Of2Cons.sim: vgroups=4, one topic for 2 consumers, firstly insert data, then start consume. Include six topics +#basic4Of2Cons.sim: vgroups=4, multi topics for 2 consumers, firstly insert data, then start consume. Include six topics + +# notes1: Scalar function: ABS/ACOS/ASIN/ATAN/CEIL/COS/FLOOR/LOG/POW/ROUND/SIN/SQRT/TAN +# The above use cases are combined with where filter conditions, such as: where ts > "2017-08-12 18:25:58.128Z" and sin(a) > 0.5; +# +# notes2: not support aggregate functions(such as sum/count/min/max) and time-windows(interval). +# + +run tsim/tmq/prepareBasicEnv-1vgrp.sim + +#---- global parameters start ----# +$dbName = db +$vgroups = 1 +$stbPrefix = stb +$ctbPrefix = ctb +$ntbPrefix = ntb +$stbNum = 1 +$ctbNum = 10 +$ntbNum = 10 +$rowsPerCtb = 10 +$tstart = 1640966400000 # 2022-01-01 00:00:00.000 +#---- global parameters end ----# + +$pullDelay = 5 +$ifcheckdata = 1 +$ifmanualcommit = 1 +$showMsg = 1 +$showRow = 0 + +sql connect +sql use $dbName + +print == create topics from super table +sql create topic topic_stb_column as select ts, c3 from stb +sql create topic topic_stb_all as select ts, c1, c2, c3 from stb +sql create topic topic_stb_function as select ts, abs(c1), sin(c2) from stb + +print == create topics from child table +sql create topic topic_ctb_column as select ts, c3 from ctb0 +sql create topic topic_ctb_all as select * from ctb0 +sql create topic topic_ctb_function as select ts, abs(c1), sin(c2) from ctb0 + +print == create topics from normal table +sql create topic topic_ntb_column as select ts, c3 from ntb0 +sql create topic topic_ntb_all as select * from ntb0 +sql create topic topic_ntb_function as select ts, abs(c1), sin(c2) from ntb0 + +#sql show topics +#if $rows != 9 then +# return -1 +#endi + +#'group.id:cgrp1,enable.auto.commit:false,auto.commit.interval.ms:6000,auto.offset.reset:earliest' +$keyList = ' . group.id:cgrp1 +$keyList = $keyList . , +$keyList = $keyList . enable.auto.commit:false +#$keyList = $keyList . , +#$keyList = $keyList . auto.commit.interval.ms:6000 +#$keyList = $keyList . , +#$keyList = $keyList . auto.offset.reset:earliest +$keyList = $keyList . ' +print ========== key list: $keyList + +$topicNum = 2 + +#=============================== start consume =============================# + + +print ================ test consume from stb +print == overlap toipcs: topic_stb_column + topic_stb_all, topic_stb_function + topic_stb_all +$topicList = ' . topic_stb_column +$topicList = $topicList . , +$topicList = $topicList . topic_stb_all +$topicList = $topicList . ' + +$consumerId = 0 +$totalMsgOfOneTopic = $ctbNum * $rowsPerCtb +$totalMsgOfStb = $totalMsgOfOneTopic * $topicNum +$expectmsgcnt = $totalMsgOfStb +sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit ) + + +$topicList = ' . topic_stb_all +$topicList = $topicList . , +$topicList = $topicList . topic_stb_function +$topicList = $topicList . ' +$consumerId = 1 +sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit ) + +print == start consumer to pull msgs from stb +print == tsim/tmq/consume.sh -d $dbName -y $pullDelay -g $showMsg -r $showRow -w $dbName -s start -e 1 +system tsim/tmq/consume.sh -d $dbName -y $pullDelay -g $showMsg -r $showRow -w $dbName -s start -e 1 + +print == check consume result +wait_consumer_end_from_stb: +sql select * from consumeresult +print ==> rows: $rows +print ==> rows[0]: $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] +print ==> rows[1]: $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] +if $rows != 2 then + sleep 1000 + goto wait_consumer_end_from_stb +endi +if $data[0][1] == 0 then + if $data[1][1] != 1 then + return -1 + endi +endi +if $data[0][1] == 1 then + if $data[1][1] != 0 then + return -1 + endi +endi + +# $data[0][3]/$data[1][3] should be between $totalMsgOfOneTopic and $totalMsgOfStb. +if $data[0][3] < $totalMsgOfOneTopic then + return -1 +endi +if $data[0][3] > $totalMsgOfStb then + return -1 +endi +if $data[1][3] < $totalMsgOfOneTopic then + return -1 +endi +if $data[1][3] > $totalMsgOfStb then + return -1 +endi + +$totalMsgCons = $totalMsgOfOneTopic + $totalMsgOfStb +$sumOfRows = $data[0][3] + $data[1][3] +if $sumOfRows != $totalMsgCons then + return -1 +endi + +####################################################################################### +# clear consume info and consume result +#run tsim/tmq/clearConsume.sim +# because drop table function no stable, so by create new db for consume info and result. Modify it later +$cdbName = cdb1 +sql create database $cdbName vgroups 1 +sleep 500 +sql use $cdbName + +print == create consume info table and consume result table for ctb +sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int) +sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int) + +sql show tables +if $rows != 2 then + return -1 +endi +####################################################################################### + + +print ================ test consume from ctb +print == overlap toipcs: topic_ctb_column + topic_ctb_all, topic_ctb_function + topic_ctb_all +$topicList = ' . topic_ctb_column +$topicList = $topicList . , +$topicList = $topicList . topic_ctb_all +$topicList = $topicList . ' +$consumerId = 0 + +$totalMsgOfOneTopic = $rowsPerCtb +$totalMsgOfCtb = $totalMsgOfOneTopic * $topicNum +$expectmsgcnt = $totalMsgOfCtb +sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit ) + +$topicList = ' . topic_ctb_function +$topicList = $topicList . , +$topicList = $topicList . topic_ctb_all +$topicList = $topicList . ' +$consumerId = 1 +sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit ) + +print == start consumer to pull msgs from ctb +print == tsim/tmq/consume.sh -d $dbName -y $pullDelay -g $showMsg -r $showRow -w $cdbName -s start -e 1 +system tsim/tmq/consume.sh -d $dbName -y $pullDelay -g $showMsg -r $showRow -w $cdbName -s start -e 1 + +print == check consume result +wait_consumer_end_from_ctb: +sql select * from consumeresult +print ==> rows: $rows +print ==> rows[0]: $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] +print ==> rows[1]: $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] +if $rows != 2 then + sleep 1000 + goto wait_consumer_end_from_ctb +endi +if $data[0][1] == 0 then + if $data[1][1] != 1 then + return -1 + endi +endi +if $data[0][1] == 1 then + if $data[1][1] != 0 then + return -1 + endi +endi + +if $data[0][3] == $totalMsgOfOneTopic then + if $data[1][3] == $totalMsgOfCtb then + goto check_ok_1 + endi +elif $data[1][3] == $totalMsgOfOneTopic then + if $data[0][3] == $totalMsgOfCtb then + goto check_ok_1 + endi +endi +return -1 +check_ok_1: + +####################################################################################### +# clear consume info and consume result +#run tsim/tmq/clearConsume.sim +# because drop table function no stable, so by create new db for consume info and result. Modify it later +$cdbName = cdb2 +sql create database $cdbName vgroups 1 +sleep 500 +sql use $cdbName + +print == create consume info table and consume result table for ntb +sql create table consumeinfo (ts timestamp, consumerid int, topiclist binary(1024), keylist binary(1024), expectmsgcnt bigint, ifcheckdata int, ifmanualcommit int) +sql create table consumeresult (ts timestamp, consumerid int, consummsgcnt bigint, consumrowcnt bigint, checkresult int) + +sql show tables +if $rows != 2 then + return -1 +endi +####################################################################################### + + +print ================ test consume from ntb +print == overlap toipcs: topic_ntb_column + topic_ntb_all, topic_ntb_function + topic_ntb_all +$topicList = ' . topic_ntb_column +$topicList = $topicList . , +$topicList = $topicList . topic_ntb_all +$topicList = $topicList . ' + +$consumerId = 0 +$totalMsgOfOneTopic = $rowsPerCtb +$totalMsgOfNtb = $totalMsgOfOneTopic * $topicNum +$expectmsgcnt = $totalMsgOfNtb +sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit ) + + +$topicList = ' . topic_ntb_function +$topicList = $topicList . , +$topicList = $topicList . topic_ntb_all +$topicList = $topicList . ' +$consumerId = 1 +sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit ) + +print == start consumer to pull msgs from ntb +print == tsim/tmq/consume.sh -d $dbName -y $pullDelay -g $showMsg -r $showRow -s start -e 1 +system tsim/tmq/consume.sh -d $dbName -y $pullDelay -g $showMsg -r $showRow -w $cdbName -s start -e 1 + +print == check consume result from ntb +wait_consumer_end_from_ntb: +sql select * from consumeresult +print ==> rows: $rows +print ==> rows[0]: $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] +print ==> rows[1]: $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] +if $rows != 2 then + sleep 1000 + goto wait_consumer_end_from_ntb +endi +if $data[0][1] == 0 then + if $data[1][1] != 1 then + return -1 + endi +endi +if $data[0][1] == 1 then + if $data[1][1] != 0 then + return -1 + endi +endi + + +if $data[0][3] == $totalMsgOfOneTopic then + if $data[1][3] == $totalMsgOfNtb then + goto check_ok_3 + endi +elif $data[1][3] == $totalMsgOfOneTopic then + if $data[0][3] == $totalMsgOfNtb then + goto check_ok_3 + endi +endi +return -1 +check_ok_3: + +sql select * from performance_schema.`consumers` +if $rows != 0 then + return -1 +endi + +#sql select * from performance_schema.`subscriptions` +#if $rows != 0 then +# return -1 +#endi + +#------ not need stop consumer, because it exit after pull msg overthan expect msg +#system tsim/tmq/consume.sh -s stop -x SIGINT + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/test/c/tmqSim.c b/tests/test/c/tmqSim.c index 81fa72d15a..07fdcc2415 100644 --- a/tests/test/c/tmqSim.c +++ b/tests/test/c/tmqSim.c @@ -124,15 +124,13 @@ char* getCurrentTimeString(char* timeString) { return timeString; } -static void tmqStop(int signum, void *info, void *ctx) { +static void tmqStop(int signum, void* info, void* ctx) { running = 0; char tmpString[128]; - taosFprintfFile(g_fp, "%s tmqStop() receive stop signal[%d]\n", getCurrentTimeString(tmpString), signum); + taosFprintfFile(g_fp, "%s tmqStop() receive stop signal[%d]\n", getCurrentTimeString(tmpString), signum); } -static void tmqSetSignalHandle() { - taosSetSignal(SIGINT, tmqStop); -} +static void tmqSetSignalHandle() { taosSetSignal(SIGINT, tmqStop); } void initLogFile() { char filename[256]; @@ -463,16 +461,16 @@ static int32_t msg_process(TAOS_RES* msg, SThreadInfo* pInfo, int32_t msgIndex) int32_t precision = taos_result_precision(msg); const char* tbName = tmq_get_table_name(msg); - #if 0 +#if 0 // get schema //============================== stub =================================================// for (int32_t i = 0; i < numOfFields; i++) { taosFprintfFile(g_fp, "%02d: name: %s, type: %d, len: %d\n", i, fields[i].name, fields[i].type, fields[i].bytes); } //============================== stub =================================================// - #endif +#endif - dumpToFileForCheck(pInfo->pConsumeRowsFile, row, fields, length, numOfFields, precision); + dumpToFileForCheck(pInfo->pConsumeRowsFile, row, fields, length, numOfFields, precision); taos_print_row(buf, row, fields, numOfFields); @@ -529,7 +527,7 @@ static void tmq_commit_cb_print(tmq_t* tmq, int32_t code, void* param) { g_once_commit_flag = 1; notifyMainScript((SThreadInfo*)param, (int32_t)NOTIFY_CMD_START_COMMIT); } - + char tmpString[128]; taosFprintfFile(g_fp, "%s tmq_commit_cb_print() be called\n", getCurrentTimeString(tmpString)); } @@ -565,7 +563,7 @@ void build_consumer(SThreadInfo* pInfo) { // tmq_conf_set(conf, "auto.offset.reset", "latest"); // if (g_stConfInfo.useSnapshot) { - tmq_conf_set(conf, "experiment.use.snapshot", "true"); + tmq_conf_set(conf, "experimental.snapshot.enable", "true"); } pInfo->tmq = tmq_consumer_new(conf, NULL, 0); @@ -683,13 +681,13 @@ void* consumeThreadFunc(void* param) { pInfo->taos = taos_connect(NULL, "root", "taosdata", NULL, 0); if (pInfo->taos == NULL) { taosFprintfFile(g_fp, "taos_connect() fail, can not notify and save consume result to main scripte\n"); - return NULL; + return NULL; } build_consumer(pInfo); build_topic_list(pInfo); if ((NULL == pInfo->tmq) || (NULL == pInfo->topicList)) { - taosFprintfFile(g_fp, "create consumer fail! tmq is null or topicList is null\n"); + taosFprintfFile(g_fp, "create consumer fail! tmq is null or topicList is null\n"); assert(0); return NULL; } @@ -697,7 +695,7 @@ void* consumeThreadFunc(void* param) { int32_t err = tmq_subscribe(pInfo->tmq, pInfo->topicList); if (err != 0) { pError("tmq_subscribe() fail, reason: %s\n", tmq_err2str(err)); - taosFprintfFile(g_fp, "tmq_subscribe() fail! reason: %s\n", tmq_err2str(err)); + taosFprintfFile(g_fp, "tmq_subscribe() fail! reason: %s\n", tmq_err2str(err)); assert(0); return NULL; } @@ -718,13 +716,13 @@ void* consumeThreadFunc(void* param) { err = tmq_unsubscribe(pInfo->tmq); if (err != 0) { pError("tmq_unsubscribe() fail, reason: %s\n", tmq_err2str(err)); - taosFprintfFile(g_fp, "tmq_unsubscribe()! reason: %s\n", tmq_err2str(err)); + taosFprintfFile(g_fp, "tmq_unsubscribe()! reason: %s\n", tmq_err2str(err)); } err = tmq_consumer_close(pInfo->tmq); if (err != 0) { pError("tmq_consumer_close() fail, reason: %s\n", tmq_err2str(err)); - taosFprintfFile(g_fp, "tmq_consumer_close()! reason: %s\n", tmq_err2str(err)); + taosFprintfFile(g_fp, "tmq_consumer_close()! reason: %s\n", tmq_err2str(err)); } pInfo->tmq = NULL; From 6141bb03dab8d6f5513c550a125ba0fc17e69993 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 30 Jun 2022 15:04:54 +0800 Subject: [PATCH 35/51] feat: insert from csv --- source/libs/parser/inc/sql.y | 10 +- source/libs/parser/src/parInsert.c | 70 +- source/libs/parser/src/parTokenizer.c | 1 + source/libs/parser/src/parTranslater.c | 54 +- source/libs/parser/src/sql.c | 2713 ++++++++++++------------ tools/shell/src/shellEngine.c | 11 +- 6 files changed, 1463 insertions(+), 1396 deletions(-) diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index cb43bfef0e..08b817dbed 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -848,14 +848,10 @@ set_quantifier_opt(A) ::= ALL. %type select_list { SNodeList* } %destructor select_list { nodesDestroyList($$); } -select_list(A) ::= NK_STAR. { A = NULL; } -select_list(A) ::= select_sublist(B). { A = B; } - -%type select_sublist { SNodeList* } -%destructor select_sublist { nodesDestroyList($$); } -select_sublist(A) ::= select_item(B). { A = createNodeList(pCxt, B); } -select_sublist(A) ::= select_sublist(B) NK_COMMA select_item(C). { A = addNodeToList(pCxt, B, C); } +select_list(A) ::= select_item(B). { A = createNodeList(pCxt, B); } +select_list(A) ::= select_list(B) NK_COMMA select_item(C). { A = addNodeToList(pCxt, B, C); } +select_item(A) ::= NK_STAR(B). { A = createColumnNode(pCxt, NULL, &B); } select_item(A) ::= common_expression(B). { A = releaseRawExprNode(pCxt, B); } select_item(A) ::= common_expression(B) column_alias(C). { A = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, B), &C); } select_item(A) ::= common_expression(B) AS column_alias(C). { A = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, B), &C); } diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 044ec90a7f..b97f1df38b 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -1302,6 +1302,74 @@ static int32_t parseValuesClause(SInsertParseContext* pCxt, STableDataBlocks* da return TSDB_CODE_SUCCESS; } +static int32_t parseCsvFile(SInsertParseContext* pCxt, TdFilePtr fp, STableDataBlocks* pDataBlock, int maxRows, + int32_t* numOfRows) { + STableComInfo tinfo = getTableInfo(pDataBlock->pTableMeta); + int32_t extendedRowSize = getExtendedRowSize(pDataBlock); + CHECK_CODE(initRowBuilder(&pDataBlock->rowBuilder, pDataBlock->pTableMeta->sversion, &pDataBlock->boundColumnInfo)); + + (*numOfRows) = 0; + char tmpTokenBuf[TSDB_MAX_BYTES_PER_ROW] = {0}; // used for deleting Escape character: \\, \', \" + char* pLine = NULL; + int64_t readLen = 0; + while ((readLen = taosGetLineFile(fp, &pLine)) != -1) { + if (('\r' == pLine[readLen - 1]) || ('\n' == pLine[readLen - 1])) { + pLine[--readLen] = '\0'; + } + + if (readLen == 0) { + continue; + } + + if ((*numOfRows) >= maxRows || pDataBlock->size + extendedRowSize >= pDataBlock->nAllocSize) { + int32_t tSize; + CHECK_CODE(allocateMemIfNeed(pDataBlock, extendedRowSize, &tSize)); + ASSERT(tSize >= maxRows); + maxRows = tSize; + } + + strtolower(pLine, pLine); + char* pRawSql = pCxt->pSql; + pCxt->pSql = pLine; + bool gotRow = false; + CHECK_CODE(parseOneRow(pCxt, pDataBlock, tinfo.precision, &gotRow, tmpTokenBuf)); + if (gotRow) { + pDataBlock->size += extendedRowSize; // len; + (*numOfRows)++; + } + pCxt->pSql = pRawSql; + } + + if (0 == (*numOfRows) && (!TSDB_QUERY_HAS_TYPE(pCxt->pOutput->insertType, TSDB_QUERY_TYPE_STMT_INSERT))) { + return buildSyntaxErrMsg(&pCxt->msg, "no any data points", NULL); + } + return TSDB_CODE_SUCCESS; +} + +static int32_t parseDataFromFile(SInsertParseContext* pCxt, SToken filePath, STableDataBlocks* dataBuf) { + char filePathStr[TSDB_FILENAME_LEN] = {0}; + strncpy(filePathStr, filePath.z, filePath.n); + TdFilePtr fp = taosOpenFile(filePathStr, TD_FILE_READ | TD_FILE_STREAM); + if (NULL == fp) { + return TAOS_SYSTEM_ERROR(errno); + } + + int32_t maxNumOfRows; + CHECK_CODE(allocateMemIfNeed(dataBuf, getExtendedRowSize(dataBuf), &maxNumOfRows)); + + int32_t numOfRows = 0; + CHECK_CODE(parseCsvFile(pCxt, fp, dataBuf, maxNumOfRows, &numOfRows)); + + SSubmitBlk* pBlocks = (SSubmitBlk*)(dataBuf->pData); + if (TSDB_CODE_SUCCESS != setBlockInfo(pBlocks, dataBuf, numOfRows)) { + return buildInvalidOperationMsg(&pCxt->msg, "too many rows in sql, total number of rows should be less than 32767"); + } + + dataBuf->numOfTables = 1; + pCxt->totalNum += numOfRows; + return TSDB_CODE_SUCCESS; +} + void destroyCreateSubTbReq(SVCreateTbReq* pReq) { taosMemoryFreeClear(pReq->name); taosMemoryFreeClear(pReq->ctb.pTag); @@ -1421,7 +1489,7 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) { if (0 == sToken.n || (TK_NK_STRING != sToken.type && TK_NK_ID != sToken.type)) { return buildSyntaxErrMsg(&pCxt->msg, "file path is required following keyword FILE", sToken.z); } - // todo + CHECK_CODE(parseDataFromFile(pCxt, sToken, dataBuf)); pCxt->pOutput->insertType = TSDB_QUERY_TYPE_FILE_INSERT; tbNum++; diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 7f5d742dc7..3b2ad84235 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -86,6 +86,7 @@ static SKeyword keywordTable[] = { {"EXISTS", TK_EXISTS}, {"EXPLAIN", TK_EXPLAIN}, {"EVERY", TK_EVERY}, + {"FILE", TK_FILE}, {"FILL", TK_FILL}, {"FIRST", TK_FIRST}, {"FLOAT", TK_FLOAT}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 521c733ceb..985fa6c9ae 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1984,34 +1984,38 @@ static int32_t createMultiResFuncsFromStar(STranslateContext* pCxt, SFunctionNod } static int32_t translateStar(STranslateContext* pCxt, SSelectStmt* pSelect) { - if (NULL == pSelect->pProjectionList) { // select * ... - return createAllColumns(pCxt, &pSelect->pProjectionList); - } else { - SNode* pNode = NULL; - WHERE_EACH(pNode, pSelect->pProjectionList) { - int32_t code = TSDB_CODE_SUCCESS; - if (isMultiResFunc(pNode)) { - SNodeList* pFuncs = NULL; - code = createMultiResFuncsFromStar(pCxt, (SFunctionNode*)pNode, &pFuncs); - if (TSDB_CODE_SUCCESS == code) { - INSERT_LIST(pSelect->pProjectionList, pFuncs); - ERASE_NODE(pSelect->pProjectionList); - continue; - } - } else if (isTableStar(pNode)) { - SNodeList* pCols = NULL; - code = createTableAllCols(pCxt, (SColumnNode*)pNode, &pCols); - if (TSDB_CODE_SUCCESS == code) { - INSERT_LIST(pSelect->pProjectionList, pCols); - ERASE_NODE(pSelect->pProjectionList); - continue; - } + SNode* pNode = NULL; + WHERE_EACH(pNode, pSelect->pProjectionList) { + int32_t code = TSDB_CODE_SUCCESS; + if (isStar(pNode)) { + SNodeList* pCols = NULL; + code = createAllColumns(pCxt, &pCols); + if (TSDB_CODE_SUCCESS == code) { + INSERT_LIST(pSelect->pProjectionList, pCols); + ERASE_NODE(pSelect->pProjectionList); + continue; } - if (TSDB_CODE_SUCCESS != code) { - return code; + } else if (isMultiResFunc(pNode)) { + SNodeList* pFuncs = NULL; + code = createMultiResFuncsFromStar(pCxt, (SFunctionNode*)pNode, &pFuncs); + if (TSDB_CODE_SUCCESS == code) { + INSERT_LIST(pSelect->pProjectionList, pFuncs); + ERASE_NODE(pSelect->pProjectionList); + continue; + } + } else if (isTableStar(pNode)) { + SNodeList* pCols = NULL; + code = createTableAllCols(pCxt, (SColumnNode*)pNode, &pCols); + if (TSDB_CODE_SUCCESS == code) { + INSERT_LIST(pSelect->pProjectionList, pCols); + ERASE_NODE(pSelect->pProjectionList); + continue; } - WHERE_NEXT; } + if (TSDB_CODE_SUCCESS != code) { + return code; + } + WHERE_NEXT; } return TSDB_CODE_SUCCESS; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 5eb9c72267..6b71a50ac0 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,26 +104,26 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 374 +#define YYNOCODE 373 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SNodeList* yy24; - SDataType yy48; - bool yy97; - SAlterOption yy189; - int32_t yy244; - EFillMode yy250; - EJoinType yy596; - EOrder yy598; - int8_t yy619; - SNode* yy652; - ENullOrder yy653; - SToken yy657; - EOperatorType yy700; - int64_t yy701; + SToken yy7; + int32_t yy20; + EJoinType yy54; + int8_t yy57; + SAlterOption yy139; + SNode* yy184; + int64_t yy193; + SNodeList* yy296; + SDataType yy332; + EOrder yy394; + bool yy419; + EOperatorType yy496; + EFillMode yy540; + ENullOrder yy627; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 653 -#define YYNRULE 483 +#define YYNSTATE 652 +#define YYNRULE 482 #define YYNTOKEN 250 -#define YY_MAX_SHIFT 652 -#define YY_MIN_SHIFTREDUCE 953 -#define YY_MAX_SHIFTREDUCE 1435 -#define YY_ERROR_ACTION 1436 -#define YY_ACCEPT_ACTION 1437 -#define YY_NO_ACTION 1438 -#define YY_MIN_REDUCE 1439 -#define YY_MAX_REDUCE 1921 +#define YY_MAX_SHIFT 651 +#define YY_MIN_SHIFTREDUCE 952 +#define YY_MAX_SHIFTREDUCE 1433 +#define YY_ERROR_ACTION 1434 +#define YY_ACCEPT_ACTION 1435 +#define YY_NO_ACTION 1436 +#define YY_MIN_REDUCE 1437 +#define YY_MAX_REDUCE 1918 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,679 +216,682 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2489) +#define YY_ACTTAB_COUNT (2447) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 567, 422, 1437, 423, 1474, 1742, 1673, 430, 317, 423, - /* 10 */ 1474, 111, 39, 37, 1504, 140, 1739, 1451, 460, 69, - /* 20 */ 326, 1440, 1236, 1742, 488, 151, 334, 526, 1573, 1564, - /* 30 */ 1261, 566, 115, 1311, 1739, 1234, 1847, 486, 1612, 484, - /* 40 */ 1739, 1568, 101, 1735, 1741, 100, 99, 98, 97, 96, - /* 50 */ 95, 94, 93, 92, 570, 119, 1306, 1625, 1755, 14, - /* 60 */ 1844, 1735, 1741, 343, 331, 1242, 373, 1735, 1741, 39, - /* 70 */ 37, 1372, 570, 1623, 566, 474, 473, 326, 570, 1236, - /* 80 */ 472, 1847, 1, 116, 469, 553, 1773, 468, 467, 466, - /* 90 */ 1311, 1625, 1234, 329, 529, 117, 1670, 567, 337, 1725, - /* 100 */ 1462, 549, 504, 1899, 649, 1843, 1899, 1623, 111, 528, - /* 110 */ 153, 1840, 1841, 1306, 1845, 465, 14, 156, 1313, 1314, - /* 120 */ 156, 1896, 1242, 1439, 1896, 1573, 1480, 1786, 1135, 1136, - /* 130 */ 88, 1756, 552, 1758, 1759, 548, 42, 570, 78, 2, - /* 140 */ 1832, 1725, 1899, 209, 319, 1828, 152, 110, 109, 108, - /* 150 */ 107, 106, 105, 104, 103, 102, 156, 439, 232, 1566, - /* 160 */ 1896, 649, 1501, 1237, 141, 1235, 505, 1860, 1530, 60, - /* 170 */ 520, 73, 474, 473, 644, 1313, 1314, 472, 1743, 338, - /* 180 */ 116, 469, 1618, 1620, 468, 467, 466, 1240, 1241, 1739, - /* 190 */ 1289, 1290, 1292, 1293, 1294, 1295, 1296, 545, 568, 1304, - /* 200 */ 1305, 1307, 1308, 1309, 1310, 1312, 1315, 33, 32, 245, - /* 210 */ 246, 40, 38, 36, 35, 34, 1735, 1741, 421, 159, - /* 220 */ 1237, 425, 1235, 626, 625, 624, 341, 570, 623, 622, - /* 230 */ 621, 121, 616, 615, 614, 613, 612, 611, 610, 609, - /* 240 */ 131, 605, 1262, 986, 1240, 1241, 61, 1289, 1290, 1292, - /* 250 */ 1293, 1294, 1295, 1296, 545, 568, 1304, 1305, 1307, 1308, - /* 260 */ 1309, 1310, 1312, 1315, 39, 37, 566, 1236, 60, 490, - /* 270 */ 304, 1396, 326, 159, 1236, 40, 38, 36, 35, 34, - /* 280 */ 1234, 1261, 1406, 990, 991, 1311, 84, 1234, 1093, 593, - /* 290 */ 592, 591, 1097, 590, 1099, 1100, 589, 1102, 586, 120, - /* 300 */ 1108, 583, 1110, 1111, 580, 577, 159, 1565, 1306, 1899, - /* 310 */ 1242, 14, 512, 1394, 1395, 1397, 1398, 1242, 602, 1551, - /* 320 */ 379, 39, 37, 156, 60, 1755, 604, 1896, 43, 326, - /* 330 */ 1003, 1236, 1002, 1260, 2, 330, 60, 129, 128, 599, - /* 340 */ 598, 597, 1311, 138, 1234, 458, 336, 1259, 372, 649, - /* 350 */ 371, 526, 1575, 1773, 138, 1899, 649, 296, 1549, 339, - /* 360 */ 1004, 550, 244, 1575, 1899, 1306, 1725, 138, 549, 1898, - /* 370 */ 1313, 1314, 231, 1896, 1242, 1899, 1575, 439, 157, 119, - /* 380 */ 33, 32, 1896, 530, 40, 38, 36, 35, 34, 1897, - /* 390 */ 1379, 8, 567, 1896, 1786, 1663, 1260, 87, 1756, 552, - /* 400 */ 1758, 1759, 548, 161, 570, 159, 168, 1832, 1237, 364, - /* 410 */ 1235, 298, 1828, 649, 1773, 1237, 604, 1235, 515, 117, - /* 420 */ 1573, 83, 519, 1899, 1218, 1219, 1242, 1313, 1314, 366, - /* 430 */ 362, 80, 1240, 1241, 154, 1840, 1841, 158, 1845, 1240, - /* 440 */ 1241, 1896, 1289, 1290, 1292, 1293, 1294, 1295, 1296, 545, - /* 450 */ 568, 1304, 1305, 1307, 1308, 1309, 1310, 1312, 1315, 101, - /* 460 */ 518, 159, 100, 99, 98, 97, 96, 95, 94, 93, - /* 470 */ 92, 427, 1237, 159, 1235, 33, 32, 1258, 26, 40, - /* 480 */ 38, 36, 35, 34, 33, 32, 412, 1321, 40, 38, - /* 490 */ 36, 35, 34, 1260, 521, 516, 1240, 1241, 596, 1289, - /* 500 */ 1290, 1292, 1293, 1294, 1295, 1296, 545, 568, 1304, 1305, - /* 510 */ 1307, 1308, 1309, 1310, 1312, 1315, 39, 37, 1316, 567, - /* 520 */ 202, 30, 240, 567, 326, 607, 1236, 1432, 159, 1461, - /* 530 */ 377, 1460, 170, 169, 378, 1745, 1003, 1311, 1002, 1234, - /* 540 */ 497, 1459, 28, 36, 35, 34, 7, 1573, 33, 32, - /* 550 */ 1386, 1573, 40, 38, 36, 35, 34, 33, 32, 1755, - /* 560 */ 1306, 40, 38, 36, 35, 34, 1004, 1291, 1458, 1242, - /* 570 */ 1725, 1747, 1725, 39, 37, 1755, 1619, 1620, 479, 71, - /* 580 */ 304, 326, 1725, 1236, 33, 32, 9, 1773, 40, 38, - /* 590 */ 36, 35, 34, 489, 1311, 550, 1234, 138, 69, 567, - /* 600 */ 1725, 567, 549, 1773, 11, 10, 1576, 201, 649, 1725, - /* 610 */ 382, 529, 397, 1431, 166, 1457, 1725, 1306, 549, 22, - /* 620 */ 1569, 482, 1313, 1314, 1550, 476, 1242, 1573, 1786, 1573, - /* 630 */ 200, 89, 1756, 552, 1758, 1759, 548, 429, 570, 67, - /* 640 */ 425, 1832, 66, 9, 1786, 1831, 1828, 88, 1756, 552, - /* 650 */ 1758, 1759, 548, 1055, 570, 55, 1725, 1832, 54, 526, - /* 660 */ 1562, 319, 1828, 152, 1291, 649, 1335, 1237, 1558, 1235, - /* 670 */ 33, 32, 1456, 1455, 40, 38, 36, 35, 34, 1313, - /* 680 */ 1314, 1548, 600, 1057, 1861, 1616, 1347, 119, 1454, 1340, - /* 690 */ 1453, 1240, 1241, 1450, 1289, 1290, 1292, 1293, 1294, 1295, - /* 700 */ 1296, 545, 568, 1304, 1305, 1307, 1308, 1309, 1310, 1312, - /* 710 */ 1315, 471, 470, 1725, 1725, 33, 32, 1371, 602, 40, - /* 720 */ 38, 36, 35, 34, 1237, 1367, 1235, 117, 27, 1725, - /* 730 */ 1449, 1725, 1448, 1447, 1725, 310, 1446, 129, 128, 599, - /* 740 */ 598, 597, 155, 1840, 1841, 1274, 1845, 1669, 1240, 1241, - /* 750 */ 305, 1289, 1290, 1292, 1293, 1294, 1295, 1296, 545, 568, - /* 760 */ 1304, 1305, 1307, 1308, 1309, 1310, 1312, 1315, 39, 37, - /* 770 */ 295, 1725, 1258, 1725, 1725, 602, 326, 1725, 1236, 405, - /* 780 */ 464, 1847, 417, 311, 1445, 309, 308, 1668, 462, 1311, - /* 790 */ 305, 1234, 464, 1263, 129, 128, 599, 598, 597, 390, - /* 800 */ 58, 418, 463, 392, 567, 1842, 620, 618, 553, 567, - /* 810 */ 1260, 567, 1306, 567, 463, 398, 567, 1444, 567, 1671, - /* 820 */ 438, 1242, 1570, 1713, 1702, 1725, 1443, 498, 1755, 502, - /* 830 */ 534, 567, 1573, 383, 1625, 990, 991, 1573, 2, 1573, - /* 840 */ 267, 1573, 564, 1603, 1573, 537, 1573, 33, 32, 1560, - /* 850 */ 1624, 40, 38, 36, 35, 34, 1773, 137, 1725, 1573, - /* 860 */ 649, 608, 601, 1545, 550, 1616, 1556, 1725, 1442, 1725, - /* 870 */ 352, 549, 1491, 416, 1313, 1314, 411, 410, 409, 408, + /* 0 */ 422, 1671, 423, 1472, 151, 1740, 1435, 430, 317, 423, + /* 10 */ 1472, 1370, 39, 37, 1502, 338, 1737, 1610, 1616, 1618, + /* 20 */ 326, 1438, 1235, 1740, 1896, 1562, 334, 525, 373, 379, + /* 30 */ 1260, 565, 1771, 1310, 1737, 1233, 1737, 1895, 30, 240, + /* 40 */ 518, 1893, 101, 1733, 1739, 100, 99, 98, 97, 96, + /* 50 */ 95, 94, 93, 92, 569, 119, 1305, 985, 1753, 14, + /* 60 */ 61, 1733, 1739, 1733, 1739, 1241, 296, 343, 1896, 39, + /* 70 */ 37, 1373, 569, 439, 569, 474, 473, 326, 517, 1235, + /* 80 */ 472, 157, 1, 116, 469, 1893, 1771, 468, 467, 466, + /* 90 */ 1310, 1002, 1233, 1001, 528, 117, 1377, 989, 990, 1723, + /* 100 */ 330, 548, 1259, 140, 648, 1449, 458, 1896, 138, 527, + /* 110 */ 153, 1838, 1839, 1305, 1843, 210, 14, 1573, 1312, 1313, + /* 120 */ 157, 1003, 1241, 1437, 1893, 1617, 1618, 1784, 1134, 1135, + /* 130 */ 88, 1754, 551, 1756, 1757, 547, 427, 569, 60, 2, + /* 140 */ 1830, 60, 1257, 73, 319, 1826, 152, 110, 109, 108, + /* 150 */ 107, 106, 105, 104, 103, 102, 141, 78, 156, 1054, + /* 160 */ 1528, 648, 1499, 1236, 519, 1234, 1856, 40, 38, 36, + /* 170 */ 35, 34, 474, 473, 1260, 1312, 1313, 472, 1564, 421, + /* 180 */ 116, 469, 425, 203, 468, 467, 466, 1239, 1240, 1056, + /* 190 */ 1288, 1289, 1291, 1292, 1293, 1294, 1295, 544, 567, 1303, + /* 200 */ 1304, 1306, 1307, 1308, 1309, 1311, 1314, 565, 33, 32, + /* 210 */ 552, 1320, 40, 38, 36, 35, 34, 1259, 329, 160, + /* 220 */ 1236, 1668, 1234, 625, 624, 623, 341, 1369, 622, 621, + /* 230 */ 620, 121, 615, 614, 613, 612, 611, 610, 609, 608, + /* 240 */ 131, 604, 71, 304, 1239, 1240, 7, 1288, 1289, 1291, + /* 250 */ 1292, 1293, 1294, 1295, 544, 567, 1303, 1304, 1306, 1307, + /* 260 */ 1308, 1309, 1311, 1314, 39, 37, 1896, 60, 565, 42, + /* 270 */ 1623, 1394, 326, 1290, 1235, 160, 1259, 331, 160, 158, + /* 280 */ 412, 167, 607, 1893, 1543, 1310, 1621, 1233, 1092, 592, + /* 290 */ 591, 590, 1096, 589, 1098, 1099, 588, 1101, 585, 603, + /* 300 */ 1107, 582, 1109, 1110, 579, 576, 67, 1896, 1305, 66, + /* 310 */ 310, 14, 511, 1392, 1393, 1395, 1396, 1241, 601, 1235, + /* 320 */ 1894, 39, 37, 1753, 1893, 566, 171, 170, 60, 326, + /* 330 */ 43, 1235, 1233, 488, 2, 1549, 111, 129, 128, 598, + /* 340 */ 597, 596, 1310, 460, 1233, 1261, 486, 372, 484, 371, + /* 350 */ 1241, 1771, 1002, 1571, 1001, 1430, 648, 364, 311, 549, + /* 360 */ 309, 308, 1241, 462, 1723, 1305, 548, 464, 471, 470, + /* 370 */ 1312, 1313, 429, 1258, 1241, 425, 504, 366, 362, 33, + /* 380 */ 32, 529, 1003, 40, 38, 36, 35, 34, 1290, 463, + /* 390 */ 69, 8, 1784, 439, 1753, 87, 1754, 551, 1756, 1757, + /* 400 */ 547, 648, 569, 115, 160, 1830, 160, 1661, 566, 298, + /* 410 */ 1826, 84, 1566, 648, 22, 1236, 1896, 1234, 169, 111, + /* 420 */ 1460, 1896, 1771, 606, 120, 1366, 465, 1312, 1313, 157, + /* 430 */ 549, 244, 1563, 1893, 159, 1723, 1571, 548, 1893, 1239, + /* 440 */ 1240, 1429, 1288, 1289, 1291, 1292, 1293, 1294, 1295, 544, + /* 450 */ 567, 1303, 1304, 1306, 1307, 1308, 1309, 1311, 1314, 1262, + /* 460 */ 1236, 1723, 1234, 1784, 525, 160, 88, 1754, 551, 1756, + /* 470 */ 1757, 547, 1236, 569, 1234, 232, 1830, 533, 336, 552, + /* 480 */ 319, 1826, 1909, 490, 1239, 1240, 138, 595, 11, 10, + /* 490 */ 1669, 1864, 119, 1217, 1218, 1573, 1239, 1240, 58, 1288, + /* 500 */ 1289, 1291, 1292, 1293, 1294, 1295, 544, 567, 1303, 1304, + /* 510 */ 1306, 1307, 1308, 1309, 1311, 1314, 39, 37, 1315, 36, + /* 520 */ 35, 34, 525, 1896, 326, 83, 1235, 566, 160, 1478, + /* 530 */ 651, 566, 117, 1560, 69, 80, 157, 1310, 162, 1233, + /* 540 */ 1893, 1547, 377, 1459, 262, 1623, 1623, 154, 1838, 1839, + /* 550 */ 119, 1843, 525, 337, 514, 1571, 1567, 566, 149, 1571, + /* 560 */ 1305, 1622, 1621, 641, 637, 633, 629, 260, 378, 1241, + /* 570 */ 1346, 339, 529, 39, 37, 1753, 566, 643, 1334, 138, + /* 580 */ 119, 326, 566, 1235, 1723, 1571, 9, 382, 1573, 213, + /* 590 */ 117, 1458, 85, 397, 1310, 254, 1233, 245, 246, 603, + /* 600 */ 1450, 1339, 529, 1771, 1571, 230, 1838, 524, 648, 523, + /* 610 */ 1571, 549, 1896, 566, 497, 1457, 1723, 1305, 548, 1711, + /* 620 */ 117, 1556, 1312, 1313, 398, 159, 1241, 1558, 562, 1893, + /* 630 */ 520, 515, 1723, 529, 1456, 230, 1838, 524, 618, 523, + /* 640 */ 27, 1571, 1896, 9, 1784, 50, 1753, 87, 1754, 551, + /* 650 */ 1756, 1757, 547, 1845, 569, 157, 1723, 1830, 304, 1893, + /* 660 */ 212, 298, 1826, 619, 617, 648, 352, 1236, 1554, 1234, + /* 670 */ 1455, 1454, 534, 1896, 1771, 1723, 1453, 1842, 367, 1312, + /* 680 */ 1313, 1209, 549, 205, 138, 1391, 157, 1723, 1452, 548, + /* 690 */ 1893, 1239, 1240, 1574, 1288, 1289, 1291, 1292, 1293, 1294, + /* 700 */ 1295, 544, 567, 1303, 1304, 1306, 1307, 1308, 1309, 1311, + /* 710 */ 1314, 1723, 1723, 525, 1845, 1784, 566, 1723, 88, 1754, + /* 720 */ 551, 1756, 1757, 547, 1236, 569, 1234, 438, 1830, 1723, + /* 730 */ 1451, 531, 319, 1826, 1909, 1529, 1741, 1667, 1841, 1448, + /* 740 */ 305, 119, 1447, 1887, 1571, 1446, 1445, 1737, 1239, 1240, + /* 750 */ 206, 1288, 1289, 1291, 1292, 1293, 1294, 1295, 544, 567, + /* 760 */ 1303, 1304, 1306, 1307, 1308, 1309, 1311, 1314, 39, 37, + /* 770 */ 295, 1723, 1257, 543, 1733, 1739, 326, 566, 1235, 405, + /* 780 */ 1723, 117, 417, 1723, 594, 569, 1723, 1723, 1568, 1310, + /* 790 */ 1444, 1233, 599, 989, 990, 1614, 155, 1838, 1839, 390, + /* 800 */ 1843, 418, 512, 392, 26, 1571, 1845, 536, 1443, 1442, + /* 810 */ 33, 32, 1305, 28, 40, 38, 36, 35, 34, 33, + /* 820 */ 32, 1241, 235, 40, 38, 36, 35, 34, 1753, 1441, + /* 830 */ 1840, 1723, 1259, 383, 566, 566, 33, 32, 2, 464, + /* 840 */ 40, 38, 36, 35, 34, 1700, 498, 33, 32, 1723, + /* 850 */ 1723, 40, 38, 36, 35, 34, 1771, 541, 1440, 457, + /* 860 */ 648, 463, 1571, 1571, 528, 1666, 1850, 1366, 305, 1723, + /* 870 */ 1723, 548, 1489, 416, 1312, 1313, 411, 410, 409, 408, /* 880 */ 407, 404, 403, 402, 401, 400, 396, 395, 394, 393, - /* 890 */ 387, 386, 385, 384, 475, 381, 380, 1786, 299, 1245, - /* 900 */ 88, 1756, 552, 1758, 1759, 548, 567, 570, 208, 1725, - /* 910 */ 1832, 1852, 1367, 1486, 319, 1828, 1912, 565, 188, 1237, - /* 920 */ 205, 1235, 1274, 212, 544, 1867, 193, 619, 195, 191, - /* 930 */ 1333, 194, 144, 1370, 1573, 477, 72, 456, 452, 448, - /* 940 */ 444, 187, 197, 1240, 1241, 196, 1289, 1290, 1292, 1293, - /* 950 */ 1294, 1295, 1296, 545, 568, 1304, 1305, 1307, 1308, 1309, - /* 960 */ 1310, 1312, 1315, 139, 567, 567, 70, 367, 273, 185, - /* 970 */ 52, 501, 595, 50, 199, 256, 340, 198, 1484, 542, - /* 980 */ 216, 1291, 271, 57, 1334, 1452, 56, 1531, 11, 10, - /* 990 */ 513, 235, 1573, 1573, 1434, 1435, 41, 41, 457, 41, - /* 1000 */ 480, 242, 171, 123, 126, 127, 491, 1339, 223, 1244, - /* 1010 */ 1027, 33, 32, 1393, 1774, 40, 38, 36, 35, 34, - /* 1020 */ 218, 342, 1475, 50, 575, 535, 126, 60, 127, 1248, - /* 1030 */ 526, 184, 177, 532, 182, 1613, 1341, 1297, 435, 1186, - /* 1040 */ 1028, 247, 538, 559, 253, 1086, 29, 324, 1328, 1329, - /* 1050 */ 1330, 1331, 1332, 1336, 1337, 1338, 112, 175, 119, 126, - /* 1060 */ 527, 1863, 299, 266, 1114, 86, 1118, 234, 1125, 5, - /* 1070 */ 3, 237, 239, 344, 1258, 347, 351, 306, 1055, 307, - /* 1080 */ 530, 263, 1202, 399, 167, 1665, 406, 414, 413, 419, - /* 1090 */ 1264, 415, 420, 428, 1333, 1267, 1123, 431, 117, 130, - /* 1100 */ 64, 63, 376, 432, 1266, 165, 174, 1325, 1755, 176, - /* 1110 */ 433, 370, 1268, 229, 1840, 525, 434, 524, 179, 436, - /* 1120 */ 1899, 1265, 294, 181, 183, 360, 68, 358, 354, 350, - /* 1130 */ 162, 345, 437, 186, 158, 440, 1773, 459, 1896, 1247, - /* 1140 */ 1707, 461, 91, 1563, 550, 297, 190, 1559, 1334, 1725, - /* 1150 */ 192, 549, 132, 264, 133, 203, 1561, 492, 1557, 134, - /* 1160 */ 135, 1755, 206, 493, 159, 499, 530, 503, 210, 1263, - /* 1170 */ 514, 1339, 1874, 316, 1864, 556, 496, 1786, 1873, 6, - /* 1180 */ 87, 1756, 552, 1758, 1759, 548, 1854, 570, 509, 1773, - /* 1190 */ 1832, 214, 511, 523, 298, 1828, 217, 550, 510, 508, - /* 1200 */ 146, 318, 1725, 1755, 549, 517, 1899, 224, 222, 225, - /* 1210 */ 29, 324, 1328, 1329, 1330, 1331, 1332, 1336, 1337, 1338, - /* 1220 */ 156, 507, 227, 1367, 1896, 118, 1262, 44, 539, 536, - /* 1230 */ 1786, 1773, 1848, 88, 1756, 552, 1758, 1759, 548, 550, - /* 1240 */ 570, 226, 228, 1832, 1725, 18, 549, 319, 1828, 1912, - /* 1250 */ 333, 332, 320, 1813, 560, 561, 1915, 1895, 1890, 249, - /* 1260 */ 1250, 533, 233, 236, 124, 540, 554, 555, 238, 125, - /* 1270 */ 1706, 1311, 1786, 1243, 251, 88, 1756, 552, 1758, 1759, - /* 1280 */ 548, 1755, 570, 265, 1675, 1832, 562, 557, 328, 319, - /* 1290 */ 1828, 1912, 79, 77, 1306, 1617, 1574, 573, 1546, 268, - /* 1300 */ 1851, 645, 646, 1242, 259, 648, 145, 289, 1755, 1773, - /* 1310 */ 51, 291, 290, 270, 272, 1719, 1718, 550, 62, 1717, - /* 1320 */ 1714, 346, 1725, 348, 549, 349, 1229, 1230, 163, 353, - /* 1330 */ 1712, 355, 356, 357, 1711, 359, 1773, 1710, 361, 530, - /* 1340 */ 1709, 1708, 571, 363, 550, 365, 1692, 368, 164, 1725, - /* 1350 */ 1786, 549, 1205, 280, 1756, 552, 1758, 1759, 548, 369, - /* 1360 */ 570, 1204, 1686, 1685, 374, 375, 530, 1684, 1683, 1174, - /* 1370 */ 1658, 1657, 1656, 65, 1655, 1654, 1755, 1786, 1653, 1899, - /* 1380 */ 280, 1756, 552, 1758, 1759, 548, 1652, 570, 1651, 388, - /* 1390 */ 389, 1650, 391, 158, 1649, 1648, 1647, 1896, 1646, 1645, - /* 1400 */ 1644, 1251, 1643, 1246, 1773, 1176, 1899, 1642, 1641, 1640, - /* 1410 */ 1639, 1638, 550, 1637, 1636, 122, 1635, 1725, 1755, 549, - /* 1420 */ 156, 1634, 1633, 1632, 1896, 1254, 1631, 1630, 1629, 1628, - /* 1430 */ 1627, 1626, 1503, 1471, 172, 424, 568, 1304, 1305, 1307, - /* 1440 */ 1308, 1309, 1310, 1755, 150, 1786, 1773, 1021, 89, 1756, - /* 1450 */ 552, 1758, 1759, 548, 547, 570, 113, 993, 1832, 1725, - /* 1460 */ 992, 549, 541, 1828, 426, 1470, 1700, 1694, 1682, 1681, - /* 1470 */ 1667, 1773, 180, 1552, 173, 114, 178, 1502, 1500, 550, - /* 1480 */ 526, 443, 442, 441, 1725, 1498, 549, 1786, 445, 447, - /* 1490 */ 287, 1756, 552, 1758, 1759, 548, 546, 570, 543, 1804, - /* 1500 */ 1755, 446, 1496, 450, 1494, 454, 449, 1483, 119, 453, - /* 1510 */ 1482, 451, 1786, 189, 455, 142, 1756, 552, 1758, 1759, - /* 1520 */ 548, 1467, 570, 1554, 1129, 1128, 1553, 1054, 1773, 49, - /* 1530 */ 530, 1053, 1052, 1051, 617, 1048, 550, 619, 1492, 312, - /* 1540 */ 1047, 1725, 1487, 549, 1046, 1485, 313, 314, 117, 481, - /* 1550 */ 478, 1466, 1465, 483, 485, 1464, 487, 1755, 1699, 90, - /* 1560 */ 531, 1913, 53, 229, 1840, 525, 1212, 524, 1693, 1786, - /* 1570 */ 1899, 494, 89, 1756, 552, 1758, 1759, 548, 1755, 570, - /* 1580 */ 1680, 1678, 1832, 1679, 156, 1773, 207, 1829, 1896, 136, - /* 1590 */ 495, 315, 1677, 550, 1676, 1408, 500, 4, 1725, 41, - /* 1600 */ 549, 45, 15, 215, 23, 47, 1773, 220, 25, 213, - /* 1610 */ 46, 1392, 506, 1385, 550, 143, 16, 219, 24, 1725, - /* 1620 */ 221, 549, 1745, 74, 230, 147, 1786, 1364, 17, 288, - /* 1630 */ 1756, 552, 1758, 1759, 548, 1755, 570, 1420, 13, 1419, - /* 1640 */ 1363, 321, 1425, 1414, 1424, 1423, 322, 1786, 10, 1326, - /* 1650 */ 283, 1756, 552, 1758, 1759, 548, 19, 570, 1755, 1282, - /* 1660 */ 1299, 148, 160, 1773, 31, 551, 1674, 1298, 12, 20, - /* 1670 */ 21, 550, 241, 1390, 1666, 243, 1725, 248, 549, 75, - /* 1680 */ 558, 250, 76, 252, 1744, 255, 1773, 1789, 80, 522, - /* 1690 */ 1301, 1252, 572, 574, 550, 1115, 569, 335, 578, 1725, - /* 1700 */ 1755, 549, 48, 576, 1786, 1112, 579, 142, 1756, 552, - /* 1710 */ 1758, 1759, 548, 323, 570, 1109, 1755, 581, 582, 584, - /* 1720 */ 587, 1092, 594, 1103, 1101, 585, 588, 1786, 1773, 1107, - /* 1730 */ 288, 1756, 552, 1758, 1759, 548, 547, 570, 81, 1106, - /* 1740 */ 1105, 1725, 82, 549, 1773, 1124, 59, 257, 1120, 1019, - /* 1750 */ 603, 1104, 550, 1914, 1043, 606, 258, 1725, 1061, 549, - /* 1760 */ 1041, 1036, 1040, 1039, 1038, 1037, 1755, 1035, 1034, 1786, - /* 1770 */ 1058, 325, 287, 1756, 552, 1758, 1759, 548, 1056, 570, - /* 1780 */ 1031, 1805, 1030, 1029, 1026, 1786, 1025, 1024, 288, 1756, - /* 1790 */ 552, 1758, 1759, 548, 1773, 570, 652, 1499, 627, 629, - /* 1800 */ 628, 1497, 550, 631, 632, 633, 1495, 1725, 635, 549, - /* 1810 */ 262, 636, 1493, 637, 639, 641, 640, 1481, 643, 983, - /* 1820 */ 1463, 327, 261, 1755, 149, 647, 1438, 1238, 650, 642, - /* 1830 */ 638, 634, 630, 260, 1438, 1786, 269, 1438, 288, 1756, - /* 1840 */ 552, 1758, 1759, 548, 651, 570, 1438, 1438, 1438, 1438, - /* 1850 */ 1438, 1773, 1438, 1438, 1438, 1438, 1438, 1438, 85, 550, - /* 1860 */ 1438, 254, 1438, 1438, 1725, 1438, 549, 1438, 1438, 1438, - /* 1870 */ 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, - /* 1880 */ 1438, 1438, 1438, 1438, 1755, 1438, 1438, 1438, 1438, 1438, - /* 1890 */ 1438, 1438, 1786, 1438, 563, 274, 1756, 552, 1758, 1759, - /* 1900 */ 548, 1755, 570, 1438, 1438, 1438, 1438, 1438, 1438, 1438, - /* 1910 */ 1438, 1438, 1773, 1438, 1438, 1438, 1438, 1438, 1438, 1438, - /* 1920 */ 550, 1438, 1438, 1438, 1438, 1725, 211, 549, 1438, 1773, - /* 1930 */ 1438, 1438, 1438, 1438, 1438, 1438, 1438, 550, 1438, 1438, - /* 1940 */ 1438, 1438, 1725, 1755, 549, 1438, 1438, 1210, 1438, 204, - /* 1950 */ 1438, 1438, 1438, 1786, 1755, 1438, 275, 1756, 552, 1758, - /* 1960 */ 1759, 548, 1438, 570, 1438, 1755, 1438, 1438, 1438, 1438, - /* 1970 */ 1786, 1773, 1438, 276, 1756, 552, 1758, 1759, 548, 550, - /* 1980 */ 570, 1438, 1773, 1438, 1725, 1438, 549, 1438, 1438, 1438, - /* 1990 */ 550, 1438, 1438, 1773, 1438, 1725, 1438, 549, 1438, 1438, - /* 2000 */ 1438, 550, 1438, 1438, 1438, 1438, 1725, 1755, 549, 1438, - /* 2010 */ 1438, 1438, 1786, 1438, 1438, 282, 1756, 552, 1758, 1759, - /* 2020 */ 548, 1438, 570, 1786, 1438, 1755, 284, 1756, 552, 1758, - /* 2030 */ 1759, 548, 1438, 570, 1786, 1773, 1438, 277, 1756, 552, - /* 2040 */ 1758, 1759, 548, 550, 570, 1438, 1438, 1438, 1725, 1755, - /* 2050 */ 549, 1438, 1438, 1773, 1438, 1438, 1438, 1438, 1438, 1438, - /* 2060 */ 1438, 550, 1438, 1438, 1438, 1438, 1725, 1438, 549, 1438, - /* 2070 */ 1438, 1438, 1438, 1438, 1438, 1438, 1786, 1773, 1438, 285, - /* 2080 */ 1756, 552, 1758, 1759, 548, 550, 570, 1438, 1438, 1438, - /* 2090 */ 1725, 1438, 549, 1438, 1786, 1438, 1438, 278, 1756, 552, - /* 2100 */ 1758, 1759, 548, 1438, 570, 1755, 1438, 1438, 1438, 1438, - /* 2110 */ 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1786, 1438, - /* 2120 */ 1438, 286, 1756, 552, 1758, 1759, 548, 1438, 570, 1438, - /* 2130 */ 1438, 1438, 1438, 1773, 1438, 1438, 1438, 1438, 1438, 1438, - /* 2140 */ 1438, 550, 1438, 1438, 1438, 1438, 1725, 1438, 549, 1438, - /* 2150 */ 1438, 1438, 1438, 1438, 1438, 1755, 1438, 1438, 1438, 1438, - /* 2160 */ 1438, 1438, 1438, 1438, 1438, 1438, 1755, 1438, 1438, 1438, - /* 2170 */ 1438, 1438, 1438, 1438, 1786, 1438, 1438, 279, 1756, 552, - /* 2180 */ 1758, 1759, 548, 1773, 570, 1438, 1438, 1438, 1438, 1438, - /* 2190 */ 1438, 550, 1438, 1438, 1773, 1438, 1725, 1438, 549, 1438, - /* 2200 */ 1438, 1438, 550, 1438, 1438, 1438, 1438, 1725, 1755, 549, - /* 2210 */ 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1755, - /* 2220 */ 1438, 1438, 1438, 1438, 1786, 1438, 1438, 292, 1756, 552, - /* 2230 */ 1758, 1759, 548, 1755, 570, 1786, 1773, 1438, 293, 1756, - /* 2240 */ 552, 1758, 1759, 548, 550, 570, 1438, 1773, 1438, 1725, - /* 2250 */ 1438, 549, 1438, 1438, 1438, 550, 1438, 1438, 1438, 1438, - /* 2260 */ 1725, 1773, 549, 1438, 1438, 1438, 1438, 1438, 1438, 550, - /* 2270 */ 1438, 1438, 1438, 1438, 1725, 1438, 549, 1786, 1438, 1438, - /* 2280 */ 1767, 1756, 552, 1758, 1759, 548, 1438, 570, 1786, 1755, - /* 2290 */ 1438, 1766, 1756, 552, 1758, 1759, 548, 1438, 570, 1438, - /* 2300 */ 1438, 1438, 1786, 1755, 1438, 1765, 1756, 552, 1758, 1759, - /* 2310 */ 548, 1438, 570, 1438, 1438, 1438, 1438, 1773, 1438, 1438, - /* 2320 */ 1438, 1438, 1438, 1438, 1438, 550, 1438, 1438, 1438, 1438, - /* 2330 */ 1725, 1773, 549, 1438, 1438, 1438, 1438, 1438, 1438, 550, - /* 2340 */ 1438, 1438, 1438, 1438, 1725, 1438, 549, 1438, 1438, 1438, - /* 2350 */ 1438, 1438, 1438, 1755, 1438, 1438, 1438, 1438, 1786, 1438, - /* 2360 */ 1438, 302, 1756, 552, 1758, 1759, 548, 1438, 570, 1438, - /* 2370 */ 1438, 1438, 1786, 1438, 1438, 301, 1756, 552, 1758, 1759, - /* 2380 */ 548, 1773, 570, 1438, 1438, 1438, 1438, 1438, 1438, 550, - /* 2390 */ 1438, 1438, 1438, 1438, 1725, 1755, 549, 1438, 1438, 1438, - /* 2400 */ 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1755, - /* 2410 */ 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, - /* 2420 */ 1438, 1438, 1786, 1773, 1438, 303, 1756, 552, 1758, 1759, - /* 2430 */ 548, 550, 570, 1438, 1438, 1438, 1725, 1773, 549, 1438, - /* 2440 */ 1438, 1438, 1438, 1438, 1438, 550, 1438, 1438, 1438, 1438, - /* 2450 */ 1725, 1438, 549, 1438, 1438, 1438, 1438, 1438, 1438, 1438, - /* 2460 */ 1438, 1438, 1438, 1438, 1786, 1438, 1438, 300, 1756, 552, - /* 2470 */ 1758, 1759, 548, 1438, 570, 1438, 1438, 1438, 1786, 1438, - /* 2480 */ 1438, 281, 1756, 552, 1758, 1759, 548, 1438, 570, + /* 890 */ 387, 386, 385, 384, 475, 381, 380, 1784, 299, 1723, + /* 900 */ 88, 1754, 551, 1756, 1757, 547, 566, 569, 491, 566, + /* 910 */ 1830, 1273, 566, 566, 319, 1826, 152, 502, 224, 1236, + /* 920 */ 563, 1234, 1273, 564, 256, 600, 44, 4, 1614, 267, + /* 930 */ 1332, 217, 1601, 342, 1571, 194, 1857, 1571, 192, 1772, + /* 940 */ 1571, 1571, 196, 1239, 1240, 195, 1288, 1289, 1291, 1292, + /* 950 */ 1293, 1294, 1295, 544, 567, 1303, 1304, 1306, 1307, 1308, + /* 960 */ 1309, 1311, 1314, 139, 198, 52, 501, 197, 273, 101, + /* 970 */ 566, 219, 100, 99, 98, 97, 96, 95, 94, 93, + /* 980 */ 92, 340, 271, 57, 1333, 1324, 56, 200, 33, 32, + /* 990 */ 199, 1484, 40, 38, 36, 35, 34, 1753, 1571, 1482, + /* 1000 */ 1432, 1433, 172, 1290, 537, 41, 209, 1338, 11, 10, + /* 1010 */ 1244, 33, 32, 477, 1243, 40, 38, 36, 35, 34, + /* 1020 */ 41, 480, 1743, 1473, 41, 1771, 1611, 60, 242, 1860, + /* 1030 */ 526, 1026, 229, 549, 72, 123, 3, 126, 1723, 1548, + /* 1040 */ 548, 127, 234, 237, 239, 1340, 29, 324, 1327, 1328, + /* 1050 */ 1329, 1330, 1331, 1335, 1336, 1337, 50, 574, 1745, 126, + /* 1060 */ 1296, 1027, 299, 1404, 1185, 86, 1784, 5, 247, 89, + /* 1070 */ 1754, 551, 1756, 1757, 547, 558, 569, 253, 344, 1830, + /* 1080 */ 347, 1085, 1257, 1829, 1826, 351, 306, 1054, 307, 479, + /* 1090 */ 1201, 263, 399, 1663, 1332, 168, 266, 1113, 127, 1117, + /* 1100 */ 64, 63, 376, 112, 489, 166, 1753, 1546, 406, 414, + /* 1110 */ 126, 370, 413, 415, 333, 332, 419, 1263, 202, 420, + /* 1120 */ 428, 1266, 294, 431, 1249, 360, 175, 358, 354, 350, + /* 1130 */ 163, 345, 482, 601, 1771, 1310, 476, 1242, 1124, 432, + /* 1140 */ 1247, 201, 549, 1122, 1246, 177, 1265, 1723, 1333, 548, + /* 1150 */ 130, 433, 129, 128, 598, 597, 596, 1267, 1305, 434, + /* 1160 */ 180, 436, 182, 1264, 160, 437, 55, 1241, 184, 54, + /* 1170 */ 68, 1338, 440, 187, 459, 1784, 264, 461, 88, 1754, + /* 1180 */ 551, 1756, 1757, 547, 1705, 569, 91, 1561, 1830, 297, + /* 1190 */ 191, 1557, 319, 1826, 1909, 193, 132, 1753, 133, 1559, + /* 1200 */ 204, 601, 1555, 1849, 134, 135, 570, 492, 493, 496, + /* 1210 */ 29, 324, 1327, 1328, 1329, 1330, 1331, 1335, 1336, 1337, + /* 1220 */ 129, 128, 598, 597, 596, 1771, 207, 189, 499, 503, + /* 1230 */ 316, 1262, 211, 549, 508, 513, 1861, 555, 1723, 6, + /* 1240 */ 548, 144, 1871, 215, 1870, 510, 456, 452, 448, 444, + /* 1250 */ 188, 218, 318, 516, 1852, 529, 33, 32, 522, 223, + /* 1260 */ 40, 38, 36, 35, 34, 1250, 1784, 1245, 509, 280, + /* 1270 */ 1754, 551, 1756, 1757, 547, 70, 569, 507, 186, 33, + /* 1280 */ 32, 1753, 225, 40, 38, 36, 35, 34, 146, 1253, + /* 1290 */ 226, 506, 228, 227, 1366, 1896, 1261, 1846, 118, 1892, + /* 1300 */ 567, 1303, 1304, 1306, 1307, 1308, 1309, 538, 159, 1771, + /* 1310 */ 535, 18, 1893, 233, 320, 1912, 532, 549, 236, 553, + /* 1320 */ 539, 238, 1723, 124, 548, 1811, 554, 125, 1704, 1673, + /* 1330 */ 559, 1384, 560, 1753, 556, 328, 249, 251, 265, 529, + /* 1340 */ 185, 178, 77, 183, 561, 1572, 79, 435, 572, 1544, + /* 1350 */ 1784, 1615, 268, 280, 1754, 551, 1756, 1757, 547, 259, + /* 1360 */ 569, 1771, 644, 51, 645, 647, 176, 145, 289, 549, + /* 1370 */ 291, 272, 1717, 290, 1723, 270, 548, 1716, 62, 1896, + /* 1380 */ 1715, 346, 1712, 348, 349, 1753, 1228, 1229, 164, 353, + /* 1390 */ 1710, 355, 157, 356, 357, 1709, 1893, 359, 1708, 361, + /* 1400 */ 1707, 1753, 1784, 363, 1706, 89, 1754, 551, 1756, 1757, + /* 1410 */ 547, 365, 569, 1771, 1690, 1830, 369, 165, 368, 540, + /* 1420 */ 1826, 546, 1204, 1203, 1684, 1683, 1723, 375, 548, 1771, + /* 1430 */ 1682, 374, 1681, 1173, 1656, 1655, 1654, 549, 65, 1653, + /* 1440 */ 1652, 1651, 1723, 1650, 548, 1649, 388, 389, 1648, 391, + /* 1450 */ 1647, 1753, 122, 1633, 1784, 1646, 1645, 287, 1754, 551, + /* 1460 */ 1756, 1757, 547, 545, 569, 542, 1802, 1753, 1644, 1643, + /* 1470 */ 1784, 1642, 1641, 142, 1754, 551, 1756, 1757, 547, 1771, + /* 1480 */ 569, 1640, 1639, 1638, 1637, 1636, 1635, 549, 1634, 1632, + /* 1490 */ 1631, 1630, 1723, 1629, 548, 1771, 1628, 1175, 1627, 1626, + /* 1500 */ 1625, 1624, 1501, 549, 1469, 173, 113, 424, 1723, 1753, + /* 1510 */ 548, 992, 426, 150, 1468, 1698, 174, 530, 1910, 991, + /* 1520 */ 1784, 1753, 505, 89, 1754, 551, 1756, 1757, 547, 1692, + /* 1530 */ 569, 114, 1680, 1830, 179, 1679, 1784, 1771, 1827, 288, + /* 1540 */ 1754, 551, 1756, 1757, 547, 549, 569, 181, 1665, 1771, + /* 1550 */ 1723, 1550, 548, 1500, 1020, 1498, 441, 549, 442, 443, + /* 1560 */ 1496, 445, 1723, 446, 548, 1494, 447, 451, 449, 450, + /* 1570 */ 1492, 1753, 453, 1481, 1480, 455, 1465, 454, 1784, 1552, + /* 1580 */ 1127, 283, 1754, 551, 1756, 1757, 547, 1753, 569, 1128, + /* 1590 */ 1784, 1551, 190, 142, 1754, 551, 1756, 1757, 547, 1771, + /* 1600 */ 569, 49, 1053, 1052, 1051, 616, 1050, 549, 1490, 618, + /* 1610 */ 1047, 312, 1723, 1046, 548, 1771, 1045, 1485, 313, 521, + /* 1620 */ 1483, 478, 314, 546, 1464, 481, 323, 483, 1723, 1463, + /* 1630 */ 548, 1462, 485, 487, 90, 1697, 1211, 53, 1911, 1753, + /* 1640 */ 1784, 1691, 136, 288, 1754, 551, 1756, 1757, 547, 494, + /* 1650 */ 569, 1678, 1676, 208, 1677, 1753, 1784, 495, 315, 287, + /* 1660 */ 1754, 551, 1756, 1757, 547, 500, 569, 1771, 1803, 1675, + /* 1670 */ 1674, 41, 15, 47, 16, 549, 23, 221, 1406, 222, + /* 1680 */ 1723, 214, 548, 1771, 1743, 216, 1390, 143, 220, 24, + /* 1690 */ 25, 549, 1383, 1363, 325, 74, 1723, 45, 548, 1362, + /* 1700 */ 13, 231, 46, 17, 147, 1753, 1423, 1418, 1784, 1412, + /* 1710 */ 327, 288, 1754, 551, 1756, 1757, 547, 1753, 569, 1417, + /* 1720 */ 321, 1422, 1421, 322, 1784, 10, 1325, 288, 1754, 551, + /* 1730 */ 1756, 1757, 547, 1771, 569, 19, 1298, 148, 31, 161, + /* 1740 */ 1281, 549, 1672, 1664, 1297, 1771, 1723, 12, 548, 20, + /* 1750 */ 550, 241, 557, 549, 1388, 21, 243, 248, 1723, 75, + /* 1760 */ 548, 250, 76, 1742, 252, 255, 1300, 1251, 80, 573, + /* 1770 */ 335, 1753, 1787, 577, 1784, 571, 568, 274, 1754, 551, + /* 1780 */ 1756, 1757, 547, 48, 569, 1114, 1784, 1753, 575, 275, + /* 1790 */ 1754, 551, 1756, 1757, 547, 1111, 569, 578, 1753, 1771, + /* 1800 */ 580, 583, 586, 1108, 1102, 1091, 581, 549, 584, 1106, + /* 1810 */ 1100, 587, 1723, 1105, 548, 1771, 1104, 1123, 81, 1103, + /* 1820 */ 257, 82, 593, 549, 1119, 1042, 1771, 602, 1723, 59, + /* 1830 */ 548, 1018, 605, 1040, 549, 1060, 258, 1035, 1039, 1723, + /* 1840 */ 1784, 548, 1038, 276, 1754, 551, 1756, 1757, 547, 1037, + /* 1850 */ 569, 1753, 1036, 1034, 1033, 1055, 1784, 1057, 1030, 282, + /* 1860 */ 1754, 551, 1756, 1757, 547, 1029, 569, 1784, 1753, 1028, + /* 1870 */ 284, 1754, 551, 1756, 1757, 547, 1497, 569, 1025, 1771, + /* 1880 */ 1024, 1023, 626, 627, 1495, 630, 631, 549, 628, 1493, + /* 1890 */ 632, 634, 1723, 1753, 548, 635, 1771, 636, 1491, 638, + /* 1900 */ 639, 640, 1479, 642, 549, 982, 1461, 261, 646, 1723, + /* 1910 */ 1753, 548, 1237, 269, 1436, 649, 650, 1436, 1436, 1436, + /* 1920 */ 1784, 1771, 1436, 277, 1754, 551, 1756, 1757, 547, 549, + /* 1930 */ 569, 1436, 1436, 1436, 1723, 1436, 548, 1784, 1771, 1436, + /* 1940 */ 285, 1754, 551, 1756, 1757, 547, 549, 569, 1436, 1436, + /* 1950 */ 1436, 1723, 1753, 548, 1436, 1436, 1436, 1436, 1436, 1436, + /* 1960 */ 1436, 1436, 1784, 1436, 1753, 278, 1754, 551, 1756, 1757, + /* 1970 */ 547, 1436, 569, 1436, 1436, 1436, 1436, 1436, 1436, 1784, + /* 1980 */ 1771, 1436, 286, 1754, 551, 1756, 1757, 547, 549, 569, + /* 1990 */ 1436, 1436, 1771, 1723, 1436, 548, 1436, 1436, 1436, 1436, + /* 2000 */ 549, 1436, 1436, 1436, 1436, 1723, 1436, 548, 1436, 1436, + /* 2010 */ 1436, 1436, 1436, 1436, 1753, 1436, 1436, 1436, 1436, 1436, + /* 2020 */ 1436, 1784, 1436, 1436, 279, 1754, 551, 1756, 1757, 547, + /* 2030 */ 1436, 569, 1753, 1784, 1436, 1436, 292, 1754, 551, 1756, + /* 2040 */ 1757, 547, 1771, 569, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2050 */ 549, 1436, 1436, 1436, 1436, 1723, 1436, 548, 1436, 1436, + /* 2060 */ 1771, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 549, 1436, + /* 2070 */ 1436, 1436, 1436, 1723, 1436, 548, 1436, 1436, 1436, 1436, + /* 2080 */ 1436, 1436, 1753, 1784, 1436, 1436, 293, 1754, 551, 1756, + /* 2090 */ 1757, 547, 1436, 569, 1753, 1436, 1436, 1436, 1436, 1436, + /* 2100 */ 1436, 1784, 1436, 1436, 1765, 1754, 551, 1756, 1757, 547, + /* 2110 */ 1771, 569, 1436, 1436, 1436, 1436, 1436, 1436, 549, 1436, + /* 2120 */ 1436, 1436, 1771, 1723, 1436, 548, 1436, 1436, 1436, 1436, + /* 2130 */ 549, 1436, 1436, 1436, 1436, 1723, 1436, 548, 1436, 1436, + /* 2140 */ 1436, 1436, 1436, 1436, 1436, 1436, 1753, 1436, 1436, 1436, + /* 2150 */ 1436, 1784, 1436, 1436, 1764, 1754, 551, 1756, 1757, 547, + /* 2160 */ 1436, 569, 1436, 1784, 1753, 1436, 1763, 1754, 551, 1756, + /* 2170 */ 1757, 547, 1436, 569, 1771, 1436, 1436, 1436, 1436, 1436, + /* 2180 */ 1436, 1436, 549, 1436, 1436, 1436, 1436, 1723, 1753, 548, + /* 2190 */ 1436, 1436, 1771, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2200 */ 549, 1436, 1436, 1436, 1436, 1723, 1753, 548, 1436, 1436, + /* 2210 */ 1436, 1436, 1436, 1436, 1436, 1784, 1771, 1436, 302, 1754, + /* 2220 */ 551, 1756, 1757, 547, 549, 569, 1436, 1436, 1436, 1723, + /* 2230 */ 1436, 548, 1436, 1784, 1771, 1436, 301, 1754, 551, 1756, + /* 2240 */ 1757, 547, 549, 569, 1436, 1436, 1436, 1723, 1436, 548, + /* 2250 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1784, 1436, 1753, + /* 2260 */ 303, 1754, 551, 1756, 1757, 547, 1436, 569, 1436, 1436, + /* 2270 */ 1436, 1436, 1436, 1436, 1436, 1784, 1436, 1436, 300, 1754, + /* 2280 */ 551, 1756, 1757, 547, 1436, 569, 1436, 1771, 1436, 1436, + /* 2290 */ 1436, 1436, 1436, 1436, 1436, 549, 1436, 1436, 1436, 1436, + /* 2300 */ 1723, 1436, 548, 1436, 33, 32, 1436, 1436, 40, 38, + /* 2310 */ 36, 35, 34, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2320 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1784, 1436, + /* 2330 */ 1436, 281, 1754, 551, 1756, 1757, 547, 1436, 569, 1436, + /* 2340 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2350 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2360 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2370 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2380 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2390 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2400 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2410 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2420 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2430 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, + /* 2440 */ 1436, 1436, 1436, 1436, 1436, 1436, 137, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 261, 257, 250, 259, 260, 283, 0, 257, 286, 259, - /* 10 */ 260, 272, 12, 13, 0, 252, 294, 254, 279, 265, - /* 20 */ 20, 0, 22, 283, 21, 280, 286, 261, 289, 283, - /* 30 */ 20, 20, 278, 33, 294, 35, 323, 34, 293, 36, - /* 40 */ 294, 287, 21, 321, 322, 24, 25, 26, 27, 28, - /* 50 */ 29, 30, 31, 32, 332, 289, 56, 281, 253, 59, - /* 60 */ 347, 321, 322, 311, 288, 65, 311, 321, 322, 12, - /* 70 */ 13, 14, 332, 297, 20, 61, 62, 20, 332, 22, - /* 80 */ 66, 323, 82, 69, 70, 296, 281, 73, 74, 75, - /* 90 */ 33, 281, 35, 304, 289, 329, 307, 261, 288, 294, - /* 100 */ 253, 296, 311, 351, 104, 347, 351, 297, 272, 343, - /* 110 */ 344, 345, 346, 56, 348, 279, 59, 365, 118, 119, - /* 120 */ 365, 369, 65, 0, 369, 289, 0, 322, 118, 119, - /* 130 */ 325, 326, 327, 328, 329, 330, 82, 332, 263, 82, - /* 140 */ 335, 294, 351, 56, 339, 340, 341, 24, 25, 26, - /* 150 */ 27, 28, 29, 30, 31, 32, 365, 58, 353, 284, - /* 160 */ 369, 104, 0, 163, 266, 165, 361, 362, 270, 82, - /* 170 */ 20, 84, 61, 62, 48, 118, 119, 66, 283, 292, - /* 180 */ 69, 70, 295, 296, 73, 74, 75, 187, 188, 294, + /* 0 */ 257, 0, 259, 260, 280, 283, 250, 257, 286, 259, + /* 10 */ 260, 4, 12, 13, 0, 292, 294, 293, 295, 296, + /* 20 */ 20, 0, 22, 283, 351, 283, 286, 261, 311, 261, + /* 30 */ 20, 20, 281, 33, 294, 35, 294, 364, 336, 337, + /* 40 */ 289, 368, 21, 321, 322, 24, 25, 26, 27, 28, + /* 50 */ 29, 30, 31, 32, 332, 289, 56, 4, 253, 59, + /* 60 */ 4, 321, 322, 321, 322, 65, 298, 311, 351, 12, + /* 70 */ 13, 14, 332, 58, 332, 61, 62, 20, 327, 22, + /* 80 */ 66, 364, 82, 69, 70, 368, 281, 73, 74, 75, + /* 90 */ 33, 20, 35, 22, 289, 329, 14, 44, 45, 294, + /* 100 */ 273, 296, 20, 252, 104, 254, 35, 351, 281, 343, + /* 110 */ 344, 345, 346, 56, 348, 56, 59, 290, 118, 119, + /* 120 */ 364, 50, 65, 0, 368, 295, 296, 322, 118, 119, + /* 130 */ 325, 326, 327, 328, 329, 330, 14, 332, 82, 82, + /* 140 */ 335, 82, 20, 84, 339, 340, 341, 24, 25, 26, + /* 150 */ 27, 28, 29, 30, 31, 32, 266, 263, 353, 35, + /* 160 */ 270, 104, 0, 163, 20, 165, 361, 12, 13, 14, + /* 170 */ 15, 16, 61, 62, 20, 118, 119, 66, 284, 258, + /* 180 */ 69, 70, 261, 114, 73, 74, 75, 187, 188, 65, /* 190 */ 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - /* 200 */ 200, 201, 202, 203, 204, 205, 206, 8, 9, 113, - /* 210 */ 114, 12, 13, 14, 15, 16, 321, 322, 258, 219, - /* 220 */ 163, 261, 165, 61, 62, 63, 64, 332, 66, 67, + /* 200 */ 200, 201, 202, 203, 204, 205, 206, 20, 8, 9, + /* 210 */ 296, 14, 12, 13, 14, 15, 16, 20, 304, 219, + /* 220 */ 163, 307, 165, 61, 62, 63, 64, 220, 66, 67, /* 230 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 240 */ 78, 79, 20, 4, 187, 188, 4, 190, 191, 192, + /* 240 */ 78, 79, 173, 174, 187, 188, 39, 190, 191, 192, /* 250 */ 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - /* 260 */ 203, 204, 205, 206, 12, 13, 20, 22, 82, 311, - /* 270 */ 174, 187, 20, 219, 22, 12, 13, 14, 15, 16, - /* 280 */ 35, 20, 83, 44, 45, 33, 263, 35, 95, 96, - /* 290 */ 97, 98, 99, 100, 101, 102, 103, 104, 105, 276, - /* 300 */ 107, 108, 109, 110, 111, 112, 219, 284, 56, 351, - /* 310 */ 65, 59, 228, 229, 230, 231, 232, 65, 94, 0, - /* 320 */ 261, 12, 13, 365, 82, 253, 58, 369, 82, 20, - /* 330 */ 20, 22, 22, 20, 82, 273, 82, 113, 114, 115, - /* 340 */ 116, 117, 33, 281, 35, 35, 273, 20, 162, 104, - /* 350 */ 164, 261, 290, 281, 281, 351, 104, 298, 0, 273, - /* 360 */ 50, 289, 113, 290, 351, 56, 294, 281, 296, 365, - /* 370 */ 118, 119, 150, 369, 65, 351, 290, 58, 365, 289, - /* 380 */ 8, 9, 369, 311, 12, 13, 14, 15, 16, 365, - /* 390 */ 14, 82, 261, 369, 322, 289, 20, 325, 326, 327, - /* 400 */ 328, 329, 330, 272, 332, 219, 300, 335, 163, 158, - /* 410 */ 165, 339, 340, 104, 281, 163, 58, 165, 148, 329, - /* 420 */ 289, 82, 289, 351, 175, 176, 65, 118, 119, 178, - /* 430 */ 179, 92, 187, 188, 344, 345, 346, 365, 348, 187, - /* 440 */ 188, 369, 190, 191, 192, 193, 194, 195, 196, 197, - /* 450 */ 198, 199, 200, 201, 202, 203, 204, 205, 206, 21, - /* 460 */ 327, 219, 24, 25, 26, 27, 28, 29, 30, 31, - /* 470 */ 32, 14, 163, 219, 165, 8, 9, 20, 2, 12, - /* 480 */ 13, 14, 15, 16, 8, 9, 76, 14, 12, 13, - /* 490 */ 14, 15, 16, 20, 224, 225, 187, 188, 93, 190, + /* 260 */ 203, 204, 205, 206, 12, 13, 351, 82, 20, 82, + /* 270 */ 281, 187, 20, 191, 22, 219, 20, 288, 219, 364, + /* 280 */ 76, 56, 269, 368, 271, 33, 297, 35, 95, 96, + /* 290 */ 97, 98, 99, 100, 101, 102, 103, 104, 105, 58, + /* 300 */ 107, 108, 109, 110, 111, 112, 81, 351, 56, 84, + /* 310 */ 37, 59, 228, 229, 230, 231, 232, 65, 94, 22, + /* 320 */ 364, 12, 13, 253, 368, 261, 122, 123, 82, 20, + /* 330 */ 82, 22, 35, 21, 82, 0, 272, 113, 114, 115, + /* 340 */ 116, 117, 33, 279, 35, 20, 34, 162, 36, 164, + /* 350 */ 65, 281, 20, 289, 22, 155, 104, 158, 85, 289, + /* 360 */ 87, 88, 65, 90, 294, 56, 296, 94, 267, 268, + /* 370 */ 118, 119, 258, 20, 65, 261, 311, 178, 179, 8, + /* 380 */ 9, 311, 50, 12, 13, 14, 15, 16, 191, 116, + /* 390 */ 265, 82, 322, 58, 253, 325, 326, 327, 328, 329, + /* 400 */ 330, 104, 332, 278, 219, 335, 219, 289, 261, 339, + /* 410 */ 340, 263, 287, 104, 43, 163, 351, 165, 300, 272, + /* 420 */ 253, 351, 281, 65, 276, 218, 279, 118, 119, 364, + /* 430 */ 289, 113, 284, 368, 364, 294, 289, 296, 368, 187, + /* 440 */ 188, 241, 190, 191, 192, 193, 194, 195, 196, 197, + /* 450 */ 198, 199, 200, 201, 202, 203, 204, 205, 206, 20, + /* 460 */ 163, 294, 165, 322, 261, 219, 325, 326, 327, 328, + /* 470 */ 329, 330, 163, 332, 165, 150, 335, 43, 273, 296, + /* 480 */ 339, 340, 341, 311, 187, 188, 281, 93, 1, 2, + /* 490 */ 307, 350, 289, 175, 176, 290, 187, 188, 3, 190, /* 500 */ 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - /* 510 */ 201, 202, 203, 204, 205, 206, 12, 13, 14, 261, - /* 520 */ 114, 336, 337, 261, 20, 65, 22, 155, 219, 253, - /* 530 */ 272, 253, 122, 123, 272, 46, 20, 33, 22, 35, - /* 540 */ 315, 253, 2, 14, 15, 16, 39, 289, 8, 9, - /* 550 */ 83, 289, 12, 13, 14, 15, 16, 8, 9, 253, - /* 560 */ 56, 12, 13, 14, 15, 16, 50, 191, 253, 65, - /* 570 */ 294, 82, 294, 12, 13, 253, 295, 296, 4, 173, - /* 580 */ 174, 20, 294, 22, 8, 9, 82, 281, 12, 13, - /* 590 */ 14, 15, 16, 19, 33, 289, 35, 281, 265, 261, - /* 600 */ 294, 261, 296, 281, 1, 2, 290, 33, 104, 294, - /* 610 */ 272, 289, 272, 241, 56, 253, 294, 56, 296, 43, - /* 620 */ 287, 47, 118, 119, 0, 51, 65, 289, 322, 289, - /* 630 */ 56, 325, 326, 327, 328, 329, 330, 258, 332, 81, - /* 640 */ 261, 335, 84, 82, 322, 339, 340, 325, 326, 327, - /* 650 */ 328, 329, 330, 35, 332, 81, 294, 335, 84, 261, - /* 660 */ 282, 339, 340, 341, 191, 104, 145, 163, 282, 165, - /* 670 */ 8, 9, 253, 253, 12, 13, 14, 15, 16, 118, - /* 680 */ 119, 0, 291, 65, 362, 294, 83, 289, 253, 168, - /* 690 */ 253, 187, 188, 253, 190, 191, 192, 193, 194, 195, + /* 510 */ 201, 202, 203, 204, 205, 206, 12, 13, 14, 14, + /* 520 */ 15, 16, 261, 351, 20, 82, 22, 261, 219, 0, + /* 530 */ 19, 261, 329, 282, 265, 92, 364, 33, 272, 35, + /* 540 */ 368, 0, 272, 253, 33, 281, 281, 344, 345, 346, + /* 550 */ 289, 348, 261, 288, 148, 289, 287, 261, 47, 289, + /* 560 */ 56, 297, 297, 52, 53, 54, 55, 56, 272, 65, + /* 570 */ 83, 273, 311, 12, 13, 253, 261, 48, 145, 281, + /* 580 */ 289, 20, 261, 22, 294, 289, 82, 272, 290, 150, + /* 590 */ 329, 253, 81, 272, 33, 84, 35, 113, 114, 58, + /* 600 */ 254, 168, 311, 281, 289, 344, 345, 346, 104, 348, + /* 610 */ 289, 289, 351, 261, 315, 253, 294, 56, 296, 0, + /* 620 */ 329, 282, 118, 119, 272, 364, 65, 282, 117, 368, + /* 630 */ 224, 225, 294, 311, 253, 344, 345, 346, 43, 348, + /* 640 */ 207, 289, 351, 82, 322, 43, 253, 325, 326, 327, + /* 650 */ 328, 329, 330, 323, 332, 364, 294, 335, 174, 368, + /* 660 */ 149, 339, 340, 267, 268, 104, 47, 163, 282, 165, + /* 670 */ 253, 253, 238, 351, 281, 294, 253, 347, 83, 118, + /* 680 */ 119, 170, 289, 172, 281, 83, 364, 294, 253, 296, + /* 690 */ 368, 187, 188, 290, 190, 191, 192, 193, 194, 195, /* 700 */ 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - /* 710 */ 206, 267, 268, 294, 294, 8, 9, 4, 94, 12, - /* 720 */ 13, 14, 15, 16, 163, 218, 165, 329, 207, 294, - /* 730 */ 253, 294, 253, 253, 294, 37, 253, 113, 114, 115, - /* 740 */ 116, 117, 344, 345, 346, 83, 348, 306, 187, 188, - /* 750 */ 309, 190, 191, 192, 193, 194, 195, 196, 197, 198, + /* 710 */ 206, 294, 294, 261, 323, 322, 261, 294, 325, 326, + /* 720 */ 327, 328, 329, 330, 163, 332, 165, 272, 335, 294, + /* 730 */ 253, 236, 339, 340, 341, 270, 283, 306, 347, 253, + /* 740 */ 309, 289, 253, 350, 289, 253, 253, 294, 187, 188, + /* 750 */ 282, 190, 191, 192, 193, 194, 195, 196, 197, 198, /* 760 */ 199, 200, 201, 202, 203, 204, 205, 206, 12, 13, - /* 770 */ 18, 294, 20, 294, 294, 94, 20, 294, 22, 27, - /* 780 */ 94, 323, 30, 85, 253, 87, 88, 306, 90, 33, - /* 790 */ 309, 35, 94, 20, 113, 114, 115, 116, 117, 47, - /* 800 */ 3, 49, 116, 51, 261, 347, 267, 268, 296, 261, - /* 810 */ 20, 261, 56, 261, 116, 272, 261, 253, 261, 307, - /* 820 */ 272, 65, 272, 0, 272, 294, 253, 272, 253, 272, - /* 830 */ 43, 261, 289, 81, 281, 44, 45, 289, 82, 289, - /* 840 */ 274, 289, 272, 277, 289, 43, 289, 8, 9, 282, - /* 850 */ 297, 12, 13, 14, 15, 16, 281, 150, 294, 289, - /* 860 */ 104, 269, 291, 271, 289, 294, 282, 294, 253, 294, - /* 870 */ 47, 296, 0, 121, 118, 119, 124, 125, 126, 127, + /* 770 */ 18, 294, 20, 282, 321, 322, 20, 261, 22, 27, + /* 780 */ 294, 329, 30, 294, 282, 332, 294, 294, 272, 33, + /* 790 */ 253, 35, 291, 44, 45, 294, 344, 345, 346, 47, + /* 800 */ 348, 49, 362, 51, 2, 289, 323, 43, 253, 253, + /* 810 */ 8, 9, 56, 2, 12, 13, 14, 15, 16, 8, + /* 820 */ 9, 65, 371, 12, 13, 14, 15, 16, 253, 253, + /* 830 */ 347, 294, 20, 81, 261, 261, 8, 9, 82, 94, + /* 840 */ 12, 13, 14, 15, 16, 272, 272, 8, 9, 294, + /* 850 */ 294, 12, 13, 14, 15, 16, 281, 59, 253, 262, + /* 860 */ 104, 116, 289, 289, 289, 306, 217, 218, 309, 294, + /* 870 */ 294, 296, 0, 121, 118, 119, 124, 125, 126, 127, /* 880 */ 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - /* 890 */ 138, 139, 140, 141, 22, 143, 144, 322, 59, 35, - /* 900 */ 325, 326, 327, 328, 329, 330, 261, 332, 56, 294, - /* 910 */ 335, 217, 218, 0, 339, 340, 341, 272, 33, 163, - /* 920 */ 282, 165, 83, 150, 282, 350, 86, 43, 86, 89, - /* 930 */ 91, 89, 47, 220, 289, 22, 84, 52, 53, 54, - /* 940 */ 55, 56, 86, 187, 188, 89, 190, 191, 192, 193, + /* 890 */ 138, 139, 140, 141, 22, 143, 144, 322, 59, 294, + /* 900 */ 325, 326, 327, 328, 329, 330, 261, 332, 318, 261, + /* 910 */ 335, 83, 261, 261, 339, 340, 341, 272, 358, 163, + /* 920 */ 272, 165, 83, 272, 272, 291, 42, 43, 294, 274, + /* 930 */ 91, 43, 277, 262, 289, 86, 361, 289, 89, 281, + /* 940 */ 289, 289, 86, 187, 188, 89, 190, 191, 192, 193, /* 950 */ 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - /* 960 */ 204, 205, 206, 18, 261, 261, 81, 83, 23, 84, - /* 970 */ 150, 151, 282, 43, 86, 272, 272, 89, 0, 59, - /* 980 */ 43, 191, 37, 38, 145, 254, 41, 270, 1, 2, - /* 990 */ 363, 372, 289, 289, 118, 119, 43, 43, 262, 43, - /* 1000 */ 22, 43, 57, 43, 43, 43, 318, 168, 358, 35, - /* 1010 */ 35, 8, 9, 83, 281, 12, 13, 14, 15, 16, - /* 1020 */ 83, 262, 260, 43, 43, 238, 43, 82, 43, 165, - /* 1030 */ 261, 146, 147, 236, 149, 293, 83, 83, 153, 83, - /* 1040 */ 65, 83, 240, 83, 83, 83, 207, 208, 209, 210, - /* 1050 */ 211, 212, 213, 214, 215, 216, 43, 172, 289, 43, - /* 1060 */ 349, 324, 59, 83, 83, 120, 83, 366, 83, 221, - /* 1070 */ 352, 366, 366, 320, 20, 261, 47, 319, 35, 267, - /* 1080 */ 311, 313, 161, 261, 42, 261, 301, 145, 299, 261, - /* 1090 */ 20, 299, 255, 255, 91, 20, 83, 317, 329, 83, - /* 1100 */ 155, 156, 157, 296, 20, 160, 265, 187, 253, 265, - /* 1110 */ 310, 166, 20, 344, 345, 346, 312, 348, 265, 310, - /* 1120 */ 351, 20, 177, 265, 265, 180, 265, 182, 183, 184, - /* 1130 */ 185, 186, 302, 265, 365, 261, 281, 255, 369, 165, - /* 1140 */ 294, 281, 261, 281, 289, 255, 281, 281, 145, 294, - /* 1150 */ 281, 296, 281, 317, 281, 263, 281, 171, 281, 281, - /* 1160 */ 281, 253, 263, 316, 219, 261, 311, 261, 263, 20, - /* 1170 */ 227, 168, 357, 310, 324, 226, 296, 322, 357, 233, - /* 1180 */ 325, 326, 327, 328, 329, 330, 360, 332, 294, 281, - /* 1190 */ 335, 305, 294, 154, 339, 340, 305, 289, 235, 234, - /* 1200 */ 357, 294, 294, 253, 296, 294, 351, 356, 359, 355, + /* 960 */ 204, 205, 206, 18, 86, 150, 151, 89, 23, 21, + /* 970 */ 261, 83, 24, 25, 26, 27, 28, 29, 30, 31, + /* 980 */ 32, 272, 37, 38, 145, 187, 41, 86, 8, 9, + /* 990 */ 89, 0, 12, 13, 14, 15, 16, 253, 289, 0, + /* 1000 */ 118, 119, 57, 191, 240, 43, 56, 168, 1, 2, + /* 1010 */ 35, 8, 9, 22, 35, 12, 13, 14, 15, 16, + /* 1020 */ 43, 22, 46, 260, 43, 281, 293, 82, 43, 324, + /* 1030 */ 349, 35, 342, 289, 84, 43, 352, 43, 294, 0, + /* 1040 */ 296, 43, 365, 365, 365, 83, 207, 208, 209, 210, + /* 1050 */ 211, 212, 213, 214, 215, 216, 43, 43, 82, 43, + /* 1060 */ 83, 65, 59, 83, 83, 120, 322, 221, 83, 325, + /* 1070 */ 326, 327, 328, 329, 330, 83, 332, 83, 320, 335, + /* 1080 */ 261, 83, 20, 339, 340, 47, 319, 35, 267, 4, + /* 1090 */ 161, 313, 261, 261, 91, 42, 83, 83, 43, 83, + /* 1100 */ 155, 156, 157, 43, 19, 160, 253, 0, 301, 145, + /* 1110 */ 43, 166, 299, 299, 12, 13, 261, 20, 33, 255, + /* 1120 */ 255, 20, 177, 317, 22, 180, 265, 182, 183, 184, + /* 1130 */ 185, 186, 47, 94, 281, 33, 51, 35, 83, 296, + /* 1140 */ 165, 56, 289, 83, 165, 265, 20, 294, 145, 296, + /* 1150 */ 83, 310, 113, 114, 115, 116, 117, 20, 56, 312, + /* 1160 */ 265, 310, 265, 20, 219, 302, 81, 65, 265, 84, + /* 1170 */ 265, 168, 261, 265, 255, 322, 317, 281, 325, 326, + /* 1180 */ 327, 328, 329, 330, 294, 332, 261, 281, 335, 255, + /* 1190 */ 281, 281, 339, 340, 341, 281, 281, 253, 281, 281, + /* 1200 */ 263, 94, 281, 350, 281, 281, 104, 171, 316, 296, /* 1210 */ 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - /* 1220 */ 365, 222, 320, 218, 369, 289, 20, 42, 239, 237, - /* 1230 */ 322, 281, 323, 325, 326, 327, 328, 329, 330, 289, - /* 1240 */ 332, 354, 342, 335, 294, 82, 296, 339, 340, 341, - /* 1250 */ 12, 13, 242, 338, 147, 303, 373, 368, 350, 289, - /* 1260 */ 22, 368, 367, 367, 305, 368, 294, 294, 367, 305, - /* 1270 */ 294, 33, 322, 35, 263, 325, 326, 327, 328, 329, - /* 1280 */ 330, 253, 332, 277, 294, 335, 302, 294, 294, 339, - /* 1290 */ 340, 341, 82, 263, 56, 294, 289, 285, 271, 261, - /* 1300 */ 350, 36, 256, 65, 263, 255, 309, 275, 253, 281, - /* 1310 */ 314, 275, 275, 264, 251, 0, 0, 289, 42, 0, - /* 1320 */ 0, 73, 294, 35, 296, 181, 35, 35, 35, 181, - /* 1330 */ 0, 35, 35, 181, 0, 181, 281, 0, 35, 311, - /* 1340 */ 0, 0, 104, 22, 289, 35, 0, 168, 82, 294, - /* 1350 */ 322, 296, 165, 325, 326, 327, 328, 329, 330, 167, - /* 1360 */ 332, 163, 0, 0, 159, 158, 311, 0, 0, 46, - /* 1370 */ 0, 0, 0, 142, 0, 0, 253, 322, 0, 351, - /* 1380 */ 325, 326, 327, 328, 329, 330, 0, 332, 0, 137, - /* 1390 */ 35, 0, 137, 365, 0, 0, 0, 369, 0, 0, - /* 1400 */ 0, 163, 0, 165, 281, 22, 351, 0, 0, 0, - /* 1410 */ 0, 0, 289, 0, 0, 42, 0, 294, 253, 296, - /* 1420 */ 365, 0, 0, 0, 369, 187, 0, 0, 0, 0, - /* 1430 */ 0, 0, 0, 0, 42, 46, 198, 199, 200, 201, - /* 1440 */ 202, 203, 204, 253, 43, 322, 281, 60, 325, 326, - /* 1450 */ 327, 328, 329, 330, 289, 332, 39, 14, 335, 294, - /* 1460 */ 14, 296, 339, 340, 46, 0, 0, 0, 0, 0, - /* 1470 */ 0, 281, 154, 0, 40, 39, 39, 0, 0, 289, - /* 1480 */ 261, 39, 47, 35, 294, 0, 296, 322, 35, 39, - /* 1490 */ 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - /* 1500 */ 253, 47, 0, 47, 0, 47, 35, 0, 289, 35, - /* 1510 */ 0, 39, 322, 89, 39, 325, 326, 327, 328, 329, - /* 1520 */ 330, 0, 332, 0, 35, 22, 0, 35, 281, 91, - /* 1530 */ 311, 35, 35, 35, 43, 35, 289, 43, 0, 22, - /* 1540 */ 35, 294, 0, 296, 35, 0, 22, 22, 329, 35, - /* 1550 */ 49, 0, 0, 35, 35, 0, 22, 253, 0, 20, - /* 1560 */ 370, 371, 150, 344, 345, 346, 35, 348, 0, 322, - /* 1570 */ 351, 22, 325, 326, 327, 328, 329, 330, 253, 332, - /* 1580 */ 0, 0, 335, 0, 365, 281, 147, 340, 369, 169, - /* 1590 */ 150, 150, 0, 289, 0, 83, 152, 43, 294, 43, - /* 1600 */ 296, 217, 223, 83, 82, 43, 281, 43, 43, 82, - /* 1610 */ 43, 83, 308, 83, 289, 82, 223, 82, 82, 294, - /* 1620 */ 46, 296, 46, 82, 46, 46, 322, 83, 43, 325, - /* 1630 */ 326, 327, 328, 329, 330, 253, 332, 35, 223, 35, - /* 1640 */ 83, 35, 83, 83, 35, 35, 35, 322, 2, 187, - /* 1650 */ 325, 326, 327, 328, 329, 330, 43, 332, 253, 22, - /* 1660 */ 83, 46, 46, 281, 82, 189, 0, 83, 82, 82, - /* 1670 */ 82, 289, 83, 83, 0, 82, 294, 82, 296, 82, - /* 1680 */ 148, 39, 82, 146, 46, 46, 281, 82, 92, 364, - /* 1690 */ 83, 22, 93, 35, 289, 83, 82, 35, 35, 294, - /* 1700 */ 253, 296, 82, 82, 322, 83, 82, 325, 326, 327, - /* 1710 */ 328, 329, 330, 308, 332, 83, 253, 35, 82, 35, - /* 1720 */ 35, 22, 94, 83, 83, 82, 82, 322, 281, 106, - /* 1730 */ 325, 326, 327, 328, 329, 330, 289, 332, 82, 106, - /* 1740 */ 106, 294, 82, 296, 281, 35, 82, 43, 22, 60, - /* 1750 */ 59, 106, 289, 371, 35, 80, 43, 294, 65, 296, - /* 1760 */ 35, 22, 35, 35, 35, 35, 253, 35, 35, 322, - /* 1770 */ 65, 308, 325, 326, 327, 328, 329, 330, 35, 332, - /* 1780 */ 35, 334, 35, 35, 35, 322, 35, 35, 325, 326, - /* 1790 */ 327, 328, 329, 330, 281, 332, 19, 0, 35, 39, - /* 1800 */ 47, 0, 289, 35, 47, 39, 0, 294, 35, 296, - /* 1810 */ 33, 47, 0, 39, 35, 39, 47, 0, 35, 35, - /* 1820 */ 0, 308, 22, 253, 47, 21, 374, 22, 21, 52, - /* 1830 */ 53, 54, 55, 56, 374, 322, 22, 374, 325, 326, - /* 1840 */ 327, 328, 329, 330, 20, 332, 374, 374, 374, 374, - /* 1850 */ 374, 281, 374, 374, 374, 374, 374, 374, 81, 289, - /* 1860 */ 374, 84, 374, 374, 294, 374, 296, 374, 374, 374, - /* 1870 */ 374, 374, 374, 374, 374, 374, 374, 374, 374, 374, - /* 1880 */ 374, 374, 374, 374, 253, 374, 374, 374, 374, 374, - /* 1890 */ 374, 374, 322, 374, 117, 325, 326, 327, 328, 329, - /* 1900 */ 330, 253, 332, 374, 374, 374, 374, 374, 374, 374, - /* 1910 */ 374, 374, 281, 374, 374, 374, 374, 374, 374, 374, - /* 1920 */ 289, 374, 374, 374, 374, 294, 149, 296, 374, 281, - /* 1930 */ 374, 374, 374, 374, 374, 374, 374, 289, 374, 374, - /* 1940 */ 374, 374, 294, 253, 296, 374, 374, 170, 374, 172, - /* 1950 */ 374, 374, 374, 322, 253, 374, 325, 326, 327, 328, - /* 1960 */ 329, 330, 374, 332, 374, 253, 374, 374, 374, 374, - /* 1970 */ 322, 281, 374, 325, 326, 327, 328, 329, 330, 289, - /* 1980 */ 332, 374, 281, 374, 294, 374, 296, 374, 374, 374, - /* 1990 */ 289, 374, 374, 281, 374, 294, 374, 296, 374, 374, - /* 2000 */ 374, 289, 374, 374, 374, 374, 294, 253, 296, 374, - /* 2010 */ 374, 374, 322, 374, 374, 325, 326, 327, 328, 329, - /* 2020 */ 330, 374, 332, 322, 374, 253, 325, 326, 327, 328, - /* 2030 */ 329, 330, 374, 332, 322, 281, 374, 325, 326, 327, - /* 2040 */ 328, 329, 330, 289, 332, 374, 374, 374, 294, 253, - /* 2050 */ 296, 374, 374, 281, 374, 374, 374, 374, 374, 374, - /* 2060 */ 374, 289, 374, 374, 374, 374, 294, 374, 296, 374, - /* 2070 */ 374, 374, 374, 374, 374, 374, 322, 281, 374, 325, - /* 2080 */ 326, 327, 328, 329, 330, 289, 332, 374, 374, 374, - /* 2090 */ 294, 374, 296, 374, 322, 374, 374, 325, 326, 327, - /* 2100 */ 328, 329, 330, 374, 332, 253, 374, 374, 374, 374, - /* 2110 */ 374, 374, 374, 374, 374, 374, 374, 374, 322, 374, - /* 2120 */ 374, 325, 326, 327, 328, 329, 330, 374, 332, 374, - /* 2130 */ 374, 374, 374, 281, 374, 374, 374, 374, 374, 374, - /* 2140 */ 374, 289, 374, 374, 374, 374, 294, 374, 296, 374, - /* 2150 */ 374, 374, 374, 374, 374, 253, 374, 374, 374, 374, - /* 2160 */ 374, 374, 374, 374, 374, 374, 253, 374, 374, 374, - /* 2170 */ 374, 374, 374, 374, 322, 374, 374, 325, 326, 327, - /* 2180 */ 328, 329, 330, 281, 332, 374, 374, 374, 374, 374, - /* 2190 */ 374, 289, 374, 374, 281, 374, 294, 374, 296, 374, - /* 2200 */ 374, 374, 289, 374, 374, 374, 374, 294, 253, 296, - /* 2210 */ 374, 374, 374, 374, 374, 374, 374, 374, 374, 253, - /* 2220 */ 374, 374, 374, 374, 322, 374, 374, 325, 326, 327, - /* 2230 */ 328, 329, 330, 253, 332, 322, 281, 374, 325, 326, - /* 2240 */ 327, 328, 329, 330, 289, 332, 374, 281, 374, 294, - /* 2250 */ 374, 296, 374, 374, 374, 289, 374, 374, 374, 374, - /* 2260 */ 294, 281, 296, 374, 374, 374, 374, 374, 374, 289, - /* 2270 */ 374, 374, 374, 374, 294, 374, 296, 322, 374, 374, - /* 2280 */ 325, 326, 327, 328, 329, 330, 374, 332, 322, 253, - /* 2290 */ 374, 325, 326, 327, 328, 329, 330, 374, 332, 374, - /* 2300 */ 374, 374, 322, 253, 374, 325, 326, 327, 328, 329, - /* 2310 */ 330, 374, 332, 374, 374, 374, 374, 281, 374, 374, - /* 2320 */ 374, 374, 374, 374, 374, 289, 374, 374, 374, 374, - /* 2330 */ 294, 281, 296, 374, 374, 374, 374, 374, 374, 289, - /* 2340 */ 374, 374, 374, 374, 294, 374, 296, 374, 374, 374, - /* 2350 */ 374, 374, 374, 253, 374, 374, 374, 374, 322, 374, - /* 2360 */ 374, 325, 326, 327, 328, 329, 330, 374, 332, 374, - /* 2370 */ 374, 374, 322, 374, 374, 325, 326, 327, 328, 329, - /* 2380 */ 330, 281, 332, 374, 374, 374, 374, 374, 374, 289, - /* 2390 */ 374, 374, 374, 374, 294, 253, 296, 374, 374, 374, - /* 2400 */ 374, 374, 374, 374, 374, 374, 374, 374, 374, 253, - /* 2410 */ 374, 374, 374, 374, 374, 374, 374, 374, 374, 374, - /* 2420 */ 374, 374, 322, 281, 374, 325, 326, 327, 328, 329, - /* 2430 */ 330, 289, 332, 374, 374, 374, 294, 281, 296, 374, - /* 2440 */ 374, 374, 374, 374, 374, 289, 374, 374, 374, 374, - /* 2450 */ 294, 374, 296, 374, 374, 374, 374, 374, 374, 374, - /* 2460 */ 374, 374, 374, 374, 322, 374, 374, 325, 326, 327, - /* 2470 */ 328, 329, 330, 374, 332, 374, 374, 374, 322, 374, - /* 2480 */ 374, 325, 326, 327, 328, 329, 330, 374, 332, + /* 1220 */ 113, 114, 115, 116, 117, 281, 263, 33, 261, 261, + /* 1230 */ 310, 20, 263, 289, 294, 227, 324, 226, 294, 233, + /* 1240 */ 296, 47, 357, 305, 357, 294, 52, 53, 54, 55, + /* 1250 */ 56, 305, 294, 294, 360, 311, 8, 9, 154, 359, + /* 1260 */ 12, 13, 14, 15, 16, 163, 322, 165, 235, 325, + /* 1270 */ 326, 327, 328, 329, 330, 81, 332, 234, 84, 8, + /* 1280 */ 9, 253, 356, 12, 13, 14, 15, 16, 357, 187, + /* 1290 */ 355, 222, 320, 354, 218, 351, 20, 323, 289, 367, + /* 1300 */ 198, 199, 200, 201, 202, 203, 204, 239, 364, 281, + /* 1310 */ 237, 82, 368, 366, 242, 372, 367, 289, 366, 294, + /* 1320 */ 367, 366, 294, 305, 296, 338, 294, 305, 294, 294, + /* 1330 */ 147, 83, 303, 253, 294, 294, 289, 263, 277, 311, + /* 1340 */ 146, 147, 263, 149, 302, 289, 82, 153, 285, 271, + /* 1350 */ 322, 294, 261, 325, 326, 327, 328, 329, 330, 263, + /* 1360 */ 332, 281, 36, 314, 256, 255, 172, 309, 275, 289, + /* 1370 */ 275, 251, 0, 275, 294, 264, 296, 0, 42, 351, + /* 1380 */ 0, 73, 0, 35, 181, 253, 35, 35, 35, 181, + /* 1390 */ 0, 35, 364, 35, 181, 0, 368, 181, 0, 35, + /* 1400 */ 0, 253, 322, 22, 0, 325, 326, 327, 328, 329, + /* 1410 */ 330, 35, 332, 281, 0, 335, 167, 82, 168, 339, + /* 1420 */ 340, 289, 165, 163, 0, 0, 294, 158, 296, 281, + /* 1430 */ 0, 159, 0, 46, 0, 0, 0, 289, 142, 0, + /* 1440 */ 0, 0, 294, 0, 296, 0, 137, 35, 0, 137, + /* 1450 */ 0, 253, 42, 0, 322, 0, 0, 325, 326, 327, + /* 1460 */ 328, 329, 330, 331, 332, 333, 334, 253, 0, 0, + /* 1470 */ 322, 0, 0, 325, 326, 327, 328, 329, 330, 281, + /* 1480 */ 332, 0, 0, 0, 0, 0, 0, 289, 0, 0, + /* 1490 */ 0, 0, 294, 0, 296, 281, 0, 22, 0, 0, + /* 1500 */ 0, 0, 0, 289, 0, 42, 39, 46, 294, 253, + /* 1510 */ 296, 14, 46, 43, 0, 0, 40, 369, 370, 14, + /* 1520 */ 322, 253, 308, 325, 326, 327, 328, 329, 330, 0, + /* 1530 */ 332, 39, 0, 335, 39, 0, 322, 281, 340, 325, + /* 1540 */ 326, 327, 328, 329, 330, 289, 332, 154, 0, 281, + /* 1550 */ 294, 0, 296, 0, 60, 0, 35, 289, 47, 39, + /* 1560 */ 0, 35, 294, 47, 296, 0, 39, 39, 35, 47, + /* 1570 */ 0, 253, 35, 0, 0, 39, 0, 47, 322, 0, + /* 1580 */ 22, 325, 326, 327, 328, 329, 330, 253, 332, 35, + /* 1590 */ 322, 0, 89, 325, 326, 327, 328, 329, 330, 281, + /* 1600 */ 332, 91, 35, 35, 35, 43, 35, 289, 0, 43, + /* 1610 */ 35, 22, 294, 35, 296, 281, 35, 0, 22, 363, + /* 1620 */ 0, 49, 22, 289, 0, 35, 308, 35, 294, 0, + /* 1630 */ 296, 0, 35, 22, 20, 0, 35, 150, 370, 253, + /* 1640 */ 322, 0, 169, 325, 326, 327, 328, 329, 330, 22, + /* 1650 */ 332, 0, 0, 147, 0, 253, 322, 150, 150, 325, + /* 1660 */ 326, 327, 328, 329, 330, 152, 332, 281, 334, 0, + /* 1670 */ 0, 43, 223, 43, 223, 289, 82, 43, 83, 46, + /* 1680 */ 294, 82, 296, 281, 46, 83, 83, 82, 82, 82, + /* 1690 */ 43, 289, 83, 83, 308, 82, 294, 217, 296, 83, + /* 1700 */ 223, 46, 43, 43, 46, 253, 83, 35, 322, 83, + /* 1710 */ 308, 325, 326, 327, 328, 329, 330, 253, 332, 35, + /* 1720 */ 35, 35, 35, 35, 322, 2, 187, 325, 326, 327, + /* 1730 */ 328, 329, 330, 281, 332, 43, 83, 46, 82, 46, + /* 1740 */ 22, 289, 0, 0, 83, 281, 294, 82, 296, 82, + /* 1750 */ 189, 83, 148, 289, 83, 82, 82, 82, 294, 82, + /* 1760 */ 296, 39, 82, 46, 146, 46, 83, 22, 92, 35, + /* 1770 */ 35, 253, 82, 35, 322, 93, 82, 325, 326, 327, + /* 1780 */ 328, 329, 330, 82, 332, 83, 322, 253, 82, 325, + /* 1790 */ 326, 327, 328, 329, 330, 83, 332, 82, 253, 281, + /* 1800 */ 35, 35, 35, 83, 83, 22, 82, 289, 82, 106, + /* 1810 */ 83, 82, 294, 106, 296, 281, 106, 35, 82, 106, + /* 1820 */ 43, 82, 94, 289, 22, 35, 281, 59, 294, 82, + /* 1830 */ 296, 60, 80, 35, 289, 65, 43, 22, 35, 294, + /* 1840 */ 322, 296, 35, 325, 326, 327, 328, 329, 330, 35, + /* 1850 */ 332, 253, 35, 35, 35, 35, 322, 65, 35, 325, + /* 1860 */ 326, 327, 328, 329, 330, 35, 332, 322, 253, 35, + /* 1870 */ 325, 326, 327, 328, 329, 330, 0, 332, 35, 281, + /* 1880 */ 35, 35, 35, 47, 0, 35, 47, 289, 39, 0, + /* 1890 */ 39, 35, 294, 253, 296, 47, 281, 39, 0, 35, + /* 1900 */ 47, 39, 0, 35, 289, 35, 0, 22, 21, 294, + /* 1910 */ 253, 296, 22, 22, 373, 21, 20, 373, 373, 373, + /* 1920 */ 322, 281, 373, 325, 326, 327, 328, 329, 330, 289, + /* 1930 */ 332, 373, 373, 373, 294, 373, 296, 322, 281, 373, + /* 1940 */ 325, 326, 327, 328, 329, 330, 289, 332, 373, 373, + /* 1950 */ 373, 294, 253, 296, 373, 373, 373, 373, 373, 373, + /* 1960 */ 373, 373, 322, 373, 253, 325, 326, 327, 328, 329, + /* 1970 */ 330, 373, 332, 373, 373, 373, 373, 373, 373, 322, + /* 1980 */ 281, 373, 325, 326, 327, 328, 329, 330, 289, 332, + /* 1990 */ 373, 373, 281, 294, 373, 296, 373, 373, 373, 373, + /* 2000 */ 289, 373, 373, 373, 373, 294, 373, 296, 373, 373, + /* 2010 */ 373, 373, 373, 373, 253, 373, 373, 373, 373, 373, + /* 2020 */ 373, 322, 373, 373, 325, 326, 327, 328, 329, 330, + /* 2030 */ 373, 332, 253, 322, 373, 373, 325, 326, 327, 328, + /* 2040 */ 329, 330, 281, 332, 373, 373, 373, 373, 373, 373, + /* 2050 */ 289, 373, 373, 373, 373, 294, 373, 296, 373, 373, + /* 2060 */ 281, 373, 373, 373, 373, 373, 373, 373, 289, 373, + /* 2070 */ 373, 373, 373, 294, 373, 296, 373, 373, 373, 373, + /* 2080 */ 373, 373, 253, 322, 373, 373, 325, 326, 327, 328, + /* 2090 */ 329, 330, 373, 332, 253, 373, 373, 373, 373, 373, + /* 2100 */ 373, 322, 373, 373, 325, 326, 327, 328, 329, 330, + /* 2110 */ 281, 332, 373, 373, 373, 373, 373, 373, 289, 373, + /* 2120 */ 373, 373, 281, 294, 373, 296, 373, 373, 373, 373, + /* 2130 */ 289, 373, 373, 373, 373, 294, 373, 296, 373, 373, + /* 2140 */ 373, 373, 373, 373, 373, 373, 253, 373, 373, 373, + /* 2150 */ 373, 322, 373, 373, 325, 326, 327, 328, 329, 330, + /* 2160 */ 373, 332, 373, 322, 253, 373, 325, 326, 327, 328, + /* 2170 */ 329, 330, 373, 332, 281, 373, 373, 373, 373, 373, + /* 2180 */ 373, 373, 289, 373, 373, 373, 373, 294, 253, 296, + /* 2190 */ 373, 373, 281, 373, 373, 373, 373, 373, 373, 373, + /* 2200 */ 289, 373, 373, 373, 373, 294, 253, 296, 373, 373, + /* 2210 */ 373, 373, 373, 373, 373, 322, 281, 373, 325, 326, + /* 2220 */ 327, 328, 329, 330, 289, 332, 373, 373, 373, 294, + /* 2230 */ 373, 296, 373, 322, 281, 373, 325, 326, 327, 328, + /* 2240 */ 329, 330, 289, 332, 373, 373, 373, 294, 373, 296, + /* 2250 */ 373, 373, 373, 373, 373, 373, 373, 322, 373, 253, + /* 2260 */ 325, 326, 327, 328, 329, 330, 373, 332, 373, 373, + /* 2270 */ 373, 373, 373, 373, 373, 322, 373, 373, 325, 326, + /* 2280 */ 327, 328, 329, 330, 373, 332, 373, 281, 373, 373, + /* 2290 */ 373, 373, 373, 373, 373, 289, 373, 373, 373, 373, + /* 2300 */ 294, 373, 296, 373, 8, 9, 373, 373, 12, 13, + /* 2310 */ 14, 15, 16, 373, 373, 373, 373, 373, 373, 373, + /* 2320 */ 373, 373, 373, 373, 373, 373, 373, 373, 322, 373, + /* 2330 */ 373, 325, 326, 327, 328, 329, 330, 373, 332, 373, + /* 2340 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2350 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2360 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2370 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2380 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2390 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2400 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2410 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2420 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2430 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2440 */ 373, 373, 373, 373, 373, 373, 150, 373, 373, 373, + /* 2450 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2460 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2470 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2480 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2490 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2500 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2510 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2520 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2530 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2540 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, + /* 2550 */ 373, 373, 373, 373, 373, }; -#define YY_SHIFT_COUNT (652) +#define YY_SHIFT_COUNT (651) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (1824) +#define YY_SHIFT_MAX (2296) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 945, 0, 0, 57, 252, 252, 252, 252, 309, 309, + /* 0 */ 945, 0, 0, 57, 57, 252, 252, 252, 309, 309, /* 10 */ 252, 252, 504, 561, 756, 561, 561, 561, 561, 561, /* 20 */ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, /* 30 */ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, - /* 40 */ 561, 561, 54, 54, 246, 246, 246, 1238, 1238, 1238, - /* 50 */ 1238, 186, 87, 254, 11, 11, 239, 239, 242, 10, - /* 60 */ 254, 254, 11, 11, 11, 11, 11, 11, 11, 11, - /* 70 */ 99, 11, 11, 11, 150, 261, 313, 11, 11, 313, - /* 80 */ 11, 313, 313, 313, 11, 268, 752, 839, 1003, 1003, - /* 90 */ 438, 111, 245, 245, 245, 245, 245, 245, 245, 245, - /* 100 */ 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - /* 110 */ 245, 698, 10, 457, 457, 319, 618, 222, 222, 222, - /* 120 */ 358, 618, 327, 261, 6, 6, 313, 313, 361, 361, - /* 130 */ 405, 460, 193, 193, 193, 193, 193, 193, 193, 1777, - /* 140 */ 21, 14, 372, 84, 310, 406, 270, 376, 473, 516, - /* 150 */ 791, 686, 773, 694, 507, 694, 797, 797, 797, 713, - /* 160 */ 790, 848, 1054, 1029, 1043, 921, 1054, 1054, 1042, 942, - /* 170 */ 942, 1054, 1070, 1070, 1075, 99, 261, 99, 1084, 1092, - /* 180 */ 99, 1084, 99, 1101, 99, 99, 1054, 99, 1070, 313, - /* 190 */ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - /* 200 */ 1054, 1070, 361, 1075, 268, 986, 261, 268, 1054, 1054, - /* 210 */ 1084, 268, 1149, 361, 943, 949, 361, 943, 949, 361, - /* 220 */ 361, 313, 946, 1039, 943, 963, 965, 999, 848, 1005, - /* 230 */ 327, 1206, 1185, 989, 992, 1010, 989, 992, 989, 992, - /* 240 */ 1163, 949, 361, 361, 361, 361, 361, 949, 361, 1107, - /* 250 */ 327, 1101, 268, 405, 268, 327, 1210, 361, 460, 1054, - /* 260 */ 268, 1265, 1070, 2489, 2489, 2489, 2489, 2489, 2489, 2489, - /* 270 */ 162, 885, 123, 574, 199, 576, 467, 476, 540, 707, - /* 280 */ 662, 549, 549, 549, 549, 549, 549, 549, 549, 624, - /* 290 */ 681, 224, 263, 263, 251, 558, 410, 3, 603, 521, - /* 300 */ 529, 529, 529, 529, 249, 96, 823, 884, 840, 842, - /* 310 */ 856, 888, 872, 913, 978, 852, 820, 930, 937, 987, - /* 320 */ 876, 787, 802, 953, 920, 954, 489, 956, 958, 960, - /* 330 */ 961, 962, 864, 974, 980, 981, 983, 985, 1013, 1016, - /* 340 */ 339, 975, 126, 1315, 1316, 1276, 1319, 1248, 1320, 1288, - /* 350 */ 1144, 1291, 1292, 1293, 1148, 1330, 1296, 1297, 1152, 1334, - /* 360 */ 1154, 1337, 1303, 1340, 1321, 1341, 1310, 1346, 1266, 1179, - /* 370 */ 1192, 1187, 1198, 1362, 1363, 1205, 1207, 1367, 1368, 1323, - /* 380 */ 1370, 1371, 1372, 1231, 1374, 1375, 1378, 1386, 1388, 1252, - /* 390 */ 1355, 1391, 1255, 1394, 1395, 1396, 1398, 1399, 1400, 1402, - /* 400 */ 1407, 1408, 1409, 1410, 1411, 1413, 1414, 1373, 1416, 1421, - /* 410 */ 1422, 1423, 1426, 1427, 1383, 1428, 1429, 1430, 1431, 1432, - /* 420 */ 1433, 1392, 1417, 1401, 1443, 1389, 1446, 1418, 1465, 1434, - /* 430 */ 1436, 1466, 1467, 1468, 1437, 1318, 1469, 1470, 1473, 1387, - /* 440 */ 1477, 1478, 1448, 1435, 1442, 1485, 1453, 1454, 1450, 1502, - /* 450 */ 1471, 1456, 1472, 1504, 1474, 1458, 1475, 1507, 1510, 1521, - /* 460 */ 1523, 1438, 1424, 1489, 1503, 1526, 1492, 1496, 1497, 1498, - /* 470 */ 1491, 1494, 1500, 1505, 1509, 1538, 1517, 1542, 1524, 1501, - /* 480 */ 1545, 1525, 1514, 1551, 1518, 1552, 1519, 1555, 1534, 1539, - /* 490 */ 1558, 1412, 1531, 1568, 1420, 1549, 1440, 1439, 1580, 1581, - /* 500 */ 1441, 1444, 1583, 1592, 1594, 1554, 1556, 1379, 1522, 1512, - /* 510 */ 1527, 1520, 1562, 1528, 1533, 1535, 1536, 1530, 1564, 1574, - /* 520 */ 1576, 1541, 1565, 1393, 1544, 1557, 1578, 1384, 1567, 1579, - /* 530 */ 1559, 1585, 1415, 1560, 1602, 1604, 1606, 1609, 1610, 1611, - /* 540 */ 1560, 1646, 1462, 1613, 1577, 1582, 1584, 1615, 1586, 1587, - /* 550 */ 1616, 1637, 1476, 1588, 1589, 1590, 1593, 1666, 1595, 1532, - /* 560 */ 1597, 1674, 1642, 1537, 1600, 1596, 1638, 1639, 1605, 1607, - /* 570 */ 1614, 1669, 1620, 1599, 1612, 1658, 1662, 1621, 1622, 1663, - /* 580 */ 1624, 1632, 1682, 1636, 1640, 1684, 1643, 1641, 1685, 1644, - /* 590 */ 1623, 1633, 1634, 1645, 1699, 1628, 1656, 1660, 1710, 1664, - /* 600 */ 1704, 1704, 1726, 1689, 1691, 1719, 1693, 1675, 1713, 1725, - /* 610 */ 1727, 1728, 1729, 1730, 1739, 1732, 1733, 1705, 1491, 1743, - /* 620 */ 1494, 1745, 1747, 1748, 1749, 1751, 1752, 1797, 1763, 1753, - /* 630 */ 1760, 1801, 1768, 1757, 1766, 1806, 1773, 1764, 1774, 1812, - /* 640 */ 1779, 1769, 1776, 1817, 1783, 1784, 1820, 1800, 1804, 1805, - /* 650 */ 1814, 1807, 1824, + /* 40 */ 561, 561, 187, 187, 248, 248, 248, 1102, 1102, 1102, + /* 50 */ 1102, 185, 59, 246, 11, 11, 53, 53, 56, 10, + /* 60 */ 246, 246, 11, 11, 11, 11, 11, 11, 11, 11, + /* 70 */ 15, 11, 11, 11, 144, 154, 256, 11, 11, 256, + /* 80 */ 11, 256, 256, 256, 11, 241, 752, 839, 1003, 1003, + /* 90 */ 948, 111, 297, 297, 297, 297, 297, 297, 297, 297, + /* 100 */ 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, + /* 110 */ 297, 273, 10, 122, 122, 335, 124, 325, 325, 325, + /* 120 */ 541, 124, 353, 154, 1, 1, 256, 256, 285, 285, + /* 130 */ 394, 358, 193, 193, 193, 193, 193, 193, 193, 511, + /* 140 */ 21, 14, 200, 84, 71, 69, 406, 82, 197, 332, + /* 150 */ 749, 745, 439, 649, 207, 649, 884, 495, 495, 495, + /* 160 */ 7, 812, 846, 1062, 1038, 1052, 929, 1062, 1062, 1053, + /* 170 */ 964, 964, 1062, 1097, 1097, 1101, 15, 154, 15, 1126, + /* 180 */ 1137, 15, 1126, 15, 1143, 15, 15, 1062, 15, 1097, + /* 190 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + /* 200 */ 256, 1062, 1097, 285, 1101, 241, 1036, 154, 241, 1062, + /* 210 */ 1062, 1126, 241, 1211, 285, 1008, 1011, 285, 1008, 1011, + /* 220 */ 285, 285, 256, 1006, 1104, 1008, 1033, 1043, 1069, 846, + /* 230 */ 1076, 353, 1276, 1068, 1073, 1072, 1068, 1073, 1068, 1073, + /* 240 */ 1229, 1011, 285, 285, 285, 285, 285, 1011, 285, 1183, + /* 250 */ 353, 1143, 241, 394, 241, 353, 1264, 285, 358, 1062, + /* 260 */ 241, 1326, 1097, 2447, 2447, 2447, 2447, 2447, 2447, 2447, + /* 270 */ 162, 1194, 123, 1085, 980, 371, 1248, 802, 811, 2296, + /* 280 */ 828, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1039, + /* 290 */ 1107, 224, 155, 155, 199, 225, 204, 312, 487, 433, + /* 300 */ 505, 505, 505, 505, 318, 484, 619, 595, 849, 856, + /* 310 */ 878, 901, 872, 991, 999, 950, 815, 602, 888, 1007, + /* 320 */ 882, 434, 764, 962, 798, 977, 976, 981, 985, 992, + /* 330 */ 994, 998, 975, 979, 1013, 1014, 1016, 1055, 1060, 1067, + /* 340 */ 443, 996, 529, 1372, 1377, 1336, 1380, 1308, 1382, 1348, + /* 350 */ 1203, 1351, 1352, 1353, 1208, 1390, 1356, 1358, 1213, 1395, + /* 360 */ 1216, 1398, 1364, 1400, 1381, 1404, 1376, 1414, 1335, 1250, + /* 370 */ 1249, 1257, 1260, 1424, 1425, 1272, 1269, 1430, 1432, 1387, + /* 380 */ 1434, 1435, 1436, 1296, 1439, 1440, 1441, 1443, 1445, 1309, + /* 390 */ 1412, 1448, 1312, 1450, 1455, 1456, 1468, 1469, 1471, 1472, + /* 400 */ 1481, 1482, 1483, 1484, 1485, 1486, 1488, 1410, 1453, 1489, + /* 410 */ 1490, 1491, 1493, 1496, 1475, 1498, 1499, 1500, 1501, 1502, + /* 420 */ 1504, 1463, 1467, 1470, 1497, 1461, 1505, 1466, 1514, 1476, + /* 430 */ 1492, 1515, 1529, 1532, 1495, 1393, 1535, 1548, 1551, 1494, + /* 440 */ 1553, 1555, 1521, 1511, 1520, 1560, 1526, 1516, 1527, 1565, + /* 450 */ 1533, 1522, 1528, 1570, 1537, 1530, 1536, 1573, 1574, 1576, + /* 460 */ 1579, 1510, 1503, 1554, 1558, 1591, 1567, 1568, 1569, 1571, + /* 470 */ 1562, 1566, 1575, 1578, 1581, 1608, 1589, 1617, 1596, 1572, + /* 480 */ 1620, 1600, 1590, 1624, 1592, 1629, 1597, 1631, 1611, 1614, + /* 490 */ 1635, 1487, 1601, 1641, 1473, 1627, 1507, 1506, 1651, 1652, + /* 500 */ 1508, 1513, 1654, 1669, 1670, 1628, 1449, 1594, 1595, 1599, + /* 510 */ 1602, 1630, 1603, 1605, 1606, 1607, 1609, 1634, 1633, 1638, + /* 520 */ 1613, 1647, 1451, 1610, 1616, 1655, 1480, 1659, 1658, 1623, + /* 530 */ 1660, 1477, 1626, 1672, 1684, 1685, 1686, 1687, 1688, 1626, + /* 540 */ 1723, 1539, 1692, 1653, 1656, 1661, 1691, 1665, 1667, 1693, + /* 550 */ 1718, 1561, 1673, 1668, 1671, 1674, 1742, 1675, 1604, 1677, + /* 560 */ 1743, 1722, 1618, 1680, 1676, 1717, 1719, 1690, 1683, 1694, + /* 570 */ 1745, 1701, 1682, 1702, 1734, 1735, 1706, 1712, 1738, 1715, + /* 580 */ 1720, 1765, 1724, 1721, 1766, 1726, 1727, 1767, 1729, 1703, + /* 590 */ 1707, 1710, 1713, 1783, 1728, 1736, 1739, 1782, 1747, 1777, + /* 600 */ 1777, 1802, 1771, 1768, 1790, 1770, 1752, 1793, 1798, 1803, + /* 610 */ 1807, 1814, 1817, 1815, 1818, 1819, 1792, 1562, 1820, 1566, + /* 620 */ 1823, 1830, 1834, 1843, 1845, 1846, 1876, 1847, 1836, 1849, + /* 630 */ 1884, 1850, 1839, 1851, 1889, 1856, 1848, 1858, 1898, 1864, + /* 640 */ 1853, 1862, 1902, 1868, 1870, 1906, 1885, 1887, 1890, 1891, + /* 650 */ 1894, 1896, }; #define YY_REDUCE_COUNT (269) -#define YY_REDUCE_MIN (-287) -#define YY_REDUCE_MAX (2156) +#define YY_REDUCE_MIN (-327) +#define YY_REDUCE_MAX (2006) static const short yy_reduce_ofst[] = { - /* 0 */ -248, 72, 855, -195, 322, 575, 908, 950, 1028, 1055, - /* 10 */ 306, 1123, 1165, 1190, 1247, 1304, 1325, 1382, 1405, 1447, - /* 20 */ 1463, 1513, 1570, 1631, 1648, 1690, 1701, 1712, 1754, 1772, - /* 30 */ 1796, 1852, 1902, 1913, 1955, 1966, 1980, 2036, 2050, 2100, - /* 40 */ 2142, 2156, 769, 1219, -234, 90, 398, -278, -260, -254, - /* 50 */ -105, -245, -209, -42, -261, -164, -256, -250, 4, -113, - /* 60 */ 13, 24, 131, 258, 262, 338, 340, 543, 548, 550, - /* 70 */ -246, 552, 555, 557, 133, -211, 62, 570, 645, -224, - /* 80 */ 703, 73, -190, 86, 704, 23, 59, 185, 185, 185, - /* 90 */ -237, -102, -153, 276, 278, 288, 315, 362, 419, 420, - /* 100 */ 435, 437, 440, 477, 479, 480, 483, 531, 564, 573, - /* 110 */ 615, -255, 281, -40, 379, 333, 444, -287, -242, 458, - /* 120 */ -125, 539, 106, 512, 441, 481, 316, 553, 391, 571, - /* 130 */ 566, 592, 378, 386, 567, 584, 638, 642, 690, 225, - /* 140 */ 731, 717, 619, 627, 736, 688, 650, 733, 733, 759, - /* 150 */ 762, 742, 737, 711, 711, 711, 701, 705, 706, 718, - /* 160 */ 733, 753, 814, 758, 812, 768, 822, 824, 785, 789, - /* 170 */ 792, 828, 837, 838, 780, 841, 807, 844, 800, 804, - /* 180 */ 853, 809, 858, 830, 859, 861, 874, 868, 882, 860, - /* 190 */ 862, 865, 866, 869, 871, 873, 875, 877, 878, 879, - /* 200 */ 881, 890, 846, 836, 892, 847, 880, 899, 904, 906, - /* 210 */ 863, 905, 850, 894, 815, 886, 898, 821, 891, 907, - /* 220 */ 911, 733, 826, 849, 843, 851, 854, 887, 902, 711, - /* 230 */ 936, 909, 900, 889, 895, 883, 893, 896, 897, 901, - /* 240 */ 915, 959, 972, 973, 976, 990, 993, 964, 994, 952, - /* 250 */ 970, 984, 1011, 1006, 1030, 1007, 1012, 1001, 1027, 1038, - /* 260 */ 1041, 1046, 1050, 996, 997, 1032, 1036, 1037, 1049, 1063, + /* 0 */ -244, 70, 322, -195, 575, 141, 393, 853, 944, 1028, + /* 10 */ 744, 1080, 1132, 1148, 1198, 1214, 1256, 1268, 1318, 1334, + /* 20 */ 1386, 1402, 1452, 1464, 1518, 1534, 1545, 1598, 1615, 1640, + /* 30 */ 1657, 1699, 1711, 1761, 1779, 1829, 1841, 1893, 1911, 1935, + /* 40 */ 1953, 2006, 261, 291, -234, 203, 452, -278, -260, -258, + /* 50 */ 453, -283, 65, 172, 64, 147, -257, -250, -327, -277, + /* 60 */ -85, -44, 266, 270, 296, 315, 321, 352, 455, 516, + /* 70 */ 125, 573, 574, 645, -249, -86, -173, 648, 651, -11, + /* 80 */ 652, 205, 265, 298, 709, 148, -232, -298, -298, -298, + /* 90 */ -149, -110, 167, 290, 338, 362, 381, 417, 418, 423, + /* 100 */ 435, 477, 486, 489, 492, 493, 537, 555, 556, 576, + /* 110 */ 605, -276, -170, -79, 114, 269, 101, 330, 391, 483, + /* 120 */ -106, 396, 118, 183, 431, 559, 403, 264, 501, 634, + /* 130 */ 655, 13, 251, 339, 345, 386, 468, 491, 502, 299, + /* 140 */ 346, 465, 451, 440, 597, 590, 560, 658, 658, 671, + /* 150 */ 763, 733, 705, 681, 681, 681, 690, 677, 678, 679, + /* 160 */ 684, 658, 758, 819, 767, 821, 778, 831, 832, 807, + /* 170 */ 813, 814, 855, 864, 865, 806, 861, 843, 880, 841, + /* 180 */ 847, 895, 851, 897, 863, 903, 905, 911, 908, 919, + /* 190 */ 896, 906, 909, 910, 914, 915, 917, 918, 921, 923, + /* 200 */ 924, 925, 934, 890, 859, 937, 892, 913, 963, 967, + /* 210 */ 968, 920, 969, 912, 940, 885, 938, 951, 887, 946, + /* 220 */ 958, 959, 658, 894, 900, 931, 926, 935, 939, 972, + /* 230 */ 681, 1009, 974, 932, 947, 943, 949, 952, 953, 955, + /* 240 */ 987, 1018, 1025, 1032, 1034, 1035, 1040, 1022, 1041, 1029, + /* 250 */ 1047, 1042, 1074, 1061, 1079, 1056, 1063, 1057, 1078, 1091, + /* 260 */ 1096, 1108, 1110, 1049, 1058, 1093, 1095, 1098, 1111, 1120, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 10 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 20 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 30 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 40 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 50 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 60 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 70 */ 1508, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 80 */ 1436, 1436, 1436, 1436, 1436, 1506, 1659, 1436, 1834, 1436, - /* 90 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 100 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 110 */ 1436, 1436, 1436, 1436, 1436, 1508, 1436, 1846, 1846, 1846, - /* 120 */ 1506, 1436, 1436, 1436, 1703, 1703, 1436, 1436, 1436, 1436, - /* 130 */ 1602, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1695, - /* 140 */ 1436, 1436, 1916, 1436, 1436, 1701, 1870, 1436, 1436, 1436, - /* 150 */ 1436, 1555, 1862, 1838, 1852, 1839, 1901, 1901, 1901, 1855, - /* 160 */ 1436, 1866, 1436, 1436, 1436, 1687, 1436, 1436, 1664, 1661, - /* 170 */ 1661, 1436, 1436, 1436, 1436, 1508, 1436, 1508, 1436, 1436, - /* 180 */ 1508, 1436, 1508, 1436, 1508, 1508, 1436, 1508, 1436, 1436, - /* 190 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 200 */ 1436, 1436, 1436, 1436, 1506, 1697, 1436, 1506, 1436, 1436, - /* 210 */ 1436, 1506, 1436, 1436, 1877, 1875, 1436, 1877, 1875, 1436, - /* 220 */ 1436, 1436, 1889, 1885, 1877, 1893, 1891, 1868, 1866, 1852, - /* 230 */ 1436, 1436, 1836, 1907, 1903, 1919, 1907, 1903, 1907, 1903, - /* 240 */ 1436, 1875, 1436, 1436, 1436, 1436, 1436, 1875, 1436, 1436, - /* 250 */ 1436, 1436, 1506, 1436, 1506, 1436, 1571, 1436, 1436, 1436, - /* 260 */ 1506, 1468, 1436, 1689, 1703, 1605, 1605, 1605, 1509, 1441, - /* 270 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 280 */ 1436, 1772, 1888, 1887, 1810, 1809, 1808, 1806, 1771, 1436, - /* 290 */ 1436, 1567, 1770, 1769, 1436, 1436, 1436, 1436, 1436, 1436, - /* 300 */ 1763, 1764, 1762, 1761, 1436, 1436, 1436, 1436, 1436, 1436, - /* 310 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1835, - /* 320 */ 1436, 1904, 1908, 1436, 1436, 1436, 1746, 1436, 1436, 1436, - /* 330 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 340 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 350 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 360 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 370 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 380 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 390 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 400 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 410 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 420 */ 1436, 1436, 1436, 1473, 1436, 1436, 1436, 1436, 1436, 1436, - /* 430 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 440 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 450 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 460 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 470 */ 1536, 1535, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 480 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 490 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 500 */ 1436, 1436, 1436, 1436, 1436, 1859, 1869, 1436, 1436, 1436, - /* 510 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 520 */ 1746, 1436, 1886, 1436, 1845, 1841, 1436, 1436, 1837, 1436, - /* 530 */ 1436, 1902, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 540 */ 1436, 1830, 1436, 1803, 1436, 1436, 1436, 1436, 1436, 1436, - /* 550 */ 1436, 1436, 1757, 1436, 1436, 1436, 1436, 1707, 1436, 1436, - /* 560 */ 1436, 1436, 1436, 1436, 1436, 1436, 1745, 1436, 1788, 1436, - /* 570 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1599, 1436, 1436, - /* 580 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 590 */ 1584, 1582, 1581, 1580, 1436, 1577, 1436, 1436, 1436, 1436, - /* 600 */ 1608, 1607, 1436, 1436, 1436, 1436, 1436, 1436, 1528, 1436, - /* 610 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1519, 1436, - /* 620 */ 1518, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 630 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 640 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 650 */ 1436, 1436, 1436, + /* 0 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 10 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 20 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 30 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 40 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 50 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 60 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 70 */ 1506, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 80 */ 1434, 1434, 1434, 1434, 1434, 1504, 1657, 1434, 1832, 1434, + /* 90 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 100 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 110 */ 1434, 1434, 1434, 1434, 1434, 1506, 1434, 1844, 1844, 1844, + /* 120 */ 1504, 1434, 1434, 1434, 1701, 1701, 1434, 1434, 1434, 1434, + /* 130 */ 1600, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1693, + /* 140 */ 1434, 1434, 1913, 1434, 1434, 1699, 1867, 1434, 1434, 1434, + /* 150 */ 1434, 1553, 1859, 1836, 1850, 1837, 1834, 1898, 1898, 1898, + /* 160 */ 1853, 1434, 1863, 1434, 1434, 1434, 1685, 1434, 1434, 1662, + /* 170 */ 1659, 1659, 1434, 1434, 1434, 1434, 1506, 1434, 1506, 1434, + /* 180 */ 1434, 1506, 1434, 1506, 1434, 1506, 1506, 1434, 1506, 1434, + /* 190 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 200 */ 1434, 1434, 1434, 1434, 1434, 1504, 1695, 1434, 1504, 1434, + /* 210 */ 1434, 1434, 1504, 1434, 1434, 1874, 1872, 1434, 1874, 1872, + /* 220 */ 1434, 1434, 1434, 1886, 1882, 1874, 1890, 1888, 1865, 1863, + /* 230 */ 1850, 1434, 1434, 1904, 1900, 1916, 1904, 1900, 1904, 1900, + /* 240 */ 1434, 1872, 1434, 1434, 1434, 1434, 1434, 1872, 1434, 1434, + /* 250 */ 1434, 1434, 1504, 1434, 1504, 1434, 1569, 1434, 1434, 1434, + /* 260 */ 1504, 1466, 1434, 1687, 1701, 1603, 1603, 1603, 1507, 1439, + /* 270 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 280 */ 1434, 1770, 1885, 1884, 1808, 1807, 1806, 1804, 1769, 1434, + /* 290 */ 1434, 1565, 1768, 1767, 1434, 1434, 1434, 1434, 1434, 1434, + /* 300 */ 1761, 1762, 1760, 1759, 1434, 1434, 1434, 1434, 1434, 1434, + /* 310 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1833, + /* 320 */ 1434, 1901, 1905, 1434, 1434, 1434, 1744, 1434, 1434, 1434, + /* 330 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 340 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 350 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 360 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 370 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 380 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 390 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 400 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 410 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 420 */ 1434, 1434, 1434, 1471, 1434, 1434, 1434, 1434, 1434, 1434, + /* 430 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 440 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 450 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 460 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 470 */ 1534, 1533, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 480 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 490 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 500 */ 1434, 1434, 1434, 1434, 1434, 1866, 1434, 1434, 1434, 1434, + /* 510 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1744, + /* 520 */ 1434, 1883, 1434, 1843, 1839, 1434, 1434, 1835, 1434, 1434, + /* 530 */ 1899, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 540 */ 1828, 1434, 1801, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 550 */ 1434, 1755, 1434, 1434, 1434, 1434, 1705, 1434, 1434, 1434, + /* 560 */ 1434, 1434, 1434, 1434, 1434, 1743, 1434, 1786, 1434, 1434, + /* 570 */ 1434, 1434, 1434, 1434, 1434, 1434, 1597, 1434, 1434, 1434, + /* 580 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1582, + /* 590 */ 1580, 1579, 1578, 1434, 1575, 1434, 1434, 1434, 1434, 1606, + /* 600 */ 1605, 1434, 1434, 1434, 1434, 1434, 1434, 1526, 1434, 1434, + /* 610 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1517, 1434, 1516, + /* 620 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 630 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 640 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, + /* 650 */ 1434, 1434, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1606,19 +1609,18 @@ static const char *const yyTokenName[] = { /* 358 */ "twindow_clause_opt", /* 359 */ "group_by_clause_opt", /* 360 */ "having_clause_opt", - /* 361 */ "select_sublist", - /* 362 */ "select_item", - /* 363 */ "fill_mode", - /* 364 */ "group_by_list", - /* 365 */ "query_expression_body", - /* 366 */ "order_by_clause_opt", - /* 367 */ "slimit_clause_opt", - /* 368 */ "limit_clause_opt", - /* 369 */ "query_primary", - /* 370 */ "sort_specification_list", - /* 371 */ "sort_specification", - /* 372 */ "ordering_specification_opt", - /* 373 */ "null_ordering_opt", + /* 361 */ "select_item", + /* 362 */ "fill_mode", + /* 363 */ "group_by_list", + /* 364 */ "query_expression_body", + /* 365 */ "order_by_clause_opt", + /* 366 */ "slimit_clause_opt", + /* 367 */ "limit_clause_opt", + /* 368 */ "query_primary", + /* 369 */ "sort_specification_list", + /* 370 */ "sort_specification", + /* 371 */ "ordering_specification_opt", + /* 372 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2045,70 +2047,69 @@ static const char *const yyRuleName[] = { /* 416 */ "set_quantifier_opt ::=", /* 417 */ "set_quantifier_opt ::= DISTINCT", /* 418 */ "set_quantifier_opt ::= ALL", - /* 419 */ "select_list ::= NK_STAR", - /* 420 */ "select_list ::= select_sublist", - /* 421 */ "select_sublist ::= select_item", - /* 422 */ "select_sublist ::= select_sublist NK_COMMA select_item", - /* 423 */ "select_item ::= common_expression", - /* 424 */ "select_item ::= common_expression column_alias", - /* 425 */ "select_item ::= common_expression AS column_alias", - /* 426 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 427 */ "where_clause_opt ::=", - /* 428 */ "where_clause_opt ::= WHERE search_condition", - /* 429 */ "partition_by_clause_opt ::=", - /* 430 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 431 */ "twindow_clause_opt ::=", - /* 432 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 433 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", - /* 434 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 435 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 436 */ "sliding_opt ::=", - /* 437 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 438 */ "fill_opt ::=", - /* 439 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 440 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 441 */ "fill_mode ::= NONE", - /* 442 */ "fill_mode ::= PREV", - /* 443 */ "fill_mode ::= NULL", - /* 444 */ "fill_mode ::= LINEAR", - /* 445 */ "fill_mode ::= NEXT", - /* 446 */ "group_by_clause_opt ::=", - /* 447 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 448 */ "group_by_list ::= expression", - /* 449 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 450 */ "having_clause_opt ::=", - /* 451 */ "having_clause_opt ::= HAVING search_condition", - /* 452 */ "range_opt ::=", - /* 453 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP", - /* 454 */ "every_opt ::=", - /* 455 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 456 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 457 */ "query_expression_body ::= query_primary", - /* 458 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 459 */ "query_expression_body ::= query_expression_body UNION query_expression_body", - /* 460 */ "query_primary ::= query_specification", - /* 461 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", - /* 462 */ "order_by_clause_opt ::=", - /* 463 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 464 */ "slimit_clause_opt ::=", - /* 465 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 466 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 467 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 468 */ "limit_clause_opt ::=", - /* 469 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 470 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 471 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 472 */ "subquery ::= NK_LP query_expression NK_RP", - /* 473 */ "search_condition ::= common_expression", - /* 474 */ "sort_specification_list ::= sort_specification", - /* 475 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 476 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 477 */ "ordering_specification_opt ::=", - /* 478 */ "ordering_specification_opt ::= ASC", - /* 479 */ "ordering_specification_opt ::= DESC", - /* 480 */ "null_ordering_opt ::=", - /* 481 */ "null_ordering_opt ::= NULLS FIRST", - /* 482 */ "null_ordering_opt ::= NULLS LAST", + /* 419 */ "select_list ::= select_item", + /* 420 */ "select_list ::= select_list NK_COMMA select_item", + /* 421 */ "select_item ::= NK_STAR", + /* 422 */ "select_item ::= common_expression", + /* 423 */ "select_item ::= common_expression column_alias", + /* 424 */ "select_item ::= common_expression AS column_alias", + /* 425 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 426 */ "where_clause_opt ::=", + /* 427 */ "where_clause_opt ::= WHERE search_condition", + /* 428 */ "partition_by_clause_opt ::=", + /* 429 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 430 */ "twindow_clause_opt ::=", + /* 431 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 432 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", + /* 433 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 434 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 435 */ "sliding_opt ::=", + /* 436 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 437 */ "fill_opt ::=", + /* 438 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 439 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 440 */ "fill_mode ::= NONE", + /* 441 */ "fill_mode ::= PREV", + /* 442 */ "fill_mode ::= NULL", + /* 443 */ "fill_mode ::= LINEAR", + /* 444 */ "fill_mode ::= NEXT", + /* 445 */ "group_by_clause_opt ::=", + /* 446 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 447 */ "group_by_list ::= expression", + /* 448 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 449 */ "having_clause_opt ::=", + /* 450 */ "having_clause_opt ::= HAVING search_condition", + /* 451 */ "range_opt ::=", + /* 452 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP", + /* 453 */ "every_opt ::=", + /* 454 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 455 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 456 */ "query_expression_body ::= query_primary", + /* 457 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 458 */ "query_expression_body ::= query_expression_body UNION query_expression_body", + /* 459 */ "query_primary ::= query_specification", + /* 460 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", + /* 461 */ "order_by_clause_opt ::=", + /* 462 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 463 */ "slimit_clause_opt ::=", + /* 464 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 465 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 466 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 467 */ "limit_clause_opt ::=", + /* 468 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 469 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 470 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 471 */ "subquery ::= NK_LP query_expression NK_RP", + /* 472 */ "search_condition ::= common_expression", + /* 473 */ "sort_specification_list ::= sort_specification", + /* 474 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 475 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 476 */ "ordering_specification_opt ::=", + /* 477 */ "ordering_specification_opt ::= ASC", + /* 478 */ "ordering_specification_opt ::= DESC", + /* 479 */ "null_ordering_opt ::=", + /* 480 */ "null_ordering_opt ::= NULLS FIRST", + /* 481 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2290,14 +2291,14 @@ static void yy_destructor( case 357: /* fill_opt */ case 358: /* twindow_clause_opt */ case 360: /* having_clause_opt */ - case 362: /* select_item */ - case 365: /* query_expression_body */ - case 367: /* slimit_clause_opt */ - case 368: /* limit_clause_opt */ - case 369: /* query_primary */ - case 371: /* sort_specification */ + case 361: /* select_item */ + case 364: /* query_expression_body */ + case 366: /* slimit_clause_opt */ + case 367: /* limit_clause_opt */ + case 368: /* query_primary */ + case 370: /* sort_specification */ { - nodesDestroyNode((yypminor->yy652)); + nodesDestroyNode((yypminor->yy184)); } break; case 251: /* account_options */ @@ -2370,12 +2371,11 @@ static void yy_destructor( case 353: /* select_list */ case 354: /* partition_by_clause_opt */ case 359: /* group_by_clause_opt */ - case 361: /* select_sublist */ - case 364: /* group_by_list */ - case 366: /* order_by_clause_opt */ - case 370: /* sort_specification_list */ + case 363: /* group_by_list */ + case 365: /* order_by_clause_opt */ + case 369: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy24)); + nodesDestroyList((yypminor->yy296)); } break; case 270: /* alter_db_option */ @@ -2400,17 +2400,17 @@ static void yy_destructor( } break; - case 363: /* fill_mode */ + case 362: /* fill_mode */ { } break; - case 372: /* ordering_specification_opt */ + case 371: /* ordering_specification_opt */ { } break; - case 373: /* null_ordering_opt */ + case 372: /* null_ordering_opt */ { } @@ -3128,70 +3128,69 @@ static const struct { { 352, 0 }, /* (416) set_quantifier_opt ::= */ { 352, -1 }, /* (417) set_quantifier_opt ::= DISTINCT */ { 352, -1 }, /* (418) set_quantifier_opt ::= ALL */ - { 353, -1 }, /* (419) select_list ::= NK_STAR */ - { 353, -1 }, /* (420) select_list ::= select_sublist */ - { 361, -1 }, /* (421) select_sublist ::= select_item */ - { 361, -3 }, /* (422) select_sublist ::= select_sublist NK_COMMA select_item */ - { 362, -1 }, /* (423) select_item ::= common_expression */ - { 362, -2 }, /* (424) select_item ::= common_expression column_alias */ - { 362, -3 }, /* (425) select_item ::= common_expression AS column_alias */ - { 362, -3 }, /* (426) select_item ::= table_name NK_DOT NK_STAR */ - { 320, 0 }, /* (427) where_clause_opt ::= */ - { 320, -2 }, /* (428) where_clause_opt ::= WHERE search_condition */ - { 354, 0 }, /* (429) partition_by_clause_opt ::= */ - { 354, -3 }, /* (430) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 358, 0 }, /* (431) twindow_clause_opt ::= */ - { 358, -6 }, /* (432) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 358, -4 }, /* (433) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ - { 358, -6 }, /* (434) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 358, -8 }, /* (435) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 305, 0 }, /* (436) sliding_opt ::= */ - { 305, -4 }, /* (437) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 357, 0 }, /* (438) fill_opt ::= */ - { 357, -4 }, /* (439) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 357, -6 }, /* (440) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 363, -1 }, /* (441) fill_mode ::= NONE */ - { 363, -1 }, /* (442) fill_mode ::= PREV */ - { 363, -1 }, /* (443) fill_mode ::= NULL */ - { 363, -1 }, /* (444) fill_mode ::= LINEAR */ - { 363, -1 }, /* (445) fill_mode ::= NEXT */ - { 359, 0 }, /* (446) group_by_clause_opt ::= */ - { 359, -3 }, /* (447) group_by_clause_opt ::= GROUP BY group_by_list */ - { 364, -1 }, /* (448) group_by_list ::= expression */ - { 364, -3 }, /* (449) group_by_list ::= group_by_list NK_COMMA expression */ - { 360, 0 }, /* (450) having_clause_opt ::= */ - { 360, -2 }, /* (451) having_clause_opt ::= HAVING search_condition */ - { 355, 0 }, /* (452) range_opt ::= */ - { 355, -6 }, /* (453) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ - { 356, 0 }, /* (454) every_opt ::= */ - { 356, -4 }, /* (455) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 311, -4 }, /* (456) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 365, -1 }, /* (457) query_expression_body ::= query_primary */ - { 365, -4 }, /* (458) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 365, -3 }, /* (459) query_expression_body ::= query_expression_body UNION query_expression_body */ - { 369, -1 }, /* (460) query_primary ::= query_specification */ - { 369, -6 }, /* (461) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ - { 366, 0 }, /* (462) order_by_clause_opt ::= */ - { 366, -3 }, /* (463) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 367, 0 }, /* (464) slimit_clause_opt ::= */ - { 367, -2 }, /* (465) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 367, -4 }, /* (466) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 367, -4 }, /* (467) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 368, 0 }, /* (468) limit_clause_opt ::= */ - { 368, -2 }, /* (469) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 368, -4 }, /* (470) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 368, -4 }, /* (471) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 329, -3 }, /* (472) subquery ::= NK_LP query_expression NK_RP */ - { 350, -1 }, /* (473) search_condition ::= common_expression */ - { 370, -1 }, /* (474) sort_specification_list ::= sort_specification */ - { 370, -3 }, /* (475) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 371, -3 }, /* (476) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 372, 0 }, /* (477) ordering_specification_opt ::= */ - { 372, -1 }, /* (478) ordering_specification_opt ::= ASC */ - { 372, -1 }, /* (479) ordering_specification_opt ::= DESC */ - { 373, 0 }, /* (480) null_ordering_opt ::= */ - { 373, -2 }, /* (481) null_ordering_opt ::= NULLS FIRST */ - { 373, -2 }, /* (482) null_ordering_opt ::= NULLS LAST */ + { 353, -1 }, /* (419) select_list ::= select_item */ + { 353, -3 }, /* (420) select_list ::= select_list NK_COMMA select_item */ + { 361, -1 }, /* (421) select_item ::= NK_STAR */ + { 361, -1 }, /* (422) select_item ::= common_expression */ + { 361, -2 }, /* (423) select_item ::= common_expression column_alias */ + { 361, -3 }, /* (424) select_item ::= common_expression AS column_alias */ + { 361, -3 }, /* (425) select_item ::= table_name NK_DOT NK_STAR */ + { 320, 0 }, /* (426) where_clause_opt ::= */ + { 320, -2 }, /* (427) where_clause_opt ::= WHERE search_condition */ + { 354, 0 }, /* (428) partition_by_clause_opt ::= */ + { 354, -3 }, /* (429) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 358, 0 }, /* (430) twindow_clause_opt ::= */ + { 358, -6 }, /* (431) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 358, -4 }, /* (432) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ + { 358, -6 }, /* (433) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 358, -8 }, /* (434) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 305, 0 }, /* (435) sliding_opt ::= */ + { 305, -4 }, /* (436) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 357, 0 }, /* (437) fill_opt ::= */ + { 357, -4 }, /* (438) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 357, -6 }, /* (439) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 362, -1 }, /* (440) fill_mode ::= NONE */ + { 362, -1 }, /* (441) fill_mode ::= PREV */ + { 362, -1 }, /* (442) fill_mode ::= NULL */ + { 362, -1 }, /* (443) fill_mode ::= LINEAR */ + { 362, -1 }, /* (444) fill_mode ::= NEXT */ + { 359, 0 }, /* (445) group_by_clause_opt ::= */ + { 359, -3 }, /* (446) group_by_clause_opt ::= GROUP BY group_by_list */ + { 363, -1 }, /* (447) group_by_list ::= expression */ + { 363, -3 }, /* (448) group_by_list ::= group_by_list NK_COMMA expression */ + { 360, 0 }, /* (449) having_clause_opt ::= */ + { 360, -2 }, /* (450) having_clause_opt ::= HAVING search_condition */ + { 355, 0 }, /* (451) range_opt ::= */ + { 355, -6 }, /* (452) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ + { 356, 0 }, /* (453) every_opt ::= */ + { 356, -4 }, /* (454) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 311, -4 }, /* (455) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 364, -1 }, /* (456) query_expression_body ::= query_primary */ + { 364, -4 }, /* (457) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 364, -3 }, /* (458) query_expression_body ::= query_expression_body UNION query_expression_body */ + { 368, -1 }, /* (459) query_primary ::= query_specification */ + { 368, -6 }, /* (460) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ + { 365, 0 }, /* (461) order_by_clause_opt ::= */ + { 365, -3 }, /* (462) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 366, 0 }, /* (463) slimit_clause_opt ::= */ + { 366, -2 }, /* (464) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 366, -4 }, /* (465) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 366, -4 }, /* (466) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 367, 0 }, /* (467) limit_clause_opt ::= */ + { 367, -2 }, /* (468) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 367, -4 }, /* (469) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 367, -4 }, /* (470) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 329, -3 }, /* (471) subquery ::= NK_LP query_expression NK_RP */ + { 350, -1 }, /* (472) search_condition ::= common_expression */ + { 369, -1 }, /* (473) sort_specification_list ::= sort_specification */ + { 369, -3 }, /* (474) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 370, -3 }, /* (475) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 371, 0 }, /* (476) ordering_specification_opt ::= */ + { 371, -1 }, /* (477) ordering_specification_opt ::= ASC */ + { 371, -1 }, /* (478) ordering_specification_opt ::= DESC */ + { 372, 0 }, /* (479) null_ordering_opt ::= */ + { 372, -2 }, /* (480) null_ordering_opt ::= NULLS FIRST */ + { 372, -2 }, /* (481) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3328,69 +3327,69 @@ static YYACTIONTYPE yy_reduce( yy_destructor(yypParser,253,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy657, &yymsp[-1].minor.yy0, yymsp[0].minor.yy619); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy7, &yymsp[-1].minor.yy0, yymsp[0].minor.yy57); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy657, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy7, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy657, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy7, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy657, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy7, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy7); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy619 = 1; } +{ yymsp[1].minor.yy57 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy619 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy57 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy701, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy193, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy701, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy193, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy701 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy193 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 35: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==35); -{ yylhsminor.yy701 = yymsp[0].minor.yy701; } - yymsp[0].minor.yy701 = yylhsminor.yy701; +{ yylhsminor.yy193 = yymsp[0].minor.yy193; } + yymsp[0].minor.yy193 = yylhsminor.yy193; break; case 36: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy701 = yymsp[-2].minor.yy701 | yymsp[0].minor.yy701; } - yymsp[-2].minor.yy701 = yylhsminor.yy701; +{ yylhsminor.yy193 = yymsp[-2].minor.yy193 | yymsp[0].minor.yy193; } + yymsp[-2].minor.yy193 = yylhsminor.yy193; break; case 37: /* priv_type ::= READ */ -{ yymsp[0].minor.yy701 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy193 = PRIVILEGE_TYPE_READ; } break; case 38: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy701 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy193 = PRIVILEGE_TYPE_WRITE; } break; case 39: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy657 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy657 = yylhsminor.yy657; +{ yylhsminor.yy7 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy7 = yylhsminor.yy7; break; case 40: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy657 = yymsp[-2].minor.yy657; } - yymsp[-2].minor.yy657 = yylhsminor.yy657; +{ yylhsminor.yy7 = yymsp[-2].minor.yy7; } + yymsp[-2].minor.yy7 = yylhsminor.yy7; break; case 41: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy657, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy7, NULL); } break; case 42: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy0); } break; case 43: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 44: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy7); } break; case 45: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3431,8 +3430,8 @@ static YYACTIONTYPE yy_reduce( case 360: /* star_func ::= FIRST */ yytestcase(yyruleno==360); case 361: /* star_func ::= LAST */ yytestcase(yyruleno==361); case 362: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==362); -{ yylhsminor.yy657 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy657 = yylhsminor.yy657; +{ yylhsminor.yy7 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy7 = yylhsminor.yy7; break; case 52: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3465,156 +3464,156 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 62: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy97, &yymsp[-1].minor.yy657, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy419, &yymsp[-1].minor.yy7, yymsp[0].minor.yy184); } break; case 63: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } break; case 64: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy7); } break; case 65: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy657, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy7, yymsp[0].minor.yy184); } break; case 66: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy97 = true; } +{ yymsp[-2].minor.yy419 = true; } break; case 67: /* not_exists_opt ::= */ case 69: /* exists_opt ::= */ yytestcase(yyruleno==69); case 248: /* analyze_opt ::= */ yytestcase(yyruleno==248); case 256: /* agg_func_opt ::= */ yytestcase(yyruleno==256); case 416: /* set_quantifier_opt ::= */ yytestcase(yyruleno==416); -{ yymsp[1].minor.yy97 = false; } +{ yymsp[1].minor.yy419 = false; } break; case 68: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy97 = true; } +{ yymsp[-1].minor.yy419 = true; } break; case 70: /* db_options ::= */ -{ yymsp[1].minor.yy652 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy184 = createDefaultDatabaseOptions(pCxt); } break; case 71: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 72: /* db_options ::= db_options CACHELAST NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 73: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 74: /* db_options ::= db_options DURATION NK_INTEGER */ case 75: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==75); -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 76: /* db_options ::= db_options FSYNC NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 77: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 78: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 79: /* db_options ::= db_options KEEP integer_list */ case 80: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==80); -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_KEEP, yymsp[0].minor.yy24); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_KEEP, yymsp[0].minor.yy296); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 81: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 82: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 83: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 84: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 85: /* db_options ::= db_options STRICT NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 86: /* db_options ::= db_options WAL NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 87: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 88: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 89: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_RETENTIONS, yymsp[0].minor.yy24); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_RETENTIONS, yymsp[0].minor.yy296); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 90: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy652 = setDatabaseOption(pCxt, yymsp[-2].minor.yy652, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 91: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy652 = createAlterDatabaseOptions(pCxt); yylhsminor.yy652 = setAlterDatabaseOption(pCxt, yylhsminor.yy652, &yymsp[0].minor.yy189); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterDatabaseOptions(pCxt); yylhsminor.yy184 = setAlterDatabaseOption(pCxt, yylhsminor.yy184, &yymsp[0].minor.yy139); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 92: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy652 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy652, &yymsp[0].minor.yy189); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy184, &yymsp[0].minor.yy139); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 93: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy189.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy139.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } break; case 94: /* alter_db_option ::= CACHELAST NK_INTEGER */ -{ yymsp[-1].minor.yy189.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy139.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } break; case 95: /* alter_db_option ::= FSYNC NK_INTEGER */ -{ yymsp[-1].minor.yy189.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy139.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } break; case 96: /* alter_db_option ::= KEEP integer_list */ case 97: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==97); -{ yymsp[-1].minor.yy189.type = DB_OPTION_KEEP; yymsp[-1].minor.yy189.pList = yymsp[0].minor.yy24; } +{ yymsp[-1].minor.yy139.type = DB_OPTION_KEEP; yymsp[-1].minor.yy139.pList = yymsp[0].minor.yy296; } break; case 98: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy189.type = DB_OPTION_PAGES; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy139.type = DB_OPTION_PAGES; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } break; case 99: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy189.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy139.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } break; case 100: /* alter_db_option ::= STRICT NK_INTEGER */ -{ yymsp[-1].minor.yy189.type = DB_OPTION_STRICT; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy139.type = DB_OPTION_STRICT; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } break; case 101: /* alter_db_option ::= WAL NK_INTEGER */ -{ yymsp[-1].minor.yy189.type = DB_OPTION_WAL; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy139.type = DB_OPTION_WAL; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } break; case 102: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy24 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy24 = yylhsminor.yy24; +{ yylhsminor.yy296 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy296 = yylhsminor.yy296; break; case 103: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ case 277: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==277); -{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy24 = yylhsminor.yy24; +{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy296 = yylhsminor.yy296; break; case 104: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy24 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy24 = yylhsminor.yy24; +{ yylhsminor.yy296 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy296 = yylhsminor.yy296; break; case 105: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy24 = yylhsminor.yy24; +{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy296 = yylhsminor.yy296; break; case 106: /* retention_list ::= retention */ case 126: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==126); @@ -3625,10 +3624,10 @@ static YYACTIONTYPE yy_reduce( case 231: /* func_list ::= func */ yytestcase(yyruleno==231); case 303: /* literal_list ::= signed_literal */ yytestcase(yyruleno==303); case 365: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==365); - case 421: /* select_sublist ::= select_item */ yytestcase(yyruleno==421); - case 474: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==474); -{ yylhsminor.yy24 = createNodeList(pCxt, yymsp[0].minor.yy652); } - yymsp[0].minor.yy24 = yylhsminor.yy24; + case 419: /* select_list ::= select_item */ yytestcase(yyruleno==419); + case 473: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==473); +{ yylhsminor.yy296 = createNodeList(pCxt, yymsp[0].minor.yy184); } + yymsp[0].minor.yy296 = yylhsminor.yy296; break; case 107: /* retention_list ::= retention_list NK_COMMA retention */ case 137: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==137); @@ -3637,251 +3636,250 @@ static YYACTIONTYPE yy_reduce( case 232: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==232); case 304: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==304); case 366: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==366); - case 422: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==422); - case 475: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==475); -{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, yymsp[0].minor.yy652); } - yymsp[-2].minor.yy24 = yylhsminor.yy24; + case 420: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==420); + case 474: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==474); +{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, yymsp[0].minor.yy184); } + yymsp[-2].minor.yy296 = yylhsminor.yy296; break; case 108: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy652 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 109: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 111: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==111); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy97, yymsp[-5].minor.yy652, yymsp[-3].minor.yy24, yymsp[-1].minor.yy24, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy419, yymsp[-5].minor.yy184, yymsp[-3].minor.yy296, yymsp[-1].minor.yy296, yymsp[0].minor.yy184); } break; case 110: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy24); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy296); } break; case 112: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy24); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy296); } break; case 113: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy97, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy419, yymsp[0].minor.yy184); } break; case 114: /* cmd ::= ALTER TABLE alter_table_clause */ case 115: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==115); case 280: /* cmd ::= query_expression */ yytestcase(yyruleno==280); -{ pCxt->pRootNode = yymsp[0].minor.yy652; } +{ pCxt->pRootNode = yymsp[0].minor.yy184; } break; case 116: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy652 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy652, yymsp[0].minor.yy652); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 117: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy652 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy652, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy657, yymsp[0].minor.yy48); } - yymsp[-4].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; case 118: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy652 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy652, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy657); } - yymsp[-3].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy184, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy7); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; case 119: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy652 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy652, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy657, yymsp[0].minor.yy48); } - yymsp[-4].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; case 120: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy652 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy652, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy657, &yymsp[0].minor.yy657); } - yymsp[-4].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy7, &yymsp[0].minor.yy7); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; case 121: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy652 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy652, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy657, yymsp[0].minor.yy48); } - yymsp[-4].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; case 122: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy652 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy652, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy657); } - yymsp[-3].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy184, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy7); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; case 123: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy652 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy652, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy657, yymsp[0].minor.yy48); } - yymsp[-4].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; case 124: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy652 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy652, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy657, &yymsp[0].minor.yy657); } - yymsp[-4].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy7, &yymsp[0].minor.yy7); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; case 125: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy652 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy652, &yymsp[-2].minor.yy657, yymsp[0].minor.yy652); } - yymsp[-5].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy184, &yymsp[-2].minor.yy7, yymsp[0].minor.yy184); } + yymsp[-5].minor.yy184 = yylhsminor.yy184; break; case 127: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 130: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==130); -{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-1].minor.yy24, yymsp[0].minor.yy652); } - yymsp[-1].minor.yy24 = yylhsminor.yy24; +{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-1].minor.yy296, yymsp[0].minor.yy184); } + yymsp[-1].minor.yy296 = yylhsminor.yy296; break; case 128: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ -{ yylhsminor.yy652 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy97, yymsp[-8].minor.yy652, yymsp[-6].minor.yy652, yymsp[-5].minor.yy24, yymsp[-2].minor.yy24, yymsp[0].minor.yy652); } - yymsp[-9].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy419, yymsp[-8].minor.yy184, yymsp[-6].minor.yy184, yymsp[-5].minor.yy296, yymsp[-2].minor.yy296, yymsp[0].minor.yy184); } + yymsp[-9].minor.yy184 = yylhsminor.yy184; break; case 131: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy652 = createDropTableClause(pCxt, yymsp[-1].minor.yy97, yymsp[0].minor.yy652); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createDropTableClause(pCxt, yymsp[-1].minor.yy419, yymsp[0].minor.yy184); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 132: /* specific_tags_opt ::= */ case 163: /* tags_def_opt ::= */ yytestcase(yyruleno==163); - case 429: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==429); - case 446: /* group_by_clause_opt ::= */ yytestcase(yyruleno==446); - case 462: /* order_by_clause_opt ::= */ yytestcase(yyruleno==462); -{ yymsp[1].minor.yy24 = NULL; } + case 428: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==428); + case 445: /* group_by_clause_opt ::= */ yytestcase(yyruleno==445); + case 461: /* order_by_clause_opt ::= */ yytestcase(yyruleno==461); +{ yymsp[1].minor.yy296 = NULL; } break; case 133: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy24 = yymsp[-1].minor.yy24; } +{ yymsp[-2].minor.yy296 = yymsp[-1].minor.yy296; } break; case 134: /* full_table_name ::= table_name */ -{ yylhsminor.yy652 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy657, NULL); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy7, NULL); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 135: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy652 = createRealTableNode(pCxt, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy657, NULL); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRealTableNode(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7, NULL); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 138: /* column_def ::= column_name type_name */ -{ yylhsminor.yy652 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy657, yymsp[0].minor.yy48, NULL); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332, NULL); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 139: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy652 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy657, yymsp[-2].minor.yy48, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy7, yymsp[-2].minor.yy332, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; case 140: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 141: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 142: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 143: /* type_name ::= INT */ case 144: /* type_name ::= INTEGER */ yytestcase(yyruleno==144); -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_INT); } break; case 145: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 146: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 147: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 148: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy48 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy332 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 149: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 150: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy48 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy332 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 151: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy48 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy332 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 152: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy48 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy332 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 153: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy48 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy332 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 154: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy48 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy332 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 155: /* type_name ::= JSON */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 156: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy48 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy332 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 157: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 158: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 159: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy48 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy332 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 160: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy48 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 161: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy48 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy332 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 162: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy48 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy332 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 164: /* tags_def_opt ::= tags_def */ case 364: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==364); - case 420: /* select_list ::= select_sublist */ yytestcase(yyruleno==420); -{ yylhsminor.yy24 = yymsp[0].minor.yy24; } - yymsp[0].minor.yy24 = yylhsminor.yy24; +{ yylhsminor.yy296 = yymsp[0].minor.yy296; } + yymsp[0].minor.yy296 = yylhsminor.yy296; break; case 165: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy24 = yymsp[-1].minor.yy24; } +{ yymsp[-3].minor.yy296 = yymsp[-1].minor.yy296; } break; case 166: /* table_options ::= */ -{ yymsp[1].minor.yy652 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy184 = createDefaultTableOptions(pCxt); } break; case 167: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy652 = setTableOption(pCxt, yymsp[-2].minor.yy652, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 168: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy652 = setTableOption(pCxt, yymsp[-2].minor.yy652, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy24); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy296); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 169: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy652 = setTableOption(pCxt, yymsp[-2].minor.yy652, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy24); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy296); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 170: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy652 = setTableOption(pCxt, yymsp[-4].minor.yy652, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy24); } - yymsp[-4].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-4].minor.yy184, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy296); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; case 171: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy652 = setTableOption(pCxt, yymsp[-2].minor.yy652, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 172: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy652 = setTableOption(pCxt, yymsp[-4].minor.yy652, TABLE_OPTION_SMA, yymsp[-1].minor.yy24); } - yymsp[-4].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-4].minor.yy184, TABLE_OPTION_SMA, yymsp[-1].minor.yy296); } + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; case 173: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy652 = createAlterTableOptions(pCxt); yylhsminor.yy652 = setTableOption(pCxt, yylhsminor.yy652, yymsp[0].minor.yy189.type, &yymsp[0].minor.yy189.val); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createAlterTableOptions(pCxt); yylhsminor.yy184 = setTableOption(pCxt, yylhsminor.yy184, yymsp[0].minor.yy139.type, &yymsp[0].minor.yy139.val); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 174: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy652 = setTableOption(pCxt, yymsp[-1].minor.yy652, yymsp[0].minor.yy189.type, &yymsp[0].minor.yy189.val); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy139.type, &yymsp[0].minor.yy139.val); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 175: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy189.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy139.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } break; case 176: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy189.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy189.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy139.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } break; case 177: /* duration_list ::= duration_literal */ case 332: /* expression_list ::= expression */ yytestcase(yyruleno==332); -{ yylhsminor.yy24 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy652)); } - yymsp[0].minor.yy24 = yylhsminor.yy24; +{ yylhsminor.yy296 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } + yymsp[0].minor.yy296 = yylhsminor.yy296; break; case 178: /* duration_list ::= duration_list NK_COMMA duration_literal */ case 333: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==333); -{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, releaseRawExprNode(pCxt, yymsp[0].minor.yy652)); } - yymsp[-2].minor.yy24 = yylhsminor.yy24; +{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } + yymsp[-2].minor.yy296 = yylhsminor.yy296; break; case 181: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy652 = createFunctionNode(pCxt, &yymsp[0].minor.yy657, NULL); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createFunctionNode(pCxt, &yymsp[0].minor.yy7, NULL); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 182: /* rollup_func_name ::= FIRST */ case 183: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==183); -{ yylhsminor.yy652 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 186: /* col_name ::= column_name */ -{ yylhsminor.yy652 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy657); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy7); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 187: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -3893,13 +3891,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; case 190: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy652, yymsp[0].minor.yy652, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, OP_TYPE_LIKE); } break; case 191: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy652, yymsp[0].minor.yy652, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, OP_TYPE_LIKE); } break; case 192: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy652, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy184, NULL, OP_TYPE_LIKE); } break; case 193: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -3914,7 +3912,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; case 197: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy652, yymsp[-1].minor.yy652, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy184, yymsp[-1].minor.yy184, OP_TYPE_EQUAL); } break; case 198: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } @@ -3933,13 +3931,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT); } break; case 204: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy7); } break; case 205: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy184); } break; case 206: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy184); } break; case 207: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } @@ -3972,7 +3970,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; case 217: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy184); } break; case 218: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } @@ -3982,150 +3980,150 @@ static YYACTIONTYPE yy_reduce( break; case 220: /* db_name_cond_opt ::= */ case 225: /* from_db_opt ::= */ yytestcase(yyruleno==225); -{ yymsp[1].minor.yy652 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy184 = createDefaultDatabaseCondValue(pCxt); } break; case 221: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy657); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy7); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 222: /* like_pattern_opt ::= */ case 262: /* into_opt ::= */ yytestcase(yyruleno==262); case 397: /* from_clause_opt ::= */ yytestcase(yyruleno==397); - case 427: /* where_clause_opt ::= */ yytestcase(yyruleno==427); - case 431: /* twindow_clause_opt ::= */ yytestcase(yyruleno==431); - case 436: /* sliding_opt ::= */ yytestcase(yyruleno==436); - case 438: /* fill_opt ::= */ yytestcase(yyruleno==438); - case 450: /* having_clause_opt ::= */ yytestcase(yyruleno==450); - case 452: /* range_opt ::= */ yytestcase(yyruleno==452); - case 454: /* every_opt ::= */ yytestcase(yyruleno==454); - case 464: /* slimit_clause_opt ::= */ yytestcase(yyruleno==464); - case 468: /* limit_clause_opt ::= */ yytestcase(yyruleno==468); -{ yymsp[1].minor.yy652 = NULL; } + case 426: /* where_clause_opt ::= */ yytestcase(yyruleno==426); + case 430: /* twindow_clause_opt ::= */ yytestcase(yyruleno==430); + case 435: /* sliding_opt ::= */ yytestcase(yyruleno==435); + case 437: /* fill_opt ::= */ yytestcase(yyruleno==437); + case 449: /* having_clause_opt ::= */ yytestcase(yyruleno==449); + case 451: /* range_opt ::= */ yytestcase(yyruleno==451); + case 453: /* every_opt ::= */ yytestcase(yyruleno==453); + case 463: /* slimit_clause_opt ::= */ yytestcase(yyruleno==463); + case 467: /* limit_clause_opt ::= */ yytestcase(yyruleno==467); +{ yymsp[1].minor.yy184 = NULL; } break; case 223: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 224: /* table_name_cond ::= table_name */ -{ yylhsminor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy657); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy7); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 226: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy657); } +{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy7); } break; case 227: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy97, &yymsp[-3].minor.yy657, &yymsp[-1].minor.yy657, NULL, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy419, &yymsp[-3].minor.yy7, &yymsp[-1].minor.yy7, NULL, yymsp[0].minor.yy184); } break; case 228: /* cmd ::= DROP INDEX exists_opt index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } break; case 229: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy652 = createIndexOption(pCxt, yymsp[-7].minor.yy24, releaseRawExprNode(pCxt, yymsp[-3].minor.yy652), NULL, yymsp[-1].minor.yy652, yymsp[0].minor.yy652); } +{ yymsp[-9].minor.yy184 = createIndexOption(pCxt, yymsp[-7].minor.yy296, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), NULL, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; case 230: /* 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.yy652 = createIndexOption(pCxt, yymsp[-9].minor.yy24, releaseRawExprNode(pCxt, yymsp[-5].minor.yy652), releaseRawExprNode(pCxt, yymsp[-3].minor.yy652), yymsp[-1].minor.yy652, yymsp[0].minor.yy652); } +{ yymsp[-11].minor.yy184 = createIndexOption(pCxt, yymsp[-9].minor.yy296, releaseRawExprNode(pCxt, yymsp[-5].minor.yy184), releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; case 233: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy652 = createFunctionNode(pCxt, &yymsp[-3].minor.yy657, yymsp[-1].minor.yy24); } - yymsp[-3].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createFunctionNode(pCxt, &yymsp[-3].minor.yy7, yymsp[-1].minor.yy296); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; case 234: /* sma_stream_opt ::= */ case 264: /* stream_options ::= */ yytestcase(yyruleno==264); -{ yymsp[1].minor.yy652 = createStreamOptions(pCxt); } +{ yymsp[1].minor.yy184 = createStreamOptions(pCxt); } break; case 235: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ case 268: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==268); -{ ((SStreamOptions*)yymsp[-2].minor.yy652)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy652); yylhsminor.yy652 = yymsp[-2].minor.yy652; } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ ((SStreamOptions*)yymsp[-2].minor.yy184)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); yylhsminor.yy184 = yymsp[-2].minor.yy184; } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 236: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy652)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy652); yylhsminor.yy652 = yymsp[-2].minor.yy652; } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ ((SStreamOptions*)yymsp[-2].minor.yy184)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); yylhsminor.yy184 = yymsp[-2].minor.yy184; } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 237: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy97, &yymsp[-2].minor.yy657, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy419, &yymsp[-2].minor.yy7, yymsp[0].minor.yy184); } break; case 238: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy97, &yymsp[-3].minor.yy657, &yymsp[0].minor.yy657, false); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy419, &yymsp[-3].minor.yy7, &yymsp[0].minor.yy7, false); } break; case 239: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy97, &yymsp[-5].minor.yy657, &yymsp[0].minor.yy657, true); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy419, &yymsp[-5].minor.yy7, &yymsp[0].minor.yy7, true); } break; case 240: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy97, &yymsp[-3].minor.yy657, yymsp[0].minor.yy652, false); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy419, &yymsp[-3].minor.yy7, yymsp[0].minor.yy184, false); } break; case 241: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy97, &yymsp[-5].minor.yy657, yymsp[0].minor.yy652, true); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy419, &yymsp[-5].minor.yy7, yymsp[0].minor.yy184, true); } break; case 242: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } break; case 243: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy97, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy419, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7); } break; case 244: /* cmd ::= DESC full_table_name */ case 245: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==245); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy184); } break; case 246: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; case 247: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy97, yymsp[-1].minor.yy652, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy419, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; case 249: /* analyze_opt ::= ANALYZE */ case 257: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==257); case 417: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==417); -{ yymsp[0].minor.yy97 = true; } +{ yymsp[0].minor.yy419 = true; } break; case 250: /* explain_options ::= */ -{ yymsp[1].minor.yy652 = createDefaultExplainOptions(pCxt); } +{ yymsp[1].minor.yy184 = createDefaultExplainOptions(pCxt); } break; case 251: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy652 = setExplainVerbose(pCxt, yymsp[-2].minor.yy652, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setExplainVerbose(pCxt, yymsp[-2].minor.yy184, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 252: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy652 = setExplainRatio(pCxt, yymsp[-2].minor.yy652, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = setExplainRatio(pCxt, yymsp[-2].minor.yy184, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 253: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ -{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy24); } +{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy296); } break; case 254: /* 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.yy97, yymsp[-8].minor.yy97, &yymsp[-5].minor.yy657, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy48, yymsp[0].minor.yy244); } +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy419, yymsp[-8].minor.yy419, &yymsp[-5].minor.yy7, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy332, yymsp[0].minor.yy20); } break; case 255: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } break; case 258: /* bufsize_opt ::= */ -{ yymsp[1].minor.yy244 = 0; } +{ yymsp[1].minor.yy20 = 0; } break; case 259: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ -{ yymsp[-1].minor.yy244 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy20 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 260: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy97, &yymsp[-4].minor.yy657, yymsp[-2].minor.yy652, yymsp[-3].minor.yy652, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy419, &yymsp[-4].minor.yy7, yymsp[-2].minor.yy184, yymsp[-3].minor.yy184, yymsp[0].minor.yy184); } break; case 261: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy657); } +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } break; case 263: /* into_opt ::= INTO full_table_name */ case 398: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==398); - case 428: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==428); - case 451: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==451); -{ yymsp[-1].minor.yy652 = yymsp[0].minor.yy652; } + case 427: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==427); + case 450: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==450); +{ yymsp[-1].minor.yy184 = yymsp[0].minor.yy184; } break; case 265: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy652)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy652 = yymsp[-2].minor.yy652; } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ ((SStreamOptions*)yymsp[-2].minor.yy184)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy184 = yymsp[-2].minor.yy184; } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 266: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy652)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy652 = yymsp[-2].minor.yy652; } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ ((SStreamOptions*)yymsp[-2].minor.yy184)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy184 = yymsp[-2].minor.yy184; } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 267: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy652)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy652)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy652); yylhsminor.yy652 = yymsp[-3].minor.yy652; } - yymsp[-3].minor.yy652 = yylhsminor.yy652; +{ ((SStreamOptions*)yymsp[-3].minor.yy184)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy184)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); yylhsminor.yy184 = yymsp[-3].minor.yy184; } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; case 269: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } @@ -4143,39 +4141,39 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; case 274: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy24); } +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy296); } break; case 275: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; case 276: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy24 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +{ yymsp[-1].minor.yy296 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; case 278: /* cmd ::= SYNCDB db_name REPLICA */ -{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy657); } +{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy7); } break; case 279: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy652, yymsp[0].minor.yy652); } +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; case 281: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy652 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 282: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy652 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 283: /* literal ::= NK_STRING */ -{ yylhsminor.yy652 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 284: /* literal ::= NK_BOOL */ -{ yylhsminor.yy652 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 285: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 286: /* literal ::= duration_literal */ case 296: /* signed_literal ::= signed */ yytestcase(yyruleno==296); @@ -4193,165 +4191,165 @@ static YYACTIONTYPE yy_reduce( case 401: /* table_reference ::= table_primary */ yytestcase(yyruleno==401); case 402: /* table_reference ::= joined_table */ yytestcase(yyruleno==402); case 406: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==406); - case 457: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==457); - case 460: /* query_primary ::= query_specification */ yytestcase(yyruleno==460); -{ yylhsminor.yy652 = yymsp[0].minor.yy652; } - yymsp[0].minor.yy652 = yylhsminor.yy652; + case 456: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==456); + case 459: /* query_primary ::= query_specification */ yytestcase(yyruleno==459); +{ yylhsminor.yy184 = yymsp[0].minor.yy184; } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 287: /* literal ::= NULL */ -{ yylhsminor.yy652 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 288: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy652 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 289: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy652 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 290: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 291: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; case 292: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 293: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 294: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; case 295: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 297: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 298: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 299: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 300: /* signed_literal ::= duration_literal */ case 302: /* signed_literal ::= literal_func */ yytestcase(yyruleno==302); case 367: /* star_func_para ::= expression */ yytestcase(yyruleno==367); - case 423: /* select_item ::= common_expression */ yytestcase(yyruleno==423); - case 473: /* search_condition ::= common_expression */ yytestcase(yyruleno==473); -{ yylhsminor.yy652 = releaseRawExprNode(pCxt, yymsp[0].minor.yy652); } - yymsp[0].minor.yy652 = yylhsminor.yy652; + case 422: /* select_item ::= common_expression */ yytestcase(yyruleno==422); + case 472: /* search_condition ::= common_expression */ yytestcase(yyruleno==472); +{ yylhsminor.yy184 = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 301: /* signed_literal ::= NULL */ -{ yylhsminor.yy652 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 321: /* expression ::= NK_LP expression NK_RP */ case 394: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==394); -{ yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy652)); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 322: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy652)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 323: /* expression ::= NK_MINUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy652), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy184), NULL)); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 324: /* expression ::= expression NK_PLUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 325: /* expression ::= expression NK_MINUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 326: /* expression ::= expression NK_STAR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 327: /* expression ::= expression NK_SLASH expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 328: /* expression ::= expression NK_REM expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 329: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 330: /* expression ::= expression NK_BITAND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 331: /* expression ::= expression NK_BITOR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 334: /* column_reference ::= column_name */ -{ yylhsminor.yy652 = createRawExprNode(pCxt, &yymsp[0].minor.yy657, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy657)); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy7, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy7)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 335: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy657, createColumnNode(pCxt, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy657)); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7, createColumnNode(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 336: /* pseudo_column ::= ROWTS */ case 337: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==337); @@ -4361,319 +4359,320 @@ static YYACTIONTYPE yy_reduce( case 342: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==342); case 343: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==343); case 349: /* literal_func ::= NOW */ yytestcase(yyruleno==349); -{ yylhsminor.yy652 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; case 338: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy657)))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy7)))); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 344: /* function_expression ::= function_name NK_LP expression_list NK_RP */ case 345: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==345); -{ yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy657, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy657, yymsp[-1].minor.yy24)); } - yymsp[-3].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy7, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy7, yymsp[-1].minor.yy296)); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; case 346: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ -{ yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy652), yymsp[-1].minor.yy48)); } - yymsp[-5].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-1].minor.yy332)); } + yymsp[-5].minor.yy184 = yylhsminor.yy184; break; case 348: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy657, NULL)); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy7, NULL)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 363: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy24 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy24 = yylhsminor.yy24; +{ yylhsminor.yy296 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy296 = yylhsminor.yy296; break; case 368: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 426: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==426); -{ yylhsminor.yy652 = createColumnNode(pCxt, &yymsp[-2].minor.yy657, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + case 425: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==425); +{ yylhsminor.yy184 = createColumnNode(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 369: /* predicate ::= expression compare_op expression */ case 374: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==374); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy700, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy496, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 370: /* predicate ::= expression BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy652), releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy184), releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-4].minor.yy652 = yylhsminor.yy652; + yymsp[-4].minor.yy184 = yylhsminor.yy184; break; case 371: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy652), releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy184), releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-5].minor.yy652 = yylhsminor.yy652; + yymsp[-5].minor.yy184 = yylhsminor.yy184; break; case 372: /* predicate ::= expression IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), NULL)); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 373: /* predicate ::= expression IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy652), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), NULL)); } - yymsp[-3].minor.yy652 = yylhsminor.yy652; + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; case 375: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy700 = OP_TYPE_LOWER_THAN; } +{ yymsp[0].minor.yy496 = OP_TYPE_LOWER_THAN; } break; case 376: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy700 = OP_TYPE_GREATER_THAN; } +{ yymsp[0].minor.yy496 = OP_TYPE_GREATER_THAN; } break; case 377: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy700 = OP_TYPE_LOWER_EQUAL; } +{ yymsp[0].minor.yy496 = OP_TYPE_LOWER_EQUAL; } break; case 378: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy700 = OP_TYPE_GREATER_EQUAL; } +{ yymsp[0].minor.yy496 = OP_TYPE_GREATER_EQUAL; } break; case 379: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy700 = OP_TYPE_NOT_EQUAL; } +{ yymsp[0].minor.yy496 = OP_TYPE_NOT_EQUAL; } break; case 380: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy700 = OP_TYPE_EQUAL; } +{ yymsp[0].minor.yy496 = OP_TYPE_EQUAL; } break; case 381: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy700 = OP_TYPE_LIKE; } +{ yymsp[0].minor.yy496 = OP_TYPE_LIKE; } break; case 382: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy700 = OP_TYPE_NOT_LIKE; } +{ yymsp[-1].minor.yy496 = OP_TYPE_NOT_LIKE; } break; case 383: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy700 = OP_TYPE_MATCH; } +{ yymsp[0].minor.yy496 = OP_TYPE_MATCH; } break; case 384: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy700 = OP_TYPE_NMATCH; } +{ yymsp[0].minor.yy496 = OP_TYPE_NMATCH; } break; case 385: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy700 = OP_TYPE_JSON_CONTAINS; } +{ yymsp[0].minor.yy496 = OP_TYPE_JSON_CONTAINS; } break; case 386: /* in_op ::= IN */ -{ yymsp[0].minor.yy700 = OP_TYPE_IN; } +{ yymsp[0].minor.yy496 = OP_TYPE_IN; } break; case 387: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy700 = OP_TYPE_NOT_IN; } +{ yymsp[-1].minor.yy496 = OP_TYPE_NOT_IN; } break; case 388: /* in_predicate_value ::= NK_LP expression_list NK_RP */ -{ yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy24)); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy296)); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 390: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy652), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy184), NULL)); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 391: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 392: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy652); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy652); - yylhsminor.yy652 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); + yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 400: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy652 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy652, yymsp[0].minor.yy652, NULL); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, NULL); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; case 403: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy652 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy657, &yymsp[0].minor.yy657); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy7, &yymsp[0].minor.yy7); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 404: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy652 = createRealTableNode(pCxt, &yymsp[-3].minor.yy657, &yymsp[-1].minor.yy657, &yymsp[0].minor.yy657); } - yymsp[-3].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createRealTableNode(pCxt, &yymsp[-3].minor.yy7, &yymsp[-1].minor.yy7, &yymsp[0].minor.yy7); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; case 405: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy652 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy652), &yymsp[0].minor.yy657); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184), &yymsp[0].minor.yy7); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; case 407: /* alias_opt ::= */ -{ yymsp[1].minor.yy657 = nil_token; } +{ yymsp[1].minor.yy7 = nil_token; } break; case 408: /* alias_opt ::= table_alias */ -{ yylhsminor.yy657 = yymsp[0].minor.yy657; } - yymsp[0].minor.yy657 = yylhsminor.yy657; +{ yylhsminor.yy7 = yymsp[0].minor.yy7; } + yymsp[0].minor.yy7 = yylhsminor.yy7; break; case 409: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy657 = yymsp[0].minor.yy657; } +{ yymsp[-1].minor.yy7 = yymsp[0].minor.yy7; } break; case 410: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ case 411: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==411); -{ yymsp[-2].minor.yy652 = yymsp[-1].minor.yy652; } +{ yymsp[-2].minor.yy184 = yymsp[-1].minor.yy184; } break; case 412: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy652 = createJoinTableNode(pCxt, yymsp[-4].minor.yy596, yymsp[-5].minor.yy652, yymsp[-2].minor.yy652, yymsp[0].minor.yy652); } - yymsp[-5].minor.yy652 = yylhsminor.yy652; +{ yylhsminor.yy184 = createJoinTableNode(pCxt, yymsp[-4].minor.yy54, yymsp[-5].minor.yy184, yymsp[-2].minor.yy184, yymsp[0].minor.yy184); } + yymsp[-5].minor.yy184 = yylhsminor.yy184; break; case 413: /* join_type ::= */ -{ yymsp[1].minor.yy596 = JOIN_TYPE_INNER; } +{ yymsp[1].minor.yy54 = JOIN_TYPE_INNER; } break; case 414: /* join_type ::= INNER */ -{ yymsp[0].minor.yy596 = JOIN_TYPE_INNER; } +{ yymsp[0].minor.yy54 = JOIN_TYPE_INNER; } break; case 415: /* 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.yy652 = createSelectStmt(pCxt, yymsp[-10].minor.yy97, yymsp[-9].minor.yy24, yymsp[-8].minor.yy652); - yymsp[-11].minor.yy652 = addWhereClause(pCxt, yymsp[-11].minor.yy652, yymsp[-7].minor.yy652); - yymsp[-11].minor.yy652 = addPartitionByClause(pCxt, yymsp[-11].minor.yy652, yymsp[-6].minor.yy24); - yymsp[-11].minor.yy652 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy652, yymsp[-2].minor.yy652); - yymsp[-11].minor.yy652 = addGroupByClause(pCxt, yymsp[-11].minor.yy652, yymsp[-1].minor.yy24); - yymsp[-11].minor.yy652 = addHavingClause(pCxt, yymsp[-11].minor.yy652, yymsp[0].minor.yy652); - yymsp[-11].minor.yy652 = addRangeClause(pCxt, yymsp[-11].minor.yy652, yymsp[-5].minor.yy652); - yymsp[-11].minor.yy652 = addEveryClause(pCxt, yymsp[-11].minor.yy652, yymsp[-4].minor.yy652); - yymsp[-11].minor.yy652 = addFillClause(pCxt, yymsp[-11].minor.yy652, yymsp[-3].minor.yy652); + yymsp[-11].minor.yy184 = createSelectStmt(pCxt, yymsp[-10].minor.yy419, yymsp[-9].minor.yy296, yymsp[-8].minor.yy184); + yymsp[-11].minor.yy184 = addWhereClause(pCxt, yymsp[-11].minor.yy184, yymsp[-7].minor.yy184); + yymsp[-11].minor.yy184 = addPartitionByClause(pCxt, yymsp[-11].minor.yy184, yymsp[-6].minor.yy296); + yymsp[-11].minor.yy184 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy184, yymsp[-2].minor.yy184); + yymsp[-11].minor.yy184 = addGroupByClause(pCxt, yymsp[-11].minor.yy184, yymsp[-1].minor.yy296); + yymsp[-11].minor.yy184 = addHavingClause(pCxt, yymsp[-11].minor.yy184, yymsp[0].minor.yy184); + yymsp[-11].minor.yy184 = addRangeClause(pCxt, yymsp[-11].minor.yy184, yymsp[-5].minor.yy184); + yymsp[-11].minor.yy184 = addEveryClause(pCxt, yymsp[-11].minor.yy184, yymsp[-4].minor.yy184); + yymsp[-11].minor.yy184 = addFillClause(pCxt, yymsp[-11].minor.yy184, yymsp[-3].minor.yy184); } break; case 418: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy97 = false; } +{ yymsp[0].minor.yy419 = false; } break; - case 419: /* select_list ::= NK_STAR */ -{ yymsp[0].minor.yy24 = NULL; } + case 421: /* select_item ::= NK_STAR */ +{ yylhsminor.yy184 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 424: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy652 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy652), &yymsp[0].minor.yy657); } - yymsp[-1].minor.yy652 = yylhsminor.yy652; + case 423: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy184 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184), &yymsp[0].minor.yy7); } + yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 425: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy652 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), &yymsp[0].minor.yy657); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + case 424: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy184 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), &yymsp[0].minor.yy7); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 430: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 447: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==447); - case 463: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==463); -{ yymsp[-2].minor.yy24 = yymsp[0].minor.yy24; } + case 429: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 446: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==446); + case 462: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==462); +{ yymsp[-2].minor.yy296 = yymsp[0].minor.yy296; } break; - case 432: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy652 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy652), releaseRawExprNode(pCxt, yymsp[-1].minor.yy652)); } + case 431: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy184 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } break; - case 433: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ -{ yymsp[-3].minor.yy652 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy652)); } + case 432: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ +{ yymsp[-3].minor.yy184 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } break; - case 434: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy652 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy652), NULL, yymsp[-1].minor.yy652, yymsp[0].minor.yy652); } + case 433: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy184 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), NULL, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; - case 435: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy652 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy652), releaseRawExprNode(pCxt, yymsp[-3].minor.yy652), yymsp[-1].minor.yy652, yymsp[0].minor.yy652); } + case 434: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy184 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy184), releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } break; - case 437: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - case 455: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==455); -{ yymsp[-3].minor.yy652 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy652); } + case 436: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + case 454: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==454); +{ yymsp[-3].minor.yy184 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy184); } break; - case 439: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy652 = createFillNode(pCxt, yymsp[-1].minor.yy250, NULL); } + case 438: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy184 = createFillNode(pCxt, yymsp[-1].minor.yy540, NULL); } break; - case 440: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy652 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy24)); } + case 439: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy184 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy296)); } break; - case 441: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy250 = FILL_MODE_NONE; } + case 440: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy540 = FILL_MODE_NONE; } break; - case 442: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy250 = FILL_MODE_PREV; } + case 441: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy540 = FILL_MODE_PREV; } break; - case 443: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy250 = FILL_MODE_NULL; } + case 442: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy540 = FILL_MODE_NULL; } break; - case 444: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy250 = FILL_MODE_LINEAR; } + case 443: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy540 = FILL_MODE_LINEAR; } break; - case 445: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy250 = FILL_MODE_NEXT; } + case 444: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy540 = FILL_MODE_NEXT; } break; - case 448: /* group_by_list ::= expression */ -{ yylhsminor.yy24 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); } - yymsp[0].minor.yy24 = yylhsminor.yy24; + case 447: /* group_by_list ::= expression */ +{ yylhsminor.yy296 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } + yymsp[0].minor.yy296 = yylhsminor.yy296; break; - case 449: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy652))); } - yymsp[-2].minor.yy24 = yylhsminor.yy24; + case 448: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } + yymsp[-2].minor.yy296 = yylhsminor.yy296; break; - case 453: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ -{ yymsp[-5].minor.yy652 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy652), releaseRawExprNode(pCxt, yymsp[-1].minor.yy652)); } + case 452: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ +{ yymsp[-5].minor.yy184 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } break; - case 456: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 455: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy652 = addOrderByClause(pCxt, yymsp[-3].minor.yy652, yymsp[-2].minor.yy24); - yylhsminor.yy652 = addSlimitClause(pCxt, yylhsminor.yy652, yymsp[-1].minor.yy652); - yylhsminor.yy652 = addLimitClause(pCxt, yylhsminor.yy652, yymsp[0].minor.yy652); + yylhsminor.yy184 = addOrderByClause(pCxt, yymsp[-3].minor.yy184, yymsp[-2].minor.yy296); + yylhsminor.yy184 = addSlimitClause(pCxt, yylhsminor.yy184, yymsp[-1].minor.yy184); + yylhsminor.yy184 = addLimitClause(pCxt, yylhsminor.yy184, yymsp[0].minor.yy184); } - yymsp[-3].minor.yy652 = yylhsminor.yy652; + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 458: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy652 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy652, yymsp[0].minor.yy652); } - yymsp[-3].minor.yy652 = yylhsminor.yy652; + case 457: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy184 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy184, yymsp[0].minor.yy184); } + yymsp[-3].minor.yy184 = yylhsminor.yy184; break; - case 459: /* query_expression_body ::= query_expression_body UNION query_expression_body */ -{ yylhsminor.yy652 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy652, yymsp[0].minor.yy652); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + case 458: /* query_expression_body ::= query_expression_body UNION query_expression_body */ +{ yylhsminor.yy184 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy184, yymsp[0].minor.yy184); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 461: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ -{ yymsp[-5].minor.yy652 = yymsp[-4].minor.yy652; } - yy_destructor(yypParser,366,&yymsp[-3].minor); - yy_destructor(yypParser,367,&yymsp[-2].minor); - yy_destructor(yypParser,368,&yymsp[-1].minor); + case 460: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ +{ yymsp[-5].minor.yy184 = yymsp[-4].minor.yy184; } + yy_destructor(yypParser,365,&yymsp[-3].minor); + yy_destructor(yypParser,366,&yymsp[-2].minor); + yy_destructor(yypParser,367,&yymsp[-1].minor); break; - case 465: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 469: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==469); -{ yymsp[-1].minor.yy652 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 464: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 468: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==468); +{ yymsp[-1].minor.yy184 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 466: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 470: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==470); -{ yymsp[-3].minor.yy652 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 465: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 469: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==469); +{ yymsp[-3].minor.yy184 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 467: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 471: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==471); -{ yymsp[-3].minor.yy652 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 466: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 470: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==470); +{ yymsp[-3].minor.yy184 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 472: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy652 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy652); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + case 471: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy184); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 476: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy652 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy652), yymsp[-1].minor.yy598, yymsp[0].minor.yy653); } - yymsp[-2].minor.yy652 = yylhsminor.yy652; + case 475: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy184 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), yymsp[-1].minor.yy394, yymsp[0].minor.yy627); } + yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 477: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy598 = ORDER_ASC; } + case 476: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy394 = ORDER_ASC; } break; - case 478: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy598 = ORDER_ASC; } + case 477: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy394 = ORDER_ASC; } break; - case 479: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy598 = ORDER_DESC; } + case 478: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy394 = ORDER_DESC; } break; - case 480: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy653 = NULL_ORDER_DEFAULT; } + case 479: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy627 = NULL_ORDER_DEFAULT; } break; - case 481: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy653 = NULL_ORDER_FIRST; } + case 480: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy627 = NULL_ORDER_FIRST; } break; - case 482: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy653 = NULL_ORDER_LAST; } + case 481: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy627 = NULL_ORDER_LAST; } break; default: break; diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 7b275c5a15..96d017ec7a 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -364,7 +364,7 @@ int32_t shellDumpResultToFile(const char *fname, TAOS_RES *tres) { int32_t *length = taos_fetch_lengths(tres); for (int32_t i = 0; i < num_fields; i++) { if (i > 0) { - taosFprintfFile(pFile, "\n"); + taosFprintfFile(pFile, ","); } shellDumpFieldToFile(pFile, (const char *)row[i], fields + i, length[i], precision); } @@ -394,9 +394,9 @@ void shellPrintNChar(const char *str, int32_t length, int32_t width) { break; } int w = 0; - if(*(str + pos) == '\t' || *(str + pos) == '\n' || *(str + pos) == '\r'){ + if (*(str + pos) == '\t' || *(str + pos) == '\n' || *(str + pos) == '\r') { w = bytes; - }else{ + } else { w = taosWcharWidth(wc); } pos += bytes; @@ -513,7 +513,7 @@ void shellPrintField(const char *val, TAOS_FIELD *field, int32_t width, int32_t } bool shellIsLimitQuery(const char *sql) { - //todo refactor + // todo refactor if (taosStrCaseStr(sql, " limit ") != NULL) { return true; } @@ -522,7 +522,7 @@ bool shellIsLimitQuery(const char *sql) { } bool shellIsShowQuery(const char *sql) { - //todo refactor + // todo refactor if (taosStrCaseStr(sql, "show ") != NULL) { return true; } @@ -530,7 +530,6 @@ bool shellIsShowQuery(const char *sql) { return false; } - int32_t shellVerticalPrintResult(TAOS_RES *tres, const char *sql) { TAOS_ROW row = taos_fetch_row(tres); if (row == NULL) { From 9a2af8580c7f971999ea549ba9be8b052a4531f2 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 30 Jun 2022 15:06:52 +0800 Subject: [PATCH 36/51] fix:compile error in sml --- source/client/src/clientSml.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 8a9905935a..e724637620 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -2450,6 +2450,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr return NULL; } + int batchs = 0; pTscObj->schemalessType = 1; SSmlMsgBuf msg = {ERROR_MSG_BUF_DEFAULT_SIZE, request->msgBuf}; @@ -2497,8 +2498,8 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr goto end; } - int cnt = ceil(((double)numLines) / LINE_BATCH); - for (int i = 0; i < cnt; ++i) { + batchs = ceil(((double)numLines) / LINE_BATCH); + for (int i = 0; i < batchs; ++i) { SRequestObj* req = (SRequestObj*)createRequest(pTscObj, TSDB_SQL_INSERT); if(!req){ request->code = TSDB_CODE_OUT_OF_MEMORY; From b6d66571744f1b38725db17ce77a358b236f80d6 Mon Sep 17 00:00:00 2001 From: slzhou Date: Thu, 30 Jun 2022 15:14:16 +0800 Subject: [PATCH 37/51] feat: support push agg operator condition to scan --- source/libs/nodes/src/nodesUtilFuncs.c | 1 - source/libs/planner/src/planOptimizer.c | 155 +++++++++++++++++++++++- 2 files changed, 152 insertions(+), 4 deletions(-) diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index dc9d9b92ee..1972010e25 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -1728,7 +1728,6 @@ static EDealRes classifyConditionImpl(SNode* pNode, void* pContext) { } else { pCxt->hasOtherCol = true; } - return *((bool*)pContext) ? DEAL_RES_CONTINUE : DEAL_RES_END; } return DEAL_RES_CONTINUE; } diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index b5b53f00a0..a4641a4709 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -587,11 +587,160 @@ static int32_t pushDownCondOptDealJoin(SOptimizeContext* pCxt, SJoinLogicNode* p return code; } -static int32_t pushDownCondOptDealAgg(SOptimizeContext* pCxt, SAggLogicNode* pAgg) { - // todo +typedef struct SPartAggCondContext { + SAggLogicNode* pAgg; + bool hasAggFunc; +} SPartAggCondContext; + +static EDealRes partAggCondHasAggFuncImpl(SNode* pNode, void* pContext) { + SPartAggCondContext* pCxt = pContext; + if (QUERY_NODE_COLUMN == nodeType(pNode)) { + SNode* pAggFunc = NULL; + FOREACH(pAggFunc, pCxt->pAgg->pAggFuncs) { + if (strcmp(((SColumnNode*)pNode)->colName, ((SFunctionNode*)pAggFunc)->node.aliasName) == 0) { + pCxt->hasAggFunc = true; + return DEAL_RES_END; + } + } + } + return DEAL_RES_CONTINUE; +} + +static int32_t partitionAggCondHasAggFunc(SAggLogicNode* pAgg, SNode* pCond) { + SPartAggCondContext cxt = {.pAgg = pAgg, .hasAggFunc = false}; + nodesWalkExpr(pCond, partAggCondHasAggFuncImpl, &cxt); + return cxt.hasAggFunc; +} + +static int32_t partitionAggCondConj(SAggLogicNode* pAgg, SNode** ppAggFuncCond, SNode** ppGroupKeyCond) { + SLogicConditionNode* pLogicCond = (SLogicConditionNode*)pAgg->node.pConditions; + int32_t code = TSDB_CODE_SUCCESS; + + SNodeList* pAggFuncConds = NULL; + SNodeList* pGroupKeyConds = NULL; + SNode* pCond = NULL; + FOREACH(pCond, pLogicCond->pParameterList) { + if (partitionAggCondHasAggFunc(pAgg, pCond)) { + code = nodesListMakeAppend(&pAggFuncConds, nodesCloneNode(pCond)); + } else { + code = nodesListMakeAppend(&pGroupKeyConds, nodesCloneNode(pCond)); + } + if (TSDB_CODE_SUCCESS != code) { + break; + } + } + + SNode* pTempAggFuncCond = NULL; + SNode* pTempGroupKeyCond = NULL; + if (TSDB_CODE_SUCCESS == code) { + code = nodesMergeConds(&pTempAggFuncCond, &pAggFuncConds); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodesMergeConds(&pTempGroupKeyCond, &pGroupKeyConds); + } + + if (TSDB_CODE_SUCCESS == code) { + *ppAggFuncCond = pTempAggFuncCond; + *ppGroupKeyCond = pTempGroupKeyCond; + } else { + nodesDestroyList(pAggFuncConds); + nodesDestroyList(pGroupKeyConds); + nodesDestroyNode(pTempAggFuncCond); + nodesDestroyNode(pTempGroupKeyCond); + } + pAgg->node.pConditions = NULL; + return code; +} + +static int32_t partitionAggCond(SAggLogicNode* pAgg, SNode** ppAggFunCond, SNode** ppGroupKeyCond) { + SNode* pAggNodeCond = pAgg->node.pConditions; + if (QUERY_NODE_LOGIC_CONDITION == nodeType(pAggNodeCond) && + LOGIC_COND_TYPE_AND == ((SLogicConditionNode*)(pAggNodeCond))->condType) { + return partitionAggCondConj(pAgg, ppAggFunCond, ppGroupKeyCond); + } + if (partitionAggCondHasAggFunc(pAgg, pAggNodeCond)) { + *ppAggFunCond = pAggNodeCond; + } else { + *ppGroupKeyCond = pAggNodeCond; + } + pAgg->node.pConditions = NULL; return TSDB_CODE_SUCCESS; } +static int32_t pushCondToAggCond(SOptimizeContext* pCxt, SAggLogicNode* pAgg, SNode** pAggFuncCond) { + pushDownCondOptAppendCond(&pAgg->node.pConditions, pAggFuncCond); + return TSDB_CODE_SUCCESS; +} + +typedef struct SRewriteAggGroupKeyCondContext{ + SAggLogicNode *pAgg; + int32_t errCode; +} SRewriteAggGroupKeyCondContext; + +static EDealRes rewriteAggGroupKeyCondForPushDownImpl(SNode** pNode, void* pContext) { + SRewriteAggGroupKeyCondContext* pCxt = pContext; + SAggLogicNode* pAgg = pCxt->pAgg; + if (QUERY_NODE_COLUMN == nodeType(*pNode)) { + SNode* pGroupKey = NULL; + FOREACH(pGroupKey, pAgg->pGroupKeys) { + SNode* pGroup = NULL; + FOREACH(pGroup, ((SGroupingSetNode*)pGroupKey)->pParameterList) { + if (0 == strcmp(((SExprNode*)pGroup)->aliasName, ((SColumnNode*)(*pNode))->colName)) { + SNode* pExpr = nodesCloneNode(pGroup); + if (pExpr == NULL) { + pCxt->errCode = terrno; + return DEAL_RES_ERROR; + } + nodesDestroyNode(*pNode); + *pNode = pExpr; + } + } + } + return DEAL_RES_IGNORE_CHILD; + } + return DEAL_RES_CONTINUE; +} + +static int32_t rewriteAggGroupKeyCondForPushDown(SOptimizeContext* pCxt, SAggLogicNode* pAgg, SNode* pGroupKeyCond) { + SRewriteAggGroupKeyCondContext cxt = {.pAgg = pAgg, .errCode = TSDB_CODE_SUCCESS}; + nodesRewriteExpr(&pGroupKeyCond, rewriteAggGroupKeyCondForPushDownImpl, &cxt); + return cxt.errCode; +} + +static int32_t pushDownCondOptDealAgg(SOptimizeContext* pCxt, SAggLogicNode* pAgg) { + if (NULL == pAgg->node.pConditions || + OPTIMIZE_FLAG_TEST_MASK(pAgg->node.optimizedFlag, OPTIMIZE_FLAG_PUSH_DOWN_CONDE)) { + return TSDB_CODE_SUCCESS; + } + //TODO: remove it after full implementation of pushing down to child + if (1 != LIST_LENGTH(pAgg->node.pChildren) || + QUERY_NODE_LOGIC_PLAN_SCAN != nodeType(nodesListGetNode(pAgg->node.pChildren, 0))) { + return TSDB_CODE_SUCCESS; + } + + SNode* pAggFuncCond = NULL; + SNode* pGroupKeyCond = NULL; + int32_t code = partitionAggCond(pAgg, &pAggFuncCond, &pGroupKeyCond); + if (TSDB_CODE_SUCCESS == code && NULL != pAggFuncCond) { + code = pushCondToAggCond(pCxt, pAgg, &pAggFuncCond); + } + if (TSDB_CODE_SUCCESS == code && NULL != pGroupKeyCond) { + code = rewriteAggGroupKeyCondForPushDown(pCxt, pAgg, pGroupKeyCond); + } + if (TSDB_CODE_SUCCESS == code && NULL != pGroupKeyCond) { + SLogicNode* pChild = (SLogicNode*)nodesListGetNode(pAgg->node.pChildren, 0); + code = pushDownCondOptPushCondToChild(pCxt, pChild, &pGroupKeyCond); + } + if (TSDB_CODE_SUCCESS == code) { + OPTIMIZE_FLAG_SET_MASK(pAgg->node.optimizedFlag, OPTIMIZE_FLAG_PUSH_DOWN_CONDE); + pCxt->optimized = true; + } else { + nodesDestroyNode(pGroupKeyCond); + nodesDestroyNode(pAggFuncCond); + } + return code; +} + static int32_t pushDownCondOptimizeImpl(SOptimizeContext* pCxt, SLogicNode* pLogicNode) { int32_t code = TSDB_CODE_SUCCESS; switch (nodeType(pLogicNode)) { @@ -1668,8 +1817,8 @@ static EDealRes mergeProjectionsExpr(SNode** pNode, void* pContext) { static int32_t mergeProjectsOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan, SLogicNode* pSelfNode) { SLogicNode* pChild = (SLogicNode*)nodesListGetNode(pSelfNode->pChildren, 0); - SMergeProjectionsContext cxt = {.pChildProj = (SProjectLogicNode*)pChild, .errCode = TSDB_CODE_SUCCESS}; + SMergeProjectionsContext cxt = {.pChildProj = (SProjectLogicNode*)pChild, .errCode = TSDB_CODE_SUCCESS}; nodesRewriteExprs(((SProjectLogicNode*)pSelfNode)->pProjections, mergeProjectionsExpr, &cxt); int32_t code = cxt.errCode; From 6305f6cf6497e7f55993a8b150a66e49dfc7db49 Mon Sep 17 00:00:00 2001 From: plum-lihui Date: Thu, 30 Jun 2022 15:27:31 +0800 Subject: [PATCH 38/51] test:modify case --- tests/system-test/7-tmq/subscribeDb4.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/system-test/7-tmq/subscribeDb4.py b/tests/system-test/7-tmq/subscribeDb4.py index b30f99b542..b99704b602 100644 --- a/tests/system-test/7-tmq/subscribeDb4.py +++ b/tests/system-test/7-tmq/subscribeDb4.py @@ -69,7 +69,6 @@ class TDTestCase: tdCom.create_ctable(tdSql,dbname=self.paraDict["dbName"],stbname=self.paraDict["stbName"],tag_elm_list=self.paraDict['tagSchema'],count=self.paraDict["ctbNum"],default_ctbname_prefix=self.paraDict["ctbPrefix"]) tmqCom.insert_data_2(tdSql,self.paraDict["dbName"],self.paraDict["ctbPrefix"],self.paraDict["ctbNum"],self.paraDict["rowsPerTbl"],self.paraDict["batchNum"],self.paraDict["startTs"],self.paraDict["ctbStartIdx"]) - tdLog.info("22222222222222222") self.paraDict["stbName"] = 'stb2' self.paraDict["ctbPrefix"] = 'newctb' tdCom.create_stable(tdSql,dbname=self.paraDict["dbName"],stbname=self.paraDict["stbName"],column_elm_list=self.paraDict["colSchema"],tag_elm_list=self.paraDict["tagSchema"],count=1, default_stbname_prefix=self.paraDict["stbName"]) From 3a159de7e2cead0584f852dded29bee9ee674f54 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 30 Jun 2022 15:28:03 +0800 Subject: [PATCH 39/51] refactor: assign the committed version --- source/dnode/vnode/src/vnd/vnodeCommit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index dbbe3d3750..02a0783927 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -266,6 +266,8 @@ int vnodeCommit(SVnode *pVnode) { ASSERT(0); return -1; } + + pVnode->state.committed = info.state.committed; // apply the commit (TODO) vnodeBufPoolReset(pVnode->onCommit); From 8dece648e391966a99112c8c39bc887f0dcce9af Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Thu, 30 Jun 2022 14:48:57 +0800 Subject: [PATCH 40/51] feat(tmq): enable withTbName config for snapshot --- source/dnode/vnode/src/tq/tqExec.c | 10 ++++++---- source/dnode/vnode/src/tsdb/tsdbRead.c | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index ac6cc2e411..9cdc3171f5 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -85,10 +85,12 @@ int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, S tqAddBlockDataToRsp(pDataBlock, pRsp); if (pRsp->withTbName) { - // TODO - pRsp->withTbName = 0; - /*int64_t uid = 0;*/ - /*tqAddTbNameToRsp(pTq, uid, pRsp, workerId);*/ + int64_t uid; + int64_t ts; + if (qGetStreamScanStatus(task, &uid, &ts) < 0) { + ASSERT(0); + } + tqAddTbNameToRsp(pTq, uid, pRsp, workerId); } pRsp->blockNum++; diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index e182add5d6..4604e3699f 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -532,9 +532,9 @@ int32_t tsdbSetTableList(tsdbReaderT reader, SArray* tableList) { tsdbReaderT tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* tableList, uint64_t qId, uint64_t taskId) { - /*if (taosArrayGetSize(tableList) == 0) {*/ - /*return NULL;*/ - /*}*/ + if (taosArrayGetSize(tableList) == 0) { + return NULL; + } STsdbReadHandle* pTsdbReadHandle = tsdbQueryTablesImpl(pVnode, pCond, qId, taskId); if (pTsdbReadHandle == NULL) { return NULL; From 00d342959ea26a3c7936ee966e007e338e3bfe57 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 30 Jun 2022 15:50:04 +0800 Subject: [PATCH 41/51] fix: remove arbitrator relatives from scripts (#14388) * fix: remove sudo from directory maniplation for 3.0 * fix: remove more sudo from directory maniplation * fix: packaging/release.sh * fix: remove arbitrator relatives from scripts --- packaging/cfg/tarbitratord.service | 20 -- packaging/deb/tarbitratord | 88 -------- packaging/release.sh | 1 - packaging/rpm/tarbitratord | 141 ------------ packaging/tools/install.sh | 14 -- packaging/tools/install_arbi.sh | 340 ----------------------------- packaging/tools/make_install.sh | 1 - packaging/tools/makearbi.sh | 71 ------ packaging/tools/makepkg.sh | 9 - packaging/tools/remove_arbi.sh | 132 ----------- 10 files changed, 817 deletions(-) delete mode 100644 packaging/cfg/tarbitratord.service delete mode 100644 packaging/deb/tarbitratord delete mode 100644 packaging/rpm/tarbitratord delete mode 100755 packaging/tools/install_arbi.sh delete mode 100755 packaging/tools/makearbi.sh delete mode 100755 packaging/tools/remove_arbi.sh diff --git a/packaging/cfg/tarbitratord.service b/packaging/cfg/tarbitratord.service deleted file mode 100644 index d60cb536b0..0000000000 --- a/packaging/cfg/tarbitratord.service +++ /dev/null @@ -1,20 +0,0 @@ -[Unit] -Description=TDengine arbitrator service -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -ExecStart=/usr/bin/tarbitrator -TimeoutStopSec=1000000s -LimitNOFILE=infinity -LimitNPROC=infinity -LimitCORE=infinity -TimeoutStartSec=0 -StandardOutput=null -Restart=always -StartLimitBurst=3 -StartLimitInterval=60s - -[Install] -WantedBy=multi-user.target diff --git a/packaging/deb/tarbitratord b/packaging/deb/tarbitratord deleted file mode 100644 index 3f97c3c0c2..0000000000 --- a/packaging/deb/tarbitratord +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -# -# Modified from original source: Elastic Search -# https://github.com/elasticsearch/elasticsearch -# Thank you to the Elastic Search authors -# -# chkconfig: 2345 99 01 -# -### BEGIN INIT INFO -# Provides: taoscluster -# Required-Start: $local_fs $network $syslog -# Required-Stop: $local_fs $network $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Starts taoscluster tarbitrator -# Description: Starts taoscluster tarbitrator, a arbitrator -### END INIT INFO - -set -e - -PATH="/bin:/usr/bin:/sbin:/usr/sbin" -NAME="taoscluster" -USER="root" -GROUP="root" -DAEMON="/usr/local/taos/bin/tarbitrator" -DAEMON_OPTS="" -PID_FILE="/var/run/$NAME.pid" -APPARGS="" - -# Maximum number of open files -MAX_OPEN_FILES=65535 - -. /lib/lsb/init-functions - -case "$1" in - start) - - log_action_begin_msg "Starting tarbitrator..." - if start-stop-daemon --test --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile "$PID_FILE" --exec "$DAEMON" -- $APPARGS &> /dev/null; then - - touch "$PID_FILE" && chown "$USER":"$GROUP" "$PID_FILE" - - if [ -n "$MAX_OPEN_FILES" ]; then - ulimit -n $MAX_OPEN_FILES - fi - - start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile "$PID_FILE" --exec "$DAEMON" -- $APPARGS - - log_end_msg $? - fi - ;; - - stop) - log_action_begin_msg "Stopping tarbitrator..." - set +e - if [ -f "$PID_FILE" ]; then - start-stop-daemon --stop --pidfile "$PID_FILE" --user "$USER" --retry=TERM/120/KILL/5 > /dev/null - if [ $? -eq 1 ]; then - log_action_cont_msg "TSD is not running but pid file exists, cleaning up" - elif [ $? -eq 3 ]; then - PID="`cat $PID_FILE`" - log_failure_msg "Failed to stop tarbitrator (pid $PID)" - exit 1 - fi - rm -f "$PID_FILE" - else - log_action_cont_msg "tarbitrator was not running" - fi - log_action_end_msg 0 - set -e - ;; - - restart|force-reload) - if [ -f "$PID_FILE" ]; then - $0 stop - sleep 1 - fi - $0 start - ;; - status) - status_of_proc -p "$PID_FILE" "$DAEMON" "$NAME" - ;; - *) - exit 1 - ;; -esac - -exit 0 diff --git a/packaging/release.sh b/packaging/release.sh index 2ac52a0df9..3426c2856d 100755 --- a/packaging/release.sh +++ b/packaging/release.sh @@ -302,7 +302,6 @@ if [ "$osType" != "Darwin" ]; then ${csudo}./makepkg.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${verNumberComp} ${dbName} ${csudo}./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName} - ${csudo}./makearbi.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} else # only make client for Darwin diff --git a/packaging/rpm/tarbitratord b/packaging/rpm/tarbitratord deleted file mode 100644 index 68138f5c1d..0000000000 --- a/packaging/rpm/tarbitratord +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/bash -# -# tarbitratord This shell script takes care of starting and stopping tarbitrator. -# -# chkconfig: 2345 99 01 -# description: tarbitrator is a arbitrator used in TDengine cluster. -# -# -### BEGIN INIT INFO -# Provides: taoscluster -# Required-Start: $network $local_fs $remote_fs -# Required-Stop: $network $local_fs $remote_fs -# Short-Description: start and stop tarbitrator -# Description: tarbitrator is a arbitrator used in TDengine cluster. -### END INIT INFO - -# Source init functions -. /etc/init.d/functions - -# Maximum number of open files -MAX_OPEN_FILES=65535 - -# Default program options -NAME=tarbitrator -PROG=/usr/local/taos/bin/tarbitrator -USER=root -GROUP=root - -# Default directories -LOCK_DIR=/var/lock/subsys -PID_DIR=/var/run/$NAME - -# Set file names -LOCK_FILE=$LOCK_DIR/$NAME -PID_FILE=$PID_DIR/$NAME.pid - -[ -e $PID_DIR ] || mkdir -p $PID_DIR - -PROG_OPTS="" - -start() { - echo -n "Starting ${NAME}: " - # check identity - curid="`id -u -n`" - if [ "$curid" != root ] && [ "$curid" != "$USER" ] ; then - echo "Must be run as root or $USER, but was run as $curid" - return 1 - fi - # Sets the maximum number of open file descriptors allowed. - ulimit -n $MAX_OPEN_FILES - curulimit="`ulimit -n`" - if [ "$curulimit" -lt $MAX_OPEN_FILES ] ; then - echo "'ulimit -n' must be greater than or equal to $MAX_OPEN_FILES, is $curulimit" - return 1 - fi - - if [ "`id -u -n`" == root ] ; then - # Changes the owner of the lock, and the pid files to allow - # non-root OpenTSDB daemons to run /usr/share/opentsdb/bin/opentsdb_restart.py. - touch $LOCK_FILE && chown $USER:$GROUP $LOCK_FILE - touch $PID_FILE && chown $USER:$GROUP $PID_FILE - daemon --user $USER --pidfile $PID_FILE "$PROG $PROG_OPTS &> /dev/null &" - else - # Don't have to change user. - daemon --pidfile $PID_FILE "$PROG $PROG_OPTS &> /dev/null &" - fi - retval=$? - sleep 2 - echo - [ $retval -eq 0 ] && (findproc > $PID_FILE && touch $LOCK_FILE) - return $retval -} - -stop() { - echo -n "Stopping ${NAME}: " - killproc -p $PID_FILE $NAME - retval=$? - echo - # Non-root users don't have enough permission to remove pid and lock files. - # So, the opentsdb_restart.py cannot get rid of the files, and the command - # "service opentsdb status" will complain about the existing pid file. - # Makes the pid file empty. - echo > $PID_FILE - [ $retval -eq 0 ] && (rm -f $PID_FILE && rm -f $LOCK_FILE) - return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $PID_FILE -l $LOCK_FILE $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac - -exit $? diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 7c7d5477cf..2d17ef4812 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -194,7 +194,6 @@ function install_bin() { ${csudo}rm -f ${bin_link_dir}/${serverName} || : ${csudo}rm -f ${bin_link_dir}/${adapterName} || : ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : - ${csudo}rm -f ${bin_link_dir}/tarbitrator || : ${csudo}rm -f ${bin_link_dir}/set_core || : ${csudo}rm -f ${bin_link_dir}/TDinsight.sh || : @@ -210,7 +209,6 @@ function install_bin() { [ -x ${install_main_dir}/bin/TDinsight.sh ] && ${csudo}ln -s ${install_main_dir}/bin/TDinsight.sh ${bin_link_dir}/TDinsight.sh || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || : [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : - [ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo}ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || : if [ "$verMode" == "cluster" ]; then ${csudo}cp -r ${script_dir}/nginxd/* ${nginx_dir} && ${csudo}chmod 0555 ${nginx_dir}/* @@ -606,28 +604,19 @@ function install_service_on_sysvinit() { if ((${os_type} == 1)); then # ${csudo}cp -f ${script_dir}/init.d/${serverName}.deb ${install_main_dir}/init.d/${serverName} ${csudo}cp ${script_dir}/init.d/${serverName}.deb ${service_config_dir}/${serverName} && ${csudo}chmod a+x ${service_config_dir}/${serverName} - # ${csudo}cp -f ${script_dir}/init.d/tarbitratord.deb ${install_main_dir}/init.d/tarbitratord - ${csudo}cp ${script_dir}/init.d/tarbitratord.deb ${service_config_dir}/tarbitratord && ${csudo}chmod a+x ${service_config_dir}/tarbitratord elif ((${os_type} == 2)); then # ${csudo}cp -f ${script_dir}/init.d/${serverName}.rpm ${install_main_dir}/init.d/${serverName} ${csudo}cp ${script_dir}/init.d/${serverName}.rpm ${service_config_dir}/${serverName} && ${csudo}chmod a+x ${service_config_dir}/${serverName} - # ${csudo}cp -f ${script_dir}/init.d/tarbitratord.rpm ${install_main_dir}/init.d/tarbitratord - ${csudo}cp ${script_dir}/init.d/tarbitratord.rpm ${service_config_dir}/tarbitratord && ${csudo}chmod a+x ${service_config_dir}/tarbitratord fi if ((${initd_mod} == 1)); then ${csudo}chkconfig --add ${serverName} || : ${csudo}chkconfig --level 2345 ${serverName} on || : - ${csudo}chkconfig --add tarbitratord || : - ${csudo}chkconfig --level 2345 tarbitratord on || : elif ((${initd_mod} == 2)); then ${csudo}insserv ${serverName} || : ${csudo}insserv -d ${serverName} || : - ${csudo}insserv tarbitratord || : - ${csudo}insserv -d tarbitratord || : elif ((${initd_mod} == 3)); then ${csudo}update-rc.d ${serverName} defaults || : - ${csudo}update-rc.d tarbitratord defaults || : fi } @@ -669,9 +658,6 @@ function install_service_on_systemd() { ${csudo}systemctl enable ${serverName} - [ -f ${script_dir}/cfg/tarbitratord.service ] && - ${csudo}cp ${script_dir}/cfg/tarbitratord.service \ - ${service_config_dir}/ || : ${csudo}systemctl daemon-reload if [ "$verMode" == "cluster" ]; then diff --git a/packaging/tools/install_arbi.sh b/packaging/tools/install_arbi.sh deleted file mode 100755 index 2863640153..0000000000 --- a/packaging/tools/install_arbi.sh +++ /dev/null @@ -1,340 +0,0 @@ -#!/bin/bash -# -# This file is used to install database on linux systems. The operating system -# is required to use systemd to manage services at boot - -set -e -#set -x - -# -----------------------Variables definition--------------------- -script_dir=$(dirname $(readlink -f "$0")) - -bin_link_dir="/usr/bin" -#inc_link_dir="/usr/include" - -#install main path -install_main_dir="/usr/local/tarbitrator" - -# old bin dir -bin_dir="/usr/local/tarbitrator/bin" - -service_config_dir="/etc/systemd/system" - -# Color setting -RED='\033[0;31m' -GREEN='\033[1;32m' -GREEN_DARK='\033[0;32m' -GREEN_UNDERLINE='\033[4;32m' -NC='\033[0m' - -csudo="" -if command -v sudo >/dev/null; then - csudo="sudo " -fi - -update_flag=0 - -initd_mod=0 -service_mod=2 -if pidof systemd &>/dev/null; then - service_mod=0 -elif $(which service &>/dev/null); then - service_mod=1 - service_config_dir="/etc/init.d" - if $(which chkconfig &>/dev/null); then - initd_mod=1 - elif $(which insserv &>/dev/null); then - initd_mod=2 - elif $(which update-rc.d &>/dev/null); then - initd_mod=3 - else - service_mod=2 - fi -else - service_mod=2 -fi - -# get the operating system type for using the corresponding init file -# ubuntu/debian(deb), centos/fedora(rpm), others: opensuse, redhat, ..., no verification -#osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release) -if [[ -e /etc/os-release ]]; then - osinfo=$(cat /etc/os-release | grep "NAME" | cut -d '"' -f2) || : -else - osinfo="" -fi -#echo "osinfo: ${osinfo}" -os_type=0 -if echo $osinfo | grep -qwi "ubuntu"; then - # echo "This is ubuntu system" - os_type=1 -elif echo $osinfo | grep -qwi "debian"; then - # echo "This is debian system" - os_type=1 -elif echo $osinfo | grep -qwi "Kylin"; then - # echo "This is Kylin system" - os_type=1 -elif echo $osinfo | grep -qwi "centos"; then - # echo "This is centos system" - os_type=2 -elif echo $osinfo | grep -qwi "fedora"; then - # echo "This is fedora system" - os_type=2 -else - echo " osinfo: ${osinfo}" - echo " This is an officially unverified linux system," - echo " if there are any problems with the installation and operation, " - echo " please feel free to contact taosdata.com for support." - os_type=1 -fi - -function kill_tarbitrator() { - pid=$(ps -ef | grep "tarbitrator" | grep -v "grep" | awk '{print $2}') - if [ -n "$pid" ]; then - ${csudo}kill -9 $pid || : - fi -} - -function install_main_path() { - #create install main dir and all sub dir - ${csudo}rm -rf ${install_main_dir} || : - ${csudo}mkdir -p ${install_main_dir} - ${csudo}mkdir -p ${install_main_dir}/bin - #${csudo}mkdir -p ${install_main_dir}/include - ${csudo}mkdir -p ${install_main_dir}/init.d -} - -function install_bin() { - # Remove links - ${csudo}rm -f ${bin_link_dir}/rmtarbitrator || : - ${csudo}rm -f ${bin_link_dir}/tarbitrator || : - ${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/* - - #Make link - [ -x ${install_main_dir}/bin/remove_arbi.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_arbi.sh ${bin_link_dir}/rmtarbitrator || : - [ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo}ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || : -} - -function install_header() { - ${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h ${inc_link_dir}/taosudf.h || : - ${csudo}cp -f ${script_dir}/inc/* ${install_main_dir}/include && ${csudo}chmod 644 ${install_main_dir}/include/* - ${csudo}ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h - ${csudo}ln -s ${install_main_dir}/include/taosdef.h ${inc_link_dir}/taosdef.h - ${csudo}ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h - ${csudo}ln -s ${install_main_dir}/include/taosudf.h ${inc_link_dir}/taosudf.h -} - -function install_jemalloc() { - jemalloc_dir=${script_dir}/jemalloc - - if [ -d ${jemalloc_dir} ]; then - ${csudo}/usr/bin/install -c -d /usr/local/bin - - if [ -f ${jemalloc_dir}/bin/jemalloc-config ]; then - ${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/bin/jemalloc-config /usr/local/bin - fi - if [ -f ${jemalloc_dir}/bin/jemalloc.sh ]; then - ${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/bin/jemalloc.sh /usr/local/bin - fi - if [ -f ${jemalloc_dir}/bin/jeprof ]; then - ${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/bin/jeprof /usr/local/bin - fi - if [ -f ${jemalloc_dir}/include/jemalloc/jemalloc.h ]; then - ${csudo}/usr/bin/install -c -d /usr/local/include/jemalloc - ${csudo}/usr/bin/install -c -m 644 ${jemalloc_dir}/include/jemalloc/jemalloc.h /usr/local/include/jemalloc - fi - if [ -f ${jemalloc_dir}/lib/libjemalloc.so.2 ]; then - ${csudo}/usr/bin/install -c -d /usr/local/lib - ${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/lib/libjemalloc.so.2 /usr/local/lib - ${csudo}ln -sf libjemalloc.so.2 /usr/local/lib/libjemalloc.so - ${csudo}/usr/bin/install -c -d /usr/local/lib - if [ -f ${jemalloc_dir}/lib/libjemalloc.a ]; then - ${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/lib/libjemalloc.a /usr/local/lib - fi - if [ -f ${jemalloc_dir}/lib/libjemalloc_pic.a ]; then - ${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/lib/libjemalloc_pic.a /usr/local/lib - fi - if [ -f ${jemalloc_dir}/lib/libjemalloc_pic.a ]; then - ${csudo}/usr/bin/install -c -d /usr/local/lib/pkgconfig - ${csudo}/usr/bin/install -c -m 644 ${jemalloc_dir}/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig - fi - fi - if [ -f ${jemalloc_dir}/share/doc/jemalloc/jemalloc.html ]; then - ${csudo}/usr/bin/install -c -d /usr/local/share/doc/jemalloc - ${csudo}/usr/bin/install -c -m 644 ${jemalloc_dir}/share/doc/jemalloc/jemalloc.html /usr/local/share/doc/jemalloc - fi - if [ -f ${jemalloc_dir}/share/man/man3/jemalloc.3 ]; then - ${csudo}/usr/bin/install -c -d /usr/local/share/man/man3 - ${csudo}/usr/bin/install -c -m 644 ${jemalloc_dir}/share/man/man3/jemalloc.3 /usr/local/share/man/man3 - fi - - if [ -d /etc/ld.so.conf.d ]; then - echo "/usr/local/lib" | ${csudo}tee /etc/ld.so.conf.d/jemalloc.conf >/dev/null || echo -e "failed to write /etc/ld.so.conf.d/jemalloc.conf" - ${csudo}ldconfig - else - echo "/etc/ld.so.conf.d not found!" - fi - fi -} - -function clean_service_on_sysvinit() { - if pidof tarbitrator &>/dev/null; then - ${csudo}service tarbitratord stop || : - fi - - if ((${initd_mod} == 1)); then - if [ -e ${service_config_dir}/tarbitratord ]; then - ${csudo}chkconfig --del tarbitratord || : - fi - elif ((${initd_mod} == 2)); then - if [ -e ${service_config_dir}/tarbitratord ]; then - ${csudo}insserv -r tarbitratord || : - fi - elif ((${initd_mod} == 3)); then - if [ -e ${service_config_dir}/tarbitratord ]; then - ${csudo}update-rc.d -f tarbitratord remove || : - fi - fi - - ${csudo}rm -f ${service_config_dir}/tarbitratord || : - - if $(which init &>/dev/null); then - ${csudo}init q || : - fi -} - -function install_service_on_sysvinit() { - clean_service_on_sysvinit - sleep 1 - - if ((${os_type} == 1)); then - ${csudo}cp -f ${script_dir}/init.d/tarbitratord.deb ${install_main_dir}/init.d/tarbitratord - ${csudo}cp ${script_dir}/init.d/tarbitratord.deb ${service_config_dir}/tarbitratord && ${csudo}chmod a+x ${service_config_dir}/tarbitratord - elif ((${os_type} == 2)); then - ${csudo}cp -f ${script_dir}/init.d/tarbitratord.rpm ${install_main_dir}/init.d/tarbitratord - ${csudo}cp ${script_dir}/init.d/tarbitratord.rpm ${service_config_dir}/tarbitratord && ${csudo}chmod a+x ${service_config_dir}/tarbitratord - fi - - if ((${initd_mod} == 1)); then - ${csudo}chkconfig --add tarbitratord || : - ${csudo}chkconfig --level 2345 tarbitratord on || : - elif ((${initd_mod} == 2)); then - ${csudo}insserv tarbitratord || : - ${csudo}insserv -d tarbitratord || : - elif ((${initd_mod} == 3)); then - ${csudo}update-rc.d tarbitratord defaults || : - fi -} - -function clean_service_on_systemd() { - tarbitratord_service_config="${service_config_dir}/tarbitratord.service" - if systemctl is-active --quiet tarbitratord; then - echo "tarbitrator is running, stopping it..." - ${csudo}systemctl stop tarbitratord &>/dev/null || echo &>/dev/null - fi - ${csudo}systemctl disable tarbitratord &>/dev/null || echo &>/dev/null - - ${csudo}rm -f ${tarbitratord_service_config} -} - -function install_service_on_systemd() { - clean_service_on_systemd - - tarbitratord_service_config="${service_config_dir}/tarbitratord.service" - - ${csudo}bash -c "echo '[Unit]' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'Description=TDengine arbitrator service' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'After=network-online.target' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'Wants=network-online.target' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo '[Service]' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'Type=simple' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'ExecStart=/usr/bin/tarbitrator' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'TimeoutStopSec=1000000s' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'LimitNOFILE=infinity' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'LimitNPROC=infinity' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'LimitCORE=infinity' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'TimeoutStartSec=0' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'StandardOutput=null' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'Restart=always' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'StartLimitBurst=3' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'StartLimitInterval=60s' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo '[Install]' >> ${tarbitratord_service_config}" - ${csudo}bash -c "echo 'WantedBy=multi-user.target' >> ${tarbitratord_service_config}" - ${csudo}systemctl enable tarbitratord -} - -function install_service() { - if ((${service_mod} == 0)); then - install_service_on_systemd - elif ((${service_mod} == 1)); then - install_service_on_sysvinit - else - kill_tarbitrator - fi -} - -function update_TDengine() { - # Start to update - echo -e "${GREEN}Start to update TDengine's arbitrator ...${NC}" - # Stop the service if running - if pidof tarbitrator &>/dev/null; then - if ((${service_mod} == 0)); then - ${csudo}systemctl stop tarbitratord || : - elif ((${service_mod} == 1)); then - ${csudo}service tarbitratord stop || : - else - kill_tarbitrator - fi - sleep 1 - fi - - install_main_path - #install_header - install_bin - install_service - install_jemalloc - - echo - if ((${service_mod} == 0)); then - echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}" - elif ((${service_mod} == 1)); then - echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}" - else - echo -e "${GREEN_DARK}To start arbitrator ${NC}: ./tarbitrator${NC}" - fi - echo - echo -e "\033[44;32;1mTDengine's arbitrator is updated successfully!${NC}" -} - -function install_TDengine() { - # Start to install - echo -e "${GREEN}Start to install TDengine's arbitrator ...${NC}" - - install_main_path - #install_header - install_bin - install_service - install_jemalloc - - echo - if ((${service_mod} == 0)); then - echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}" - elif ((${service_mod} == 1)); then - echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}" - else - echo -e "${GREEN_DARK}To start arbitrator ${NC}: tarbitrator${NC}" - fi - - echo -e "\033[44;32;1mTDengine's arbitrator is installed successfully!${NC}" - echo -} - -## ==============================Main program starts from here============================ -# Install server and client -if [ -x ${bin_dir}/tarbitrator ]; then - update_flag=1 - update_TDengine -else - install_TDengine -fi diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index 59be60f8fc..4e4ebb72c0 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -185,7 +185,6 @@ function install_bin() { [ -f ${binary_dir}/build/bin/taosadapter ] && ${csudo}cp -r ${binary_dir}/build/bin/taosadapter ${install_main_dir}/bin || : [ -f ${binary_dir}/build/bin/udfd ] && ${csudo}cp -r ${binary_dir}/build/bin/udfd ${install_main_dir}/bin || : ${csudo}cp -r ${binary_dir}/build/bin/${serverName} ${install_main_dir}/bin || : - # ${csudo}cp -r ${binary_dir}/build/bin/tarbitrator ${install_main_dir}/bin || : ${csudo}cp -r ${script_dir}/taosd-dump-cfg.gdb ${install_main_dir}/bin || : ${csudo}cp -r ${script_dir}/remove.sh ${install_main_dir}/bin || : diff --git a/packaging/tools/makearbi.sh b/packaging/tools/makearbi.sh deleted file mode 100755 index cfae2b4a46..0000000000 --- a/packaging/tools/makearbi.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# Generate arbitrator's tar.gz setup package for all os system - -set -e -#set -x - -curr_dir=$(pwd) -compile_dir=$1 -version=$2 -build_time=$3 -cpuType=$4 -osType=$5 -verMode=$6 -verType=$7 -pagMode=$8 - -script_dir="$(dirname $(readlink -f $0))" -top_dir="$(readlink -f ${script_dir}/../..)" - -productName="TDengine" - -# create compressed install file. -build_dir="${compile_dir}/build" -code_dir="${top_dir}" -release_dir="${top_dir}/release" - -#package_name='linux' -if [ "$verMode" == "cluster" ]; then - install_dir="${release_dir}/${productName}-enterprise-arbitrator-${version}" -else - install_dir="${release_dir}/${productName}-arbitrator-${version}" -fi - -# Directories and files. -bin_files="${build_dir}/bin/tarbitrator ${script_dir}/remove_arbi.sh" -install_files="${script_dir}/install_arbi.sh" - -#header_files="${code_dir}/include/client/taos.h ${code_dir}/include/common/taosdef.h ${code_dir}/include/util/taoserror.h ${code_dir}/include/libs/function/taosudf.h" -init_file_tarbitrator_deb=${script_dir}/../deb/tarbitratord -init_file_tarbitrator_rpm=${script_dir}/../rpm/tarbitratord - -# make directories. -mkdir -p ${install_dir} && cp ${install_files} ${install_dir} && chmod a+x ${install_dir}/install_arbi.sh || : -#mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc || : -mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || : -mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir}/init.d/tarbitratord.deb || : -mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || : - -cd ${release_dir} - -# install_dir has been distinguishes cluster from edege, so comments this code -pkg_name=${install_dir}-${osType}-${cpuType} - -if [[ "$verType" == "beta" ]] || [[ "$verType" == "preRelease" ]]; then - pkg_name=${install_dir}-${verType}-${osType}-${cpuType} -elif [ "$verType" == "stable" ]; then - pkg_name=${pkg_name} -else - echo "unknow verType, nor stabel or beta" - exit 1 -fi - -tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files || : -exitcode=$? -if [ "$exitcode" != "0" ]; then - echo "tar ${pkg_name}.tar.gz error !!!" - exit $exitcode -fi - -cd ${curr_dir} diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 0bc11b99b3..cd656fe6f2 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -85,7 +85,6 @@ else ${build_dir}/bin/${clientName} \ ${taostools_bin_files} \ ${build_dir}/bin/taosadapter \ - ${build_dir}/bin/tarbitrator\ ${script_dir}/remove.sh \ ${script_dir}/set_core.sh \ ${script_dir}/startPre.sh \ @@ -106,8 +105,6 @@ nginx_dir="${top_dir}/../enterprise/src/plugins/web" init_file_deb=${script_dir}/../deb/taosd init_file_rpm=${script_dir}/../rpm/taosd -init_file_tarbitrator_deb=${script_dir}/../deb/tarbitratord -init_file_tarbitrator_rpm=${script_dir}/../rpm/tarbitratord # make directories. mkdir -p ${install_dir} @@ -126,10 +123,6 @@ if [ -f "${cfg_dir}/${serverName}.service" ]; then cp ${cfg_dir}/${serverName}.service ${install_dir}/cfg || : fi -if [ -f "${top_dir}/packaging/cfg/tarbitratord.service" ]; then - cp ${top_dir}/packaging/cfg/tarbitratord.service ${install_dir}/cfg || : -fi - if [ -f "${top_dir}/packaging/cfg/nginxd.service" ]; then cp ${top_dir}/packaging/cfg/nginxd.service ${install_dir}/cfg || : fi @@ -137,8 +130,6 @@ fi mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || : mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/${serverName}.deb mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/${serverName}.rpm -mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir}/init.d/tarbitratord.deb || : -mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || : if [ $adapterName != "taosadapter" ]; then mv ${install_dir}/cfg/taosadapter.toml ${install_dir}/cfg/$adapterName.toml diff --git a/packaging/tools/remove_arbi.sh b/packaging/tools/remove_arbi.sh deleted file mode 100755 index c95c579d30..0000000000 --- a/packaging/tools/remove_arbi.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# -# Script to stop the service and uninstall TDengine's arbitrator - -set -e -#set -x - -verMode=edge - -RED='\033[0;31m' -GREEN='\033[1;32m' -NC='\033[0m' - -#install main path -install_main_dir="/usr/local/tarbitrator" -bin_link_dir="/usr/bin" -#inc_link_dir="/usr/include" - -service_config_dir="/etc/systemd/system" -tarbitrator_service_name="tarbitratord" -csudo="" -if command -v sudo > /dev/null; then - csudo="sudo " -fi - -initd_mod=0 -service_mod=2 -if pidof systemd &> /dev/null; then - service_mod=0 -elif $(which service &> /dev/null); then - service_mod=1 - service_config_dir="/etc/init.d" - if $(which chkconfig &> /dev/null); then - initd_mod=1 - elif $(which insserv &> /dev/null); then - initd_mod=2 - elif $(which update-rc.d &> /dev/null); then - initd_mod=3 - else - service_mod=2 - fi -else - service_mod=2 -fi - -function kill_tarbitrator() { - pid=$(ps -ef | grep "tarbitrator" | grep -v "grep" | awk '{print $2}') - if [ -n "$pid" ]; then - ${csudo}kill -9 $pid || : - fi -} -function clean_bin() { - # Remove link - ${csudo}rm -f ${bin_link_dir}/tarbitrator || : -} - -function clean_header() { - # Remove link - ${csudo}rm -f ${inc_link_dir}/taos.h || : - ${csudo}rm -f ${inc_link_dir}/taosdef.h || : - ${csudo}rm -f ${inc_link_dir}/taoserror.h || : - ${csudo}rm -f ${inc_link_dir}/taosudf.h || : - -} - -function clean_log() { - # Remove link - ${csudo}rm -rf /arbitrator.log || : -} - -function clean_service_on_systemd() { - tarbitratord_service_config="${service_config_dir}/${tarbitrator_service_name}.service" - - if systemctl is-active --quiet ${tarbitrator_service_name}; then - echo "TDengine tarbitrator is running, stopping it..." - ${csudo}systemctl stop ${tarbitrator_service_name} &> /dev/null || echo &> /dev/null - fi - ${csudo}systemctl disable ${tarbitrator_service_name} &> /dev/null || echo &> /dev/null - - ${csudo}rm -f ${tarbitratord_service_config} -} - -function clean_service_on_sysvinit() { - if pidof tarbitrator &> /dev/null; then - echo "TDengine's tarbitrator is running, stopping it..." - ${csudo}service tarbitratord stop || : - fi - - if ((${initd_mod}==1)); then - if [ -e ${service_config_dir}/tarbitratord ]; then - ${csudo}chkconfig --del tarbitratord || : - fi - elif ((${initd_mod}==2)); then - if [ -e ${service_config_dir}/tarbitratord ]; then - ${csudo}insserv -r tarbitratord || : - fi - elif ((${initd_mod}==3)); then - if [ -e ${service_config_dir}/tarbitratord ]; then - ${csudo}update-rc.d -f tarbitratord remove || : - fi - fi - - ${csudo}rm -f ${service_config_dir}/tarbitratord || : - - if $(which init &> /dev/null); then - ${csudo}init q || : - fi -} - -function clean_service() { - if ((${service_mod}==0)); then - clean_service_on_systemd - elif ((${service_mod}==1)); then - clean_service_on_sysvinit - else - # must manual stop - kill_tarbitrator - fi -} - -# Stop service and disable booting start. -clean_service -# Remove binary file and links -clean_bin -# Remove header file. -##clean_header -# Remove log file -clean_log - -${csudo}rm -rf ${install_main_dir} - -echo -e "${GREEN}TDengine's arbitrator is removed successfully!${NC}" From 05b4f8b273fde8da28c4efae485f4ee6ad8ddf8a Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Thu, 30 Jun 2022 15:54:30 +0800 Subject: [PATCH 42/51] os: support-gcc4.8-compile --- cmake/cmake.options | 22 ++++++++++++++++------ source/libs/qcom/src/querymsg.c | 2 ++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/cmake/cmake.options b/cmake/cmake.options index 62816a80d5..86096c18fe 100644 --- a/cmake/cmake.options +++ b/cmake/cmake.options @@ -52,12 +52,22 @@ IF(${TD_WINDOWS}) ON ) ELSE () - - option( - BUILD_TEST - "If build unit tests using googletest" - ON - ) + include(CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-std=c++13" COMPILER_SUPPORTS_CXX13) + IF(${COMPILER_SUPPORTS_CXX13}) + add_definitions(-DCOMPILER_SUPPORTS_CXX13) + option( + BUILD_TEST + "If build unit tests using googletest" + ON + ) + ELSE () + option( + BUILD_TEST + "If build unit tests using googletest" + OFF + ) + ENDIF () ENDIF () option( diff --git a/source/libs/qcom/src/querymsg.c b/source/libs/qcom/src/querymsg.c index b433a88001..908149c3ea 100644 --- a/source/libs/qcom/src/querymsg.c +++ b/source/libs/qcom/src/querymsg.c @@ -20,7 +20,9 @@ #include "systable.h" #pragma GCC diagnostic push +#ifdef COMPILER_SUPPORTS_CXX13 #pragma GCC diagnostic ignored "-Wformat-truncation" +#endif int32_t (*queryBuildMsg[TDMT_MAX])(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void*(*mallocFp)(int32_t)) = {0}; int32_t (*queryProcessMsgRsp[TDMT_MAX])(void *output, char *msg, int32_t msgSize) = {0}; From 4fc1a6faecc52a76a46eb667690e6c632783539d Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 30 Jun 2022 15:59:42 +0800 Subject: [PATCH 43/51] fix connect error --- source/libs/transport/src/transCli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 4ec54beebf..d03f0fd903 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -400,7 +400,7 @@ void cliHandleExcept(SCliConn* pConn) { STransConnCtx* pCtx = pMsg ? pMsg->ctx : NULL; STransMsg transMsg = {0}; - transMsg.code = TSDB_CODE_RPC_BROKEN_LINK; + transMsg.code = pConn->broken ? TSDB_CODE_RPC_BROKEN_LINK : TSDB_CODE_RPC_NETWORK_UNAVAIL; transMsg.msgType = pMsg ? pMsg->msg.msgType + 1 : 0; transMsg.info.ahandle = NULL; From 1530b339919b168bed05c6ce5c1614f96ec6eb01 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 30 Jun 2022 16:16:05 +0800 Subject: [PATCH 44/51] feat: support 'select *, expr from ...' syntax --- include/common/tmsg.h | 1 + include/common/ttokendef.h | 148 +- include/libs/nodes/cmdnodes.h | 1 + include/libs/nodes/plannodes.h | 10 +- include/libs/planner/planner.h | 1 + source/common/src/tmsg.c | 3 +- source/libs/executor/src/scanoperator.c | 2 +- source/libs/nodes/src/nodesCloneFuncs.c | 11 +- source/libs/nodes/src/nodesCodeFuncs.c | 49 +- source/libs/parser/inc/sql.y | 1 + source/libs/parser/src/parTokenizer.c | 3 +- source/libs/parser/src/parTranslater.c | 16 + source/libs/parser/src/sql.c | 4799 ++++++++++--------- source/libs/parser/test/parInitialCTest.cpp | 38 +- source/libs/planner/src/planLogicCreater.c | 5 +- source/libs/planner/src/planOptimizer.c | 3 +- source/libs/planner/src/planPhysiCreater.c | 5 +- 17 files changed, 2556 insertions(+), 2540 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 71867d9741..aefbf0bf1c 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1623,6 +1623,7 @@ typedef struct { int8_t triggerType; int64_t maxDelay; int64_t watermark; + int8_t igExpired; } SCMCreateStreamReq; typedef struct { diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index f5e068693e..bd73e04746 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -192,79 +192,81 @@ #define TK_TRIGGER 174 #define TK_AT_ONCE 175 #define TK_WINDOW_CLOSE 176 -#define TK_KILL 177 -#define TK_CONNECTION 178 -#define TK_TRANSACTION 179 -#define TK_BALANCE 180 -#define TK_VGROUP 181 -#define TK_MERGE 182 -#define TK_REDISTRIBUTE 183 -#define TK_SPLIT 184 -#define TK_SYNCDB 185 -#define TK_DELETE 186 -#define TK_NULL 187 -#define TK_NK_QUESTION 188 -#define TK_NK_ARROW 189 -#define TK_ROWTS 190 -#define TK_TBNAME 191 -#define TK_QSTARTTS 192 -#define TK_QENDTS 193 -#define TK_WSTARTTS 194 -#define TK_WENDTS 195 -#define TK_WDURATION 196 -#define TK_CAST 197 -#define TK_NOW 198 -#define TK_TODAY 199 -#define TK_TIMEZONE 200 -#define TK_CLIENT_VERSION 201 -#define TK_SERVER_VERSION 202 -#define TK_SERVER_STATUS 203 -#define TK_CURRENT_USER 204 -#define TK_COUNT 205 -#define TK_LAST_ROW 206 -#define TK_BETWEEN 207 -#define TK_IS 208 -#define TK_NK_LT 209 -#define TK_NK_GT 210 -#define TK_NK_LE 211 -#define TK_NK_GE 212 -#define TK_NK_NE 213 -#define TK_MATCH 214 -#define TK_NMATCH 215 -#define TK_CONTAINS 216 -#define TK_JOIN 217 -#define TK_INNER 218 -#define TK_SELECT 219 -#define TK_DISTINCT 220 -#define TK_WHERE 221 -#define TK_PARTITION 222 -#define TK_BY 223 -#define TK_SESSION 224 -#define TK_STATE_WINDOW 225 -#define TK_SLIDING 226 -#define TK_FILL 227 -#define TK_VALUE 228 -#define TK_NONE 229 -#define TK_PREV 230 -#define TK_LINEAR 231 -#define TK_NEXT 232 -#define TK_HAVING 233 -#define TK_RANGE 234 -#define TK_EVERY 235 -#define TK_ORDER 236 -#define TK_SLIMIT 237 -#define TK_SOFFSET 238 -#define TK_LIMIT 239 -#define TK_OFFSET 240 -#define TK_ASC 241 -#define TK_NULLS 242 -#define TK_ID 243 -#define TK_NK_BITNOT 244 -#define TK_INSERT 245 -#define TK_VALUES 246 -#define TK_IMPORT 247 -#define TK_NK_SEMI 248 -#define TK_FILE 249 +#define TK_IGNORE 177 +#define TK_EXPIRED 178 +#define TK_KILL 179 +#define TK_CONNECTION 180 +#define TK_TRANSACTION 181 +#define TK_BALANCE 182 +#define TK_VGROUP 183 +#define TK_MERGE 184 +#define TK_REDISTRIBUTE 185 +#define TK_SPLIT 186 +#define TK_SYNCDB 187 +#define TK_DELETE 188 +#define TK_NULL 189 +#define TK_NK_QUESTION 190 +#define TK_NK_ARROW 191 +#define TK_ROWTS 192 +#define TK_TBNAME 193 +#define TK_QSTARTTS 194 +#define TK_QENDTS 195 +#define TK_WSTARTTS 196 +#define TK_WENDTS 197 +#define TK_WDURATION 198 +#define TK_CAST 199 +#define TK_NOW 200 +#define TK_TODAY 201 +#define TK_TIMEZONE 202 +#define TK_CLIENT_VERSION 203 +#define TK_SERVER_VERSION 204 +#define TK_SERVER_STATUS 205 +#define TK_CURRENT_USER 206 +#define TK_COUNT 207 +#define TK_LAST_ROW 208 +#define TK_BETWEEN 209 +#define TK_IS 210 +#define TK_NK_LT 211 +#define TK_NK_GT 212 +#define TK_NK_LE 213 +#define TK_NK_GE 214 +#define TK_NK_NE 215 +#define TK_MATCH 216 +#define TK_NMATCH 217 +#define TK_CONTAINS 218 +#define TK_JOIN 219 +#define TK_INNER 220 +#define TK_SELECT 221 +#define TK_DISTINCT 222 +#define TK_WHERE 223 +#define TK_PARTITION 224 +#define TK_BY 225 +#define TK_SESSION 226 +#define TK_STATE_WINDOW 227 +#define TK_SLIDING 228 +#define TK_FILL 229 +#define TK_VALUE 230 +#define TK_NONE 231 +#define TK_PREV 232 +#define TK_LINEAR 233 +#define TK_NEXT 234 +#define TK_HAVING 235 +#define TK_RANGE 236 +#define TK_EVERY 237 +#define TK_ORDER 238 +#define TK_SLIMIT 239 +#define TK_SOFFSET 240 +#define TK_LIMIT 241 +#define TK_OFFSET 242 +#define TK_ASC 243 +#define TK_NULLS 244 +#define TK_ID 245 +#define TK_NK_BITNOT 246 +#define TK_INSERT 247 +#define TK_VALUES 248 +#define TK_IMPORT 249 +#define TK_NK_SEMI 250 +#define TK_FILE 251 #define TK_NK_SPACE 300 #define TK_NK_COMMENT 301 diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index e473daad8d..134cd80487 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -338,6 +338,7 @@ typedef struct SStreamOptions { int8_t triggerType; SNode* pDelay; SNode* pWatermark; + bool ignoreExpired; } SStreamOptions; typedef struct SCreateStreamStmt { diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index f8d79a863f..1f9c66ccc3 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -73,8 +73,7 @@ typedef struct SScanLogicNode { SNode* pTagIndexCond; int8_t triggerType; int64_t watermark; - int16_t tsColId; - double filesFactor; + int8_t igExpired; SArray* pSmaIndexes; SNodeList* pGroupTags; bool groupSort; @@ -175,7 +174,7 @@ typedef struct SWindowLogicNode { SNode* pStateExpr; int8_t triggerType; int64_t watermark; - double filesFactor; + int8_t igExpired; EWindowAlgorithm windowAlgo; } SWindowLogicNode; @@ -296,8 +295,7 @@ typedef struct STableScanPhysiNode { int8_t slidingUnit; int8_t triggerType; int64_t watermark; - int16_t tsColId; - double filesFactor; + int8_t igExpired; } STableScanPhysiNode; typedef STableScanPhysiNode STableSeqScanPhysiNode; @@ -373,7 +371,7 @@ typedef struct SWinodwPhysiNode { SNode* pTsEnd; // window end timestamp int8_t triggerType; int64_t watermark; - double filesFactor; + int8_t igExpired; } SWinodwPhysiNode; typedef struct SIntervalPhysiNode { diff --git a/include/libs/planner/planner.h b/include/libs/planner/planner.h index b4c75da131..d1a5c5db10 100644 --- a/include/libs/planner/planner.h +++ b/include/libs/planner/planner.h @@ -34,6 +34,7 @@ typedef struct SPlanContext { bool showRewrite; int8_t triggerType; int64_t watermark; + int8_t igExpired; char* pMsg; int32_t msgLen; const char* pUser; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 78eccdf0cd..807d102eef 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -4641,6 +4641,7 @@ int32_t tSerializeSCMCreateStreamReq(void *buf, int32_t bufLen, const SCMCreateS if (tEncodeI8(&encoder, pReq->triggerType) < 0) return -1; if (tEncodeI64(&encoder, pReq->maxDelay) < 0) return -1; if (tEncodeI64(&encoder, pReq->watermark) < 0) return -1; + if (tEncodeI8(&encoder, pReq->igExpired) < 0) return -1; if (sqlLen > 0 && tEncodeCStr(&encoder, pReq->sql) < 0) return -1; if (astLen > 0 && tEncodeCStr(&encoder, pReq->ast) < 0) return -1; @@ -4668,6 +4669,7 @@ int32_t tDeserializeSCMCreateStreamReq(void *buf, int32_t bufLen, SCMCreateStrea if (tDecodeI8(&decoder, &pReq->triggerType) < 0) return -1; if (tDecodeI64(&decoder, &pReq->maxDelay) < 0) return -1; if (tDecodeI64(&decoder, &pReq->watermark) < 0) return -1; + if (tDecodeI8(&decoder, &pReq->igExpired) < 0) return -1; if (sqlLen > 0) { pReq->sql = taosMemoryCalloc(1, sqlLen + 1); @@ -5502,4 +5504,3 @@ int32_t tDecodeSMqDataRsp(SDecoder *pDecoder, SMqDataRsp *pRsp) { } return 0; } - diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index ca4afdeb7f..34e5ad1bca 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1188,7 +1188,7 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys int16_t colId = id->colId; taosArrayPush(pColIds, &colId); - if (id->colId == pTableScanNode->tsColId) { + if (id->colId == PRIMARYKEY_TIMESTAMP_COL_ID) { pInfo->primaryTsIndex = id->targetSlotId; } } diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index b372bf75fc..60d52f89a7 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -350,9 +350,9 @@ static int32_t logicScanCopy(const SScanLogicNode* pSrc, SScanLogicNode* pDst) { CLONE_NODE_FIELD(pTagIndexCond); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); - COPY_SCALAR_FIELD(tsColId); - COPY_SCALAR_FIELD(filesFactor); + COPY_SCALAR_FIELD(igExpired); CLONE_NODE_LIST_FIELD(pGroupTags); + COPY_SCALAR_FIELD(groupSort); return TSDB_CODE_SUCCESS; } @@ -421,7 +421,7 @@ static int32_t logicWindowCopy(const SWindowLogicNode* pSrc, SWindowLogicNode* p CLONE_NODE_FIELD(pStateExpr); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); - COPY_SCALAR_FIELD(filesFactor); + COPY_SCALAR_FIELD(igExpired); COPY_SCALAR_FIELD(windowAlgo); return TSDB_CODE_SUCCESS; } @@ -511,8 +511,7 @@ static int32_t physiTableScanCopy(const STableScanPhysiNode* pSrc, STableScanPhy COPY_SCALAR_FIELD(slidingUnit); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); - COPY_SCALAR_FIELD(tsColId); - COPY_SCALAR_FIELD(filesFactor); + COPY_SCALAR_FIELD(igExpired); return TSDB_CODE_SUCCESS; } @@ -532,7 +531,7 @@ static int32_t physiWindowCopy(const SWinodwPhysiNode* pSrc, SWinodwPhysiNode* p CLONE_NODE_FIELD(pTsEnd); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); - COPY_SCALAR_FIELD(filesFactor); + COPY_SCALAR_FIELD(igExpired); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index df7429bd88..dc293bf6c1 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -1426,12 +1426,11 @@ static const char* jkTableScanPhysiPlanDynamicScanFuncs = "DynamicScanFuncs"; static const char* jkTableScanPhysiPlanInterval = "Interval"; static const char* jkTableScanPhysiPlanOffset = "Offset"; static const char* jkTableScanPhysiPlanSliding = "Sliding"; -static const char* jkTableScanPhysiPlanIntervalUnit = "intervalUnit"; -static const char* jkTableScanPhysiPlanSlidingUnit = "slidingUnit"; -static const char* jkTableScanPhysiPlanTriggerType = "triggerType"; -static const char* jkTableScanPhysiPlanWatermark = "watermark"; -static const char* jkTableScanPhysiPlanTsColId = "tsColId"; -static const char* jkTableScanPhysiPlanFilesFactor = "FilesFactor"; +static const char* jkTableScanPhysiPlanIntervalUnit = "IntervalUnit"; +static const char* jkTableScanPhysiPlanSlidingUnit = "SlidingUnit"; +static const char* jkTableScanPhysiPlanTriggerType = "TriggerType"; +static const char* jkTableScanPhysiPlanWatermark = "Watermark"; +static const char* jkTableScanPhysiPlanIgnoreExpired = "IgnoreExpired"; static const char* jkTableScanPhysiPlanGroupTags = "GroupTags"; static const char* jkTableScanPhysiPlanGroupSort = "GroupSort"; @@ -1482,10 +1481,7 @@ static int32_t physiTableScanNodeToJson(const void* pObj, SJson* pJson) { code = tjsonAddIntegerToObject(pJson, jkTableScanPhysiPlanWatermark, pNode->watermark); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonAddIntegerToObject(pJson, jkTableScanPhysiPlanTsColId, pNode->tsColId); - } - if (TSDB_CODE_SUCCESS == code) { - code = tjsonAddDoubleToObject(pJson, jkTableScanPhysiPlanFilesFactor, pNode->filesFactor); + code = tjsonAddIntegerToObject(pJson, jkTableScanPhysiPlanIgnoreExpired, pNode->igExpired); } if (TSDB_CODE_SUCCESS == code) { code = nodeListToJson(pJson, jkTableScanPhysiPlanGroupTags, pNode->pGroupTags); @@ -1517,37 +1513,34 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) { code = tjsonGetDoubleValue(pJson, jkTableScanPhysiPlanRatio, &pNode->ratio); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkTableScanPhysiPlanDataRequired, pNode->dataRequired, code); + code = tjsonGetIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->dataRequired); } if (TSDB_CODE_SUCCESS == code) { code = jsonToNodeList(pJson, jkTableScanPhysiPlanDynamicScanFuncs, &pNode->pDynamicScanFuncs); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkTableScanPhysiPlanInterval, pNode->interval, code); + code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->interval); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkTableScanPhysiPlanOffset, pNode->offset, code); + code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->offset); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkTableScanPhysiPlanSliding, pNode->sliding, code); + code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->sliding); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkTableScanPhysiPlanIntervalUnit, pNode->intervalUnit, code); + code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->intervalUnit); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkTableScanPhysiPlanSlidingUnit, pNode->slidingUnit, code); + code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->slidingUnit); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkTableScanPhysiPlanTriggerType, pNode->triggerType, code); + code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->triggerType); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkTableScanPhysiPlanWatermark, pNode->watermark, code); + code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->watermark); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkTableScanPhysiPlanTsColId, pNode->tsColId, code); - } - if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetDoubleValue(pJson, jkTableScanPhysiPlanFilesFactor, &pNode->filesFactor); + code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->igExpired); } if (TSDB_CODE_SUCCESS == code) { code = jsonToNodeList(pJson, jkTableScanPhysiPlanGroupTags, &pNode->pGroupTags); @@ -1826,7 +1819,7 @@ static const char* jkWindowPhysiPlanTsPk = "TsPk"; static const char* jkWindowPhysiPlanTsEnd = "TsEnd"; static const char* jkWindowPhysiPlanTriggerType = "TriggerType"; static const char* jkWindowPhysiPlanWatermark = "Watermark"; -static const char* jkWindowPhysiPlanFilesFactor = "FilesFactor"; +static const char* JKWINDOWPHYSIPLANIGNOREEXPIRED = "IgnoreExpired"; static int32_t physiWindowNodeToJson(const void* pObj, SJson* pJson) { const SWinodwPhysiNode* pNode = (const SWinodwPhysiNode*)pObj; @@ -1851,7 +1844,7 @@ static int32_t physiWindowNodeToJson(const void* pObj, SJson* pJson) { code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanWatermark, pNode->watermark); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonAddDoubleToObject(pJson, jkWindowPhysiPlanFilesFactor, pNode->filesFactor); + code = tjsonAddIntegerToObject(pJson, JKWINDOWPHYSIPLANIGNOREEXPIRED, pNode->igExpired); } return code; @@ -1874,15 +1867,13 @@ static int32_t jsonToPhysiWindowNode(const SJson* pJson, void* pObj) { code = jsonToNodeObject(pJson, jkWindowPhysiPlanTsEnd, (SNode**)&pNode->pTsEnd); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkWindowPhysiPlanTriggerType, pNode->triggerType, code); - ; + code = tjsonGetTinyIntValue(pJson, JKWINDOWPHYSIPLANIGNOREEXPIRED, &pNode->triggerType); } if (TSDB_CODE_SUCCESS == code) { - tjsonGetNumberValue(pJson, jkWindowPhysiPlanWatermark, pNode->watermark, code); - ; + code = tjsonGetBigIntValue(pJson, JKWINDOWPHYSIPLANIGNOREEXPIRED, &pNode->watermark); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetDoubleValue(pJson, jkWindowPhysiPlanFilesFactor, &pNode->filesFactor); + code = tjsonGetTinyIntValue(pJson, JKWINDOWPHYSIPLANIGNOREEXPIRED, &pNode->igExpired); } return code; diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 08b817dbed..2e58cc56b8 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -488,6 +488,7 @@ stream_options(A) ::= stream_options(B) TRIGGER AT_ONCE. stream_options(A) ::= stream_options(B) TRIGGER WINDOW_CLOSE. { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; A = B; } stream_options(A) ::= stream_options(B) TRIGGER MAX_DELAY duration_literal(C). { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)B)->pDelay = releaseRawExprNode(pCxt, C); A = B; } stream_options(A) ::= stream_options(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; } +stream_options(A) ::= stream_options(B) IGNORE EXPIRED. { ((SStreamOptions*)B)->ignoreExpired = true; A = B; } /************************************************ kill connection/query ***********************************************/ cmd ::= KILL CONNECTION NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &A); } diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 3b2ad84235..6736fea635 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -84,6 +84,7 @@ static SKeyword keywordTable[] = { {"DURATION", TK_DURATION}, {"ENABLE", TK_ENABLE}, {"EXISTS", TK_EXISTS}, + {"EXPIRED", TK_EXPIRED}, {"EXPLAIN", TK_EXPLAIN}, {"EVERY", TK_EVERY}, {"FILE", TK_FILE}, @@ -99,6 +100,7 @@ static SKeyword keywordTable[] = { {"GROUP", TK_GROUP}, {"HAVING", TK_HAVING}, {"IF", TK_IF}, + {"IGNORE", TK_IGNORE}, {"IMPORT", TK_IMPORT}, {"IN", TK_IN}, {"INDEX", TK_INDEX}, @@ -290,7 +292,6 @@ static SKeyword keywordTable[] = { // {"END", TK_END}, // {"FAIL", TK_FAIL}, // {"FOR", TK_FOR}, - // {"IGNORE", TK_IGNORE}, // {"IMMEDIATE", TK_IMMEDIATE}, // {"INITIALLY", TK_INITIALLY}, // {"INSTEAD", TK_INSTEAD}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 985fa6c9ae..21a3fde65b 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -4208,6 +4208,7 @@ static int32_t buildCreateStreamReq(STranslateContext* pCxt, SCreateStreamStmt* pReq->triggerType = pStmt->pOptions->triggerType; pReq->maxDelay = (NULL != pStmt->pOptions->pDelay ? ((SValueNode*)pStmt->pOptions->pDelay)->datum.i : 0); pReq->watermark = (NULL != pStmt->pOptions->pWatermark ? ((SValueNode*)pStmt->pOptions->pWatermark)->datum.i : 0); + pReq->igExpired = pStmt->pOptions->ignoreExpired; } return code; @@ -4798,6 +4799,15 @@ static const char* getSysTableName(ENodeType type) { return NULL; } +static SNode* createStarCol() { + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); + if (NULL == pCol) { + return NULL; + } + strcpy(pCol->colName, "*"); + return (SNode*)pCol; +} + static int32_t createSimpleSelectStmt(const char* pDb, const char* pTable, SSelectStmt** pStmt) { SSelectStmt* pSelect = (SSelectStmt*)nodesMakeNode(QUERY_NODE_SELECT_STMT); if (NULL == pSelect) { @@ -4815,6 +4825,11 @@ static int32_t createSimpleSelectStmt(const char* pDb, const char* pTable, SSele strcpy(pRealTable->table.tableAlias, pTable); pSelect->pFromTable = (SNode*)pRealTable; + if (TSDB_CODE_SUCCESS != nodesListMakeStrictAppend(&pSelect->pProjectionList, createStarCol())) { + nodesDestroyNode((SNode*)pSelect); + return TSDB_CODE_OUT_OF_MEMORY; + } + *pStmt = pSelect; return TSDB_CODE_SUCCESS; @@ -4963,6 +4978,7 @@ static int32_t rewriteShowTableDist(STranslateContext* pCxt, SQuery* pQuery) { SSelectStmt* pStmt = NULL; int32_t code = createSelectStmtForShowTableDist((SShowTableDistributedStmt*)pQuery->pRoot, &pStmt); if (TSDB_CODE_SUCCESS == code) { + NODES_DESTORY_LIST(pStmt->pProjectionList); code = nodesListMakeStrictAppend(&pStmt->pProjectionList, createBlockDistFunc()); } if (TSDB_CODE_SUCCESS == code) { diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 6b71a50ac0..e4317d97b0 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,26 +104,26 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 373 +#define YYNOCODE 375 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SToken yy7; - int32_t yy20; - EJoinType yy54; - int8_t yy57; - SAlterOption yy139; - SNode* yy184; - int64_t yy193; - SNodeList* yy296; - SDataType yy332; - EOrder yy394; - bool yy419; - EOperatorType yy496; - EFillMode yy540; - ENullOrder yy627; + SDataType yy34; + EJoinType yy162; + EOrder yy188; + SNode* yy212; + SAlterOption yy245; + EOperatorType yy290; + EFillMode yy294; + SToken yy329; + SNodeList* yy424; + ENullOrder yy607; + int64_t yy609; + int32_t yy610; + int8_t yy653; + bool yy737; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 652 -#define YYNRULE 482 -#define YYNTOKEN 250 -#define YY_MAX_SHIFT 651 -#define YY_MIN_SHIFTREDUCE 952 -#define YY_MAX_SHIFTREDUCE 1433 -#define YY_ERROR_ACTION 1434 -#define YY_ACCEPT_ACTION 1435 -#define YY_NO_ACTION 1436 -#define YY_MIN_REDUCE 1437 -#define YY_MAX_REDUCE 1918 +#define YYNSTATE 653 +#define YYNRULE 483 +#define YYNTOKEN 252 +#define YY_MAX_SHIFT 652 +#define YY_MIN_SHIFTREDUCE 954 +#define YY_MAX_SHIFTREDUCE 1436 +#define YY_ERROR_ACTION 1437 +#define YY_ACCEPT_ACTION 1438 +#define YY_NO_ACTION 1439 +#define YY_MIN_REDUCE 1440 +#define YY_MAX_REDUCE 1922 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,682 +216,677 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2447) +#define YY_ACTTAB_COUNT (2471) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 422, 1671, 423, 1472, 151, 1740, 1435, 430, 317, 423, - /* 10 */ 1472, 1370, 39, 37, 1502, 338, 1737, 1610, 1616, 1618, - /* 20 */ 326, 1438, 1235, 1740, 1896, 1562, 334, 525, 373, 379, - /* 30 */ 1260, 565, 1771, 1310, 1737, 1233, 1737, 1895, 30, 240, - /* 40 */ 518, 1893, 101, 1733, 1739, 100, 99, 98, 97, 96, - /* 50 */ 95, 94, 93, 92, 569, 119, 1305, 985, 1753, 14, - /* 60 */ 61, 1733, 1739, 1733, 1739, 1241, 296, 343, 1896, 39, - /* 70 */ 37, 1373, 569, 439, 569, 474, 473, 326, 517, 1235, - /* 80 */ 472, 157, 1, 116, 469, 1893, 1771, 468, 467, 466, - /* 90 */ 1310, 1002, 1233, 1001, 528, 117, 1377, 989, 990, 1723, - /* 100 */ 330, 548, 1259, 140, 648, 1449, 458, 1896, 138, 527, - /* 110 */ 153, 1838, 1839, 1305, 1843, 210, 14, 1573, 1312, 1313, - /* 120 */ 157, 1003, 1241, 1437, 1893, 1617, 1618, 1784, 1134, 1135, - /* 130 */ 88, 1754, 551, 1756, 1757, 547, 427, 569, 60, 2, - /* 140 */ 1830, 60, 1257, 73, 319, 1826, 152, 110, 109, 108, - /* 150 */ 107, 106, 105, 104, 103, 102, 141, 78, 156, 1054, - /* 160 */ 1528, 648, 1499, 1236, 519, 1234, 1856, 40, 38, 36, - /* 170 */ 35, 34, 474, 473, 1260, 1312, 1313, 472, 1564, 421, - /* 180 */ 116, 469, 425, 203, 468, 467, 466, 1239, 1240, 1056, - /* 190 */ 1288, 1289, 1291, 1292, 1293, 1294, 1295, 544, 567, 1303, - /* 200 */ 1304, 1306, 1307, 1308, 1309, 1311, 1314, 565, 33, 32, - /* 210 */ 552, 1320, 40, 38, 36, 35, 34, 1259, 329, 160, - /* 220 */ 1236, 1668, 1234, 625, 624, 623, 341, 1369, 622, 621, - /* 230 */ 620, 121, 615, 614, 613, 612, 611, 610, 609, 608, - /* 240 */ 131, 604, 71, 304, 1239, 1240, 7, 1288, 1289, 1291, - /* 250 */ 1292, 1293, 1294, 1295, 544, 567, 1303, 1304, 1306, 1307, - /* 260 */ 1308, 1309, 1311, 1314, 39, 37, 1896, 60, 565, 42, - /* 270 */ 1623, 1394, 326, 1290, 1235, 160, 1259, 331, 160, 158, - /* 280 */ 412, 167, 607, 1893, 1543, 1310, 1621, 1233, 1092, 592, - /* 290 */ 591, 590, 1096, 589, 1098, 1099, 588, 1101, 585, 603, - /* 300 */ 1107, 582, 1109, 1110, 579, 576, 67, 1896, 1305, 66, - /* 310 */ 310, 14, 511, 1392, 1393, 1395, 1396, 1241, 601, 1235, - /* 320 */ 1894, 39, 37, 1753, 1893, 566, 171, 170, 60, 326, - /* 330 */ 43, 1235, 1233, 488, 2, 1549, 111, 129, 128, 598, - /* 340 */ 597, 596, 1310, 460, 1233, 1261, 486, 372, 484, 371, - /* 350 */ 1241, 1771, 1002, 1571, 1001, 1430, 648, 364, 311, 549, - /* 360 */ 309, 308, 1241, 462, 1723, 1305, 548, 464, 471, 470, - /* 370 */ 1312, 1313, 429, 1258, 1241, 425, 504, 366, 362, 33, - /* 380 */ 32, 529, 1003, 40, 38, 36, 35, 34, 1290, 463, - /* 390 */ 69, 8, 1784, 439, 1753, 87, 1754, 551, 1756, 1757, - /* 400 */ 547, 648, 569, 115, 160, 1830, 160, 1661, 566, 298, - /* 410 */ 1826, 84, 1566, 648, 22, 1236, 1896, 1234, 169, 111, - /* 420 */ 1460, 1896, 1771, 606, 120, 1366, 465, 1312, 1313, 157, - /* 430 */ 549, 244, 1563, 1893, 159, 1723, 1571, 548, 1893, 1239, - /* 440 */ 1240, 1429, 1288, 1289, 1291, 1292, 1293, 1294, 1295, 544, - /* 450 */ 567, 1303, 1304, 1306, 1307, 1308, 1309, 1311, 1314, 1262, - /* 460 */ 1236, 1723, 1234, 1784, 525, 160, 88, 1754, 551, 1756, - /* 470 */ 1757, 547, 1236, 569, 1234, 232, 1830, 533, 336, 552, - /* 480 */ 319, 1826, 1909, 490, 1239, 1240, 138, 595, 11, 10, - /* 490 */ 1669, 1864, 119, 1217, 1218, 1573, 1239, 1240, 58, 1288, - /* 500 */ 1289, 1291, 1292, 1293, 1294, 1295, 544, 567, 1303, 1304, - /* 510 */ 1306, 1307, 1308, 1309, 1311, 1314, 39, 37, 1315, 36, - /* 520 */ 35, 34, 525, 1896, 326, 83, 1235, 566, 160, 1478, - /* 530 */ 651, 566, 117, 1560, 69, 80, 157, 1310, 162, 1233, - /* 540 */ 1893, 1547, 377, 1459, 262, 1623, 1623, 154, 1838, 1839, - /* 550 */ 119, 1843, 525, 337, 514, 1571, 1567, 566, 149, 1571, - /* 560 */ 1305, 1622, 1621, 641, 637, 633, 629, 260, 378, 1241, - /* 570 */ 1346, 339, 529, 39, 37, 1753, 566, 643, 1334, 138, - /* 580 */ 119, 326, 566, 1235, 1723, 1571, 9, 382, 1573, 213, - /* 590 */ 117, 1458, 85, 397, 1310, 254, 1233, 245, 246, 603, - /* 600 */ 1450, 1339, 529, 1771, 1571, 230, 1838, 524, 648, 523, - /* 610 */ 1571, 549, 1896, 566, 497, 1457, 1723, 1305, 548, 1711, - /* 620 */ 117, 1556, 1312, 1313, 398, 159, 1241, 1558, 562, 1893, - /* 630 */ 520, 515, 1723, 529, 1456, 230, 1838, 524, 618, 523, - /* 640 */ 27, 1571, 1896, 9, 1784, 50, 1753, 87, 1754, 551, - /* 650 */ 1756, 1757, 547, 1845, 569, 157, 1723, 1830, 304, 1893, - /* 660 */ 212, 298, 1826, 619, 617, 648, 352, 1236, 1554, 1234, - /* 670 */ 1455, 1454, 534, 1896, 1771, 1723, 1453, 1842, 367, 1312, - /* 680 */ 1313, 1209, 549, 205, 138, 1391, 157, 1723, 1452, 548, - /* 690 */ 1893, 1239, 1240, 1574, 1288, 1289, 1291, 1292, 1293, 1294, - /* 700 */ 1295, 544, 567, 1303, 1304, 1306, 1307, 1308, 1309, 1311, - /* 710 */ 1314, 1723, 1723, 525, 1845, 1784, 566, 1723, 88, 1754, - /* 720 */ 551, 1756, 1757, 547, 1236, 569, 1234, 438, 1830, 1723, - /* 730 */ 1451, 531, 319, 1826, 1909, 1529, 1741, 1667, 1841, 1448, - /* 740 */ 305, 119, 1447, 1887, 1571, 1446, 1445, 1737, 1239, 1240, - /* 750 */ 206, 1288, 1289, 1291, 1292, 1293, 1294, 1295, 544, 567, - /* 760 */ 1303, 1304, 1306, 1307, 1308, 1309, 1311, 1314, 39, 37, - /* 770 */ 295, 1723, 1257, 543, 1733, 1739, 326, 566, 1235, 405, - /* 780 */ 1723, 117, 417, 1723, 594, 569, 1723, 1723, 1568, 1310, - /* 790 */ 1444, 1233, 599, 989, 990, 1614, 155, 1838, 1839, 390, - /* 800 */ 1843, 418, 512, 392, 26, 1571, 1845, 536, 1443, 1442, - /* 810 */ 33, 32, 1305, 28, 40, 38, 36, 35, 34, 33, - /* 820 */ 32, 1241, 235, 40, 38, 36, 35, 34, 1753, 1441, - /* 830 */ 1840, 1723, 1259, 383, 566, 566, 33, 32, 2, 464, - /* 840 */ 40, 38, 36, 35, 34, 1700, 498, 33, 32, 1723, - /* 850 */ 1723, 40, 38, 36, 35, 34, 1771, 541, 1440, 457, - /* 860 */ 648, 463, 1571, 1571, 528, 1666, 1850, 1366, 305, 1723, - /* 870 */ 1723, 548, 1489, 416, 1312, 1313, 411, 410, 409, 408, - /* 880 */ 407, 404, 403, 402, 401, 400, 396, 395, 394, 393, - /* 890 */ 387, 386, 385, 384, 475, 381, 380, 1784, 299, 1723, - /* 900 */ 88, 1754, 551, 1756, 1757, 547, 566, 569, 491, 566, - /* 910 */ 1830, 1273, 566, 566, 319, 1826, 152, 502, 224, 1236, - /* 920 */ 563, 1234, 1273, 564, 256, 600, 44, 4, 1614, 267, - /* 930 */ 1332, 217, 1601, 342, 1571, 194, 1857, 1571, 192, 1772, - /* 940 */ 1571, 1571, 196, 1239, 1240, 195, 1288, 1289, 1291, 1292, - /* 950 */ 1293, 1294, 1295, 544, 567, 1303, 1304, 1306, 1307, 1308, - /* 960 */ 1309, 1311, 1314, 139, 198, 52, 501, 197, 273, 101, - /* 970 */ 566, 219, 100, 99, 98, 97, 96, 95, 94, 93, - /* 980 */ 92, 340, 271, 57, 1333, 1324, 56, 200, 33, 32, - /* 990 */ 199, 1484, 40, 38, 36, 35, 34, 1753, 1571, 1482, - /* 1000 */ 1432, 1433, 172, 1290, 537, 41, 209, 1338, 11, 10, - /* 1010 */ 1244, 33, 32, 477, 1243, 40, 38, 36, 35, 34, - /* 1020 */ 41, 480, 1743, 1473, 41, 1771, 1611, 60, 242, 1860, - /* 1030 */ 526, 1026, 229, 549, 72, 123, 3, 126, 1723, 1548, - /* 1040 */ 548, 127, 234, 237, 239, 1340, 29, 324, 1327, 1328, - /* 1050 */ 1329, 1330, 1331, 1335, 1336, 1337, 50, 574, 1745, 126, - /* 1060 */ 1296, 1027, 299, 1404, 1185, 86, 1784, 5, 247, 89, - /* 1070 */ 1754, 551, 1756, 1757, 547, 558, 569, 253, 344, 1830, - /* 1080 */ 347, 1085, 1257, 1829, 1826, 351, 306, 1054, 307, 479, - /* 1090 */ 1201, 263, 399, 1663, 1332, 168, 266, 1113, 127, 1117, - /* 1100 */ 64, 63, 376, 112, 489, 166, 1753, 1546, 406, 414, - /* 1110 */ 126, 370, 413, 415, 333, 332, 419, 1263, 202, 420, - /* 1120 */ 428, 1266, 294, 431, 1249, 360, 175, 358, 354, 350, - /* 1130 */ 163, 345, 482, 601, 1771, 1310, 476, 1242, 1124, 432, - /* 1140 */ 1247, 201, 549, 1122, 1246, 177, 1265, 1723, 1333, 548, - /* 1150 */ 130, 433, 129, 128, 598, 597, 596, 1267, 1305, 434, - /* 1160 */ 180, 436, 182, 1264, 160, 437, 55, 1241, 184, 54, - /* 1170 */ 68, 1338, 440, 187, 459, 1784, 264, 461, 88, 1754, - /* 1180 */ 551, 1756, 1757, 547, 1705, 569, 91, 1561, 1830, 297, - /* 1190 */ 191, 1557, 319, 1826, 1909, 193, 132, 1753, 133, 1559, - /* 1200 */ 204, 601, 1555, 1849, 134, 135, 570, 492, 493, 496, - /* 1210 */ 29, 324, 1327, 1328, 1329, 1330, 1331, 1335, 1336, 1337, - /* 1220 */ 129, 128, 598, 597, 596, 1771, 207, 189, 499, 503, - /* 1230 */ 316, 1262, 211, 549, 508, 513, 1861, 555, 1723, 6, - /* 1240 */ 548, 144, 1871, 215, 1870, 510, 456, 452, 448, 444, - /* 1250 */ 188, 218, 318, 516, 1852, 529, 33, 32, 522, 223, - /* 1260 */ 40, 38, 36, 35, 34, 1250, 1784, 1245, 509, 280, - /* 1270 */ 1754, 551, 1756, 1757, 547, 70, 569, 507, 186, 33, - /* 1280 */ 32, 1753, 225, 40, 38, 36, 35, 34, 146, 1253, - /* 1290 */ 226, 506, 228, 227, 1366, 1896, 1261, 1846, 118, 1892, - /* 1300 */ 567, 1303, 1304, 1306, 1307, 1308, 1309, 538, 159, 1771, - /* 1310 */ 535, 18, 1893, 233, 320, 1912, 532, 549, 236, 553, - /* 1320 */ 539, 238, 1723, 124, 548, 1811, 554, 125, 1704, 1673, - /* 1330 */ 559, 1384, 560, 1753, 556, 328, 249, 251, 265, 529, - /* 1340 */ 185, 178, 77, 183, 561, 1572, 79, 435, 572, 1544, - /* 1350 */ 1784, 1615, 268, 280, 1754, 551, 1756, 1757, 547, 259, - /* 1360 */ 569, 1771, 644, 51, 645, 647, 176, 145, 289, 549, - /* 1370 */ 291, 272, 1717, 290, 1723, 270, 548, 1716, 62, 1896, - /* 1380 */ 1715, 346, 1712, 348, 349, 1753, 1228, 1229, 164, 353, - /* 1390 */ 1710, 355, 157, 356, 357, 1709, 1893, 359, 1708, 361, - /* 1400 */ 1707, 1753, 1784, 363, 1706, 89, 1754, 551, 1756, 1757, - /* 1410 */ 547, 365, 569, 1771, 1690, 1830, 369, 165, 368, 540, - /* 1420 */ 1826, 546, 1204, 1203, 1684, 1683, 1723, 375, 548, 1771, - /* 1430 */ 1682, 374, 1681, 1173, 1656, 1655, 1654, 549, 65, 1653, - /* 1440 */ 1652, 1651, 1723, 1650, 548, 1649, 388, 389, 1648, 391, - /* 1450 */ 1647, 1753, 122, 1633, 1784, 1646, 1645, 287, 1754, 551, - /* 1460 */ 1756, 1757, 547, 545, 569, 542, 1802, 1753, 1644, 1643, - /* 1470 */ 1784, 1642, 1641, 142, 1754, 551, 1756, 1757, 547, 1771, - /* 1480 */ 569, 1640, 1639, 1638, 1637, 1636, 1635, 549, 1634, 1632, - /* 1490 */ 1631, 1630, 1723, 1629, 548, 1771, 1628, 1175, 1627, 1626, - /* 1500 */ 1625, 1624, 1501, 549, 1469, 173, 113, 424, 1723, 1753, - /* 1510 */ 548, 992, 426, 150, 1468, 1698, 174, 530, 1910, 991, - /* 1520 */ 1784, 1753, 505, 89, 1754, 551, 1756, 1757, 547, 1692, - /* 1530 */ 569, 114, 1680, 1830, 179, 1679, 1784, 1771, 1827, 288, - /* 1540 */ 1754, 551, 1756, 1757, 547, 549, 569, 181, 1665, 1771, - /* 1550 */ 1723, 1550, 548, 1500, 1020, 1498, 441, 549, 442, 443, - /* 1560 */ 1496, 445, 1723, 446, 548, 1494, 447, 451, 449, 450, - /* 1570 */ 1492, 1753, 453, 1481, 1480, 455, 1465, 454, 1784, 1552, - /* 1580 */ 1127, 283, 1754, 551, 1756, 1757, 547, 1753, 569, 1128, - /* 1590 */ 1784, 1551, 190, 142, 1754, 551, 1756, 1757, 547, 1771, - /* 1600 */ 569, 49, 1053, 1052, 1051, 616, 1050, 549, 1490, 618, - /* 1610 */ 1047, 312, 1723, 1046, 548, 1771, 1045, 1485, 313, 521, - /* 1620 */ 1483, 478, 314, 546, 1464, 481, 323, 483, 1723, 1463, - /* 1630 */ 548, 1462, 485, 487, 90, 1697, 1211, 53, 1911, 1753, - /* 1640 */ 1784, 1691, 136, 288, 1754, 551, 1756, 1757, 547, 494, - /* 1650 */ 569, 1678, 1676, 208, 1677, 1753, 1784, 495, 315, 287, - /* 1660 */ 1754, 551, 1756, 1757, 547, 500, 569, 1771, 1803, 1675, - /* 1670 */ 1674, 41, 15, 47, 16, 549, 23, 221, 1406, 222, - /* 1680 */ 1723, 214, 548, 1771, 1743, 216, 1390, 143, 220, 24, - /* 1690 */ 25, 549, 1383, 1363, 325, 74, 1723, 45, 548, 1362, - /* 1700 */ 13, 231, 46, 17, 147, 1753, 1423, 1418, 1784, 1412, - /* 1710 */ 327, 288, 1754, 551, 1756, 1757, 547, 1753, 569, 1417, - /* 1720 */ 321, 1422, 1421, 322, 1784, 10, 1325, 288, 1754, 551, - /* 1730 */ 1756, 1757, 547, 1771, 569, 19, 1298, 148, 31, 161, - /* 1740 */ 1281, 549, 1672, 1664, 1297, 1771, 1723, 12, 548, 20, - /* 1750 */ 550, 241, 557, 549, 1388, 21, 243, 248, 1723, 75, - /* 1760 */ 548, 250, 76, 1742, 252, 255, 1300, 1251, 80, 573, - /* 1770 */ 335, 1753, 1787, 577, 1784, 571, 568, 274, 1754, 551, - /* 1780 */ 1756, 1757, 547, 48, 569, 1114, 1784, 1753, 575, 275, - /* 1790 */ 1754, 551, 1756, 1757, 547, 1111, 569, 578, 1753, 1771, - /* 1800 */ 580, 583, 586, 1108, 1102, 1091, 581, 549, 584, 1106, - /* 1810 */ 1100, 587, 1723, 1105, 548, 1771, 1104, 1123, 81, 1103, - /* 1820 */ 257, 82, 593, 549, 1119, 1042, 1771, 602, 1723, 59, - /* 1830 */ 548, 1018, 605, 1040, 549, 1060, 258, 1035, 1039, 1723, - /* 1840 */ 1784, 548, 1038, 276, 1754, 551, 1756, 1757, 547, 1037, - /* 1850 */ 569, 1753, 1036, 1034, 1033, 1055, 1784, 1057, 1030, 282, - /* 1860 */ 1754, 551, 1756, 1757, 547, 1029, 569, 1784, 1753, 1028, - /* 1870 */ 284, 1754, 551, 1756, 1757, 547, 1497, 569, 1025, 1771, - /* 1880 */ 1024, 1023, 626, 627, 1495, 630, 631, 549, 628, 1493, - /* 1890 */ 632, 634, 1723, 1753, 548, 635, 1771, 636, 1491, 638, - /* 1900 */ 639, 640, 1479, 642, 549, 982, 1461, 261, 646, 1723, - /* 1910 */ 1753, 548, 1237, 269, 1436, 649, 650, 1436, 1436, 1436, - /* 1920 */ 1784, 1771, 1436, 277, 1754, 551, 1756, 1757, 547, 549, - /* 1930 */ 569, 1436, 1436, 1436, 1723, 1436, 548, 1784, 1771, 1436, - /* 1940 */ 285, 1754, 551, 1756, 1757, 547, 549, 569, 1436, 1436, - /* 1950 */ 1436, 1723, 1753, 548, 1436, 1436, 1436, 1436, 1436, 1436, - /* 1960 */ 1436, 1436, 1784, 1436, 1753, 278, 1754, 551, 1756, 1757, - /* 1970 */ 547, 1436, 569, 1436, 1436, 1436, 1436, 1436, 1436, 1784, - /* 1980 */ 1771, 1436, 286, 1754, 551, 1756, 1757, 547, 549, 569, - /* 1990 */ 1436, 1436, 1771, 1723, 1436, 548, 1436, 1436, 1436, 1436, - /* 2000 */ 549, 1436, 1436, 1436, 1436, 1723, 1436, 548, 1436, 1436, - /* 2010 */ 1436, 1436, 1436, 1436, 1753, 1436, 1436, 1436, 1436, 1436, - /* 2020 */ 1436, 1784, 1436, 1436, 279, 1754, 551, 1756, 1757, 547, - /* 2030 */ 1436, 569, 1753, 1784, 1436, 1436, 292, 1754, 551, 1756, - /* 2040 */ 1757, 547, 1771, 569, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2050 */ 549, 1436, 1436, 1436, 1436, 1723, 1436, 548, 1436, 1436, - /* 2060 */ 1771, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 549, 1436, - /* 2070 */ 1436, 1436, 1436, 1723, 1436, 548, 1436, 1436, 1436, 1436, - /* 2080 */ 1436, 1436, 1753, 1784, 1436, 1436, 293, 1754, 551, 1756, - /* 2090 */ 1757, 547, 1436, 569, 1753, 1436, 1436, 1436, 1436, 1436, - /* 2100 */ 1436, 1784, 1436, 1436, 1765, 1754, 551, 1756, 1757, 547, - /* 2110 */ 1771, 569, 1436, 1436, 1436, 1436, 1436, 1436, 549, 1436, - /* 2120 */ 1436, 1436, 1771, 1723, 1436, 548, 1436, 1436, 1436, 1436, - /* 2130 */ 549, 1436, 1436, 1436, 1436, 1723, 1436, 548, 1436, 1436, - /* 2140 */ 1436, 1436, 1436, 1436, 1436, 1436, 1753, 1436, 1436, 1436, - /* 2150 */ 1436, 1784, 1436, 1436, 1764, 1754, 551, 1756, 1757, 547, - /* 2160 */ 1436, 569, 1436, 1784, 1753, 1436, 1763, 1754, 551, 1756, - /* 2170 */ 1757, 547, 1436, 569, 1771, 1436, 1436, 1436, 1436, 1436, - /* 2180 */ 1436, 1436, 549, 1436, 1436, 1436, 1436, 1723, 1753, 548, - /* 2190 */ 1436, 1436, 1771, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2200 */ 549, 1436, 1436, 1436, 1436, 1723, 1753, 548, 1436, 1436, - /* 2210 */ 1436, 1436, 1436, 1436, 1436, 1784, 1771, 1436, 302, 1754, - /* 2220 */ 551, 1756, 1757, 547, 549, 569, 1436, 1436, 1436, 1723, - /* 2230 */ 1436, 548, 1436, 1784, 1771, 1436, 301, 1754, 551, 1756, - /* 2240 */ 1757, 547, 549, 569, 1436, 1436, 1436, 1723, 1436, 548, - /* 2250 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1784, 1436, 1753, - /* 2260 */ 303, 1754, 551, 1756, 1757, 547, 1436, 569, 1436, 1436, - /* 2270 */ 1436, 1436, 1436, 1436, 1436, 1784, 1436, 1436, 300, 1754, - /* 2280 */ 551, 1756, 1757, 547, 1436, 569, 1436, 1771, 1436, 1436, - /* 2290 */ 1436, 1436, 1436, 1436, 1436, 549, 1436, 1436, 1436, 1436, - /* 2300 */ 1723, 1436, 548, 1436, 33, 32, 1436, 1436, 40, 38, - /* 2310 */ 36, 35, 34, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2320 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1784, 1436, - /* 2330 */ 1436, 281, 1754, 551, 1756, 1757, 547, 1436, 569, 1436, - /* 2340 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2350 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2360 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2370 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2380 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2390 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2400 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2410 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2420 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2430 */ 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, - /* 2440 */ 1436, 1436, 1436, 1436, 1436, 1436, 137, + /* 0 */ 422, 1670, 423, 1475, 294, 1744, 1438, 430, 317, 423, + /* 10 */ 1475, 1563, 39, 37, 1505, 338, 1741, 69, 1619, 1621, + /* 20 */ 326, 1441, 1238, 1744, 1900, 1565, 334, 525, 373, 379, + /* 30 */ 115, 1674, 1775, 1313, 1741, 1236, 1741, 1899, 1552, 1569, + /* 40 */ 518, 1897, 101, 1737, 1743, 100, 99, 98, 97, 96, + /* 50 */ 95, 94, 93, 92, 570, 119, 1308, 987, 1757, 14, + /* 60 */ 61, 1737, 1743, 1737, 1743, 1244, 297, 343, 1900, 39, + /* 70 */ 37, 1376, 570, 439, 570, 474, 473, 326, 517, 1238, + /* 80 */ 472, 157, 1, 116, 469, 1897, 1775, 468, 467, 466, + /* 90 */ 1313, 1004, 1236, 1003, 528, 117, 439, 991, 992, 1727, + /* 100 */ 479, 548, 1380, 310, 649, 566, 458, 1900, 1262, 527, + /* 110 */ 153, 1842, 1843, 1308, 1847, 489, 14, 552, 1315, 1316, + /* 120 */ 157, 1005, 1244, 1550, 1897, 329, 412, 1788, 1671, 202, + /* 130 */ 88, 1758, 551, 1760, 1761, 547, 60, 570, 60, 2, + /* 140 */ 1834, 525, 210, 482, 319, 1830, 152, 476, 30, 240, + /* 150 */ 652, 311, 201, 309, 308, 140, 462, 1452, 156, 421, + /* 160 */ 464, 649, 425, 1239, 262, 1237, 1860, 43, 60, 119, + /* 170 */ 73, 330, 171, 170, 566, 1315, 1316, 55, 149, 138, + /* 180 */ 54, 604, 463, 642, 638, 634, 630, 260, 1576, 1242, + /* 190 */ 1243, 519, 1291, 1292, 1294, 1295, 1296, 1297, 1298, 544, + /* 200 */ 568, 1306, 1307, 1309, 1310, 1311, 1312, 1314, 1317, 117, + /* 210 */ 1263, 1669, 85, 1323, 294, 254, 372, 167, 371, 1262, + /* 220 */ 1239, 160, 1237, 427, 154, 1842, 1843, 1900, 1847, 1260, + /* 230 */ 1745, 33, 32, 504, 1263, 40, 38, 36, 35, 34, + /* 240 */ 158, 1741, 67, 525, 1897, 66, 1242, 1243, 563, 1291, + /* 250 */ 1292, 1294, 1295, 1296, 1297, 1298, 544, 568, 1306, 1307, + /* 260 */ 1309, 1310, 1311, 1312, 1314, 1317, 39, 37, 1737, 1743, + /* 270 */ 488, 119, 490, 1900, 326, 160, 1238, 160, 69, 570, + /* 280 */ 212, 1293, 300, 486, 60, 484, 157, 1313, 101, 1236, + /* 290 */ 1897, 100, 99, 98, 97, 96, 95, 94, 93, 92, + /* 300 */ 1570, 1211, 151, 205, 1900, 552, 1276, 160, 1136, 1137, + /* 310 */ 1308, 117, 1900, 14, 1335, 1613, 1672, 1898, 1262, 1244, + /* 320 */ 602, 1897, 566, 39, 37, 157, 155, 1842, 1843, 1897, + /* 330 */ 1847, 326, 604, 1238, 1502, 1004, 2, 1003, 1261, 129, + /* 340 */ 128, 599, 598, 597, 1313, 78, 1236, 1094, 593, 592, + /* 350 */ 591, 1098, 590, 1100, 1101, 589, 1103, 586, 649, 1109, + /* 360 */ 583, 1111, 1112, 580, 577, 1005, 1567, 1308, 1336, 36, + /* 370 */ 35, 34, 1315, 1316, 1664, 1463, 1244, 40, 38, 36, + /* 380 */ 35, 34, 33, 32, 42, 169, 40, 38, 36, 35, + /* 390 */ 34, 1341, 1293, 8, 541, 626, 625, 624, 341, 596, + /* 400 */ 623, 622, 621, 121, 616, 615, 614, 613, 612, 611, + /* 410 */ 610, 609, 131, 605, 141, 649, 1727, 1239, 1531, 1237, + /* 420 */ 33, 32, 1397, 160, 40, 38, 36, 35, 34, 1315, + /* 430 */ 1316, 1551, 29, 324, 1330, 1331, 1332, 1333, 1334, 1338, + /* 440 */ 1339, 1340, 600, 1242, 1243, 1617, 1291, 1292, 1294, 1295, + /* 450 */ 1296, 1297, 1298, 544, 568, 1306, 1307, 1309, 1310, 1311, + /* 460 */ 1312, 1314, 1317, 511, 1395, 1396, 1398, 1399, 1056, 567, + /* 470 */ 474, 473, 138, 1337, 1239, 472, 1237, 1264, 116, 469, + /* 480 */ 111, 1577, 468, 467, 466, 33, 32, 460, 1244, 40, + /* 490 */ 38, 36, 35, 34, 607, 1407, 1342, 1574, 1058, 1462, + /* 500 */ 1242, 1243, 203, 1291, 1292, 1294, 1295, 1296, 1297, 1298, + /* 510 */ 544, 568, 1306, 1307, 1309, 1310, 1311, 1312, 1314, 1317, + /* 520 */ 39, 37, 1318, 160, 1327, 602, 1620, 1621, 326, 1433, + /* 530 */ 1238, 567, 160, 471, 470, 189, 300, 27, 245, 246, + /* 540 */ 1727, 1313, 162, 1236, 129, 128, 599, 598, 597, 144, + /* 550 */ 1559, 525, 567, 1626, 456, 452, 448, 444, 188, 1574, + /* 560 */ 331, 71, 305, 111, 1308, 556, 1265, 336, 1335, 1624, + /* 570 */ 465, 11, 10, 1244, 339, 138, 497, 39, 37, 119, + /* 580 */ 1574, 1561, 138, 70, 1576, 326, 186, 1238, 33, 32, + /* 590 */ 9, 1576, 40, 38, 36, 35, 34, 84, 1313, 305, + /* 600 */ 1236, 529, 556, 1757, 567, 567, 464, 232, 1626, 1461, + /* 610 */ 120, 1460, 649, 1626, 567, 377, 378, 1432, 1566, 117, + /* 620 */ 337, 1308, 1336, 22, 1625, 382, 1315, 1316, 463, 1624, + /* 630 */ 1244, 1775, 1574, 1574, 230, 1842, 524, 1262, 523, 549, + /* 640 */ 1459, 1900, 1574, 364, 1727, 1341, 548, 9, 185, 178, + /* 650 */ 1727, 183, 1727, 1349, 159, 435, 33, 32, 1897, 514, + /* 660 */ 40, 38, 36, 35, 34, 366, 362, 429, 58, 649, + /* 670 */ 425, 1239, 1788, 1237, 176, 142, 1758, 551, 1760, 1761, + /* 680 */ 547, 1727, 570, 1315, 1316, 1549, 29, 324, 1330, 1331, + /* 690 */ 1332, 1333, 1334, 1338, 1339, 1340, 213, 1242, 1243, 1458, + /* 700 */ 1291, 1292, 1294, 1295, 1296, 1297, 1298, 544, 568, 1306, + /* 710 */ 1307, 1309, 1310, 1311, 1312, 1314, 1317, 1440, 267, 530, + /* 720 */ 1914, 1604, 567, 567, 567, 620, 618, 1557, 1239, 601, + /* 730 */ 1237, 1387, 1617, 397, 398, 438, 206, 520, 515, 1715, + /* 740 */ 1727, 110, 109, 108, 107, 106, 105, 104, 103, 102, + /* 750 */ 1574, 1574, 1574, 525, 1242, 1243, 543, 1291, 1292, 1294, + /* 760 */ 1295, 1296, 1297, 1298, 544, 568, 1306, 1307, 1309, 1310, + /* 770 */ 1311, 1312, 1314, 1317, 39, 37, 296, 1238, 1260, 602, + /* 780 */ 567, 119, 326, 567, 1238, 405, 352, 1457, 417, 1849, + /* 790 */ 1236, 1571, 1849, 595, 1703, 1313, 1373, 1236, 129, 128, + /* 800 */ 599, 598, 597, 529, 1456, 390, 567, 418, 1574, 392, + /* 810 */ 1293, 1574, 244, 1846, 991, 992, 1845, 498, 1308, 1453, + /* 820 */ 1244, 117, 567, 7, 1455, 1849, 1532, 1244, 1727, 1854, + /* 830 */ 1369, 1454, 194, 502, 1574, 192, 230, 1842, 524, 383, + /* 840 */ 523, 26, 235, 1900, 2, 1727, 533, 33, 32, 1844, + /* 850 */ 1574, 40, 38, 36, 35, 34, 157, 28, 512, 649, + /* 860 */ 1897, 44, 4, 33, 32, 1727, 649, 40, 38, 36, + /* 870 */ 35, 34, 1727, 457, 1219, 1220, 1451, 52, 501, 416, + /* 880 */ 1315, 1316, 411, 410, 409, 408, 407, 404, 403, 402, + /* 890 */ 401, 400, 396, 395, 394, 393, 387, 386, 385, 384, + /* 900 */ 1492, 381, 380, 531, 196, 567, 1450, 195, 567, 139, + /* 910 */ 536, 608, 1449, 1546, 273, 491, 564, 1727, 1239, 565, + /* 920 */ 1237, 198, 475, 200, 197, 1239, 199, 1237, 271, 57, + /* 930 */ 11, 10, 56, 1574, 33, 32, 1574, 1448, 40, 38, + /* 940 */ 36, 35, 34, 1757, 1242, 1243, 1447, 1727, 172, 1446, + /* 950 */ 1445, 1242, 1243, 1727, 1291, 1292, 1294, 1295, 1296, 1297, + /* 960 */ 1298, 544, 568, 1306, 1307, 1309, 1310, 1311, 1312, 1314, + /* 970 */ 1317, 1775, 567, 60, 567, 1435, 1436, 209, 1727, 549, + /* 980 */ 1444, 1487, 224, 256, 1727, 340, 548, 1727, 33, 32, + /* 990 */ 1727, 1727, 40, 38, 36, 35, 34, 1443, 1776, 619, + /* 1000 */ 1574, 529, 1574, 477, 1369, 72, 1747, 1247, 1246, 1276, + /* 1010 */ 50, 86, 1788, 217, 1372, 87, 1758, 551, 1760, 1761, + /* 1020 */ 547, 1727, 570, 1485, 1757, 1834, 1476, 33, 32, 299, + /* 1030 */ 1830, 40, 38, 36, 35, 34, 1481, 342, 1727, 367, + /* 1040 */ 1614, 1900, 1749, 534, 1757, 480, 64, 63, 376, 41, + /* 1050 */ 1394, 166, 1775, 219, 159, 41, 83, 370, 1897, 1864, + /* 1060 */ 549, 1028, 229, 526, 41, 1727, 80, 548, 242, 234, + /* 1070 */ 295, 237, 1775, 360, 123, 358, 354, 350, 163, 345, + /* 1080 */ 528, 239, 529, 3, 644, 1727, 5, 548, 126, 1343, + /* 1090 */ 344, 1029, 1260, 1788, 127, 1299, 87, 1758, 551, 1760, + /* 1100 */ 1761, 547, 50, 570, 1187, 347, 1834, 351, 247, 537, + /* 1110 */ 299, 1830, 160, 1788, 559, 306, 88, 1758, 551, 1760, + /* 1120 */ 1761, 547, 1900, 570, 1056, 307, 1834, 1203, 253, 263, + /* 1130 */ 319, 1830, 152, 575, 1087, 157, 1757, 1250, 1249, 1897, + /* 1140 */ 126, 127, 266, 112, 126, 399, 1666, 168, 406, 414, + /* 1150 */ 413, 415, 1861, 419, 1266, 420, 428, 1269, 432, 431, + /* 1160 */ 175, 177, 1268, 433, 1775, 1270, 434, 1267, 180, 137, + /* 1170 */ 436, 182, 549, 1115, 437, 184, 68, 1727, 440, 548, + /* 1180 */ 1119, 1126, 459, 1124, 130, 187, 461, 91, 1564, 191, + /* 1190 */ 1560, 298, 1708, 193, 132, 133, 1562, 1558, 264, 1757, + /* 1200 */ 134, 204, 135, 492, 493, 1788, 207, 316, 88, 1758, + /* 1210 */ 551, 1760, 1761, 547, 496, 570, 499, 503, 1834, 1265, + /* 1220 */ 211, 513, 319, 1830, 1913, 1875, 1757, 1775, 1865, 508, + /* 1230 */ 555, 510, 1874, 1868, 215, 549, 333, 332, 218, 318, + /* 1240 */ 1727, 516, 548, 6, 509, 522, 1252, 1856, 223, 507, + /* 1250 */ 228, 146, 506, 1369, 1775, 225, 118, 1313, 1264, 1245, + /* 1260 */ 320, 538, 549, 1850, 18, 124, 535, 1727, 1788, 548, + /* 1270 */ 125, 88, 1758, 551, 1760, 1761, 547, 226, 570, 227, + /* 1280 */ 1308, 1834, 553, 554, 1707, 319, 1830, 1913, 1815, 1244, + /* 1290 */ 1676, 1896, 557, 328, 561, 1788, 1891, 1757, 88, 1758, + /* 1300 */ 551, 1760, 1761, 547, 1916, 570, 532, 233, 1834, 539, + /* 1310 */ 236, 560, 319, 1830, 1913, 238, 265, 251, 562, 77, + /* 1320 */ 249, 1575, 79, 1853, 268, 1775, 573, 259, 571, 1547, + /* 1330 */ 1618, 645, 646, 549, 648, 145, 270, 272, 1727, 1721, + /* 1340 */ 548, 289, 291, 290, 1720, 62, 1719, 346, 1716, 348, + /* 1350 */ 349, 51, 1231, 1232, 164, 529, 353, 1714, 355, 356, + /* 1360 */ 357, 1713, 1757, 359, 1712, 361, 1788, 1711, 1710, 280, + /* 1370 */ 1758, 551, 1760, 1761, 547, 363, 570, 365, 1693, 165, + /* 1380 */ 368, 369, 1206, 1205, 1687, 1686, 374, 1253, 375, 1248, + /* 1390 */ 1775, 1685, 1684, 1175, 1659, 1900, 1658, 1657, 549, 65, + /* 1400 */ 1656, 1655, 1654, 1727, 1653, 548, 1652, 388, 159, 389, + /* 1410 */ 1651, 1650, 1897, 1256, 391, 1649, 1648, 1647, 1646, 1645, + /* 1420 */ 529, 1644, 1643, 1642, 568, 1306, 1307, 1309, 1310, 1311, + /* 1430 */ 1312, 1788, 1641, 1757, 280, 1758, 551, 1760, 1761, 547, + /* 1440 */ 1640, 570, 1639, 1638, 1637, 122, 1636, 1635, 1634, 1633, + /* 1450 */ 1632, 1631, 1177, 1630, 1629, 1757, 173, 49, 424, 113, + /* 1460 */ 1900, 1775, 1628, 1627, 1504, 1472, 994, 150, 1471, 549, + /* 1470 */ 114, 993, 426, 157, 1727, 174, 548, 1897, 1701, 1695, + /* 1480 */ 1683, 181, 1682, 1775, 179, 1668, 1553, 1022, 1503, 1501, + /* 1490 */ 441, 549, 1499, 1497, 445, 1495, 1727, 1484, 548, 443, + /* 1500 */ 447, 1483, 1788, 1468, 449, 89, 1758, 551, 1760, 1761, + /* 1510 */ 547, 451, 570, 442, 446, 1834, 453, 450, 1757, 1833, + /* 1520 */ 1830, 454, 455, 1555, 1788, 190, 1130, 89, 1758, 551, + /* 1530 */ 1760, 1761, 547, 1129, 570, 1554, 1757, 1834, 1493, 1055, + /* 1540 */ 1054, 540, 1830, 1053, 1052, 617, 1775, 1049, 1048, 619, + /* 1550 */ 1047, 312, 1488, 313, 546, 1486, 478, 481, 314, 1727, + /* 1560 */ 1467, 548, 483, 1466, 1775, 485, 1465, 487, 90, 1700, + /* 1570 */ 1694, 494, 549, 1681, 1213, 53, 136, 1727, 495, 548, + /* 1580 */ 208, 1679, 1680, 1678, 315, 1677, 41, 1788, 15, 1757, + /* 1590 */ 287, 1758, 551, 1760, 1761, 547, 545, 570, 542, 1806, + /* 1600 */ 23, 47, 221, 1409, 216, 1788, 214, 143, 89, 1758, + /* 1610 */ 551, 1760, 1761, 547, 220, 570, 1393, 1775, 1834, 24, + /* 1620 */ 222, 1747, 74, 1831, 1386, 549, 231, 500, 45, 25, + /* 1630 */ 1727, 46, 548, 16, 1366, 147, 1365, 1426, 17, 1415, + /* 1640 */ 1421, 1420, 321, 1757, 505, 10, 1425, 1424, 322, 148, + /* 1650 */ 1301, 19, 1284, 31, 1757, 1300, 1675, 1667, 1788, 12, + /* 1660 */ 1328, 288, 1758, 551, 1760, 1761, 547, 161, 570, 20, + /* 1670 */ 250, 1775, 21, 1746, 241, 550, 1391, 1223, 243, 549, + /* 1680 */ 248, 255, 1775, 13, 1727, 1303, 548, 1254, 574, 80, + /* 1690 */ 549, 75, 558, 252, 572, 1727, 76, 548, 1791, 569, + /* 1700 */ 48, 1093, 1116, 335, 576, 578, 1113, 579, 581, 1110, + /* 1710 */ 582, 1757, 1788, 584, 585, 283, 1758, 551, 1760, 1761, + /* 1720 */ 547, 1104, 570, 1788, 1102, 587, 142, 1758, 551, 1760, + /* 1730 */ 1761, 547, 1757, 570, 588, 1108, 594, 81, 1125, 1775, + /* 1740 */ 1107, 82, 1106, 1105, 59, 257, 1121, 549, 1020, 1044, + /* 1750 */ 1062, 603, 1727, 521, 548, 606, 258, 1042, 1041, 1037, + /* 1760 */ 1775, 1040, 1039, 1038, 1036, 1035, 323, 1057, 546, 1059, + /* 1770 */ 1032, 1915, 1500, 1727, 1757, 548, 1031, 1030, 1027, 1026, + /* 1780 */ 1788, 1025, 627, 288, 1758, 551, 1760, 1761, 547, 629, + /* 1790 */ 570, 1498, 628, 631, 633, 632, 1496, 1757, 635, 636, + /* 1800 */ 637, 1788, 1775, 1494, 287, 1758, 551, 1760, 1761, 547, + /* 1810 */ 549, 570, 639, 1807, 640, 1727, 1482, 548, 641, 643, + /* 1820 */ 984, 1464, 261, 647, 1439, 1775, 1240, 269, 650, 325, + /* 1830 */ 651, 1439, 1439, 549, 1439, 1439, 1439, 1439, 1727, 1439, + /* 1840 */ 548, 1439, 1439, 1788, 1439, 1439, 288, 1758, 551, 1760, + /* 1850 */ 1761, 547, 327, 570, 1757, 1439, 1439, 1439, 1439, 1439, + /* 1860 */ 1439, 1439, 1439, 1439, 1439, 1757, 1788, 1439, 1439, 288, + /* 1870 */ 1758, 551, 1760, 1761, 547, 1439, 570, 1439, 1439, 1757, + /* 1880 */ 1439, 1439, 1775, 1439, 1439, 1439, 1439, 1439, 1439, 1439, + /* 1890 */ 549, 1439, 1439, 1775, 1439, 1727, 1439, 548, 1439, 1439, + /* 1900 */ 1439, 549, 1439, 1439, 1439, 1439, 1727, 1775, 548, 1439, + /* 1910 */ 1439, 1439, 1439, 1439, 1439, 549, 1439, 1439, 1439, 1439, + /* 1920 */ 1727, 1757, 548, 1788, 1439, 1439, 274, 1758, 551, 1760, + /* 1930 */ 1761, 547, 1439, 570, 1788, 1757, 1439, 275, 1758, 551, + /* 1940 */ 1760, 1761, 547, 1439, 570, 1439, 1757, 1439, 1788, 1775, + /* 1950 */ 1439, 276, 1758, 551, 1760, 1761, 547, 549, 570, 1439, + /* 1960 */ 1439, 1439, 1727, 1775, 548, 1439, 1439, 1439, 1439, 1439, + /* 1970 */ 1439, 549, 1439, 1439, 1775, 1439, 1727, 1439, 548, 1439, + /* 1980 */ 1439, 1439, 549, 1439, 1439, 1439, 1439, 1727, 1757, 548, + /* 1990 */ 1788, 1439, 1439, 282, 1758, 551, 1760, 1761, 547, 1439, + /* 2000 */ 570, 1439, 1439, 1439, 1788, 1439, 1439, 284, 1758, 551, + /* 2010 */ 1760, 1761, 547, 1439, 570, 1788, 1775, 1439, 277, 1758, + /* 2020 */ 551, 1760, 1761, 547, 549, 570, 1439, 1439, 1439, 1727, + /* 2030 */ 1757, 548, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, + /* 2040 */ 1439, 1757, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, + /* 2050 */ 1439, 1439, 1439, 1757, 1439, 1439, 1439, 1788, 1775, 1439, + /* 2060 */ 285, 1758, 551, 1760, 1761, 547, 549, 570, 1439, 1775, + /* 2070 */ 1439, 1727, 1439, 548, 1439, 1439, 1439, 549, 1439, 1439, + /* 2080 */ 1439, 1775, 1727, 1439, 548, 1439, 1439, 1439, 1439, 549, + /* 2090 */ 1439, 1439, 1439, 1439, 1727, 1439, 548, 1439, 1439, 1788, + /* 2100 */ 1439, 1439, 278, 1758, 551, 1760, 1761, 547, 1757, 570, + /* 2110 */ 1788, 1439, 1439, 286, 1758, 551, 1760, 1761, 547, 1439, + /* 2120 */ 570, 1439, 1788, 1439, 1439, 279, 1758, 551, 1760, 1761, + /* 2130 */ 547, 1439, 570, 1439, 1439, 1757, 1775, 1439, 1439, 1439, + /* 2140 */ 1439, 1439, 1439, 1439, 549, 1439, 1439, 1439, 1439, 1727, + /* 2150 */ 1439, 548, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, + /* 2160 */ 1439, 1439, 1757, 1775, 1439, 1439, 1439, 1439, 1439, 1439, + /* 2170 */ 1439, 549, 1439, 1439, 1439, 1439, 1727, 1788, 548, 1439, + /* 2180 */ 292, 1758, 551, 1760, 1761, 547, 1439, 570, 1439, 1757, + /* 2190 */ 1775, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 549, 1439, + /* 2200 */ 1439, 1439, 1439, 1727, 1788, 548, 1439, 293, 1758, 551, + /* 2210 */ 1760, 1761, 547, 1439, 570, 1439, 1439, 1775, 1439, 1439, + /* 2220 */ 1439, 1439, 1439, 1439, 1439, 549, 1439, 1439, 1439, 1439, + /* 2230 */ 1727, 1788, 548, 1439, 1769, 1758, 551, 1760, 1761, 547, + /* 2240 */ 1439, 570, 1439, 1757, 1439, 1439, 1439, 1439, 1439, 1439, + /* 2250 */ 1439, 1439, 1757, 1439, 1439, 1439, 1439, 1439, 1788, 1439, + /* 2260 */ 1439, 1768, 1758, 551, 1760, 1761, 547, 1439, 570, 1439, + /* 2270 */ 1757, 1775, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 549, + /* 2280 */ 1775, 1439, 1439, 1439, 1727, 1439, 548, 1439, 549, 1439, + /* 2290 */ 1439, 1439, 1439, 1727, 1439, 548, 1439, 1439, 1775, 1439, + /* 2300 */ 1439, 1439, 1439, 1439, 1439, 1439, 549, 1439, 1439, 1439, + /* 2310 */ 1439, 1727, 1788, 548, 1439, 1767, 1758, 551, 1760, 1761, + /* 2320 */ 547, 1788, 570, 1757, 303, 1758, 551, 1760, 1761, 547, + /* 2330 */ 1439, 570, 1439, 1439, 1439, 1439, 1439, 1757, 1439, 1788, + /* 2340 */ 1439, 1439, 302, 1758, 551, 1760, 1761, 547, 1439, 570, + /* 2350 */ 1439, 1775, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 549, + /* 2360 */ 1439, 1439, 1439, 1439, 1727, 1775, 548, 1439, 1439, 1439, + /* 2370 */ 1439, 1439, 1439, 549, 1439, 1439, 1439, 1439, 1727, 1439, + /* 2380 */ 548, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, + /* 2390 */ 1439, 1757, 1788, 1439, 1439, 304, 1758, 551, 1760, 1761, + /* 2400 */ 547, 1439, 570, 1439, 1439, 1439, 1788, 1439, 1439, 301, + /* 2410 */ 1758, 551, 1760, 1761, 547, 1439, 570, 1439, 1439, 1775, + /* 2420 */ 1439, 1439, 1439, 1439, 1439, 1439, 1439, 549, 1439, 1439, + /* 2430 */ 1439, 1439, 1727, 1439, 548, 1439, 1439, 1439, 1439, 1439, + /* 2440 */ 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, + /* 2450 */ 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, + /* 2460 */ 1788, 1439, 1439, 281, 1758, 551, 1760, 1761, 547, 1439, + /* 2470 */ 570, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 257, 0, 259, 260, 280, 283, 250, 257, 286, 259, - /* 10 */ 260, 4, 12, 13, 0, 292, 294, 293, 295, 296, - /* 20 */ 20, 0, 22, 283, 351, 283, 286, 261, 311, 261, - /* 30 */ 20, 20, 281, 33, 294, 35, 294, 364, 336, 337, - /* 40 */ 289, 368, 21, 321, 322, 24, 25, 26, 27, 28, - /* 50 */ 29, 30, 31, 32, 332, 289, 56, 4, 253, 59, - /* 60 */ 4, 321, 322, 321, 322, 65, 298, 311, 351, 12, - /* 70 */ 13, 14, 332, 58, 332, 61, 62, 20, 327, 22, - /* 80 */ 66, 364, 82, 69, 70, 368, 281, 73, 74, 75, - /* 90 */ 33, 20, 35, 22, 289, 329, 14, 44, 45, 294, - /* 100 */ 273, 296, 20, 252, 104, 254, 35, 351, 281, 343, - /* 110 */ 344, 345, 346, 56, 348, 56, 59, 290, 118, 119, - /* 120 */ 364, 50, 65, 0, 368, 295, 296, 322, 118, 119, - /* 130 */ 325, 326, 327, 328, 329, 330, 14, 332, 82, 82, - /* 140 */ 335, 82, 20, 84, 339, 340, 341, 24, 25, 26, - /* 150 */ 27, 28, 29, 30, 31, 32, 266, 263, 353, 35, - /* 160 */ 270, 104, 0, 163, 20, 165, 361, 12, 13, 14, - /* 170 */ 15, 16, 61, 62, 20, 118, 119, 66, 284, 258, - /* 180 */ 69, 70, 261, 114, 73, 74, 75, 187, 188, 65, - /* 190 */ 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - /* 200 */ 200, 201, 202, 203, 204, 205, 206, 20, 8, 9, - /* 210 */ 296, 14, 12, 13, 14, 15, 16, 20, 304, 219, - /* 220 */ 163, 307, 165, 61, 62, 63, 64, 220, 66, 67, - /* 230 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 240 */ 78, 79, 173, 174, 187, 188, 39, 190, 191, 192, + /* 0 */ 259, 308, 261, 262, 311, 285, 252, 259, 288, 261, + /* 10 */ 262, 284, 12, 13, 0, 294, 296, 267, 297, 298, + /* 20 */ 20, 0, 22, 285, 353, 285, 288, 263, 313, 263, + /* 30 */ 280, 0, 283, 33, 296, 35, 296, 366, 0, 289, + /* 40 */ 291, 370, 21, 323, 324, 24, 25, 26, 27, 28, + /* 50 */ 29, 30, 31, 32, 334, 291, 56, 4, 255, 59, + /* 60 */ 4, 323, 324, 323, 324, 65, 300, 313, 353, 12, + /* 70 */ 13, 14, 334, 58, 334, 61, 62, 20, 329, 22, + /* 80 */ 66, 366, 82, 69, 70, 370, 283, 73, 74, 75, + /* 90 */ 33, 20, 35, 22, 291, 331, 58, 44, 45, 296, + /* 100 */ 4, 298, 14, 37, 104, 20, 35, 353, 20, 345, + /* 110 */ 346, 347, 348, 56, 350, 19, 59, 298, 118, 119, + /* 120 */ 366, 50, 65, 0, 370, 306, 76, 324, 309, 33, + /* 130 */ 327, 328, 329, 330, 331, 332, 82, 334, 82, 82, + /* 140 */ 337, 263, 56, 47, 341, 342, 343, 51, 338, 339, + /* 150 */ 19, 85, 56, 87, 88, 254, 90, 256, 355, 260, + /* 160 */ 94, 104, 263, 163, 33, 165, 363, 82, 82, 291, + /* 170 */ 84, 275, 122, 123, 20, 118, 119, 81, 47, 283, + /* 180 */ 84, 58, 116, 52, 53, 54, 55, 56, 292, 189, + /* 190 */ 190, 20, 192, 193, 194, 195, 196, 197, 198, 199, + /* 200 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 331, + /* 210 */ 20, 308, 81, 14, 311, 84, 162, 56, 164, 20, + /* 220 */ 163, 221, 165, 14, 346, 347, 348, 353, 350, 20, + /* 230 */ 285, 8, 9, 313, 20, 12, 13, 14, 15, 16, + /* 240 */ 366, 296, 81, 263, 370, 84, 189, 190, 117, 192, /* 250 */ 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - /* 260 */ 203, 204, 205, 206, 12, 13, 351, 82, 20, 82, - /* 270 */ 281, 187, 20, 191, 22, 219, 20, 288, 219, 364, - /* 280 */ 76, 56, 269, 368, 271, 33, 297, 35, 95, 96, - /* 290 */ 97, 98, 99, 100, 101, 102, 103, 104, 105, 58, - /* 300 */ 107, 108, 109, 110, 111, 112, 81, 351, 56, 84, - /* 310 */ 37, 59, 228, 229, 230, 231, 232, 65, 94, 22, - /* 320 */ 364, 12, 13, 253, 368, 261, 122, 123, 82, 20, - /* 330 */ 82, 22, 35, 21, 82, 0, 272, 113, 114, 115, - /* 340 */ 116, 117, 33, 279, 35, 20, 34, 162, 36, 164, - /* 350 */ 65, 281, 20, 289, 22, 155, 104, 158, 85, 289, - /* 360 */ 87, 88, 65, 90, 294, 56, 296, 94, 267, 268, - /* 370 */ 118, 119, 258, 20, 65, 261, 311, 178, 179, 8, - /* 380 */ 9, 311, 50, 12, 13, 14, 15, 16, 191, 116, - /* 390 */ 265, 82, 322, 58, 253, 325, 326, 327, 328, 329, - /* 400 */ 330, 104, 332, 278, 219, 335, 219, 289, 261, 339, - /* 410 */ 340, 263, 287, 104, 43, 163, 351, 165, 300, 272, - /* 420 */ 253, 351, 281, 65, 276, 218, 279, 118, 119, 364, - /* 430 */ 289, 113, 284, 368, 364, 294, 289, 296, 368, 187, - /* 440 */ 188, 241, 190, 191, 192, 193, 194, 195, 196, 197, - /* 450 */ 198, 199, 200, 201, 202, 203, 204, 205, 206, 20, - /* 460 */ 163, 294, 165, 322, 261, 219, 325, 326, 327, 328, - /* 470 */ 329, 330, 163, 332, 165, 150, 335, 43, 273, 296, - /* 480 */ 339, 340, 341, 311, 187, 188, 281, 93, 1, 2, - /* 490 */ 307, 350, 289, 175, 176, 290, 187, 188, 3, 190, - /* 500 */ 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - /* 510 */ 201, 202, 203, 204, 205, 206, 12, 13, 14, 14, - /* 520 */ 15, 16, 261, 351, 20, 82, 22, 261, 219, 0, - /* 530 */ 19, 261, 329, 282, 265, 92, 364, 33, 272, 35, - /* 540 */ 368, 0, 272, 253, 33, 281, 281, 344, 345, 346, - /* 550 */ 289, 348, 261, 288, 148, 289, 287, 261, 47, 289, - /* 560 */ 56, 297, 297, 52, 53, 54, 55, 56, 272, 65, - /* 570 */ 83, 273, 311, 12, 13, 253, 261, 48, 145, 281, - /* 580 */ 289, 20, 261, 22, 294, 289, 82, 272, 290, 150, - /* 590 */ 329, 253, 81, 272, 33, 84, 35, 113, 114, 58, - /* 600 */ 254, 168, 311, 281, 289, 344, 345, 346, 104, 348, - /* 610 */ 289, 289, 351, 261, 315, 253, 294, 56, 296, 0, - /* 620 */ 329, 282, 118, 119, 272, 364, 65, 282, 117, 368, - /* 630 */ 224, 225, 294, 311, 253, 344, 345, 346, 43, 348, - /* 640 */ 207, 289, 351, 82, 322, 43, 253, 325, 326, 327, - /* 650 */ 328, 329, 330, 323, 332, 364, 294, 335, 174, 368, - /* 660 */ 149, 339, 340, 267, 268, 104, 47, 163, 282, 165, - /* 670 */ 253, 253, 238, 351, 281, 294, 253, 347, 83, 118, - /* 680 */ 119, 170, 289, 172, 281, 83, 364, 294, 253, 296, - /* 690 */ 368, 187, 188, 290, 190, 191, 192, 193, 194, 195, - /* 700 */ 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - /* 710 */ 206, 294, 294, 261, 323, 322, 261, 294, 325, 326, - /* 720 */ 327, 328, 329, 330, 163, 332, 165, 272, 335, 294, - /* 730 */ 253, 236, 339, 340, 341, 270, 283, 306, 347, 253, - /* 740 */ 309, 289, 253, 350, 289, 253, 253, 294, 187, 188, - /* 750 */ 282, 190, 191, 192, 193, 194, 195, 196, 197, 198, - /* 760 */ 199, 200, 201, 202, 203, 204, 205, 206, 12, 13, - /* 770 */ 18, 294, 20, 282, 321, 322, 20, 261, 22, 27, - /* 780 */ 294, 329, 30, 294, 282, 332, 294, 294, 272, 33, - /* 790 */ 253, 35, 291, 44, 45, 294, 344, 345, 346, 47, - /* 800 */ 348, 49, 362, 51, 2, 289, 323, 43, 253, 253, - /* 810 */ 8, 9, 56, 2, 12, 13, 14, 15, 16, 8, - /* 820 */ 9, 65, 371, 12, 13, 14, 15, 16, 253, 253, - /* 830 */ 347, 294, 20, 81, 261, 261, 8, 9, 82, 94, - /* 840 */ 12, 13, 14, 15, 16, 272, 272, 8, 9, 294, - /* 850 */ 294, 12, 13, 14, 15, 16, 281, 59, 253, 262, - /* 860 */ 104, 116, 289, 289, 289, 306, 217, 218, 309, 294, - /* 870 */ 294, 296, 0, 121, 118, 119, 124, 125, 126, 127, - /* 880 */ 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - /* 890 */ 138, 139, 140, 141, 22, 143, 144, 322, 59, 294, - /* 900 */ 325, 326, 327, 328, 329, 330, 261, 332, 318, 261, - /* 910 */ 335, 83, 261, 261, 339, 340, 341, 272, 358, 163, - /* 920 */ 272, 165, 83, 272, 272, 291, 42, 43, 294, 274, - /* 930 */ 91, 43, 277, 262, 289, 86, 361, 289, 89, 281, - /* 940 */ 289, 289, 86, 187, 188, 89, 190, 191, 192, 193, - /* 950 */ 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - /* 960 */ 204, 205, 206, 18, 86, 150, 151, 89, 23, 21, - /* 970 */ 261, 83, 24, 25, 26, 27, 28, 29, 30, 31, - /* 980 */ 32, 272, 37, 38, 145, 187, 41, 86, 8, 9, - /* 990 */ 89, 0, 12, 13, 14, 15, 16, 253, 289, 0, - /* 1000 */ 118, 119, 57, 191, 240, 43, 56, 168, 1, 2, - /* 1010 */ 35, 8, 9, 22, 35, 12, 13, 14, 15, 16, - /* 1020 */ 43, 22, 46, 260, 43, 281, 293, 82, 43, 324, - /* 1030 */ 349, 35, 342, 289, 84, 43, 352, 43, 294, 0, - /* 1040 */ 296, 43, 365, 365, 365, 83, 207, 208, 209, 210, - /* 1050 */ 211, 212, 213, 214, 215, 216, 43, 43, 82, 43, - /* 1060 */ 83, 65, 59, 83, 83, 120, 322, 221, 83, 325, - /* 1070 */ 326, 327, 328, 329, 330, 83, 332, 83, 320, 335, - /* 1080 */ 261, 83, 20, 339, 340, 47, 319, 35, 267, 4, - /* 1090 */ 161, 313, 261, 261, 91, 42, 83, 83, 43, 83, - /* 1100 */ 155, 156, 157, 43, 19, 160, 253, 0, 301, 145, - /* 1110 */ 43, 166, 299, 299, 12, 13, 261, 20, 33, 255, - /* 1120 */ 255, 20, 177, 317, 22, 180, 265, 182, 183, 184, - /* 1130 */ 185, 186, 47, 94, 281, 33, 51, 35, 83, 296, - /* 1140 */ 165, 56, 289, 83, 165, 265, 20, 294, 145, 296, - /* 1150 */ 83, 310, 113, 114, 115, 116, 117, 20, 56, 312, - /* 1160 */ 265, 310, 265, 20, 219, 302, 81, 65, 265, 84, - /* 1170 */ 265, 168, 261, 265, 255, 322, 317, 281, 325, 326, - /* 1180 */ 327, 328, 329, 330, 294, 332, 261, 281, 335, 255, - /* 1190 */ 281, 281, 339, 340, 341, 281, 281, 253, 281, 281, - /* 1200 */ 263, 94, 281, 350, 281, 281, 104, 171, 316, 296, - /* 1210 */ 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - /* 1220 */ 113, 114, 115, 116, 117, 281, 263, 33, 261, 261, - /* 1230 */ 310, 20, 263, 289, 294, 227, 324, 226, 294, 233, - /* 1240 */ 296, 47, 357, 305, 357, 294, 52, 53, 54, 55, - /* 1250 */ 56, 305, 294, 294, 360, 311, 8, 9, 154, 359, - /* 1260 */ 12, 13, 14, 15, 16, 163, 322, 165, 235, 325, - /* 1270 */ 326, 327, 328, 329, 330, 81, 332, 234, 84, 8, - /* 1280 */ 9, 253, 356, 12, 13, 14, 15, 16, 357, 187, - /* 1290 */ 355, 222, 320, 354, 218, 351, 20, 323, 289, 367, - /* 1300 */ 198, 199, 200, 201, 202, 203, 204, 239, 364, 281, - /* 1310 */ 237, 82, 368, 366, 242, 372, 367, 289, 366, 294, - /* 1320 */ 367, 366, 294, 305, 296, 338, 294, 305, 294, 294, - /* 1330 */ 147, 83, 303, 253, 294, 294, 289, 263, 277, 311, - /* 1340 */ 146, 147, 263, 149, 302, 289, 82, 153, 285, 271, - /* 1350 */ 322, 294, 261, 325, 326, 327, 328, 329, 330, 263, - /* 1360 */ 332, 281, 36, 314, 256, 255, 172, 309, 275, 289, - /* 1370 */ 275, 251, 0, 275, 294, 264, 296, 0, 42, 351, - /* 1380 */ 0, 73, 0, 35, 181, 253, 35, 35, 35, 181, - /* 1390 */ 0, 35, 364, 35, 181, 0, 368, 181, 0, 35, - /* 1400 */ 0, 253, 322, 22, 0, 325, 326, 327, 328, 329, - /* 1410 */ 330, 35, 332, 281, 0, 335, 167, 82, 168, 339, - /* 1420 */ 340, 289, 165, 163, 0, 0, 294, 158, 296, 281, - /* 1430 */ 0, 159, 0, 46, 0, 0, 0, 289, 142, 0, - /* 1440 */ 0, 0, 294, 0, 296, 0, 137, 35, 0, 137, - /* 1450 */ 0, 253, 42, 0, 322, 0, 0, 325, 326, 327, - /* 1460 */ 328, 329, 330, 331, 332, 333, 334, 253, 0, 0, - /* 1470 */ 322, 0, 0, 325, 326, 327, 328, 329, 330, 281, - /* 1480 */ 332, 0, 0, 0, 0, 0, 0, 289, 0, 0, - /* 1490 */ 0, 0, 294, 0, 296, 281, 0, 22, 0, 0, - /* 1500 */ 0, 0, 0, 289, 0, 42, 39, 46, 294, 253, - /* 1510 */ 296, 14, 46, 43, 0, 0, 40, 369, 370, 14, - /* 1520 */ 322, 253, 308, 325, 326, 327, 328, 329, 330, 0, - /* 1530 */ 332, 39, 0, 335, 39, 0, 322, 281, 340, 325, - /* 1540 */ 326, 327, 328, 329, 330, 289, 332, 154, 0, 281, - /* 1550 */ 294, 0, 296, 0, 60, 0, 35, 289, 47, 39, - /* 1560 */ 0, 35, 294, 47, 296, 0, 39, 39, 35, 47, - /* 1570 */ 0, 253, 35, 0, 0, 39, 0, 47, 322, 0, - /* 1580 */ 22, 325, 326, 327, 328, 329, 330, 253, 332, 35, - /* 1590 */ 322, 0, 89, 325, 326, 327, 328, 329, 330, 281, - /* 1600 */ 332, 91, 35, 35, 35, 43, 35, 289, 0, 43, - /* 1610 */ 35, 22, 294, 35, 296, 281, 35, 0, 22, 363, - /* 1620 */ 0, 49, 22, 289, 0, 35, 308, 35, 294, 0, - /* 1630 */ 296, 0, 35, 22, 20, 0, 35, 150, 370, 253, - /* 1640 */ 322, 0, 169, 325, 326, 327, 328, 329, 330, 22, - /* 1650 */ 332, 0, 0, 147, 0, 253, 322, 150, 150, 325, - /* 1660 */ 326, 327, 328, 329, 330, 152, 332, 281, 334, 0, - /* 1670 */ 0, 43, 223, 43, 223, 289, 82, 43, 83, 46, - /* 1680 */ 294, 82, 296, 281, 46, 83, 83, 82, 82, 82, - /* 1690 */ 43, 289, 83, 83, 308, 82, 294, 217, 296, 83, - /* 1700 */ 223, 46, 43, 43, 46, 253, 83, 35, 322, 83, - /* 1710 */ 308, 325, 326, 327, 328, 329, 330, 253, 332, 35, - /* 1720 */ 35, 35, 35, 35, 322, 2, 187, 325, 326, 327, - /* 1730 */ 328, 329, 330, 281, 332, 43, 83, 46, 82, 46, - /* 1740 */ 22, 289, 0, 0, 83, 281, 294, 82, 296, 82, - /* 1750 */ 189, 83, 148, 289, 83, 82, 82, 82, 294, 82, - /* 1760 */ 296, 39, 82, 46, 146, 46, 83, 22, 92, 35, - /* 1770 */ 35, 253, 82, 35, 322, 93, 82, 325, 326, 327, - /* 1780 */ 328, 329, 330, 82, 332, 83, 322, 253, 82, 325, - /* 1790 */ 326, 327, 328, 329, 330, 83, 332, 82, 253, 281, - /* 1800 */ 35, 35, 35, 83, 83, 22, 82, 289, 82, 106, - /* 1810 */ 83, 82, 294, 106, 296, 281, 106, 35, 82, 106, - /* 1820 */ 43, 82, 94, 289, 22, 35, 281, 59, 294, 82, - /* 1830 */ 296, 60, 80, 35, 289, 65, 43, 22, 35, 294, - /* 1840 */ 322, 296, 35, 325, 326, 327, 328, 329, 330, 35, - /* 1850 */ 332, 253, 35, 35, 35, 35, 322, 65, 35, 325, - /* 1860 */ 326, 327, 328, 329, 330, 35, 332, 322, 253, 35, - /* 1870 */ 325, 326, 327, 328, 329, 330, 0, 332, 35, 281, - /* 1880 */ 35, 35, 35, 47, 0, 35, 47, 289, 39, 0, - /* 1890 */ 39, 35, 294, 253, 296, 47, 281, 39, 0, 35, - /* 1900 */ 47, 39, 0, 35, 289, 35, 0, 22, 21, 294, - /* 1910 */ 253, 296, 22, 22, 373, 21, 20, 373, 373, 373, - /* 1920 */ 322, 281, 373, 325, 326, 327, 328, 329, 330, 289, - /* 1930 */ 332, 373, 373, 373, 294, 373, 296, 322, 281, 373, - /* 1940 */ 325, 326, 327, 328, 329, 330, 289, 332, 373, 373, - /* 1950 */ 373, 294, 253, 296, 373, 373, 373, 373, 373, 373, - /* 1960 */ 373, 373, 322, 373, 253, 325, 326, 327, 328, 329, - /* 1970 */ 330, 373, 332, 373, 373, 373, 373, 373, 373, 322, - /* 1980 */ 281, 373, 325, 326, 327, 328, 329, 330, 289, 332, - /* 1990 */ 373, 373, 281, 294, 373, 296, 373, 373, 373, 373, - /* 2000 */ 289, 373, 373, 373, 373, 294, 373, 296, 373, 373, - /* 2010 */ 373, 373, 373, 373, 253, 373, 373, 373, 373, 373, - /* 2020 */ 373, 322, 373, 373, 325, 326, 327, 328, 329, 330, - /* 2030 */ 373, 332, 253, 322, 373, 373, 325, 326, 327, 328, - /* 2040 */ 329, 330, 281, 332, 373, 373, 373, 373, 373, 373, - /* 2050 */ 289, 373, 373, 373, 373, 294, 373, 296, 373, 373, - /* 2060 */ 281, 373, 373, 373, 373, 373, 373, 373, 289, 373, - /* 2070 */ 373, 373, 373, 294, 373, 296, 373, 373, 373, 373, - /* 2080 */ 373, 373, 253, 322, 373, 373, 325, 326, 327, 328, - /* 2090 */ 329, 330, 373, 332, 253, 373, 373, 373, 373, 373, - /* 2100 */ 373, 322, 373, 373, 325, 326, 327, 328, 329, 330, - /* 2110 */ 281, 332, 373, 373, 373, 373, 373, 373, 289, 373, - /* 2120 */ 373, 373, 281, 294, 373, 296, 373, 373, 373, 373, - /* 2130 */ 289, 373, 373, 373, 373, 294, 373, 296, 373, 373, - /* 2140 */ 373, 373, 373, 373, 373, 373, 253, 373, 373, 373, - /* 2150 */ 373, 322, 373, 373, 325, 326, 327, 328, 329, 330, - /* 2160 */ 373, 332, 373, 322, 253, 373, 325, 326, 327, 328, - /* 2170 */ 329, 330, 373, 332, 281, 373, 373, 373, 373, 373, - /* 2180 */ 373, 373, 289, 373, 373, 373, 373, 294, 253, 296, - /* 2190 */ 373, 373, 281, 373, 373, 373, 373, 373, 373, 373, - /* 2200 */ 289, 373, 373, 373, 373, 294, 253, 296, 373, 373, - /* 2210 */ 373, 373, 373, 373, 373, 322, 281, 373, 325, 326, - /* 2220 */ 327, 328, 329, 330, 289, 332, 373, 373, 373, 294, - /* 2230 */ 373, 296, 373, 322, 281, 373, 325, 326, 327, 328, - /* 2240 */ 329, 330, 289, 332, 373, 373, 373, 294, 373, 296, - /* 2250 */ 373, 373, 373, 373, 373, 373, 373, 322, 373, 253, - /* 2260 */ 325, 326, 327, 328, 329, 330, 373, 332, 373, 373, - /* 2270 */ 373, 373, 373, 373, 373, 322, 373, 373, 325, 326, - /* 2280 */ 327, 328, 329, 330, 373, 332, 373, 281, 373, 373, - /* 2290 */ 373, 373, 373, 373, 373, 289, 373, 373, 373, 373, - /* 2300 */ 294, 373, 296, 373, 8, 9, 373, 373, 12, 13, - /* 2310 */ 14, 15, 16, 373, 373, 373, 373, 373, 373, 373, - /* 2320 */ 373, 373, 373, 373, 373, 373, 373, 373, 322, 373, - /* 2330 */ 373, 325, 326, 327, 328, 329, 330, 373, 332, 373, - /* 2340 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2350 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2360 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2370 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2380 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2390 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2400 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2410 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2420 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2430 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2440 */ 373, 373, 373, 373, 373, 373, 150, 373, 373, 373, - /* 2450 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2460 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2470 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2480 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2490 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2500 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2510 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2520 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2530 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2540 */ 373, 373, 373, 373, 373, 373, 373, 373, 373, 373, - /* 2550 */ 373, 373, 373, 373, 373, + /* 260 */ 203, 204, 205, 206, 207, 208, 12, 13, 323, 324, + /* 270 */ 21, 291, 313, 353, 20, 221, 22, 221, 267, 334, + /* 280 */ 149, 193, 59, 34, 82, 36, 366, 33, 21, 35, + /* 290 */ 370, 24, 25, 26, 27, 28, 29, 30, 31, 32, + /* 300 */ 289, 170, 282, 172, 353, 298, 83, 221, 118, 119, + /* 310 */ 56, 331, 353, 59, 91, 295, 309, 366, 20, 65, + /* 320 */ 94, 370, 20, 12, 13, 366, 346, 347, 348, 370, + /* 330 */ 350, 20, 58, 22, 0, 20, 82, 22, 20, 113, + /* 340 */ 114, 115, 116, 117, 33, 265, 35, 95, 96, 97, + /* 350 */ 98, 99, 100, 101, 102, 103, 104, 105, 104, 107, + /* 360 */ 108, 109, 110, 111, 112, 50, 286, 56, 145, 14, + /* 370 */ 15, 16, 118, 119, 291, 255, 65, 12, 13, 14, + /* 380 */ 15, 16, 8, 9, 82, 302, 12, 13, 14, 15, + /* 390 */ 16, 168, 193, 82, 59, 61, 62, 63, 64, 93, + /* 400 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + /* 410 */ 76, 77, 78, 79, 268, 104, 296, 163, 272, 165, + /* 420 */ 8, 9, 189, 221, 12, 13, 14, 15, 16, 118, + /* 430 */ 119, 0, 209, 210, 211, 212, 213, 214, 215, 216, + /* 440 */ 217, 218, 293, 189, 190, 296, 192, 193, 194, 195, + /* 450 */ 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + /* 460 */ 206, 207, 208, 230, 231, 232, 233, 234, 35, 263, + /* 470 */ 61, 62, 283, 145, 163, 66, 165, 20, 69, 70, + /* 480 */ 274, 292, 73, 74, 75, 8, 9, 281, 65, 12, + /* 490 */ 13, 14, 15, 16, 65, 83, 168, 291, 65, 255, + /* 500 */ 189, 190, 114, 192, 193, 194, 195, 196, 197, 198, + /* 510 */ 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + /* 520 */ 12, 13, 14, 221, 189, 94, 297, 298, 20, 155, + /* 530 */ 22, 263, 221, 269, 270, 33, 59, 209, 113, 114, + /* 540 */ 296, 33, 274, 35, 113, 114, 115, 116, 117, 47, + /* 550 */ 284, 263, 263, 283, 52, 53, 54, 55, 56, 291, + /* 560 */ 290, 173, 174, 274, 56, 177, 20, 275, 91, 299, + /* 570 */ 281, 1, 2, 65, 275, 283, 317, 12, 13, 291, + /* 580 */ 291, 284, 283, 81, 292, 20, 84, 22, 8, 9, + /* 590 */ 82, 292, 12, 13, 14, 15, 16, 265, 33, 174, + /* 600 */ 35, 313, 177, 255, 263, 263, 94, 150, 283, 255, + /* 610 */ 278, 255, 104, 283, 263, 274, 274, 243, 286, 331, + /* 620 */ 290, 56, 145, 43, 299, 274, 118, 119, 116, 299, + /* 630 */ 65, 283, 291, 291, 346, 347, 348, 20, 350, 291, + /* 640 */ 255, 353, 291, 158, 296, 168, 298, 82, 146, 147, + /* 650 */ 296, 149, 296, 83, 366, 153, 8, 9, 370, 148, + /* 660 */ 12, 13, 14, 15, 16, 180, 181, 260, 3, 104, + /* 670 */ 263, 163, 324, 165, 172, 327, 328, 329, 330, 331, + /* 680 */ 332, 296, 334, 118, 119, 0, 209, 210, 211, 212, + /* 690 */ 213, 214, 215, 216, 217, 218, 150, 189, 190, 255, + /* 700 */ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + /* 710 */ 202, 203, 204, 205, 206, 207, 208, 0, 276, 371, + /* 720 */ 372, 279, 263, 263, 263, 269, 270, 284, 163, 293, + /* 730 */ 165, 83, 296, 274, 274, 274, 284, 226, 227, 0, + /* 740 */ 296, 24, 25, 26, 27, 28, 29, 30, 31, 32, + /* 750 */ 291, 291, 291, 263, 189, 190, 284, 192, 193, 194, + /* 760 */ 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + /* 770 */ 205, 206, 207, 208, 12, 13, 18, 22, 20, 94, + /* 780 */ 263, 291, 20, 263, 22, 27, 47, 255, 30, 325, + /* 790 */ 35, 274, 325, 284, 274, 33, 4, 35, 113, 114, + /* 800 */ 115, 116, 117, 313, 255, 47, 263, 49, 291, 51, + /* 810 */ 193, 291, 113, 349, 44, 45, 349, 274, 56, 256, + /* 820 */ 65, 331, 263, 39, 255, 325, 272, 65, 296, 219, + /* 830 */ 220, 255, 86, 274, 291, 89, 346, 347, 348, 81, + /* 840 */ 350, 2, 373, 353, 82, 296, 43, 8, 9, 349, + /* 850 */ 291, 12, 13, 14, 15, 16, 366, 2, 364, 104, + /* 860 */ 370, 42, 43, 8, 9, 296, 104, 12, 13, 14, + /* 870 */ 15, 16, 296, 264, 175, 176, 255, 150, 151, 121, + /* 880 */ 118, 119, 124, 125, 126, 127, 128, 129, 130, 131, + /* 890 */ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + /* 900 */ 0, 143, 144, 238, 86, 263, 255, 89, 263, 18, + /* 910 */ 43, 271, 255, 273, 23, 320, 274, 296, 163, 274, + /* 920 */ 165, 86, 22, 86, 89, 163, 89, 165, 37, 38, + /* 930 */ 1, 2, 41, 291, 8, 9, 291, 255, 12, 13, + /* 940 */ 14, 15, 16, 255, 189, 190, 255, 296, 57, 255, + /* 950 */ 255, 189, 190, 296, 192, 193, 194, 195, 196, 197, + /* 960 */ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + /* 970 */ 208, 283, 263, 82, 263, 118, 119, 56, 296, 291, + /* 980 */ 255, 0, 360, 274, 296, 274, 298, 296, 8, 9, + /* 990 */ 296, 296, 12, 13, 14, 15, 16, 255, 283, 43, + /* 1000 */ 291, 313, 291, 22, 220, 84, 46, 35, 35, 83, + /* 1010 */ 43, 120, 324, 43, 222, 327, 328, 329, 330, 331, + /* 1020 */ 332, 296, 334, 0, 255, 337, 262, 8, 9, 341, + /* 1030 */ 342, 12, 13, 14, 15, 16, 0, 264, 296, 83, + /* 1040 */ 295, 353, 82, 240, 255, 22, 155, 156, 157, 43, + /* 1050 */ 83, 160, 283, 83, 366, 43, 82, 166, 370, 326, + /* 1060 */ 291, 35, 344, 351, 43, 296, 92, 298, 43, 367, + /* 1070 */ 179, 367, 283, 182, 43, 184, 185, 186, 187, 188, + /* 1080 */ 291, 367, 313, 354, 48, 296, 223, 298, 43, 83, + /* 1090 */ 322, 65, 20, 324, 43, 83, 327, 328, 329, 330, + /* 1100 */ 331, 332, 43, 334, 83, 263, 337, 47, 83, 242, + /* 1110 */ 341, 342, 221, 324, 83, 321, 327, 328, 329, 330, + /* 1120 */ 331, 332, 353, 334, 35, 269, 337, 161, 83, 315, + /* 1130 */ 341, 342, 343, 43, 83, 366, 255, 165, 165, 370, + /* 1140 */ 43, 43, 83, 43, 43, 263, 263, 42, 303, 145, + /* 1150 */ 301, 301, 363, 263, 20, 257, 257, 20, 298, 319, + /* 1160 */ 267, 267, 20, 312, 283, 20, 314, 20, 267, 150, + /* 1170 */ 312, 267, 291, 83, 304, 267, 267, 296, 263, 298, + /* 1180 */ 83, 83, 257, 83, 83, 267, 283, 263, 283, 283, + /* 1190 */ 283, 257, 296, 283, 283, 283, 283, 283, 319, 255, + /* 1200 */ 283, 265, 283, 171, 318, 324, 265, 312, 327, 328, + /* 1210 */ 329, 330, 331, 332, 298, 334, 263, 263, 337, 20, + /* 1220 */ 265, 229, 341, 342, 343, 359, 255, 283, 326, 296, + /* 1230 */ 228, 296, 359, 352, 307, 291, 12, 13, 307, 296, + /* 1240 */ 296, 296, 298, 235, 237, 154, 22, 362, 361, 236, + /* 1250 */ 322, 359, 224, 220, 283, 358, 291, 33, 20, 35, + /* 1260 */ 244, 241, 291, 325, 82, 307, 239, 296, 324, 298, + /* 1270 */ 307, 327, 328, 329, 330, 331, 332, 357, 334, 356, + /* 1280 */ 56, 337, 296, 296, 296, 341, 342, 343, 340, 65, + /* 1290 */ 296, 369, 296, 296, 305, 324, 352, 255, 327, 328, + /* 1300 */ 329, 330, 331, 332, 374, 334, 369, 368, 337, 369, + /* 1310 */ 368, 147, 341, 342, 343, 368, 279, 265, 304, 265, + /* 1320 */ 291, 291, 82, 352, 263, 283, 287, 265, 104, 273, + /* 1330 */ 296, 36, 258, 291, 257, 311, 266, 253, 296, 0, + /* 1340 */ 298, 277, 277, 277, 0, 42, 0, 73, 0, 35, + /* 1350 */ 183, 316, 35, 35, 35, 313, 183, 0, 35, 35, + /* 1360 */ 183, 0, 255, 183, 0, 35, 324, 0, 0, 327, + /* 1370 */ 328, 329, 330, 331, 332, 22, 334, 35, 0, 82, + /* 1380 */ 168, 167, 165, 163, 0, 0, 159, 163, 158, 165, + /* 1390 */ 283, 0, 0, 46, 0, 353, 0, 0, 291, 142, + /* 1400 */ 0, 0, 0, 296, 0, 298, 0, 137, 366, 35, + /* 1410 */ 0, 0, 370, 189, 137, 0, 0, 0, 0, 0, + /* 1420 */ 313, 0, 0, 0, 200, 201, 202, 203, 204, 205, + /* 1430 */ 206, 324, 0, 255, 327, 328, 329, 330, 331, 332, + /* 1440 */ 0, 334, 0, 0, 0, 42, 0, 0, 0, 0, + /* 1450 */ 0, 0, 22, 0, 0, 255, 42, 91, 46, 39, + /* 1460 */ 353, 283, 0, 0, 0, 0, 14, 43, 0, 291, + /* 1470 */ 39, 14, 46, 366, 296, 40, 298, 370, 0, 0, + /* 1480 */ 0, 154, 0, 283, 39, 0, 0, 60, 0, 0, + /* 1490 */ 35, 291, 0, 0, 35, 0, 296, 0, 298, 39, + /* 1500 */ 39, 0, 324, 0, 35, 327, 328, 329, 330, 331, + /* 1510 */ 332, 39, 334, 47, 47, 337, 35, 47, 255, 341, + /* 1520 */ 342, 47, 39, 0, 324, 89, 35, 327, 328, 329, + /* 1530 */ 330, 331, 332, 22, 334, 0, 255, 337, 0, 35, + /* 1540 */ 35, 341, 342, 35, 35, 43, 283, 35, 35, 43, + /* 1550 */ 35, 22, 0, 22, 291, 0, 49, 35, 22, 296, + /* 1560 */ 0, 298, 35, 0, 283, 35, 0, 22, 20, 0, + /* 1570 */ 0, 22, 291, 0, 35, 150, 169, 296, 150, 298, + /* 1580 */ 147, 0, 0, 0, 150, 0, 43, 324, 225, 255, + /* 1590 */ 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + /* 1600 */ 82, 43, 43, 83, 83, 324, 82, 82, 327, 328, + /* 1610 */ 329, 330, 331, 332, 82, 334, 83, 283, 337, 82, + /* 1620 */ 46, 46, 82, 342, 83, 291, 46, 152, 219, 43, + /* 1630 */ 296, 43, 298, 225, 83, 46, 83, 83, 43, 83, + /* 1640 */ 35, 35, 35, 255, 310, 2, 35, 35, 35, 46, + /* 1650 */ 83, 43, 22, 82, 255, 83, 0, 0, 324, 82, + /* 1660 */ 189, 327, 328, 329, 330, 331, 332, 46, 334, 82, + /* 1670 */ 39, 283, 82, 46, 83, 191, 83, 178, 82, 291, + /* 1680 */ 82, 46, 283, 225, 296, 83, 298, 22, 35, 92, + /* 1690 */ 291, 82, 148, 146, 93, 296, 82, 298, 82, 82, + /* 1700 */ 82, 22, 83, 35, 82, 35, 83, 82, 35, 83, + /* 1710 */ 82, 255, 324, 35, 82, 327, 328, 329, 330, 331, + /* 1720 */ 332, 83, 334, 324, 83, 35, 327, 328, 329, 330, + /* 1730 */ 331, 332, 255, 334, 82, 106, 94, 82, 35, 283, + /* 1740 */ 106, 82, 106, 106, 82, 43, 22, 291, 60, 35, + /* 1750 */ 65, 59, 296, 365, 298, 80, 43, 35, 35, 22, + /* 1760 */ 283, 35, 35, 35, 35, 35, 310, 35, 291, 65, + /* 1770 */ 35, 372, 0, 296, 255, 298, 35, 35, 35, 35, + /* 1780 */ 324, 35, 35, 327, 328, 329, 330, 331, 332, 39, + /* 1790 */ 334, 0, 47, 35, 39, 47, 0, 255, 35, 47, + /* 1800 */ 39, 324, 283, 0, 327, 328, 329, 330, 331, 332, + /* 1810 */ 291, 334, 35, 336, 47, 296, 0, 298, 39, 35, + /* 1820 */ 35, 0, 22, 21, 375, 283, 22, 22, 21, 310, + /* 1830 */ 20, 375, 375, 291, 375, 375, 375, 375, 296, 375, + /* 1840 */ 298, 375, 375, 324, 375, 375, 327, 328, 329, 330, + /* 1850 */ 331, 332, 310, 334, 255, 375, 375, 375, 375, 375, + /* 1860 */ 375, 375, 375, 375, 375, 255, 324, 375, 375, 327, + /* 1870 */ 328, 329, 330, 331, 332, 375, 334, 375, 375, 255, + /* 1880 */ 375, 375, 283, 375, 375, 375, 375, 375, 375, 375, + /* 1890 */ 291, 375, 375, 283, 375, 296, 375, 298, 375, 375, + /* 1900 */ 375, 291, 375, 375, 375, 375, 296, 283, 298, 375, + /* 1910 */ 375, 375, 375, 375, 375, 291, 375, 375, 375, 375, + /* 1920 */ 296, 255, 298, 324, 375, 375, 327, 328, 329, 330, + /* 1930 */ 331, 332, 375, 334, 324, 255, 375, 327, 328, 329, + /* 1940 */ 330, 331, 332, 375, 334, 375, 255, 375, 324, 283, + /* 1950 */ 375, 327, 328, 329, 330, 331, 332, 291, 334, 375, + /* 1960 */ 375, 375, 296, 283, 298, 375, 375, 375, 375, 375, + /* 1970 */ 375, 291, 375, 375, 283, 375, 296, 375, 298, 375, + /* 1980 */ 375, 375, 291, 375, 375, 375, 375, 296, 255, 298, + /* 1990 */ 324, 375, 375, 327, 328, 329, 330, 331, 332, 375, + /* 2000 */ 334, 375, 375, 375, 324, 375, 375, 327, 328, 329, + /* 2010 */ 330, 331, 332, 375, 334, 324, 283, 375, 327, 328, + /* 2020 */ 329, 330, 331, 332, 291, 334, 375, 375, 375, 296, + /* 2030 */ 255, 298, 375, 375, 375, 375, 375, 375, 375, 375, + /* 2040 */ 375, 255, 375, 375, 375, 375, 375, 375, 375, 375, + /* 2050 */ 375, 375, 375, 255, 375, 375, 375, 324, 283, 375, + /* 2060 */ 327, 328, 329, 330, 331, 332, 291, 334, 375, 283, + /* 2070 */ 375, 296, 375, 298, 375, 375, 375, 291, 375, 375, + /* 2080 */ 375, 283, 296, 375, 298, 375, 375, 375, 375, 291, + /* 2090 */ 375, 375, 375, 375, 296, 375, 298, 375, 375, 324, + /* 2100 */ 375, 375, 327, 328, 329, 330, 331, 332, 255, 334, + /* 2110 */ 324, 375, 375, 327, 328, 329, 330, 331, 332, 375, + /* 2120 */ 334, 375, 324, 375, 375, 327, 328, 329, 330, 331, + /* 2130 */ 332, 375, 334, 375, 375, 255, 283, 375, 375, 375, + /* 2140 */ 375, 375, 375, 375, 291, 375, 375, 375, 375, 296, + /* 2150 */ 375, 298, 375, 375, 375, 375, 375, 375, 375, 375, + /* 2160 */ 375, 375, 255, 283, 375, 375, 375, 375, 375, 375, + /* 2170 */ 375, 291, 375, 375, 375, 375, 296, 324, 298, 375, + /* 2180 */ 327, 328, 329, 330, 331, 332, 375, 334, 375, 255, + /* 2190 */ 283, 375, 375, 375, 375, 375, 375, 375, 291, 375, + /* 2200 */ 375, 375, 375, 296, 324, 298, 375, 327, 328, 329, + /* 2210 */ 330, 331, 332, 375, 334, 375, 375, 283, 375, 375, + /* 2220 */ 375, 375, 375, 375, 375, 291, 375, 375, 375, 375, + /* 2230 */ 296, 324, 298, 375, 327, 328, 329, 330, 331, 332, + /* 2240 */ 375, 334, 375, 255, 375, 375, 375, 375, 375, 375, + /* 2250 */ 375, 375, 255, 375, 375, 375, 375, 375, 324, 375, + /* 2260 */ 375, 327, 328, 329, 330, 331, 332, 375, 334, 375, + /* 2270 */ 255, 283, 375, 375, 375, 375, 375, 375, 375, 291, + /* 2280 */ 283, 375, 375, 375, 296, 375, 298, 375, 291, 375, + /* 2290 */ 375, 375, 375, 296, 375, 298, 375, 375, 283, 375, + /* 2300 */ 375, 375, 375, 375, 375, 375, 291, 375, 375, 375, + /* 2310 */ 375, 296, 324, 298, 375, 327, 328, 329, 330, 331, + /* 2320 */ 332, 324, 334, 255, 327, 328, 329, 330, 331, 332, + /* 2330 */ 375, 334, 375, 375, 375, 375, 375, 255, 375, 324, + /* 2340 */ 375, 375, 327, 328, 329, 330, 331, 332, 375, 334, + /* 2350 */ 375, 283, 375, 375, 375, 375, 375, 375, 375, 291, + /* 2360 */ 375, 375, 375, 375, 296, 283, 298, 375, 375, 375, + /* 2370 */ 375, 375, 375, 291, 375, 375, 375, 375, 296, 375, + /* 2380 */ 298, 375, 375, 375, 375, 375, 375, 375, 375, 375, + /* 2390 */ 375, 255, 324, 375, 375, 327, 328, 329, 330, 331, + /* 2400 */ 332, 375, 334, 375, 375, 375, 324, 375, 375, 327, + /* 2410 */ 328, 329, 330, 331, 332, 375, 334, 375, 375, 283, + /* 2420 */ 375, 375, 375, 375, 375, 375, 375, 291, 375, 375, + /* 2430 */ 375, 375, 296, 375, 298, 375, 375, 375, 375, 375, + /* 2440 */ 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, + /* 2450 */ 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, + /* 2460 */ 324, 375, 375, 327, 328, 329, 330, 331, 332, 375, + /* 2470 */ 334, }; -#define YY_SHIFT_COUNT (651) +#define YY_SHIFT_COUNT (652) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2296) +#define YY_SHIFT_MAX (1821) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 945, 0, 0, 57, 57, 252, 252, 252, 309, 309, - /* 10 */ 252, 252, 504, 561, 756, 561, 561, 561, 561, 561, - /* 20 */ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, - /* 30 */ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, - /* 40 */ 561, 561, 187, 187, 248, 248, 248, 1102, 1102, 1102, - /* 50 */ 1102, 185, 59, 246, 11, 11, 53, 53, 56, 10, - /* 60 */ 246, 246, 11, 11, 11, 11, 11, 11, 11, 11, - /* 70 */ 15, 11, 11, 11, 144, 154, 256, 11, 11, 256, - /* 80 */ 11, 256, 256, 256, 11, 241, 752, 839, 1003, 1003, - /* 90 */ 948, 111, 297, 297, 297, 297, 297, 297, 297, 297, - /* 100 */ 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, - /* 110 */ 297, 273, 10, 122, 122, 335, 124, 325, 325, 325, - /* 120 */ 541, 124, 353, 154, 1, 1, 256, 256, 285, 285, - /* 130 */ 394, 358, 193, 193, 193, 193, 193, 193, 193, 511, - /* 140 */ 21, 14, 200, 84, 71, 69, 406, 82, 197, 332, - /* 150 */ 749, 745, 439, 649, 207, 649, 884, 495, 495, 495, - /* 160 */ 7, 812, 846, 1062, 1038, 1052, 929, 1062, 1062, 1053, - /* 170 */ 964, 964, 1062, 1097, 1097, 1101, 15, 154, 15, 1126, - /* 180 */ 1137, 15, 1126, 15, 1143, 15, 15, 1062, 15, 1097, - /* 190 */ 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, - /* 200 */ 256, 1062, 1097, 285, 1101, 241, 1036, 154, 241, 1062, - /* 210 */ 1062, 1126, 241, 1211, 285, 1008, 1011, 285, 1008, 1011, - /* 220 */ 285, 285, 256, 1006, 1104, 1008, 1033, 1043, 1069, 846, - /* 230 */ 1076, 353, 1276, 1068, 1073, 1072, 1068, 1073, 1068, 1073, - /* 240 */ 1229, 1011, 285, 285, 285, 285, 285, 1011, 285, 1183, - /* 250 */ 353, 1143, 241, 394, 241, 353, 1264, 285, 358, 1062, - /* 260 */ 241, 1326, 1097, 2447, 2447, 2447, 2447, 2447, 2447, 2447, - /* 270 */ 162, 1194, 123, 1085, 980, 371, 1248, 802, 811, 2296, - /* 280 */ 828, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1039, - /* 290 */ 1107, 224, 155, 155, 199, 225, 204, 312, 487, 433, - /* 300 */ 505, 505, 505, 505, 318, 484, 619, 595, 849, 856, - /* 310 */ 878, 901, 872, 991, 999, 950, 815, 602, 888, 1007, - /* 320 */ 882, 434, 764, 962, 798, 977, 976, 981, 985, 992, - /* 330 */ 994, 998, 975, 979, 1013, 1014, 1016, 1055, 1060, 1067, - /* 340 */ 443, 996, 529, 1372, 1377, 1336, 1380, 1308, 1382, 1348, - /* 350 */ 1203, 1351, 1352, 1353, 1208, 1390, 1356, 1358, 1213, 1395, - /* 360 */ 1216, 1398, 1364, 1400, 1381, 1404, 1376, 1414, 1335, 1250, - /* 370 */ 1249, 1257, 1260, 1424, 1425, 1272, 1269, 1430, 1432, 1387, - /* 380 */ 1434, 1435, 1436, 1296, 1439, 1440, 1441, 1443, 1445, 1309, - /* 390 */ 1412, 1448, 1312, 1450, 1455, 1456, 1468, 1469, 1471, 1472, - /* 400 */ 1481, 1482, 1483, 1484, 1485, 1486, 1488, 1410, 1453, 1489, - /* 410 */ 1490, 1491, 1493, 1496, 1475, 1498, 1499, 1500, 1501, 1502, - /* 420 */ 1504, 1463, 1467, 1470, 1497, 1461, 1505, 1466, 1514, 1476, - /* 430 */ 1492, 1515, 1529, 1532, 1495, 1393, 1535, 1548, 1551, 1494, - /* 440 */ 1553, 1555, 1521, 1511, 1520, 1560, 1526, 1516, 1527, 1565, - /* 450 */ 1533, 1522, 1528, 1570, 1537, 1530, 1536, 1573, 1574, 1576, - /* 460 */ 1579, 1510, 1503, 1554, 1558, 1591, 1567, 1568, 1569, 1571, - /* 470 */ 1562, 1566, 1575, 1578, 1581, 1608, 1589, 1617, 1596, 1572, - /* 480 */ 1620, 1600, 1590, 1624, 1592, 1629, 1597, 1631, 1611, 1614, - /* 490 */ 1635, 1487, 1601, 1641, 1473, 1627, 1507, 1506, 1651, 1652, - /* 500 */ 1508, 1513, 1654, 1669, 1670, 1628, 1449, 1594, 1595, 1599, - /* 510 */ 1602, 1630, 1603, 1605, 1606, 1607, 1609, 1634, 1633, 1638, - /* 520 */ 1613, 1647, 1451, 1610, 1616, 1655, 1480, 1659, 1658, 1623, - /* 530 */ 1660, 1477, 1626, 1672, 1684, 1685, 1686, 1687, 1688, 1626, - /* 540 */ 1723, 1539, 1692, 1653, 1656, 1661, 1691, 1665, 1667, 1693, - /* 550 */ 1718, 1561, 1673, 1668, 1671, 1674, 1742, 1675, 1604, 1677, - /* 560 */ 1743, 1722, 1618, 1680, 1676, 1717, 1719, 1690, 1683, 1694, - /* 570 */ 1745, 1701, 1682, 1702, 1734, 1735, 1706, 1712, 1738, 1715, - /* 580 */ 1720, 1765, 1724, 1721, 1766, 1726, 1727, 1767, 1729, 1703, - /* 590 */ 1707, 1710, 1713, 1783, 1728, 1736, 1739, 1782, 1747, 1777, - /* 600 */ 1777, 1802, 1771, 1768, 1790, 1770, 1752, 1793, 1798, 1803, - /* 610 */ 1807, 1814, 1817, 1815, 1818, 1819, 1792, 1562, 1820, 1566, - /* 620 */ 1823, 1830, 1834, 1843, 1845, 1846, 1876, 1847, 1836, 1849, - /* 630 */ 1884, 1850, 1839, 1851, 1889, 1856, 1848, 1858, 1898, 1864, - /* 640 */ 1853, 1862, 1902, 1868, 1870, 1906, 1885, 1887, 1890, 1891, - /* 650 */ 1894, 1896, + /* 0 */ 891, 0, 0, 57, 57, 254, 254, 254, 311, 311, + /* 10 */ 254, 254, 508, 565, 762, 565, 565, 565, 565, 565, + /* 20 */ 565, 565, 565, 565, 565, 565, 565, 565, 565, 565, + /* 30 */ 565, 565, 565, 565, 565, 565, 565, 565, 565, 565, + /* 40 */ 565, 565, 302, 302, 85, 85, 85, 1224, 1224, 1224, + /* 50 */ 1224, 54, 86, 202, 154, 154, 53, 53, 56, 190, + /* 60 */ 202, 202, 154, 154, 154, 154, 154, 154, 154, 154, + /* 70 */ 15, 154, 154, 154, 171, 214, 298, 154, 154, 298, + /* 80 */ 154, 298, 298, 298, 154, 274, 758, 223, 477, 477, + /* 90 */ 267, 409, 755, 755, 755, 755, 755, 755, 755, 755, + /* 100 */ 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, + /* 110 */ 755, 66, 190, 209, 209, 38, 433, 457, 457, 457, + /* 120 */ 123, 433, 318, 214, 31, 31, 298, 298, 423, 423, + /* 130 */ 306, 429, 252, 252, 252, 252, 252, 252, 252, 131, + /* 140 */ 21, 14, 374, 233, 71, 388, 511, 88, 199, 315, + /* 150 */ 770, 512, 546, 610, 784, 610, 819, 665, 665, 665, + /* 160 */ 792, 617, 863, 1072, 1060, 1089, 966, 1072, 1072, 1105, + /* 170 */ 1004, 1004, 1072, 1134, 1134, 1137, 15, 214, 15, 1142, + /* 180 */ 1145, 15, 1142, 15, 1147, 15, 15, 1072, 15, 1134, + /* 190 */ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + /* 200 */ 298, 1072, 1134, 423, 1137, 274, 1032, 214, 274, 1072, + /* 210 */ 1072, 1142, 274, 1199, 423, 992, 1002, 423, 992, 1002, + /* 220 */ 423, 423, 298, 1008, 1091, 992, 1007, 1013, 1028, 863, + /* 230 */ 1033, 318, 1238, 1020, 1027, 1016, 1020, 1027, 1020, 1027, + /* 240 */ 1182, 1002, 423, 423, 423, 423, 423, 1002, 423, 1164, + /* 250 */ 318, 1147, 274, 306, 274, 318, 1240, 423, 429, 1072, + /* 260 */ 274, 1295, 1134, 2471, 2471, 2471, 2471, 2471, 2471, 2471, + /* 270 */ 334, 502, 717, 96, 412, 580, 648, 839, 855, 1019, + /* 280 */ 926, 980, 980, 980, 980, 980, 980, 980, 980, 431, + /* 290 */ 685, 226, 365, 365, 425, 485, 161, 50, 249, 570, + /* 300 */ 328, 355, 355, 355, 355, 699, 739, 956, 746, 818, + /* 310 */ 835, 837, 900, 981, 1023, 921, 727, 967, 970, 929, + /* 320 */ 857, 803, 867, 1006, 335, 1012, 960, 1021, 1025, 1031, + /* 330 */ 1045, 1051, 972, 973, 1059, 1090, 1097, 1098, 1100, 1101, + /* 340 */ 974, 1026, 1036, 1339, 1344, 1303, 1346, 1274, 1348, 1314, + /* 350 */ 1167, 1317, 1318, 1319, 1173, 1357, 1323, 1324, 1177, 1361, + /* 360 */ 1180, 1364, 1330, 1367, 1353, 1368, 1342, 1378, 1297, 1212, + /* 370 */ 1214, 1217, 1220, 1384, 1385, 1227, 1230, 1391, 1392, 1347, + /* 380 */ 1394, 1396, 1397, 1257, 1400, 1401, 1402, 1404, 1406, 1270, + /* 390 */ 1374, 1410, 1277, 1411, 1415, 1416, 1417, 1418, 1419, 1421, + /* 400 */ 1422, 1423, 1432, 1440, 1442, 1443, 1444, 1403, 1446, 1447, + /* 410 */ 1448, 1449, 1450, 1451, 1430, 1453, 1454, 1462, 1463, 1464, + /* 420 */ 1465, 1414, 1420, 1424, 1452, 1412, 1457, 1426, 1468, 1435, + /* 430 */ 1431, 1478, 1479, 1480, 1445, 1327, 1482, 1485, 1486, 1427, + /* 440 */ 1488, 1489, 1455, 1466, 1460, 1492, 1459, 1467, 1461, 1493, + /* 450 */ 1469, 1470, 1472, 1495, 1481, 1474, 1483, 1497, 1501, 1503, + /* 460 */ 1523, 1366, 1436, 1491, 1511, 1535, 1504, 1505, 1508, 1509, + /* 470 */ 1502, 1506, 1512, 1513, 1515, 1538, 1529, 1552, 1531, 1507, + /* 480 */ 1555, 1536, 1522, 1560, 1527, 1563, 1530, 1566, 1545, 1548, + /* 490 */ 1569, 1425, 1539, 1570, 1407, 1549, 1428, 1433, 1573, 1581, + /* 500 */ 1434, 1475, 1582, 1583, 1585, 1543, 1363, 1518, 1520, 1524, + /* 510 */ 1521, 1558, 1533, 1525, 1532, 1537, 1541, 1559, 1574, 1575, + /* 520 */ 1540, 1586, 1408, 1551, 1553, 1580, 1409, 1588, 1589, 1554, + /* 530 */ 1595, 1458, 1556, 1605, 1606, 1607, 1611, 1612, 1613, 1556, + /* 540 */ 1643, 1471, 1608, 1567, 1571, 1572, 1603, 1577, 1587, 1621, + /* 550 */ 1630, 1484, 1590, 1591, 1593, 1596, 1499, 1656, 1598, 1544, + /* 560 */ 1609, 1657, 1631, 1547, 1614, 1597, 1627, 1635, 1616, 1602, + /* 570 */ 1617, 1665, 1618, 1601, 1619, 1653, 1668, 1622, 1623, 1670, + /* 580 */ 1625, 1626, 1673, 1628, 1638, 1678, 1632, 1641, 1690, 1652, + /* 590 */ 1629, 1634, 1636, 1637, 1679, 1642, 1655, 1659, 1703, 1662, + /* 600 */ 1702, 1702, 1724, 1688, 1692, 1714, 1685, 1675, 1713, 1722, + /* 610 */ 1723, 1726, 1727, 1728, 1737, 1729, 1730, 1704, 1502, 1732, + /* 620 */ 1506, 1735, 1741, 1742, 1743, 1744, 1746, 1772, 1747, 1745, + /* 630 */ 1750, 1791, 1758, 1748, 1755, 1796, 1763, 1752, 1761, 1803, + /* 640 */ 1777, 1767, 1779, 1816, 1784, 1785, 1821, 1800, 1802, 1804, + /* 650 */ 1805, 1807, 1810, }; #define YY_REDUCE_COUNT (269) -#define YY_REDUCE_MIN (-327) -#define YY_REDUCE_MAX (2006) +#define YY_REDUCE_MIN (-329) +#define YY_REDUCE_MAX (2136) static const short yy_reduce_ofst[] = { - /* 0 */ -244, 70, 322, -195, 575, 141, 393, 853, 944, 1028, - /* 10 */ 744, 1080, 1132, 1148, 1198, 1214, 1256, 1268, 1318, 1334, - /* 20 */ 1386, 1402, 1452, 1464, 1518, 1534, 1545, 1598, 1615, 1640, - /* 30 */ 1657, 1699, 1711, 1761, 1779, 1829, 1841, 1893, 1911, 1935, - /* 40 */ 1953, 2006, 261, 291, -234, 203, 452, -278, -260, -258, - /* 50 */ 453, -283, 65, 172, 64, 147, -257, -250, -327, -277, - /* 60 */ -85, -44, 266, 270, 296, 315, 321, 352, 455, 516, - /* 70 */ 125, 573, 574, 645, -249, -86, -173, 648, 651, -11, - /* 80 */ 652, 205, 265, 298, 709, 148, -232, -298, -298, -298, - /* 90 */ -149, -110, 167, 290, 338, 362, 381, 417, 418, 423, - /* 100 */ 435, 477, 486, 489, 492, 493, 537, 555, 556, 576, - /* 110 */ 605, -276, -170, -79, 114, 269, 101, 330, 391, 483, - /* 120 */ -106, 396, 118, 183, 431, 559, 403, 264, 501, 634, - /* 130 */ 655, 13, 251, 339, 345, 386, 468, 491, 502, 299, - /* 140 */ 346, 465, 451, 440, 597, 590, 560, 658, 658, 671, - /* 150 */ 763, 733, 705, 681, 681, 681, 690, 677, 678, 679, - /* 160 */ 684, 658, 758, 819, 767, 821, 778, 831, 832, 807, - /* 170 */ 813, 814, 855, 864, 865, 806, 861, 843, 880, 841, - /* 180 */ 847, 895, 851, 897, 863, 903, 905, 911, 908, 919, - /* 190 */ 896, 906, 909, 910, 914, 915, 917, 918, 921, 923, - /* 200 */ 924, 925, 934, 890, 859, 937, 892, 913, 963, 967, - /* 210 */ 968, 920, 969, 912, 940, 885, 938, 951, 887, 946, - /* 220 */ 958, 959, 658, 894, 900, 931, 926, 935, 939, 972, - /* 230 */ 681, 1009, 974, 932, 947, 943, 949, 952, 953, 955, - /* 240 */ 987, 1018, 1025, 1032, 1034, 1035, 1040, 1022, 1041, 1029, - /* 250 */ 1047, 1042, 1074, 1061, 1079, 1056, 1063, 1057, 1078, 1091, - /* 260 */ 1096, 1108, 1110, 1049, 1058, 1093, 1095, 1098, 1111, 1120, + /* 0 */ -246, 688, 769, -197, 789, 881, 944, 971, 1042, 1107, + /* 10 */ 1178, 1200, 1263, 348, 1281, 1334, 1388, 1399, 1456, 1477, + /* 20 */ 1519, 1542, 1599, 1610, 1624, 1666, 1680, 1691, 1733, 1775, + /* 30 */ 1786, 1798, 1853, 1880, 1907, 1934, 1988, 1997, 2015, 2068, + /* 40 */ 2082, 2136, 288, 490, -236, -122, -20, -280, -262, -260, + /* 50 */ -55, -285, -80, -41, 206, 289, -259, -252, -329, -279, + /* 60 */ -126, -49, 268, 341, 342, 351, 459, 460, 461, 517, + /* 70 */ -250, 520, 543, 559, -251, -181, -104, 642, 645, 270, + /* 80 */ 709, 292, 330, 299, 711, 332, -234, -190, -190, -190, + /* 90 */ -99, 146, 120, 244, 354, 356, 385, 444, 532, 549, + /* 100 */ 569, 576, 621, 651, 657, 682, 691, 694, 695, 725, + /* 110 */ 742, 20, 229, -101, 407, 11, 264, 464, 467, 500, + /* 120 */ 80, 456, 83, 7, -307, -97, 189, 325, 149, 436, + /* 130 */ 442, 640, -273, 266, 297, 443, 452, 472, 509, 259, + /* 140 */ 563, 554, 469, 494, 609, 595, 622, 715, 715, 773, + /* 150 */ 764, 745, 733, 712, 712, 712, 718, 702, 704, 714, + /* 160 */ 729, 715, 768, 842, 794, 856, 814, 882, 883, 845, + /* 170 */ 849, 850, 890, 898, 899, 840, 893, 860, 894, 851, + /* 180 */ 852, 901, 858, 904, 870, 908, 909, 915, 918, 925, + /* 190 */ 903, 905, 906, 907, 910, 911, 912, 913, 914, 917, + /* 200 */ 919, 924, 934, 896, 879, 936, 886, 916, 941, 953, + /* 210 */ 954, 895, 955, 902, 933, 866, 927, 935, 873, 931, + /* 220 */ 943, 945, 715, 885, 887, 892, 897, 920, 923, 928, + /* 230 */ 712, 965, 938, 922, 939, 930, 937, 942, 940, 947, + /* 240 */ 948, 958, 986, 987, 988, 994, 996, 963, 997, 989, + /* 250 */ 1029, 1014, 1052, 1037, 1054, 1030, 1039, 1034, 1056, 1061, + /* 260 */ 1062, 1074, 1077, 1035, 1024, 1064, 1065, 1066, 1070, 1084, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 10 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 20 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 30 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 40 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 50 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 60 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 70 */ 1506, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 80 */ 1434, 1434, 1434, 1434, 1434, 1504, 1657, 1434, 1832, 1434, - /* 90 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 100 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 110 */ 1434, 1434, 1434, 1434, 1434, 1506, 1434, 1844, 1844, 1844, - /* 120 */ 1504, 1434, 1434, 1434, 1701, 1701, 1434, 1434, 1434, 1434, - /* 130 */ 1600, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1693, - /* 140 */ 1434, 1434, 1913, 1434, 1434, 1699, 1867, 1434, 1434, 1434, - /* 150 */ 1434, 1553, 1859, 1836, 1850, 1837, 1834, 1898, 1898, 1898, - /* 160 */ 1853, 1434, 1863, 1434, 1434, 1434, 1685, 1434, 1434, 1662, - /* 170 */ 1659, 1659, 1434, 1434, 1434, 1434, 1506, 1434, 1506, 1434, - /* 180 */ 1434, 1506, 1434, 1506, 1434, 1506, 1506, 1434, 1506, 1434, - /* 190 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 200 */ 1434, 1434, 1434, 1434, 1434, 1504, 1695, 1434, 1504, 1434, - /* 210 */ 1434, 1434, 1504, 1434, 1434, 1874, 1872, 1434, 1874, 1872, - /* 220 */ 1434, 1434, 1434, 1886, 1882, 1874, 1890, 1888, 1865, 1863, - /* 230 */ 1850, 1434, 1434, 1904, 1900, 1916, 1904, 1900, 1904, 1900, - /* 240 */ 1434, 1872, 1434, 1434, 1434, 1434, 1434, 1872, 1434, 1434, - /* 250 */ 1434, 1434, 1504, 1434, 1504, 1434, 1569, 1434, 1434, 1434, - /* 260 */ 1504, 1466, 1434, 1687, 1701, 1603, 1603, 1603, 1507, 1439, - /* 270 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 280 */ 1434, 1770, 1885, 1884, 1808, 1807, 1806, 1804, 1769, 1434, - /* 290 */ 1434, 1565, 1768, 1767, 1434, 1434, 1434, 1434, 1434, 1434, - /* 300 */ 1761, 1762, 1760, 1759, 1434, 1434, 1434, 1434, 1434, 1434, - /* 310 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1833, - /* 320 */ 1434, 1901, 1905, 1434, 1434, 1434, 1744, 1434, 1434, 1434, - /* 330 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 340 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 350 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 360 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 370 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 380 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 390 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 400 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 410 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 420 */ 1434, 1434, 1434, 1471, 1434, 1434, 1434, 1434, 1434, 1434, - /* 430 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 440 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 450 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 460 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 470 */ 1534, 1533, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 480 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 490 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 500 */ 1434, 1434, 1434, 1434, 1434, 1866, 1434, 1434, 1434, 1434, - /* 510 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1744, - /* 520 */ 1434, 1883, 1434, 1843, 1839, 1434, 1434, 1835, 1434, 1434, - /* 530 */ 1899, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 540 */ 1828, 1434, 1801, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 550 */ 1434, 1755, 1434, 1434, 1434, 1434, 1705, 1434, 1434, 1434, - /* 560 */ 1434, 1434, 1434, 1434, 1434, 1743, 1434, 1786, 1434, 1434, - /* 570 */ 1434, 1434, 1434, 1434, 1434, 1434, 1597, 1434, 1434, 1434, - /* 580 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1582, - /* 590 */ 1580, 1579, 1578, 1434, 1575, 1434, 1434, 1434, 1434, 1606, - /* 600 */ 1605, 1434, 1434, 1434, 1434, 1434, 1434, 1526, 1434, 1434, - /* 610 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1517, 1434, 1516, - /* 620 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 630 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 640 */ 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, - /* 650 */ 1434, 1434, + /* 0 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 10 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 20 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 30 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 40 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 50 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 60 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 70 */ 1509, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 80 */ 1437, 1437, 1437, 1437, 1437, 1507, 1660, 1437, 1836, 1437, + /* 90 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 100 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 110 */ 1437, 1437, 1437, 1437, 1437, 1509, 1437, 1848, 1848, 1848, + /* 120 */ 1507, 1437, 1437, 1437, 1704, 1704, 1437, 1437, 1437, 1437, + /* 130 */ 1603, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1696, + /* 140 */ 1437, 1437, 1917, 1437, 1437, 1702, 1871, 1437, 1437, 1437, + /* 150 */ 1437, 1556, 1863, 1840, 1854, 1841, 1838, 1902, 1902, 1902, + /* 160 */ 1857, 1437, 1867, 1437, 1437, 1437, 1688, 1437, 1437, 1665, + /* 170 */ 1662, 1662, 1437, 1437, 1437, 1437, 1509, 1437, 1509, 1437, + /* 180 */ 1437, 1509, 1437, 1509, 1437, 1509, 1509, 1437, 1509, 1437, + /* 190 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 200 */ 1437, 1437, 1437, 1437, 1437, 1507, 1698, 1437, 1507, 1437, + /* 210 */ 1437, 1437, 1507, 1437, 1437, 1878, 1876, 1437, 1878, 1876, + /* 220 */ 1437, 1437, 1437, 1890, 1886, 1878, 1894, 1892, 1869, 1867, + /* 230 */ 1854, 1437, 1437, 1908, 1904, 1920, 1908, 1904, 1908, 1904, + /* 240 */ 1437, 1876, 1437, 1437, 1437, 1437, 1437, 1876, 1437, 1437, + /* 250 */ 1437, 1437, 1507, 1437, 1507, 1437, 1572, 1437, 1437, 1437, + /* 260 */ 1507, 1469, 1437, 1690, 1704, 1606, 1606, 1606, 1510, 1442, + /* 270 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 280 */ 1437, 1774, 1889, 1888, 1812, 1811, 1810, 1808, 1773, 1437, + /* 290 */ 1437, 1568, 1772, 1771, 1437, 1437, 1437, 1437, 1437, 1437, + /* 300 */ 1437, 1765, 1766, 1764, 1763, 1437, 1437, 1437, 1437, 1437, + /* 310 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1837, + /* 320 */ 1437, 1905, 1909, 1437, 1437, 1437, 1748, 1437, 1437, 1437, + /* 330 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 340 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 350 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 360 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 370 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 380 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 390 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 400 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 410 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 420 */ 1437, 1437, 1437, 1474, 1437, 1437, 1437, 1437, 1437, 1437, + /* 430 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 440 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 450 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 460 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 470 */ 1537, 1536, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 480 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 490 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 500 */ 1437, 1437, 1437, 1437, 1437, 1870, 1437, 1437, 1437, 1437, + /* 510 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1748, + /* 520 */ 1437, 1887, 1437, 1847, 1843, 1437, 1437, 1839, 1437, 1437, + /* 530 */ 1903, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 540 */ 1832, 1437, 1805, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 550 */ 1437, 1759, 1437, 1437, 1437, 1437, 1437, 1708, 1437, 1437, + /* 560 */ 1437, 1437, 1437, 1437, 1437, 1437, 1747, 1437, 1790, 1437, + /* 570 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1600, 1437, 1437, + /* 580 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 590 */ 1585, 1583, 1582, 1581, 1437, 1578, 1437, 1437, 1437, 1437, + /* 600 */ 1609, 1608, 1437, 1437, 1437, 1437, 1437, 1437, 1529, 1437, + /* 610 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1520, 1437, + /* 620 */ 1519, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 630 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 640 */ 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, + /* 650 */ 1437, 1437, 1437, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1088,6 +1083,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* TRIGGER => nothing */ 0, /* AT_ONCE => nothing */ 0, /* WINDOW_CLOSE => nothing */ + 0, /* IGNORE => nothing */ + 0, /* EXPIRED => nothing */ 0, /* KILL => nothing */ 0, /* CONNECTION => nothing */ 0, /* TRANSACTION => nothing */ @@ -1155,12 +1152,12 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ID => nothing */ - 243, /* NK_BITNOT => ID */ - 243, /* INSERT => ID */ - 243, /* VALUES => ID */ - 243, /* IMPORT => ID */ - 243, /* NK_SEMI => ID */ - 243, /* FILE => ID */ + 245, /* NK_BITNOT => ID */ + 245, /* INSERT => ID */ + 245, /* VALUES => ID */ + 245, /* IMPORT => ID */ + 245, /* NK_SEMI => ID */ + 245, /* FILE => ID */ }; #endif /* YYFALLBACK */ @@ -1425,202 +1422,204 @@ static const char *const yyTokenName[] = { /* 174 */ "TRIGGER", /* 175 */ "AT_ONCE", /* 176 */ "WINDOW_CLOSE", - /* 177 */ "KILL", - /* 178 */ "CONNECTION", - /* 179 */ "TRANSACTION", - /* 180 */ "BALANCE", - /* 181 */ "VGROUP", - /* 182 */ "MERGE", - /* 183 */ "REDISTRIBUTE", - /* 184 */ "SPLIT", - /* 185 */ "SYNCDB", - /* 186 */ "DELETE", - /* 187 */ "NULL", - /* 188 */ "NK_QUESTION", - /* 189 */ "NK_ARROW", - /* 190 */ "ROWTS", - /* 191 */ "TBNAME", - /* 192 */ "QSTARTTS", - /* 193 */ "QENDTS", - /* 194 */ "WSTARTTS", - /* 195 */ "WENDTS", - /* 196 */ "WDURATION", - /* 197 */ "CAST", - /* 198 */ "NOW", - /* 199 */ "TODAY", - /* 200 */ "TIMEZONE", - /* 201 */ "CLIENT_VERSION", - /* 202 */ "SERVER_VERSION", - /* 203 */ "SERVER_STATUS", - /* 204 */ "CURRENT_USER", - /* 205 */ "COUNT", - /* 206 */ "LAST_ROW", - /* 207 */ "BETWEEN", - /* 208 */ "IS", - /* 209 */ "NK_LT", - /* 210 */ "NK_GT", - /* 211 */ "NK_LE", - /* 212 */ "NK_GE", - /* 213 */ "NK_NE", - /* 214 */ "MATCH", - /* 215 */ "NMATCH", - /* 216 */ "CONTAINS", - /* 217 */ "JOIN", - /* 218 */ "INNER", - /* 219 */ "SELECT", - /* 220 */ "DISTINCT", - /* 221 */ "WHERE", - /* 222 */ "PARTITION", - /* 223 */ "BY", - /* 224 */ "SESSION", - /* 225 */ "STATE_WINDOW", - /* 226 */ "SLIDING", - /* 227 */ "FILL", - /* 228 */ "VALUE", - /* 229 */ "NONE", - /* 230 */ "PREV", - /* 231 */ "LINEAR", - /* 232 */ "NEXT", - /* 233 */ "HAVING", - /* 234 */ "RANGE", - /* 235 */ "EVERY", - /* 236 */ "ORDER", - /* 237 */ "SLIMIT", - /* 238 */ "SOFFSET", - /* 239 */ "LIMIT", - /* 240 */ "OFFSET", - /* 241 */ "ASC", - /* 242 */ "NULLS", - /* 243 */ "ID", - /* 244 */ "NK_BITNOT", - /* 245 */ "INSERT", - /* 246 */ "VALUES", - /* 247 */ "IMPORT", - /* 248 */ "NK_SEMI", - /* 249 */ "FILE", - /* 250 */ "cmd", - /* 251 */ "account_options", - /* 252 */ "alter_account_options", - /* 253 */ "literal", - /* 254 */ "alter_account_option", - /* 255 */ "user_name", - /* 256 */ "sysinfo_opt", - /* 257 */ "privileges", - /* 258 */ "priv_level", - /* 259 */ "priv_type_list", - /* 260 */ "priv_type", - /* 261 */ "db_name", - /* 262 */ "dnode_endpoint", - /* 263 */ "not_exists_opt", - /* 264 */ "db_options", - /* 265 */ "exists_opt", - /* 266 */ "alter_db_options", - /* 267 */ "integer_list", - /* 268 */ "variable_list", - /* 269 */ "retention_list", - /* 270 */ "alter_db_option", - /* 271 */ "retention", - /* 272 */ "full_table_name", - /* 273 */ "column_def_list", - /* 274 */ "tags_def_opt", - /* 275 */ "table_options", - /* 276 */ "multi_create_clause", - /* 277 */ "tags_def", - /* 278 */ "multi_drop_clause", - /* 279 */ "alter_table_clause", - /* 280 */ "alter_table_options", - /* 281 */ "column_name", - /* 282 */ "type_name", - /* 283 */ "signed_literal", - /* 284 */ "create_subtable_clause", - /* 285 */ "specific_tags_opt", - /* 286 */ "literal_list", - /* 287 */ "drop_table_clause", - /* 288 */ "col_name_list", - /* 289 */ "table_name", - /* 290 */ "column_def", - /* 291 */ "duration_list", - /* 292 */ "rollup_func_list", - /* 293 */ "alter_table_option", - /* 294 */ "duration_literal", - /* 295 */ "rollup_func_name", - /* 296 */ "function_name", - /* 297 */ "col_name", - /* 298 */ "db_name_cond_opt", - /* 299 */ "like_pattern_opt", - /* 300 */ "table_name_cond", - /* 301 */ "from_db_opt", - /* 302 */ "index_name", - /* 303 */ "index_options", - /* 304 */ "func_list", - /* 305 */ "sliding_opt", - /* 306 */ "sma_stream_opt", - /* 307 */ "func", - /* 308 */ "expression_list", - /* 309 */ "stream_options", - /* 310 */ "topic_name", - /* 311 */ "query_expression", - /* 312 */ "cgroup_name", - /* 313 */ "analyze_opt", - /* 314 */ "explain_options", - /* 315 */ "agg_func_opt", - /* 316 */ "bufsize_opt", - /* 317 */ "stream_name", - /* 318 */ "into_opt", - /* 319 */ "dnode_list", - /* 320 */ "where_clause_opt", - /* 321 */ "signed", - /* 322 */ "literal_func", - /* 323 */ "table_alias", - /* 324 */ "column_alias", - /* 325 */ "expression", - /* 326 */ "pseudo_column", - /* 327 */ "column_reference", - /* 328 */ "function_expression", - /* 329 */ "subquery", - /* 330 */ "star_func", - /* 331 */ "star_func_para_list", - /* 332 */ "noarg_func", - /* 333 */ "other_para_list", - /* 334 */ "star_func_para", - /* 335 */ "predicate", - /* 336 */ "compare_op", - /* 337 */ "in_op", - /* 338 */ "in_predicate_value", - /* 339 */ "boolean_value_expression", - /* 340 */ "boolean_primary", - /* 341 */ "common_expression", - /* 342 */ "from_clause_opt", - /* 343 */ "table_reference_list", - /* 344 */ "table_reference", - /* 345 */ "table_primary", - /* 346 */ "joined_table", - /* 347 */ "alias_opt", - /* 348 */ "parenthesized_joined_table", - /* 349 */ "join_type", - /* 350 */ "search_condition", - /* 351 */ "query_specification", - /* 352 */ "set_quantifier_opt", - /* 353 */ "select_list", - /* 354 */ "partition_by_clause_opt", - /* 355 */ "range_opt", - /* 356 */ "every_opt", - /* 357 */ "fill_opt", - /* 358 */ "twindow_clause_opt", - /* 359 */ "group_by_clause_opt", - /* 360 */ "having_clause_opt", - /* 361 */ "select_item", - /* 362 */ "fill_mode", - /* 363 */ "group_by_list", - /* 364 */ "query_expression_body", - /* 365 */ "order_by_clause_opt", - /* 366 */ "slimit_clause_opt", - /* 367 */ "limit_clause_opt", - /* 368 */ "query_primary", - /* 369 */ "sort_specification_list", - /* 370 */ "sort_specification", - /* 371 */ "ordering_specification_opt", - /* 372 */ "null_ordering_opt", + /* 177 */ "IGNORE", + /* 178 */ "EXPIRED", + /* 179 */ "KILL", + /* 180 */ "CONNECTION", + /* 181 */ "TRANSACTION", + /* 182 */ "BALANCE", + /* 183 */ "VGROUP", + /* 184 */ "MERGE", + /* 185 */ "REDISTRIBUTE", + /* 186 */ "SPLIT", + /* 187 */ "SYNCDB", + /* 188 */ "DELETE", + /* 189 */ "NULL", + /* 190 */ "NK_QUESTION", + /* 191 */ "NK_ARROW", + /* 192 */ "ROWTS", + /* 193 */ "TBNAME", + /* 194 */ "QSTARTTS", + /* 195 */ "QENDTS", + /* 196 */ "WSTARTTS", + /* 197 */ "WENDTS", + /* 198 */ "WDURATION", + /* 199 */ "CAST", + /* 200 */ "NOW", + /* 201 */ "TODAY", + /* 202 */ "TIMEZONE", + /* 203 */ "CLIENT_VERSION", + /* 204 */ "SERVER_VERSION", + /* 205 */ "SERVER_STATUS", + /* 206 */ "CURRENT_USER", + /* 207 */ "COUNT", + /* 208 */ "LAST_ROW", + /* 209 */ "BETWEEN", + /* 210 */ "IS", + /* 211 */ "NK_LT", + /* 212 */ "NK_GT", + /* 213 */ "NK_LE", + /* 214 */ "NK_GE", + /* 215 */ "NK_NE", + /* 216 */ "MATCH", + /* 217 */ "NMATCH", + /* 218 */ "CONTAINS", + /* 219 */ "JOIN", + /* 220 */ "INNER", + /* 221 */ "SELECT", + /* 222 */ "DISTINCT", + /* 223 */ "WHERE", + /* 224 */ "PARTITION", + /* 225 */ "BY", + /* 226 */ "SESSION", + /* 227 */ "STATE_WINDOW", + /* 228 */ "SLIDING", + /* 229 */ "FILL", + /* 230 */ "VALUE", + /* 231 */ "NONE", + /* 232 */ "PREV", + /* 233 */ "LINEAR", + /* 234 */ "NEXT", + /* 235 */ "HAVING", + /* 236 */ "RANGE", + /* 237 */ "EVERY", + /* 238 */ "ORDER", + /* 239 */ "SLIMIT", + /* 240 */ "SOFFSET", + /* 241 */ "LIMIT", + /* 242 */ "OFFSET", + /* 243 */ "ASC", + /* 244 */ "NULLS", + /* 245 */ "ID", + /* 246 */ "NK_BITNOT", + /* 247 */ "INSERT", + /* 248 */ "VALUES", + /* 249 */ "IMPORT", + /* 250 */ "NK_SEMI", + /* 251 */ "FILE", + /* 252 */ "cmd", + /* 253 */ "account_options", + /* 254 */ "alter_account_options", + /* 255 */ "literal", + /* 256 */ "alter_account_option", + /* 257 */ "user_name", + /* 258 */ "sysinfo_opt", + /* 259 */ "privileges", + /* 260 */ "priv_level", + /* 261 */ "priv_type_list", + /* 262 */ "priv_type", + /* 263 */ "db_name", + /* 264 */ "dnode_endpoint", + /* 265 */ "not_exists_opt", + /* 266 */ "db_options", + /* 267 */ "exists_opt", + /* 268 */ "alter_db_options", + /* 269 */ "integer_list", + /* 270 */ "variable_list", + /* 271 */ "retention_list", + /* 272 */ "alter_db_option", + /* 273 */ "retention", + /* 274 */ "full_table_name", + /* 275 */ "column_def_list", + /* 276 */ "tags_def_opt", + /* 277 */ "table_options", + /* 278 */ "multi_create_clause", + /* 279 */ "tags_def", + /* 280 */ "multi_drop_clause", + /* 281 */ "alter_table_clause", + /* 282 */ "alter_table_options", + /* 283 */ "column_name", + /* 284 */ "type_name", + /* 285 */ "signed_literal", + /* 286 */ "create_subtable_clause", + /* 287 */ "specific_tags_opt", + /* 288 */ "literal_list", + /* 289 */ "drop_table_clause", + /* 290 */ "col_name_list", + /* 291 */ "table_name", + /* 292 */ "column_def", + /* 293 */ "duration_list", + /* 294 */ "rollup_func_list", + /* 295 */ "alter_table_option", + /* 296 */ "duration_literal", + /* 297 */ "rollup_func_name", + /* 298 */ "function_name", + /* 299 */ "col_name", + /* 300 */ "db_name_cond_opt", + /* 301 */ "like_pattern_opt", + /* 302 */ "table_name_cond", + /* 303 */ "from_db_opt", + /* 304 */ "index_name", + /* 305 */ "index_options", + /* 306 */ "func_list", + /* 307 */ "sliding_opt", + /* 308 */ "sma_stream_opt", + /* 309 */ "func", + /* 310 */ "expression_list", + /* 311 */ "stream_options", + /* 312 */ "topic_name", + /* 313 */ "query_expression", + /* 314 */ "cgroup_name", + /* 315 */ "analyze_opt", + /* 316 */ "explain_options", + /* 317 */ "agg_func_opt", + /* 318 */ "bufsize_opt", + /* 319 */ "stream_name", + /* 320 */ "into_opt", + /* 321 */ "dnode_list", + /* 322 */ "where_clause_opt", + /* 323 */ "signed", + /* 324 */ "literal_func", + /* 325 */ "table_alias", + /* 326 */ "column_alias", + /* 327 */ "expression", + /* 328 */ "pseudo_column", + /* 329 */ "column_reference", + /* 330 */ "function_expression", + /* 331 */ "subquery", + /* 332 */ "star_func", + /* 333 */ "star_func_para_list", + /* 334 */ "noarg_func", + /* 335 */ "other_para_list", + /* 336 */ "star_func_para", + /* 337 */ "predicate", + /* 338 */ "compare_op", + /* 339 */ "in_op", + /* 340 */ "in_predicate_value", + /* 341 */ "boolean_value_expression", + /* 342 */ "boolean_primary", + /* 343 */ "common_expression", + /* 344 */ "from_clause_opt", + /* 345 */ "table_reference_list", + /* 346 */ "table_reference", + /* 347 */ "table_primary", + /* 348 */ "joined_table", + /* 349 */ "alias_opt", + /* 350 */ "parenthesized_joined_table", + /* 351 */ "join_type", + /* 352 */ "search_condition", + /* 353 */ "query_specification", + /* 354 */ "set_quantifier_opt", + /* 355 */ "select_list", + /* 356 */ "partition_by_clause_opt", + /* 357 */ "range_opt", + /* 358 */ "every_opt", + /* 359 */ "fill_opt", + /* 360 */ "twindow_clause_opt", + /* 361 */ "group_by_clause_opt", + /* 362 */ "having_clause_opt", + /* 363 */ "select_item", + /* 364 */ "fill_mode", + /* 365 */ "group_by_list", + /* 366 */ "query_expression_body", + /* 367 */ "order_by_clause_opt", + /* 368 */ "slimit_clause_opt", + /* 369 */ "limit_clause_opt", + /* 370 */ "query_primary", + /* 371 */ "sort_specification_list", + /* 372 */ "sort_specification", + /* 373 */ "ordering_specification_opt", + /* 374 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1897,219 +1896,220 @@ static const char *const yyRuleName[] = { /* 266 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", /* 267 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", /* 268 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 269 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 270 */ "cmd ::= KILL QUERY NK_STRING", - /* 271 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 272 */ "cmd ::= BALANCE VGROUP", - /* 273 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 274 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 275 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 276 */ "dnode_list ::= DNODE NK_INTEGER", - /* 277 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 278 */ "cmd ::= SYNCDB db_name REPLICA", - /* 279 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 280 */ "cmd ::= query_expression", - /* 281 */ "literal ::= NK_INTEGER", - /* 282 */ "literal ::= NK_FLOAT", - /* 283 */ "literal ::= NK_STRING", - /* 284 */ "literal ::= NK_BOOL", - /* 285 */ "literal ::= TIMESTAMP NK_STRING", - /* 286 */ "literal ::= duration_literal", - /* 287 */ "literal ::= NULL", - /* 288 */ "literal ::= NK_QUESTION", - /* 289 */ "duration_literal ::= NK_VARIABLE", - /* 290 */ "signed ::= NK_INTEGER", - /* 291 */ "signed ::= NK_PLUS NK_INTEGER", - /* 292 */ "signed ::= NK_MINUS NK_INTEGER", - /* 293 */ "signed ::= NK_FLOAT", - /* 294 */ "signed ::= NK_PLUS NK_FLOAT", - /* 295 */ "signed ::= NK_MINUS NK_FLOAT", - /* 296 */ "signed_literal ::= signed", - /* 297 */ "signed_literal ::= NK_STRING", - /* 298 */ "signed_literal ::= NK_BOOL", - /* 299 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 300 */ "signed_literal ::= duration_literal", - /* 301 */ "signed_literal ::= NULL", - /* 302 */ "signed_literal ::= literal_func", - /* 303 */ "literal_list ::= signed_literal", - /* 304 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 305 */ "db_name ::= NK_ID", - /* 306 */ "table_name ::= NK_ID", - /* 307 */ "column_name ::= NK_ID", - /* 308 */ "function_name ::= NK_ID", - /* 309 */ "table_alias ::= NK_ID", - /* 310 */ "column_alias ::= NK_ID", - /* 311 */ "user_name ::= NK_ID", - /* 312 */ "index_name ::= NK_ID", - /* 313 */ "topic_name ::= NK_ID", - /* 314 */ "stream_name ::= NK_ID", - /* 315 */ "cgroup_name ::= NK_ID", - /* 316 */ "expression ::= literal", - /* 317 */ "expression ::= pseudo_column", - /* 318 */ "expression ::= column_reference", - /* 319 */ "expression ::= function_expression", - /* 320 */ "expression ::= subquery", - /* 321 */ "expression ::= NK_LP expression NK_RP", - /* 322 */ "expression ::= NK_PLUS expression", - /* 323 */ "expression ::= NK_MINUS expression", - /* 324 */ "expression ::= expression NK_PLUS expression", - /* 325 */ "expression ::= expression NK_MINUS expression", - /* 326 */ "expression ::= expression NK_STAR expression", - /* 327 */ "expression ::= expression NK_SLASH expression", - /* 328 */ "expression ::= expression NK_REM expression", - /* 329 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 330 */ "expression ::= expression NK_BITAND expression", - /* 331 */ "expression ::= expression NK_BITOR expression", - /* 332 */ "expression_list ::= expression", - /* 333 */ "expression_list ::= expression_list NK_COMMA expression", - /* 334 */ "column_reference ::= column_name", - /* 335 */ "column_reference ::= table_name NK_DOT column_name", - /* 336 */ "pseudo_column ::= ROWTS", - /* 337 */ "pseudo_column ::= TBNAME", - /* 338 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 339 */ "pseudo_column ::= QSTARTTS", - /* 340 */ "pseudo_column ::= QENDTS", - /* 341 */ "pseudo_column ::= WSTARTTS", - /* 342 */ "pseudo_column ::= WENDTS", - /* 343 */ "pseudo_column ::= WDURATION", - /* 344 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 345 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 346 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", - /* 347 */ "function_expression ::= literal_func", - /* 348 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 349 */ "literal_func ::= NOW", - /* 350 */ "noarg_func ::= NOW", - /* 351 */ "noarg_func ::= TODAY", - /* 352 */ "noarg_func ::= TIMEZONE", - /* 353 */ "noarg_func ::= DATABASE", - /* 354 */ "noarg_func ::= CLIENT_VERSION", - /* 355 */ "noarg_func ::= SERVER_VERSION", - /* 356 */ "noarg_func ::= SERVER_STATUS", - /* 357 */ "noarg_func ::= CURRENT_USER", - /* 358 */ "noarg_func ::= USER", - /* 359 */ "star_func ::= COUNT", - /* 360 */ "star_func ::= FIRST", - /* 361 */ "star_func ::= LAST", - /* 362 */ "star_func ::= LAST_ROW", - /* 363 */ "star_func_para_list ::= NK_STAR", - /* 364 */ "star_func_para_list ::= other_para_list", - /* 365 */ "other_para_list ::= star_func_para", - /* 366 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 367 */ "star_func_para ::= expression", - /* 368 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 369 */ "predicate ::= expression compare_op expression", - /* 370 */ "predicate ::= expression BETWEEN expression AND expression", - /* 371 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 372 */ "predicate ::= expression IS NULL", - /* 373 */ "predicate ::= expression IS NOT NULL", - /* 374 */ "predicate ::= expression in_op in_predicate_value", - /* 375 */ "compare_op ::= NK_LT", - /* 376 */ "compare_op ::= NK_GT", - /* 377 */ "compare_op ::= NK_LE", - /* 378 */ "compare_op ::= NK_GE", - /* 379 */ "compare_op ::= NK_NE", - /* 380 */ "compare_op ::= NK_EQ", - /* 381 */ "compare_op ::= LIKE", - /* 382 */ "compare_op ::= NOT LIKE", - /* 383 */ "compare_op ::= MATCH", - /* 384 */ "compare_op ::= NMATCH", - /* 385 */ "compare_op ::= CONTAINS", - /* 386 */ "in_op ::= IN", - /* 387 */ "in_op ::= NOT IN", - /* 388 */ "in_predicate_value ::= NK_LP expression_list NK_RP", - /* 389 */ "boolean_value_expression ::= boolean_primary", - /* 390 */ "boolean_value_expression ::= NOT boolean_primary", - /* 391 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 392 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 393 */ "boolean_primary ::= predicate", - /* 394 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 395 */ "common_expression ::= expression", - /* 396 */ "common_expression ::= boolean_value_expression", - /* 397 */ "from_clause_opt ::=", - /* 398 */ "from_clause_opt ::= FROM table_reference_list", - /* 399 */ "table_reference_list ::= table_reference", - /* 400 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 401 */ "table_reference ::= table_primary", - /* 402 */ "table_reference ::= joined_table", - /* 403 */ "table_primary ::= table_name alias_opt", - /* 404 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 405 */ "table_primary ::= subquery alias_opt", - /* 406 */ "table_primary ::= parenthesized_joined_table", - /* 407 */ "alias_opt ::=", - /* 408 */ "alias_opt ::= table_alias", - /* 409 */ "alias_opt ::= AS table_alias", - /* 410 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 411 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 412 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 413 */ "join_type ::=", - /* 414 */ "join_type ::= INNER", - /* 415 */ "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", - /* 416 */ "set_quantifier_opt ::=", - /* 417 */ "set_quantifier_opt ::= DISTINCT", - /* 418 */ "set_quantifier_opt ::= ALL", - /* 419 */ "select_list ::= select_item", - /* 420 */ "select_list ::= select_list NK_COMMA select_item", - /* 421 */ "select_item ::= NK_STAR", - /* 422 */ "select_item ::= common_expression", - /* 423 */ "select_item ::= common_expression column_alias", - /* 424 */ "select_item ::= common_expression AS column_alias", - /* 425 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 426 */ "where_clause_opt ::=", - /* 427 */ "where_clause_opt ::= WHERE search_condition", - /* 428 */ "partition_by_clause_opt ::=", - /* 429 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 430 */ "twindow_clause_opt ::=", - /* 431 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 432 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", - /* 433 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 434 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 435 */ "sliding_opt ::=", - /* 436 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 437 */ "fill_opt ::=", - /* 438 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 439 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 440 */ "fill_mode ::= NONE", - /* 441 */ "fill_mode ::= PREV", - /* 442 */ "fill_mode ::= NULL", - /* 443 */ "fill_mode ::= LINEAR", - /* 444 */ "fill_mode ::= NEXT", - /* 445 */ "group_by_clause_opt ::=", - /* 446 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 447 */ "group_by_list ::= expression", - /* 448 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 449 */ "having_clause_opt ::=", - /* 450 */ "having_clause_opt ::= HAVING search_condition", - /* 451 */ "range_opt ::=", - /* 452 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP", - /* 453 */ "every_opt ::=", - /* 454 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 455 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 456 */ "query_expression_body ::= query_primary", - /* 457 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 458 */ "query_expression_body ::= query_expression_body UNION query_expression_body", - /* 459 */ "query_primary ::= query_specification", - /* 460 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", - /* 461 */ "order_by_clause_opt ::=", - /* 462 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 463 */ "slimit_clause_opt ::=", - /* 464 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 465 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 466 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 467 */ "limit_clause_opt ::=", - /* 468 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 469 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 470 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 471 */ "subquery ::= NK_LP query_expression NK_RP", - /* 472 */ "search_condition ::= common_expression", - /* 473 */ "sort_specification_list ::= sort_specification", - /* 474 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 475 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 476 */ "ordering_specification_opt ::=", - /* 477 */ "ordering_specification_opt ::= ASC", - /* 478 */ "ordering_specification_opt ::= DESC", - /* 479 */ "null_ordering_opt ::=", - /* 480 */ "null_ordering_opt ::= NULLS FIRST", - /* 481 */ "null_ordering_opt ::= NULLS LAST", + /* 269 */ "stream_options ::= stream_options IGNORE EXPIRED", + /* 270 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 271 */ "cmd ::= KILL QUERY NK_STRING", + /* 272 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 273 */ "cmd ::= BALANCE VGROUP", + /* 274 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 275 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 276 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 277 */ "dnode_list ::= DNODE NK_INTEGER", + /* 278 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 279 */ "cmd ::= SYNCDB db_name REPLICA", + /* 280 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 281 */ "cmd ::= query_expression", + /* 282 */ "literal ::= NK_INTEGER", + /* 283 */ "literal ::= NK_FLOAT", + /* 284 */ "literal ::= NK_STRING", + /* 285 */ "literal ::= NK_BOOL", + /* 286 */ "literal ::= TIMESTAMP NK_STRING", + /* 287 */ "literal ::= duration_literal", + /* 288 */ "literal ::= NULL", + /* 289 */ "literal ::= NK_QUESTION", + /* 290 */ "duration_literal ::= NK_VARIABLE", + /* 291 */ "signed ::= NK_INTEGER", + /* 292 */ "signed ::= NK_PLUS NK_INTEGER", + /* 293 */ "signed ::= NK_MINUS NK_INTEGER", + /* 294 */ "signed ::= NK_FLOAT", + /* 295 */ "signed ::= NK_PLUS NK_FLOAT", + /* 296 */ "signed ::= NK_MINUS NK_FLOAT", + /* 297 */ "signed_literal ::= signed", + /* 298 */ "signed_literal ::= NK_STRING", + /* 299 */ "signed_literal ::= NK_BOOL", + /* 300 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 301 */ "signed_literal ::= duration_literal", + /* 302 */ "signed_literal ::= NULL", + /* 303 */ "signed_literal ::= literal_func", + /* 304 */ "literal_list ::= signed_literal", + /* 305 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 306 */ "db_name ::= NK_ID", + /* 307 */ "table_name ::= NK_ID", + /* 308 */ "column_name ::= NK_ID", + /* 309 */ "function_name ::= NK_ID", + /* 310 */ "table_alias ::= NK_ID", + /* 311 */ "column_alias ::= NK_ID", + /* 312 */ "user_name ::= NK_ID", + /* 313 */ "index_name ::= NK_ID", + /* 314 */ "topic_name ::= NK_ID", + /* 315 */ "stream_name ::= NK_ID", + /* 316 */ "cgroup_name ::= NK_ID", + /* 317 */ "expression ::= literal", + /* 318 */ "expression ::= pseudo_column", + /* 319 */ "expression ::= column_reference", + /* 320 */ "expression ::= function_expression", + /* 321 */ "expression ::= subquery", + /* 322 */ "expression ::= NK_LP expression NK_RP", + /* 323 */ "expression ::= NK_PLUS expression", + /* 324 */ "expression ::= NK_MINUS expression", + /* 325 */ "expression ::= expression NK_PLUS expression", + /* 326 */ "expression ::= expression NK_MINUS expression", + /* 327 */ "expression ::= expression NK_STAR expression", + /* 328 */ "expression ::= expression NK_SLASH expression", + /* 329 */ "expression ::= expression NK_REM expression", + /* 330 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 331 */ "expression ::= expression NK_BITAND expression", + /* 332 */ "expression ::= expression NK_BITOR expression", + /* 333 */ "expression_list ::= expression", + /* 334 */ "expression_list ::= expression_list NK_COMMA expression", + /* 335 */ "column_reference ::= column_name", + /* 336 */ "column_reference ::= table_name NK_DOT column_name", + /* 337 */ "pseudo_column ::= ROWTS", + /* 338 */ "pseudo_column ::= TBNAME", + /* 339 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 340 */ "pseudo_column ::= QSTARTTS", + /* 341 */ "pseudo_column ::= QENDTS", + /* 342 */ "pseudo_column ::= WSTARTTS", + /* 343 */ "pseudo_column ::= WENDTS", + /* 344 */ "pseudo_column ::= WDURATION", + /* 345 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 346 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 347 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", + /* 348 */ "function_expression ::= literal_func", + /* 349 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 350 */ "literal_func ::= NOW", + /* 351 */ "noarg_func ::= NOW", + /* 352 */ "noarg_func ::= TODAY", + /* 353 */ "noarg_func ::= TIMEZONE", + /* 354 */ "noarg_func ::= DATABASE", + /* 355 */ "noarg_func ::= CLIENT_VERSION", + /* 356 */ "noarg_func ::= SERVER_VERSION", + /* 357 */ "noarg_func ::= SERVER_STATUS", + /* 358 */ "noarg_func ::= CURRENT_USER", + /* 359 */ "noarg_func ::= USER", + /* 360 */ "star_func ::= COUNT", + /* 361 */ "star_func ::= FIRST", + /* 362 */ "star_func ::= LAST", + /* 363 */ "star_func ::= LAST_ROW", + /* 364 */ "star_func_para_list ::= NK_STAR", + /* 365 */ "star_func_para_list ::= other_para_list", + /* 366 */ "other_para_list ::= star_func_para", + /* 367 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 368 */ "star_func_para ::= expression", + /* 369 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 370 */ "predicate ::= expression compare_op expression", + /* 371 */ "predicate ::= expression BETWEEN expression AND expression", + /* 372 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 373 */ "predicate ::= expression IS NULL", + /* 374 */ "predicate ::= expression IS NOT NULL", + /* 375 */ "predicate ::= expression in_op in_predicate_value", + /* 376 */ "compare_op ::= NK_LT", + /* 377 */ "compare_op ::= NK_GT", + /* 378 */ "compare_op ::= NK_LE", + /* 379 */ "compare_op ::= NK_GE", + /* 380 */ "compare_op ::= NK_NE", + /* 381 */ "compare_op ::= NK_EQ", + /* 382 */ "compare_op ::= LIKE", + /* 383 */ "compare_op ::= NOT LIKE", + /* 384 */ "compare_op ::= MATCH", + /* 385 */ "compare_op ::= NMATCH", + /* 386 */ "compare_op ::= CONTAINS", + /* 387 */ "in_op ::= IN", + /* 388 */ "in_op ::= NOT IN", + /* 389 */ "in_predicate_value ::= NK_LP expression_list NK_RP", + /* 390 */ "boolean_value_expression ::= boolean_primary", + /* 391 */ "boolean_value_expression ::= NOT boolean_primary", + /* 392 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 393 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 394 */ "boolean_primary ::= predicate", + /* 395 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 396 */ "common_expression ::= expression", + /* 397 */ "common_expression ::= boolean_value_expression", + /* 398 */ "from_clause_opt ::=", + /* 399 */ "from_clause_opt ::= FROM table_reference_list", + /* 400 */ "table_reference_list ::= table_reference", + /* 401 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 402 */ "table_reference ::= table_primary", + /* 403 */ "table_reference ::= joined_table", + /* 404 */ "table_primary ::= table_name alias_opt", + /* 405 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 406 */ "table_primary ::= subquery alias_opt", + /* 407 */ "table_primary ::= parenthesized_joined_table", + /* 408 */ "alias_opt ::=", + /* 409 */ "alias_opt ::= table_alias", + /* 410 */ "alias_opt ::= AS table_alias", + /* 411 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 412 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 413 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 414 */ "join_type ::=", + /* 415 */ "join_type ::= INNER", + /* 416 */ "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", + /* 417 */ "set_quantifier_opt ::=", + /* 418 */ "set_quantifier_opt ::= DISTINCT", + /* 419 */ "set_quantifier_opt ::= ALL", + /* 420 */ "select_list ::= select_item", + /* 421 */ "select_list ::= select_list NK_COMMA select_item", + /* 422 */ "select_item ::= NK_STAR", + /* 423 */ "select_item ::= common_expression", + /* 424 */ "select_item ::= common_expression column_alias", + /* 425 */ "select_item ::= common_expression AS column_alias", + /* 426 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 427 */ "where_clause_opt ::=", + /* 428 */ "where_clause_opt ::= WHERE search_condition", + /* 429 */ "partition_by_clause_opt ::=", + /* 430 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 431 */ "twindow_clause_opt ::=", + /* 432 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 433 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", + /* 434 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 435 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 436 */ "sliding_opt ::=", + /* 437 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 438 */ "fill_opt ::=", + /* 439 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 440 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 441 */ "fill_mode ::= NONE", + /* 442 */ "fill_mode ::= PREV", + /* 443 */ "fill_mode ::= NULL", + /* 444 */ "fill_mode ::= LINEAR", + /* 445 */ "fill_mode ::= NEXT", + /* 446 */ "group_by_clause_opt ::=", + /* 447 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 448 */ "group_by_list ::= expression", + /* 449 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 450 */ "having_clause_opt ::=", + /* 451 */ "having_clause_opt ::= HAVING search_condition", + /* 452 */ "range_opt ::=", + /* 453 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP", + /* 454 */ "every_opt ::=", + /* 455 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 456 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 457 */ "query_expression_body ::= query_primary", + /* 458 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 459 */ "query_expression_body ::= query_expression_body UNION query_expression_body", + /* 460 */ "query_primary ::= query_specification", + /* 461 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", + /* 462 */ "order_by_clause_opt ::=", + /* 463 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 464 */ "slimit_clause_opt ::=", + /* 465 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 466 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 467 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 468 */ "limit_clause_opt ::=", + /* 469 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 470 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 471 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 472 */ "subquery ::= NK_LP query_expression NK_RP", + /* 473 */ "search_condition ::= common_expression", + /* 474 */ "sort_specification_list ::= sort_specification", + /* 475 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 476 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 477 */ "ordering_specification_opt ::=", + /* 478 */ "ordering_specification_opt ::= ASC", + /* 479 */ "ordering_specification_opt ::= DESC", + /* 480 */ "null_ordering_opt ::=", + /* 481 */ "null_ordering_opt ::= NULLS FIRST", + /* 482 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2236,181 +2236,181 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 250: /* cmd */ - case 253: /* literal */ - case 264: /* db_options */ - case 266: /* alter_db_options */ - case 271: /* retention */ - case 272: /* full_table_name */ - case 275: /* table_options */ - case 279: /* alter_table_clause */ - case 280: /* alter_table_options */ - case 283: /* signed_literal */ - case 284: /* create_subtable_clause */ - case 287: /* drop_table_clause */ - case 290: /* column_def */ - case 294: /* duration_literal */ - case 295: /* rollup_func_name */ - case 297: /* col_name */ - case 298: /* db_name_cond_opt */ - case 299: /* like_pattern_opt */ - case 300: /* table_name_cond */ - case 301: /* from_db_opt */ - case 303: /* index_options */ - case 305: /* sliding_opt */ - case 306: /* sma_stream_opt */ - case 307: /* func */ - case 309: /* stream_options */ - case 311: /* query_expression */ - case 314: /* explain_options */ - case 318: /* into_opt */ - case 320: /* where_clause_opt */ - case 321: /* signed */ - case 322: /* literal_func */ - case 325: /* expression */ - case 326: /* pseudo_column */ - case 327: /* column_reference */ - case 328: /* function_expression */ - case 329: /* subquery */ - case 334: /* star_func_para */ - case 335: /* predicate */ - case 338: /* in_predicate_value */ - case 339: /* boolean_value_expression */ - case 340: /* boolean_primary */ - case 341: /* common_expression */ - case 342: /* from_clause_opt */ - case 343: /* table_reference_list */ - case 344: /* table_reference */ - case 345: /* table_primary */ - case 346: /* joined_table */ - case 348: /* parenthesized_joined_table */ - case 350: /* search_condition */ - case 351: /* query_specification */ - case 355: /* range_opt */ - case 356: /* every_opt */ - case 357: /* fill_opt */ - case 358: /* twindow_clause_opt */ - case 360: /* having_clause_opt */ - case 361: /* select_item */ - case 364: /* query_expression_body */ - case 366: /* slimit_clause_opt */ - case 367: /* limit_clause_opt */ - case 368: /* query_primary */ - case 370: /* sort_specification */ + case 252: /* cmd */ + case 255: /* literal */ + case 266: /* db_options */ + case 268: /* alter_db_options */ + case 273: /* retention */ + case 274: /* full_table_name */ + case 277: /* table_options */ + case 281: /* alter_table_clause */ + case 282: /* alter_table_options */ + case 285: /* signed_literal */ + case 286: /* create_subtable_clause */ + case 289: /* drop_table_clause */ + case 292: /* column_def */ + case 296: /* duration_literal */ + case 297: /* rollup_func_name */ + case 299: /* col_name */ + case 300: /* db_name_cond_opt */ + case 301: /* like_pattern_opt */ + case 302: /* table_name_cond */ + case 303: /* from_db_opt */ + case 305: /* index_options */ + case 307: /* sliding_opt */ + case 308: /* sma_stream_opt */ + case 309: /* func */ + case 311: /* stream_options */ + case 313: /* query_expression */ + case 316: /* explain_options */ + case 320: /* into_opt */ + case 322: /* where_clause_opt */ + case 323: /* signed */ + case 324: /* literal_func */ + case 327: /* expression */ + case 328: /* pseudo_column */ + case 329: /* column_reference */ + case 330: /* function_expression */ + case 331: /* subquery */ + case 336: /* star_func_para */ + case 337: /* predicate */ + case 340: /* in_predicate_value */ + case 341: /* boolean_value_expression */ + case 342: /* boolean_primary */ + case 343: /* common_expression */ + case 344: /* from_clause_opt */ + case 345: /* table_reference_list */ + case 346: /* table_reference */ + case 347: /* table_primary */ + case 348: /* joined_table */ + case 350: /* parenthesized_joined_table */ + case 352: /* search_condition */ + case 353: /* query_specification */ + case 357: /* range_opt */ + case 358: /* every_opt */ + case 359: /* fill_opt */ + case 360: /* twindow_clause_opt */ + case 362: /* having_clause_opt */ + case 363: /* select_item */ + case 366: /* query_expression_body */ + case 368: /* slimit_clause_opt */ + case 369: /* limit_clause_opt */ + case 370: /* query_primary */ + case 372: /* sort_specification */ { - nodesDestroyNode((yypminor->yy184)); + nodesDestroyNode((yypminor->yy212)); } break; - case 251: /* account_options */ - case 252: /* alter_account_options */ - case 254: /* alter_account_option */ - case 316: /* bufsize_opt */ + case 253: /* account_options */ + case 254: /* alter_account_options */ + case 256: /* alter_account_option */ + case 318: /* bufsize_opt */ { } break; - case 255: /* user_name */ - case 258: /* priv_level */ - case 261: /* db_name */ - case 262: /* dnode_endpoint */ - case 281: /* column_name */ - case 289: /* table_name */ - case 296: /* function_name */ - case 302: /* index_name */ - case 310: /* topic_name */ - case 312: /* cgroup_name */ - case 317: /* stream_name */ - case 323: /* table_alias */ - case 324: /* column_alias */ - case 330: /* star_func */ - case 332: /* noarg_func */ - case 347: /* alias_opt */ + case 257: /* user_name */ + case 260: /* priv_level */ + case 263: /* db_name */ + case 264: /* dnode_endpoint */ + case 283: /* column_name */ + case 291: /* table_name */ + case 298: /* function_name */ + case 304: /* index_name */ + case 312: /* topic_name */ + case 314: /* cgroup_name */ + case 319: /* stream_name */ + case 325: /* table_alias */ + case 326: /* column_alias */ + case 332: /* star_func */ + case 334: /* noarg_func */ + case 349: /* alias_opt */ { } break; - case 256: /* sysinfo_opt */ + case 258: /* sysinfo_opt */ { } break; - case 257: /* privileges */ - case 259: /* priv_type_list */ - case 260: /* priv_type */ + case 259: /* privileges */ + case 261: /* priv_type_list */ + case 262: /* priv_type */ { } break; - case 263: /* not_exists_opt */ - case 265: /* exists_opt */ - case 313: /* analyze_opt */ - case 315: /* agg_func_opt */ - case 352: /* set_quantifier_opt */ + case 265: /* not_exists_opt */ + case 267: /* exists_opt */ + case 315: /* analyze_opt */ + case 317: /* agg_func_opt */ + case 354: /* set_quantifier_opt */ { } break; - case 267: /* integer_list */ - case 268: /* variable_list */ - case 269: /* retention_list */ - case 273: /* column_def_list */ - case 274: /* tags_def_opt */ - case 276: /* multi_create_clause */ - case 277: /* tags_def */ - case 278: /* multi_drop_clause */ - case 285: /* specific_tags_opt */ - case 286: /* literal_list */ - case 288: /* col_name_list */ - case 291: /* duration_list */ - case 292: /* rollup_func_list */ - case 304: /* func_list */ - case 308: /* expression_list */ - case 319: /* dnode_list */ - case 331: /* star_func_para_list */ - case 333: /* other_para_list */ - case 353: /* select_list */ - case 354: /* partition_by_clause_opt */ - case 359: /* group_by_clause_opt */ - case 363: /* group_by_list */ - case 365: /* order_by_clause_opt */ - case 369: /* sort_specification_list */ + case 269: /* integer_list */ + case 270: /* variable_list */ + case 271: /* retention_list */ + case 275: /* column_def_list */ + case 276: /* tags_def_opt */ + case 278: /* multi_create_clause */ + case 279: /* tags_def */ + case 280: /* multi_drop_clause */ + case 287: /* specific_tags_opt */ + case 288: /* literal_list */ + case 290: /* col_name_list */ + case 293: /* duration_list */ + case 294: /* rollup_func_list */ + case 306: /* func_list */ + case 310: /* expression_list */ + case 321: /* dnode_list */ + case 333: /* star_func_para_list */ + case 335: /* other_para_list */ + case 355: /* select_list */ + case 356: /* partition_by_clause_opt */ + case 361: /* group_by_clause_opt */ + case 365: /* group_by_list */ + case 367: /* order_by_clause_opt */ + case 371: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy296)); + nodesDestroyList((yypminor->yy424)); } break; - case 270: /* alter_db_option */ - case 293: /* alter_table_option */ + case 272: /* alter_db_option */ + case 295: /* alter_table_option */ { } break; - case 282: /* type_name */ + case 284: /* type_name */ { } break; - case 336: /* compare_op */ - case 337: /* in_op */ + case 338: /* compare_op */ + case 339: /* in_op */ { } break; - case 349: /* join_type */ + case 351: /* join_type */ { } break; - case 362: /* fill_mode */ + case 364: /* fill_mode */ { } break; - case 371: /* ordering_specification_opt */ + case 373: /* ordering_specification_opt */ { } break; - case 372: /* null_ordering_opt */ + case 374: /* null_ordering_opt */ { } @@ -2709,488 +2709,489 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 250, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - { 250, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - { 251, 0 }, /* (2) account_options ::= */ - { 251, -3 }, /* (3) account_options ::= account_options PPS literal */ - { 251, -3 }, /* (4) account_options ::= account_options TSERIES literal */ - { 251, -3 }, /* (5) account_options ::= account_options STORAGE literal */ - { 251, -3 }, /* (6) account_options ::= account_options STREAMS literal */ - { 251, -3 }, /* (7) account_options ::= account_options QTIME literal */ - { 251, -3 }, /* (8) account_options ::= account_options DBS literal */ - { 251, -3 }, /* (9) account_options ::= account_options USERS literal */ - { 251, -3 }, /* (10) account_options ::= account_options CONNS literal */ - { 251, -3 }, /* (11) account_options ::= account_options STATE literal */ - { 252, -1 }, /* (12) alter_account_options ::= alter_account_option */ - { 252, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - { 254, -2 }, /* (14) alter_account_option ::= PASS literal */ - { 254, -2 }, /* (15) alter_account_option ::= PPS literal */ - { 254, -2 }, /* (16) alter_account_option ::= TSERIES literal */ - { 254, -2 }, /* (17) alter_account_option ::= STORAGE literal */ - { 254, -2 }, /* (18) alter_account_option ::= STREAMS literal */ - { 254, -2 }, /* (19) alter_account_option ::= QTIME literal */ - { 254, -2 }, /* (20) alter_account_option ::= DBS literal */ - { 254, -2 }, /* (21) alter_account_option ::= USERS literal */ - { 254, -2 }, /* (22) alter_account_option ::= CONNS literal */ - { 254, -2 }, /* (23) alter_account_option ::= STATE literal */ - { 250, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ - { 250, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 250, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - { 250, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - { 250, -3 }, /* (28) cmd ::= DROP USER user_name */ - { 256, 0 }, /* (29) sysinfo_opt ::= */ - { 256, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ - { 250, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ - { 250, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ - { 257, -1 }, /* (33) privileges ::= ALL */ - { 257, -1 }, /* (34) privileges ::= priv_type_list */ - { 259, -1 }, /* (35) priv_type_list ::= priv_type */ - { 259, -3 }, /* (36) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - { 260, -1 }, /* (37) priv_type ::= READ */ - { 260, -1 }, /* (38) priv_type ::= WRITE */ - { 258, -3 }, /* (39) priv_level ::= NK_STAR NK_DOT NK_STAR */ - { 258, -3 }, /* (40) priv_level ::= db_name NK_DOT NK_STAR */ - { 250, -3 }, /* (41) cmd ::= CREATE DNODE dnode_endpoint */ - { 250, -5 }, /* (42) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - { 250, -3 }, /* (43) cmd ::= DROP DNODE NK_INTEGER */ - { 250, -3 }, /* (44) cmd ::= DROP DNODE dnode_endpoint */ - { 250, -4 }, /* (45) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - { 250, -5 }, /* (46) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - { 250, -4 }, /* (47) cmd ::= ALTER ALL DNODES NK_STRING */ - { 250, -5 }, /* (48) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - { 262, -1 }, /* (49) dnode_endpoint ::= NK_STRING */ - { 262, -1 }, /* (50) dnode_endpoint ::= NK_ID */ - { 262, -1 }, /* (51) dnode_endpoint ::= NK_IPTOKEN */ - { 250, -3 }, /* (52) cmd ::= ALTER LOCAL NK_STRING */ - { 250, -4 }, /* (53) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - { 250, -5 }, /* (54) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 250, -5 }, /* (55) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - { 250, -5 }, /* (56) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - { 250, -5 }, /* (57) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - { 250, -5 }, /* (58) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - { 250, -5 }, /* (59) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - { 250, -5 }, /* (60) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - { 250, -5 }, /* (61) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - { 250, -5 }, /* (62) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 250, -4 }, /* (63) cmd ::= DROP DATABASE exists_opt db_name */ - { 250, -2 }, /* (64) cmd ::= USE db_name */ - { 250, -4 }, /* (65) cmd ::= ALTER DATABASE db_name alter_db_options */ - { 263, -3 }, /* (66) not_exists_opt ::= IF NOT EXISTS */ - { 263, 0 }, /* (67) not_exists_opt ::= */ - { 265, -2 }, /* (68) exists_opt ::= IF EXISTS */ - { 265, 0 }, /* (69) exists_opt ::= */ - { 264, 0 }, /* (70) db_options ::= */ - { 264, -3 }, /* (71) db_options ::= db_options BUFFER NK_INTEGER */ - { 264, -3 }, /* (72) db_options ::= db_options CACHELAST NK_INTEGER */ - { 264, -3 }, /* (73) db_options ::= db_options COMP NK_INTEGER */ - { 264, -3 }, /* (74) db_options ::= db_options DURATION NK_INTEGER */ - { 264, -3 }, /* (75) db_options ::= db_options DURATION NK_VARIABLE */ - { 264, -3 }, /* (76) db_options ::= db_options FSYNC NK_INTEGER */ - { 264, -3 }, /* (77) db_options ::= db_options MAXROWS NK_INTEGER */ - { 264, -3 }, /* (78) db_options ::= db_options MINROWS NK_INTEGER */ - { 264, -3 }, /* (79) db_options ::= db_options KEEP integer_list */ - { 264, -3 }, /* (80) db_options ::= db_options KEEP variable_list */ - { 264, -3 }, /* (81) db_options ::= db_options PAGES NK_INTEGER */ - { 264, -3 }, /* (82) db_options ::= db_options PAGESIZE NK_INTEGER */ - { 264, -3 }, /* (83) db_options ::= db_options PRECISION NK_STRING */ - { 264, -3 }, /* (84) db_options ::= db_options REPLICA NK_INTEGER */ - { 264, -3 }, /* (85) db_options ::= db_options STRICT NK_INTEGER */ - { 264, -3 }, /* (86) db_options ::= db_options WAL NK_INTEGER */ - { 264, -3 }, /* (87) db_options ::= db_options VGROUPS NK_INTEGER */ - { 264, -3 }, /* (88) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 264, -3 }, /* (89) db_options ::= db_options RETENTIONS retention_list */ - { 264, -3 }, /* (90) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 266, -1 }, /* (91) alter_db_options ::= alter_db_option */ - { 266, -2 }, /* (92) alter_db_options ::= alter_db_options alter_db_option */ - { 270, -2 }, /* (93) alter_db_option ::= BUFFER NK_INTEGER */ - { 270, -2 }, /* (94) alter_db_option ::= CACHELAST NK_INTEGER */ - { 270, -2 }, /* (95) alter_db_option ::= FSYNC NK_INTEGER */ - { 270, -2 }, /* (96) alter_db_option ::= KEEP integer_list */ - { 270, -2 }, /* (97) alter_db_option ::= KEEP variable_list */ - { 270, -2 }, /* (98) alter_db_option ::= PAGES NK_INTEGER */ - { 270, -2 }, /* (99) alter_db_option ::= REPLICA NK_INTEGER */ - { 270, -2 }, /* (100) alter_db_option ::= STRICT NK_INTEGER */ - { 270, -2 }, /* (101) alter_db_option ::= WAL NK_INTEGER */ - { 267, -1 }, /* (102) integer_list ::= NK_INTEGER */ - { 267, -3 }, /* (103) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 268, -1 }, /* (104) variable_list ::= NK_VARIABLE */ - { 268, -3 }, /* (105) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 269, -1 }, /* (106) retention_list ::= retention */ - { 269, -3 }, /* (107) retention_list ::= retention_list NK_COMMA retention */ - { 271, -3 }, /* (108) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 250, -9 }, /* (109) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 250, -3 }, /* (110) cmd ::= CREATE TABLE multi_create_clause */ - { 250, -9 }, /* (111) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 250, -3 }, /* (112) cmd ::= DROP TABLE multi_drop_clause */ - { 250, -4 }, /* (113) cmd ::= DROP STABLE exists_opt full_table_name */ - { 250, -3 }, /* (114) cmd ::= ALTER TABLE alter_table_clause */ - { 250, -3 }, /* (115) cmd ::= ALTER STABLE alter_table_clause */ - { 279, -2 }, /* (116) alter_table_clause ::= full_table_name alter_table_options */ - { 279, -5 }, /* (117) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 279, -4 }, /* (118) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 279, -5 }, /* (119) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 279, -5 }, /* (120) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 279, -5 }, /* (121) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 279, -4 }, /* (122) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 279, -5 }, /* (123) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 279, -5 }, /* (124) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 279, -6 }, /* (125) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 276, -1 }, /* (126) multi_create_clause ::= create_subtable_clause */ - { 276, -2 }, /* (127) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 284, -10 }, /* (128) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ - { 278, -1 }, /* (129) multi_drop_clause ::= drop_table_clause */ - { 278, -2 }, /* (130) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 287, -2 }, /* (131) drop_table_clause ::= exists_opt full_table_name */ - { 285, 0 }, /* (132) specific_tags_opt ::= */ - { 285, -3 }, /* (133) specific_tags_opt ::= NK_LP col_name_list NK_RP */ - { 272, -1 }, /* (134) full_table_name ::= table_name */ - { 272, -3 }, /* (135) full_table_name ::= db_name NK_DOT table_name */ - { 273, -1 }, /* (136) column_def_list ::= column_def */ - { 273, -3 }, /* (137) column_def_list ::= column_def_list NK_COMMA column_def */ - { 290, -2 }, /* (138) column_def ::= column_name type_name */ - { 290, -4 }, /* (139) column_def ::= column_name type_name COMMENT NK_STRING */ - { 282, -1 }, /* (140) type_name ::= BOOL */ - { 282, -1 }, /* (141) type_name ::= TINYINT */ - { 282, -1 }, /* (142) type_name ::= SMALLINT */ - { 282, -1 }, /* (143) type_name ::= INT */ - { 282, -1 }, /* (144) type_name ::= INTEGER */ - { 282, -1 }, /* (145) type_name ::= BIGINT */ - { 282, -1 }, /* (146) type_name ::= FLOAT */ - { 282, -1 }, /* (147) type_name ::= DOUBLE */ - { 282, -4 }, /* (148) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 282, -1 }, /* (149) type_name ::= TIMESTAMP */ - { 282, -4 }, /* (150) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 282, -2 }, /* (151) type_name ::= TINYINT UNSIGNED */ - { 282, -2 }, /* (152) type_name ::= SMALLINT UNSIGNED */ - { 282, -2 }, /* (153) type_name ::= INT UNSIGNED */ - { 282, -2 }, /* (154) type_name ::= BIGINT UNSIGNED */ - { 282, -1 }, /* (155) type_name ::= JSON */ - { 282, -4 }, /* (156) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 282, -1 }, /* (157) type_name ::= MEDIUMBLOB */ - { 282, -1 }, /* (158) type_name ::= BLOB */ - { 282, -4 }, /* (159) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 282, -1 }, /* (160) type_name ::= DECIMAL */ - { 282, -4 }, /* (161) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 282, -6 }, /* (162) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 274, 0 }, /* (163) tags_def_opt ::= */ - { 274, -1 }, /* (164) tags_def_opt ::= tags_def */ - { 277, -4 }, /* (165) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 275, 0 }, /* (166) table_options ::= */ - { 275, -3 }, /* (167) table_options ::= table_options COMMENT NK_STRING */ - { 275, -3 }, /* (168) table_options ::= table_options MAX_DELAY duration_list */ - { 275, -3 }, /* (169) table_options ::= table_options WATERMARK duration_list */ - { 275, -5 }, /* (170) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 275, -3 }, /* (171) table_options ::= table_options TTL NK_INTEGER */ - { 275, -5 }, /* (172) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 280, -1 }, /* (173) alter_table_options ::= alter_table_option */ - { 280, -2 }, /* (174) alter_table_options ::= alter_table_options alter_table_option */ - { 293, -2 }, /* (175) alter_table_option ::= COMMENT NK_STRING */ - { 293, -2 }, /* (176) alter_table_option ::= TTL NK_INTEGER */ - { 291, -1 }, /* (177) duration_list ::= duration_literal */ - { 291, -3 }, /* (178) duration_list ::= duration_list NK_COMMA duration_literal */ - { 292, -1 }, /* (179) rollup_func_list ::= rollup_func_name */ - { 292, -3 }, /* (180) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 295, -1 }, /* (181) rollup_func_name ::= function_name */ - { 295, -1 }, /* (182) rollup_func_name ::= FIRST */ - { 295, -1 }, /* (183) rollup_func_name ::= LAST */ - { 288, -1 }, /* (184) col_name_list ::= col_name */ - { 288, -3 }, /* (185) col_name_list ::= col_name_list NK_COMMA col_name */ - { 297, -1 }, /* (186) col_name ::= column_name */ - { 250, -2 }, /* (187) cmd ::= SHOW DNODES */ - { 250, -2 }, /* (188) cmd ::= SHOW USERS */ - { 250, -2 }, /* (189) cmd ::= SHOW DATABASES */ - { 250, -4 }, /* (190) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 250, -4 }, /* (191) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 250, -3 }, /* (192) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 250, -2 }, /* (193) cmd ::= SHOW MNODES */ - { 250, -2 }, /* (194) cmd ::= SHOW MODULES */ - { 250, -2 }, /* (195) cmd ::= SHOW QNODES */ - { 250, -2 }, /* (196) cmd ::= SHOW FUNCTIONS */ - { 250, -5 }, /* (197) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 250, -2 }, /* (198) cmd ::= SHOW STREAMS */ - { 250, -2 }, /* (199) cmd ::= SHOW ACCOUNTS */ - { 250, -2 }, /* (200) cmd ::= SHOW APPS */ - { 250, -2 }, /* (201) cmd ::= SHOW CONNECTIONS */ - { 250, -2 }, /* (202) cmd ::= SHOW LICENCE */ - { 250, -2 }, /* (203) cmd ::= SHOW GRANTS */ - { 250, -4 }, /* (204) cmd ::= SHOW CREATE DATABASE db_name */ - { 250, -4 }, /* (205) cmd ::= SHOW CREATE TABLE full_table_name */ - { 250, -4 }, /* (206) cmd ::= SHOW CREATE STABLE full_table_name */ - { 250, -2 }, /* (207) cmd ::= SHOW QUERIES */ - { 250, -2 }, /* (208) cmd ::= SHOW SCORES */ - { 250, -2 }, /* (209) cmd ::= SHOW TOPICS */ - { 250, -2 }, /* (210) cmd ::= SHOW VARIABLES */ - { 250, -3 }, /* (211) cmd ::= SHOW LOCAL VARIABLES */ - { 250, -4 }, /* (212) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ - { 250, -2 }, /* (213) cmd ::= SHOW BNODES */ - { 250, -2 }, /* (214) cmd ::= SHOW SNODES */ - { 250, -2 }, /* (215) cmd ::= SHOW CLUSTER */ - { 250, -2 }, /* (216) cmd ::= SHOW TRANSACTIONS */ - { 250, -4 }, /* (217) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 250, -2 }, /* (218) cmd ::= SHOW CONSUMERS */ - { 250, -2 }, /* (219) cmd ::= SHOW SUBSCRIPTIONS */ - { 298, 0 }, /* (220) db_name_cond_opt ::= */ - { 298, -2 }, /* (221) db_name_cond_opt ::= db_name NK_DOT */ - { 299, 0 }, /* (222) like_pattern_opt ::= */ - { 299, -2 }, /* (223) like_pattern_opt ::= LIKE NK_STRING */ - { 300, -1 }, /* (224) table_name_cond ::= table_name */ - { 301, 0 }, /* (225) from_db_opt ::= */ - { 301, -2 }, /* (226) from_db_opt ::= FROM db_name */ - { 250, -8 }, /* (227) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ - { 250, -4 }, /* (228) cmd ::= DROP INDEX exists_opt index_name */ - { 303, -10 }, /* (229) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 303, -12 }, /* (230) 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 */ - { 304, -1 }, /* (231) func_list ::= func */ - { 304, -3 }, /* (232) func_list ::= func_list NK_COMMA func */ - { 307, -4 }, /* (233) func ::= function_name NK_LP expression_list NK_RP */ - { 306, 0 }, /* (234) sma_stream_opt ::= */ - { 306, -3 }, /* (235) sma_stream_opt ::= stream_options WATERMARK duration_literal */ - { 306, -3 }, /* (236) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ - { 250, -6 }, /* (237) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ - { 250, -7 }, /* (238) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 250, -9 }, /* (239) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 250, -7 }, /* (240) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 250, -9 }, /* (241) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 250, -4 }, /* (242) cmd ::= DROP TOPIC exists_opt topic_name */ - { 250, -7 }, /* (243) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 250, -2 }, /* (244) cmd ::= DESC full_table_name */ - { 250, -2 }, /* (245) cmd ::= DESCRIBE full_table_name */ - { 250, -3 }, /* (246) cmd ::= RESET QUERY CACHE */ - { 250, -4 }, /* (247) cmd ::= EXPLAIN analyze_opt explain_options query_expression */ - { 313, 0 }, /* (248) analyze_opt ::= */ - { 313, -1 }, /* (249) analyze_opt ::= ANALYZE */ - { 314, 0 }, /* (250) explain_options ::= */ - { 314, -3 }, /* (251) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 314, -3 }, /* (252) explain_options ::= explain_options RATIO NK_FLOAT */ - { 250, -6 }, /* (253) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ - { 250, -10 }, /* (254) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 250, -4 }, /* (255) cmd ::= DROP FUNCTION exists_opt function_name */ - { 315, 0 }, /* (256) agg_func_opt ::= */ - { 315, -1 }, /* (257) agg_func_opt ::= AGGREGATE */ - { 316, 0 }, /* (258) bufsize_opt ::= */ - { 316, -2 }, /* (259) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 250, -8 }, /* (260) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ - { 250, -4 }, /* (261) cmd ::= DROP STREAM exists_opt stream_name */ - { 318, 0 }, /* (262) into_opt ::= */ - { 318, -2 }, /* (263) into_opt ::= INTO full_table_name */ - { 309, 0 }, /* (264) stream_options ::= */ - { 309, -3 }, /* (265) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 309, -3 }, /* (266) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 309, -4 }, /* (267) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 309, -3 }, /* (268) stream_options ::= stream_options WATERMARK duration_literal */ - { 250, -3 }, /* (269) cmd ::= KILL CONNECTION NK_INTEGER */ - { 250, -3 }, /* (270) cmd ::= KILL QUERY NK_STRING */ - { 250, -3 }, /* (271) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 250, -2 }, /* (272) cmd ::= BALANCE VGROUP */ - { 250, -4 }, /* (273) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 250, -4 }, /* (274) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 250, -3 }, /* (275) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 319, -2 }, /* (276) dnode_list ::= DNODE NK_INTEGER */ - { 319, -3 }, /* (277) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 250, -3 }, /* (278) cmd ::= SYNCDB db_name REPLICA */ - { 250, -4 }, /* (279) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 250, -1 }, /* (280) cmd ::= query_expression */ - { 253, -1 }, /* (281) literal ::= NK_INTEGER */ - { 253, -1 }, /* (282) literal ::= NK_FLOAT */ - { 253, -1 }, /* (283) literal ::= NK_STRING */ - { 253, -1 }, /* (284) literal ::= NK_BOOL */ - { 253, -2 }, /* (285) literal ::= TIMESTAMP NK_STRING */ - { 253, -1 }, /* (286) literal ::= duration_literal */ - { 253, -1 }, /* (287) literal ::= NULL */ - { 253, -1 }, /* (288) literal ::= NK_QUESTION */ - { 294, -1 }, /* (289) duration_literal ::= NK_VARIABLE */ - { 321, -1 }, /* (290) signed ::= NK_INTEGER */ - { 321, -2 }, /* (291) signed ::= NK_PLUS NK_INTEGER */ - { 321, -2 }, /* (292) signed ::= NK_MINUS NK_INTEGER */ - { 321, -1 }, /* (293) signed ::= NK_FLOAT */ - { 321, -2 }, /* (294) signed ::= NK_PLUS NK_FLOAT */ - { 321, -2 }, /* (295) signed ::= NK_MINUS NK_FLOAT */ - { 283, -1 }, /* (296) signed_literal ::= signed */ - { 283, -1 }, /* (297) signed_literal ::= NK_STRING */ - { 283, -1 }, /* (298) signed_literal ::= NK_BOOL */ - { 283, -2 }, /* (299) signed_literal ::= TIMESTAMP NK_STRING */ - { 283, -1 }, /* (300) signed_literal ::= duration_literal */ - { 283, -1 }, /* (301) signed_literal ::= NULL */ - { 283, -1 }, /* (302) signed_literal ::= literal_func */ - { 286, -1 }, /* (303) literal_list ::= signed_literal */ - { 286, -3 }, /* (304) literal_list ::= literal_list NK_COMMA signed_literal */ - { 261, -1 }, /* (305) db_name ::= NK_ID */ - { 289, -1 }, /* (306) table_name ::= NK_ID */ - { 281, -1 }, /* (307) column_name ::= NK_ID */ - { 296, -1 }, /* (308) function_name ::= NK_ID */ - { 323, -1 }, /* (309) table_alias ::= NK_ID */ - { 324, -1 }, /* (310) column_alias ::= NK_ID */ - { 255, -1 }, /* (311) user_name ::= NK_ID */ - { 302, -1 }, /* (312) index_name ::= NK_ID */ - { 310, -1 }, /* (313) topic_name ::= NK_ID */ - { 317, -1 }, /* (314) stream_name ::= NK_ID */ - { 312, -1 }, /* (315) cgroup_name ::= NK_ID */ - { 325, -1 }, /* (316) expression ::= literal */ - { 325, -1 }, /* (317) expression ::= pseudo_column */ - { 325, -1 }, /* (318) expression ::= column_reference */ - { 325, -1 }, /* (319) expression ::= function_expression */ - { 325, -1 }, /* (320) expression ::= subquery */ - { 325, -3 }, /* (321) expression ::= NK_LP expression NK_RP */ - { 325, -2 }, /* (322) expression ::= NK_PLUS expression */ - { 325, -2 }, /* (323) expression ::= NK_MINUS expression */ - { 325, -3 }, /* (324) expression ::= expression NK_PLUS expression */ - { 325, -3 }, /* (325) expression ::= expression NK_MINUS expression */ - { 325, -3 }, /* (326) expression ::= expression NK_STAR expression */ - { 325, -3 }, /* (327) expression ::= expression NK_SLASH expression */ - { 325, -3 }, /* (328) expression ::= expression NK_REM expression */ - { 325, -3 }, /* (329) expression ::= column_reference NK_ARROW NK_STRING */ - { 325, -3 }, /* (330) expression ::= expression NK_BITAND expression */ - { 325, -3 }, /* (331) expression ::= expression NK_BITOR expression */ - { 308, -1 }, /* (332) expression_list ::= expression */ - { 308, -3 }, /* (333) expression_list ::= expression_list NK_COMMA expression */ - { 327, -1 }, /* (334) column_reference ::= column_name */ - { 327, -3 }, /* (335) column_reference ::= table_name NK_DOT column_name */ - { 326, -1 }, /* (336) pseudo_column ::= ROWTS */ - { 326, -1 }, /* (337) pseudo_column ::= TBNAME */ - { 326, -3 }, /* (338) pseudo_column ::= table_name NK_DOT TBNAME */ - { 326, -1 }, /* (339) pseudo_column ::= QSTARTTS */ - { 326, -1 }, /* (340) pseudo_column ::= QENDTS */ - { 326, -1 }, /* (341) pseudo_column ::= WSTARTTS */ - { 326, -1 }, /* (342) pseudo_column ::= WENDTS */ - { 326, -1 }, /* (343) pseudo_column ::= WDURATION */ - { 328, -4 }, /* (344) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 328, -4 }, /* (345) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 328, -6 }, /* (346) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ - { 328, -1 }, /* (347) function_expression ::= literal_func */ - { 322, -3 }, /* (348) literal_func ::= noarg_func NK_LP NK_RP */ - { 322, -1 }, /* (349) literal_func ::= NOW */ - { 332, -1 }, /* (350) noarg_func ::= NOW */ - { 332, -1 }, /* (351) noarg_func ::= TODAY */ - { 332, -1 }, /* (352) noarg_func ::= TIMEZONE */ - { 332, -1 }, /* (353) noarg_func ::= DATABASE */ - { 332, -1 }, /* (354) noarg_func ::= CLIENT_VERSION */ - { 332, -1 }, /* (355) noarg_func ::= SERVER_VERSION */ - { 332, -1 }, /* (356) noarg_func ::= SERVER_STATUS */ - { 332, -1 }, /* (357) noarg_func ::= CURRENT_USER */ - { 332, -1 }, /* (358) noarg_func ::= USER */ - { 330, -1 }, /* (359) star_func ::= COUNT */ - { 330, -1 }, /* (360) star_func ::= FIRST */ - { 330, -1 }, /* (361) star_func ::= LAST */ - { 330, -1 }, /* (362) star_func ::= LAST_ROW */ - { 331, -1 }, /* (363) star_func_para_list ::= NK_STAR */ - { 331, -1 }, /* (364) star_func_para_list ::= other_para_list */ - { 333, -1 }, /* (365) other_para_list ::= star_func_para */ - { 333, -3 }, /* (366) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 334, -1 }, /* (367) star_func_para ::= expression */ - { 334, -3 }, /* (368) star_func_para ::= table_name NK_DOT NK_STAR */ - { 335, -3 }, /* (369) predicate ::= expression compare_op expression */ - { 335, -5 }, /* (370) predicate ::= expression BETWEEN expression AND expression */ - { 335, -6 }, /* (371) predicate ::= expression NOT BETWEEN expression AND expression */ - { 335, -3 }, /* (372) predicate ::= expression IS NULL */ - { 335, -4 }, /* (373) predicate ::= expression IS NOT NULL */ - { 335, -3 }, /* (374) predicate ::= expression in_op in_predicate_value */ - { 336, -1 }, /* (375) compare_op ::= NK_LT */ - { 336, -1 }, /* (376) compare_op ::= NK_GT */ - { 336, -1 }, /* (377) compare_op ::= NK_LE */ - { 336, -1 }, /* (378) compare_op ::= NK_GE */ - { 336, -1 }, /* (379) compare_op ::= NK_NE */ - { 336, -1 }, /* (380) compare_op ::= NK_EQ */ - { 336, -1 }, /* (381) compare_op ::= LIKE */ - { 336, -2 }, /* (382) compare_op ::= NOT LIKE */ - { 336, -1 }, /* (383) compare_op ::= MATCH */ - { 336, -1 }, /* (384) compare_op ::= NMATCH */ - { 336, -1 }, /* (385) compare_op ::= CONTAINS */ - { 337, -1 }, /* (386) in_op ::= IN */ - { 337, -2 }, /* (387) in_op ::= NOT IN */ - { 338, -3 }, /* (388) in_predicate_value ::= NK_LP expression_list NK_RP */ - { 339, -1 }, /* (389) boolean_value_expression ::= boolean_primary */ - { 339, -2 }, /* (390) boolean_value_expression ::= NOT boolean_primary */ - { 339, -3 }, /* (391) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 339, -3 }, /* (392) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 340, -1 }, /* (393) boolean_primary ::= predicate */ - { 340, -3 }, /* (394) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 341, -1 }, /* (395) common_expression ::= expression */ - { 341, -1 }, /* (396) common_expression ::= boolean_value_expression */ - { 342, 0 }, /* (397) from_clause_opt ::= */ - { 342, -2 }, /* (398) from_clause_opt ::= FROM table_reference_list */ - { 343, -1 }, /* (399) table_reference_list ::= table_reference */ - { 343, -3 }, /* (400) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 344, -1 }, /* (401) table_reference ::= table_primary */ - { 344, -1 }, /* (402) table_reference ::= joined_table */ - { 345, -2 }, /* (403) table_primary ::= table_name alias_opt */ - { 345, -4 }, /* (404) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 345, -2 }, /* (405) table_primary ::= subquery alias_opt */ - { 345, -1 }, /* (406) table_primary ::= parenthesized_joined_table */ - { 347, 0 }, /* (407) alias_opt ::= */ - { 347, -1 }, /* (408) alias_opt ::= table_alias */ - { 347, -2 }, /* (409) alias_opt ::= AS table_alias */ - { 348, -3 }, /* (410) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 348, -3 }, /* (411) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 346, -6 }, /* (412) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 349, 0 }, /* (413) join_type ::= */ - { 349, -1 }, /* (414) join_type ::= INNER */ - { 351, -12 }, /* (415) 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 */ - { 352, 0 }, /* (416) set_quantifier_opt ::= */ - { 352, -1 }, /* (417) set_quantifier_opt ::= DISTINCT */ - { 352, -1 }, /* (418) set_quantifier_opt ::= ALL */ - { 353, -1 }, /* (419) select_list ::= select_item */ - { 353, -3 }, /* (420) select_list ::= select_list NK_COMMA select_item */ - { 361, -1 }, /* (421) select_item ::= NK_STAR */ - { 361, -1 }, /* (422) select_item ::= common_expression */ - { 361, -2 }, /* (423) select_item ::= common_expression column_alias */ - { 361, -3 }, /* (424) select_item ::= common_expression AS column_alias */ - { 361, -3 }, /* (425) select_item ::= table_name NK_DOT NK_STAR */ - { 320, 0 }, /* (426) where_clause_opt ::= */ - { 320, -2 }, /* (427) where_clause_opt ::= WHERE search_condition */ - { 354, 0 }, /* (428) partition_by_clause_opt ::= */ - { 354, -3 }, /* (429) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 358, 0 }, /* (430) twindow_clause_opt ::= */ - { 358, -6 }, /* (431) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 358, -4 }, /* (432) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ - { 358, -6 }, /* (433) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 358, -8 }, /* (434) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 305, 0 }, /* (435) sliding_opt ::= */ - { 305, -4 }, /* (436) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 357, 0 }, /* (437) fill_opt ::= */ - { 357, -4 }, /* (438) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 357, -6 }, /* (439) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 362, -1 }, /* (440) fill_mode ::= NONE */ - { 362, -1 }, /* (441) fill_mode ::= PREV */ - { 362, -1 }, /* (442) fill_mode ::= NULL */ - { 362, -1 }, /* (443) fill_mode ::= LINEAR */ - { 362, -1 }, /* (444) fill_mode ::= NEXT */ - { 359, 0 }, /* (445) group_by_clause_opt ::= */ - { 359, -3 }, /* (446) group_by_clause_opt ::= GROUP BY group_by_list */ - { 363, -1 }, /* (447) group_by_list ::= expression */ - { 363, -3 }, /* (448) group_by_list ::= group_by_list NK_COMMA expression */ - { 360, 0 }, /* (449) having_clause_opt ::= */ - { 360, -2 }, /* (450) having_clause_opt ::= HAVING search_condition */ - { 355, 0 }, /* (451) range_opt ::= */ - { 355, -6 }, /* (452) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ - { 356, 0 }, /* (453) every_opt ::= */ - { 356, -4 }, /* (454) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 311, -4 }, /* (455) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 364, -1 }, /* (456) query_expression_body ::= query_primary */ - { 364, -4 }, /* (457) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 364, -3 }, /* (458) query_expression_body ::= query_expression_body UNION query_expression_body */ - { 368, -1 }, /* (459) query_primary ::= query_specification */ - { 368, -6 }, /* (460) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ - { 365, 0 }, /* (461) order_by_clause_opt ::= */ - { 365, -3 }, /* (462) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 366, 0 }, /* (463) slimit_clause_opt ::= */ - { 366, -2 }, /* (464) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 366, -4 }, /* (465) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 366, -4 }, /* (466) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 367, 0 }, /* (467) limit_clause_opt ::= */ - { 367, -2 }, /* (468) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 367, -4 }, /* (469) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 367, -4 }, /* (470) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 329, -3 }, /* (471) subquery ::= NK_LP query_expression NK_RP */ - { 350, -1 }, /* (472) search_condition ::= common_expression */ - { 369, -1 }, /* (473) sort_specification_list ::= sort_specification */ - { 369, -3 }, /* (474) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 370, -3 }, /* (475) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 371, 0 }, /* (476) ordering_specification_opt ::= */ - { 371, -1 }, /* (477) ordering_specification_opt ::= ASC */ - { 371, -1 }, /* (478) ordering_specification_opt ::= DESC */ - { 372, 0 }, /* (479) null_ordering_opt ::= */ - { 372, -2 }, /* (480) null_ordering_opt ::= NULLS FIRST */ - { 372, -2 }, /* (481) null_ordering_opt ::= NULLS LAST */ + { 252, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + { 252, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + { 253, 0 }, /* (2) account_options ::= */ + { 253, -3 }, /* (3) account_options ::= account_options PPS literal */ + { 253, -3 }, /* (4) account_options ::= account_options TSERIES literal */ + { 253, -3 }, /* (5) account_options ::= account_options STORAGE literal */ + { 253, -3 }, /* (6) account_options ::= account_options STREAMS literal */ + { 253, -3 }, /* (7) account_options ::= account_options QTIME literal */ + { 253, -3 }, /* (8) account_options ::= account_options DBS literal */ + { 253, -3 }, /* (9) account_options ::= account_options USERS literal */ + { 253, -3 }, /* (10) account_options ::= account_options CONNS literal */ + { 253, -3 }, /* (11) account_options ::= account_options STATE literal */ + { 254, -1 }, /* (12) alter_account_options ::= alter_account_option */ + { 254, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + { 256, -2 }, /* (14) alter_account_option ::= PASS literal */ + { 256, -2 }, /* (15) alter_account_option ::= PPS literal */ + { 256, -2 }, /* (16) alter_account_option ::= TSERIES literal */ + { 256, -2 }, /* (17) alter_account_option ::= STORAGE literal */ + { 256, -2 }, /* (18) alter_account_option ::= STREAMS literal */ + { 256, -2 }, /* (19) alter_account_option ::= QTIME literal */ + { 256, -2 }, /* (20) alter_account_option ::= DBS literal */ + { 256, -2 }, /* (21) alter_account_option ::= USERS literal */ + { 256, -2 }, /* (22) alter_account_option ::= CONNS literal */ + { 256, -2 }, /* (23) alter_account_option ::= STATE literal */ + { 252, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ + { 252, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 252, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + { 252, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + { 252, -3 }, /* (28) cmd ::= DROP USER user_name */ + { 258, 0 }, /* (29) sysinfo_opt ::= */ + { 258, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ + { 252, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ + { 252, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ + { 259, -1 }, /* (33) privileges ::= ALL */ + { 259, -1 }, /* (34) privileges ::= priv_type_list */ + { 261, -1 }, /* (35) priv_type_list ::= priv_type */ + { 261, -3 }, /* (36) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { 262, -1 }, /* (37) priv_type ::= READ */ + { 262, -1 }, /* (38) priv_type ::= WRITE */ + { 260, -3 }, /* (39) priv_level ::= NK_STAR NK_DOT NK_STAR */ + { 260, -3 }, /* (40) priv_level ::= db_name NK_DOT NK_STAR */ + { 252, -3 }, /* (41) cmd ::= CREATE DNODE dnode_endpoint */ + { 252, -5 }, /* (42) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + { 252, -3 }, /* (43) cmd ::= DROP DNODE NK_INTEGER */ + { 252, -3 }, /* (44) cmd ::= DROP DNODE dnode_endpoint */ + { 252, -4 }, /* (45) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 252, -5 }, /* (46) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 252, -4 }, /* (47) cmd ::= ALTER ALL DNODES NK_STRING */ + { 252, -5 }, /* (48) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 264, -1 }, /* (49) dnode_endpoint ::= NK_STRING */ + { 264, -1 }, /* (50) dnode_endpoint ::= NK_ID */ + { 264, -1 }, /* (51) dnode_endpoint ::= NK_IPTOKEN */ + { 252, -3 }, /* (52) cmd ::= ALTER LOCAL NK_STRING */ + { 252, -4 }, /* (53) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 252, -5 }, /* (54) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 252, -5 }, /* (55) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 252, -5 }, /* (56) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { 252, -5 }, /* (57) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { 252, -5 }, /* (58) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { 252, -5 }, /* (59) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { 252, -5 }, /* (60) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { 252, -5 }, /* (61) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { 252, -5 }, /* (62) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 252, -4 }, /* (63) cmd ::= DROP DATABASE exists_opt db_name */ + { 252, -2 }, /* (64) cmd ::= USE db_name */ + { 252, -4 }, /* (65) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 265, -3 }, /* (66) not_exists_opt ::= IF NOT EXISTS */ + { 265, 0 }, /* (67) not_exists_opt ::= */ + { 267, -2 }, /* (68) exists_opt ::= IF EXISTS */ + { 267, 0 }, /* (69) exists_opt ::= */ + { 266, 0 }, /* (70) db_options ::= */ + { 266, -3 }, /* (71) db_options ::= db_options BUFFER NK_INTEGER */ + { 266, -3 }, /* (72) db_options ::= db_options CACHELAST NK_INTEGER */ + { 266, -3 }, /* (73) db_options ::= db_options COMP NK_INTEGER */ + { 266, -3 }, /* (74) db_options ::= db_options DURATION NK_INTEGER */ + { 266, -3 }, /* (75) db_options ::= db_options DURATION NK_VARIABLE */ + { 266, -3 }, /* (76) db_options ::= db_options FSYNC NK_INTEGER */ + { 266, -3 }, /* (77) db_options ::= db_options MAXROWS NK_INTEGER */ + { 266, -3 }, /* (78) db_options ::= db_options MINROWS NK_INTEGER */ + { 266, -3 }, /* (79) db_options ::= db_options KEEP integer_list */ + { 266, -3 }, /* (80) db_options ::= db_options KEEP variable_list */ + { 266, -3 }, /* (81) db_options ::= db_options PAGES NK_INTEGER */ + { 266, -3 }, /* (82) db_options ::= db_options PAGESIZE NK_INTEGER */ + { 266, -3 }, /* (83) db_options ::= db_options PRECISION NK_STRING */ + { 266, -3 }, /* (84) db_options ::= db_options REPLICA NK_INTEGER */ + { 266, -3 }, /* (85) db_options ::= db_options STRICT NK_INTEGER */ + { 266, -3 }, /* (86) db_options ::= db_options WAL NK_INTEGER */ + { 266, -3 }, /* (87) db_options ::= db_options VGROUPS NK_INTEGER */ + { 266, -3 }, /* (88) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 266, -3 }, /* (89) db_options ::= db_options RETENTIONS retention_list */ + { 266, -3 }, /* (90) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 268, -1 }, /* (91) alter_db_options ::= alter_db_option */ + { 268, -2 }, /* (92) alter_db_options ::= alter_db_options alter_db_option */ + { 272, -2 }, /* (93) alter_db_option ::= BUFFER NK_INTEGER */ + { 272, -2 }, /* (94) alter_db_option ::= CACHELAST NK_INTEGER */ + { 272, -2 }, /* (95) alter_db_option ::= FSYNC NK_INTEGER */ + { 272, -2 }, /* (96) alter_db_option ::= KEEP integer_list */ + { 272, -2 }, /* (97) alter_db_option ::= KEEP variable_list */ + { 272, -2 }, /* (98) alter_db_option ::= PAGES NK_INTEGER */ + { 272, -2 }, /* (99) alter_db_option ::= REPLICA NK_INTEGER */ + { 272, -2 }, /* (100) alter_db_option ::= STRICT NK_INTEGER */ + { 272, -2 }, /* (101) alter_db_option ::= WAL NK_INTEGER */ + { 269, -1 }, /* (102) integer_list ::= NK_INTEGER */ + { 269, -3 }, /* (103) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 270, -1 }, /* (104) variable_list ::= NK_VARIABLE */ + { 270, -3 }, /* (105) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 271, -1 }, /* (106) retention_list ::= retention */ + { 271, -3 }, /* (107) retention_list ::= retention_list NK_COMMA retention */ + { 273, -3 }, /* (108) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 252, -9 }, /* (109) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 252, -3 }, /* (110) cmd ::= CREATE TABLE multi_create_clause */ + { 252, -9 }, /* (111) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 252, -3 }, /* (112) cmd ::= DROP TABLE multi_drop_clause */ + { 252, -4 }, /* (113) cmd ::= DROP STABLE exists_opt full_table_name */ + { 252, -3 }, /* (114) cmd ::= ALTER TABLE alter_table_clause */ + { 252, -3 }, /* (115) cmd ::= ALTER STABLE alter_table_clause */ + { 281, -2 }, /* (116) alter_table_clause ::= full_table_name alter_table_options */ + { 281, -5 }, /* (117) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 281, -4 }, /* (118) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 281, -5 }, /* (119) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 281, -5 }, /* (120) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 281, -5 }, /* (121) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 281, -4 }, /* (122) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 281, -5 }, /* (123) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 281, -5 }, /* (124) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 281, -6 }, /* (125) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 278, -1 }, /* (126) multi_create_clause ::= create_subtable_clause */ + { 278, -2 }, /* (127) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 286, -10 }, /* (128) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ + { 280, -1 }, /* (129) multi_drop_clause ::= drop_table_clause */ + { 280, -2 }, /* (130) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 289, -2 }, /* (131) drop_table_clause ::= exists_opt full_table_name */ + { 287, 0 }, /* (132) specific_tags_opt ::= */ + { 287, -3 }, /* (133) specific_tags_opt ::= NK_LP col_name_list NK_RP */ + { 274, -1 }, /* (134) full_table_name ::= table_name */ + { 274, -3 }, /* (135) full_table_name ::= db_name NK_DOT table_name */ + { 275, -1 }, /* (136) column_def_list ::= column_def */ + { 275, -3 }, /* (137) column_def_list ::= column_def_list NK_COMMA column_def */ + { 292, -2 }, /* (138) column_def ::= column_name type_name */ + { 292, -4 }, /* (139) column_def ::= column_name type_name COMMENT NK_STRING */ + { 284, -1 }, /* (140) type_name ::= BOOL */ + { 284, -1 }, /* (141) type_name ::= TINYINT */ + { 284, -1 }, /* (142) type_name ::= SMALLINT */ + { 284, -1 }, /* (143) type_name ::= INT */ + { 284, -1 }, /* (144) type_name ::= INTEGER */ + { 284, -1 }, /* (145) type_name ::= BIGINT */ + { 284, -1 }, /* (146) type_name ::= FLOAT */ + { 284, -1 }, /* (147) type_name ::= DOUBLE */ + { 284, -4 }, /* (148) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 284, -1 }, /* (149) type_name ::= TIMESTAMP */ + { 284, -4 }, /* (150) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 284, -2 }, /* (151) type_name ::= TINYINT UNSIGNED */ + { 284, -2 }, /* (152) type_name ::= SMALLINT UNSIGNED */ + { 284, -2 }, /* (153) type_name ::= INT UNSIGNED */ + { 284, -2 }, /* (154) type_name ::= BIGINT UNSIGNED */ + { 284, -1 }, /* (155) type_name ::= JSON */ + { 284, -4 }, /* (156) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 284, -1 }, /* (157) type_name ::= MEDIUMBLOB */ + { 284, -1 }, /* (158) type_name ::= BLOB */ + { 284, -4 }, /* (159) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 284, -1 }, /* (160) type_name ::= DECIMAL */ + { 284, -4 }, /* (161) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 284, -6 }, /* (162) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 276, 0 }, /* (163) tags_def_opt ::= */ + { 276, -1 }, /* (164) tags_def_opt ::= tags_def */ + { 279, -4 }, /* (165) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 277, 0 }, /* (166) table_options ::= */ + { 277, -3 }, /* (167) table_options ::= table_options COMMENT NK_STRING */ + { 277, -3 }, /* (168) table_options ::= table_options MAX_DELAY duration_list */ + { 277, -3 }, /* (169) table_options ::= table_options WATERMARK duration_list */ + { 277, -5 }, /* (170) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 277, -3 }, /* (171) table_options ::= table_options TTL NK_INTEGER */ + { 277, -5 }, /* (172) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 282, -1 }, /* (173) alter_table_options ::= alter_table_option */ + { 282, -2 }, /* (174) alter_table_options ::= alter_table_options alter_table_option */ + { 295, -2 }, /* (175) alter_table_option ::= COMMENT NK_STRING */ + { 295, -2 }, /* (176) alter_table_option ::= TTL NK_INTEGER */ + { 293, -1 }, /* (177) duration_list ::= duration_literal */ + { 293, -3 }, /* (178) duration_list ::= duration_list NK_COMMA duration_literal */ + { 294, -1 }, /* (179) rollup_func_list ::= rollup_func_name */ + { 294, -3 }, /* (180) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 297, -1 }, /* (181) rollup_func_name ::= function_name */ + { 297, -1 }, /* (182) rollup_func_name ::= FIRST */ + { 297, -1 }, /* (183) rollup_func_name ::= LAST */ + { 290, -1 }, /* (184) col_name_list ::= col_name */ + { 290, -3 }, /* (185) col_name_list ::= col_name_list NK_COMMA col_name */ + { 299, -1 }, /* (186) col_name ::= column_name */ + { 252, -2 }, /* (187) cmd ::= SHOW DNODES */ + { 252, -2 }, /* (188) cmd ::= SHOW USERS */ + { 252, -2 }, /* (189) cmd ::= SHOW DATABASES */ + { 252, -4 }, /* (190) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 252, -4 }, /* (191) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 252, -3 }, /* (192) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 252, -2 }, /* (193) cmd ::= SHOW MNODES */ + { 252, -2 }, /* (194) cmd ::= SHOW MODULES */ + { 252, -2 }, /* (195) cmd ::= SHOW QNODES */ + { 252, -2 }, /* (196) cmd ::= SHOW FUNCTIONS */ + { 252, -5 }, /* (197) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 252, -2 }, /* (198) cmd ::= SHOW STREAMS */ + { 252, -2 }, /* (199) cmd ::= SHOW ACCOUNTS */ + { 252, -2 }, /* (200) cmd ::= SHOW APPS */ + { 252, -2 }, /* (201) cmd ::= SHOW CONNECTIONS */ + { 252, -2 }, /* (202) cmd ::= SHOW LICENCE */ + { 252, -2 }, /* (203) cmd ::= SHOW GRANTS */ + { 252, -4 }, /* (204) cmd ::= SHOW CREATE DATABASE db_name */ + { 252, -4 }, /* (205) cmd ::= SHOW CREATE TABLE full_table_name */ + { 252, -4 }, /* (206) cmd ::= SHOW CREATE STABLE full_table_name */ + { 252, -2 }, /* (207) cmd ::= SHOW QUERIES */ + { 252, -2 }, /* (208) cmd ::= SHOW SCORES */ + { 252, -2 }, /* (209) cmd ::= SHOW TOPICS */ + { 252, -2 }, /* (210) cmd ::= SHOW VARIABLES */ + { 252, -3 }, /* (211) cmd ::= SHOW LOCAL VARIABLES */ + { 252, -4 }, /* (212) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ + { 252, -2 }, /* (213) cmd ::= SHOW BNODES */ + { 252, -2 }, /* (214) cmd ::= SHOW SNODES */ + { 252, -2 }, /* (215) cmd ::= SHOW CLUSTER */ + { 252, -2 }, /* (216) cmd ::= SHOW TRANSACTIONS */ + { 252, -4 }, /* (217) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 252, -2 }, /* (218) cmd ::= SHOW CONSUMERS */ + { 252, -2 }, /* (219) cmd ::= SHOW SUBSCRIPTIONS */ + { 300, 0 }, /* (220) db_name_cond_opt ::= */ + { 300, -2 }, /* (221) db_name_cond_opt ::= db_name NK_DOT */ + { 301, 0 }, /* (222) like_pattern_opt ::= */ + { 301, -2 }, /* (223) like_pattern_opt ::= LIKE NK_STRING */ + { 302, -1 }, /* (224) table_name_cond ::= table_name */ + { 303, 0 }, /* (225) from_db_opt ::= */ + { 303, -2 }, /* (226) from_db_opt ::= FROM db_name */ + { 252, -8 }, /* (227) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ + { 252, -4 }, /* (228) cmd ::= DROP INDEX exists_opt index_name */ + { 305, -10 }, /* (229) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 305, -12 }, /* (230) 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 */ + { 306, -1 }, /* (231) func_list ::= func */ + { 306, -3 }, /* (232) func_list ::= func_list NK_COMMA func */ + { 309, -4 }, /* (233) func ::= function_name NK_LP expression_list NK_RP */ + { 308, 0 }, /* (234) sma_stream_opt ::= */ + { 308, -3 }, /* (235) sma_stream_opt ::= stream_options WATERMARK duration_literal */ + { 308, -3 }, /* (236) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ + { 252, -6 }, /* (237) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ + { 252, -7 }, /* (238) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 252, -9 }, /* (239) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 252, -7 }, /* (240) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 252, -9 }, /* (241) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 252, -4 }, /* (242) cmd ::= DROP TOPIC exists_opt topic_name */ + { 252, -7 }, /* (243) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 252, -2 }, /* (244) cmd ::= DESC full_table_name */ + { 252, -2 }, /* (245) cmd ::= DESCRIBE full_table_name */ + { 252, -3 }, /* (246) cmd ::= RESET QUERY CACHE */ + { 252, -4 }, /* (247) cmd ::= EXPLAIN analyze_opt explain_options query_expression */ + { 315, 0 }, /* (248) analyze_opt ::= */ + { 315, -1 }, /* (249) analyze_opt ::= ANALYZE */ + { 316, 0 }, /* (250) explain_options ::= */ + { 316, -3 }, /* (251) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 316, -3 }, /* (252) explain_options ::= explain_options RATIO NK_FLOAT */ + { 252, -6 }, /* (253) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ + { 252, -10 }, /* (254) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 252, -4 }, /* (255) cmd ::= DROP FUNCTION exists_opt function_name */ + { 317, 0 }, /* (256) agg_func_opt ::= */ + { 317, -1 }, /* (257) agg_func_opt ::= AGGREGATE */ + { 318, 0 }, /* (258) bufsize_opt ::= */ + { 318, -2 }, /* (259) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 252, -8 }, /* (260) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ + { 252, -4 }, /* (261) cmd ::= DROP STREAM exists_opt stream_name */ + { 320, 0 }, /* (262) into_opt ::= */ + { 320, -2 }, /* (263) into_opt ::= INTO full_table_name */ + { 311, 0 }, /* (264) stream_options ::= */ + { 311, -3 }, /* (265) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 311, -3 }, /* (266) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 311, -4 }, /* (267) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 311, -3 }, /* (268) stream_options ::= stream_options WATERMARK duration_literal */ + { 311, -3 }, /* (269) stream_options ::= stream_options IGNORE EXPIRED */ + { 252, -3 }, /* (270) cmd ::= KILL CONNECTION NK_INTEGER */ + { 252, -3 }, /* (271) cmd ::= KILL QUERY NK_STRING */ + { 252, -3 }, /* (272) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 252, -2 }, /* (273) cmd ::= BALANCE VGROUP */ + { 252, -4 }, /* (274) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 252, -4 }, /* (275) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 252, -3 }, /* (276) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 321, -2 }, /* (277) dnode_list ::= DNODE NK_INTEGER */ + { 321, -3 }, /* (278) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 252, -3 }, /* (279) cmd ::= SYNCDB db_name REPLICA */ + { 252, -4 }, /* (280) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 252, -1 }, /* (281) cmd ::= query_expression */ + { 255, -1 }, /* (282) literal ::= NK_INTEGER */ + { 255, -1 }, /* (283) literal ::= NK_FLOAT */ + { 255, -1 }, /* (284) literal ::= NK_STRING */ + { 255, -1 }, /* (285) literal ::= NK_BOOL */ + { 255, -2 }, /* (286) literal ::= TIMESTAMP NK_STRING */ + { 255, -1 }, /* (287) literal ::= duration_literal */ + { 255, -1 }, /* (288) literal ::= NULL */ + { 255, -1 }, /* (289) literal ::= NK_QUESTION */ + { 296, -1 }, /* (290) duration_literal ::= NK_VARIABLE */ + { 323, -1 }, /* (291) signed ::= NK_INTEGER */ + { 323, -2 }, /* (292) signed ::= NK_PLUS NK_INTEGER */ + { 323, -2 }, /* (293) signed ::= NK_MINUS NK_INTEGER */ + { 323, -1 }, /* (294) signed ::= NK_FLOAT */ + { 323, -2 }, /* (295) signed ::= NK_PLUS NK_FLOAT */ + { 323, -2 }, /* (296) signed ::= NK_MINUS NK_FLOAT */ + { 285, -1 }, /* (297) signed_literal ::= signed */ + { 285, -1 }, /* (298) signed_literal ::= NK_STRING */ + { 285, -1 }, /* (299) signed_literal ::= NK_BOOL */ + { 285, -2 }, /* (300) signed_literal ::= TIMESTAMP NK_STRING */ + { 285, -1 }, /* (301) signed_literal ::= duration_literal */ + { 285, -1 }, /* (302) signed_literal ::= NULL */ + { 285, -1 }, /* (303) signed_literal ::= literal_func */ + { 288, -1 }, /* (304) literal_list ::= signed_literal */ + { 288, -3 }, /* (305) literal_list ::= literal_list NK_COMMA signed_literal */ + { 263, -1 }, /* (306) db_name ::= NK_ID */ + { 291, -1 }, /* (307) table_name ::= NK_ID */ + { 283, -1 }, /* (308) column_name ::= NK_ID */ + { 298, -1 }, /* (309) function_name ::= NK_ID */ + { 325, -1 }, /* (310) table_alias ::= NK_ID */ + { 326, -1 }, /* (311) column_alias ::= NK_ID */ + { 257, -1 }, /* (312) user_name ::= NK_ID */ + { 304, -1 }, /* (313) index_name ::= NK_ID */ + { 312, -1 }, /* (314) topic_name ::= NK_ID */ + { 319, -1 }, /* (315) stream_name ::= NK_ID */ + { 314, -1 }, /* (316) cgroup_name ::= NK_ID */ + { 327, -1 }, /* (317) expression ::= literal */ + { 327, -1 }, /* (318) expression ::= pseudo_column */ + { 327, -1 }, /* (319) expression ::= column_reference */ + { 327, -1 }, /* (320) expression ::= function_expression */ + { 327, -1 }, /* (321) expression ::= subquery */ + { 327, -3 }, /* (322) expression ::= NK_LP expression NK_RP */ + { 327, -2 }, /* (323) expression ::= NK_PLUS expression */ + { 327, -2 }, /* (324) expression ::= NK_MINUS expression */ + { 327, -3 }, /* (325) expression ::= expression NK_PLUS expression */ + { 327, -3 }, /* (326) expression ::= expression NK_MINUS expression */ + { 327, -3 }, /* (327) expression ::= expression NK_STAR expression */ + { 327, -3 }, /* (328) expression ::= expression NK_SLASH expression */ + { 327, -3 }, /* (329) expression ::= expression NK_REM expression */ + { 327, -3 }, /* (330) expression ::= column_reference NK_ARROW NK_STRING */ + { 327, -3 }, /* (331) expression ::= expression NK_BITAND expression */ + { 327, -3 }, /* (332) expression ::= expression NK_BITOR expression */ + { 310, -1 }, /* (333) expression_list ::= expression */ + { 310, -3 }, /* (334) expression_list ::= expression_list NK_COMMA expression */ + { 329, -1 }, /* (335) column_reference ::= column_name */ + { 329, -3 }, /* (336) column_reference ::= table_name NK_DOT column_name */ + { 328, -1 }, /* (337) pseudo_column ::= ROWTS */ + { 328, -1 }, /* (338) pseudo_column ::= TBNAME */ + { 328, -3 }, /* (339) pseudo_column ::= table_name NK_DOT TBNAME */ + { 328, -1 }, /* (340) pseudo_column ::= QSTARTTS */ + { 328, -1 }, /* (341) pseudo_column ::= QENDTS */ + { 328, -1 }, /* (342) pseudo_column ::= WSTARTTS */ + { 328, -1 }, /* (343) pseudo_column ::= WENDTS */ + { 328, -1 }, /* (344) pseudo_column ::= WDURATION */ + { 330, -4 }, /* (345) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 330, -4 }, /* (346) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 330, -6 }, /* (347) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ + { 330, -1 }, /* (348) function_expression ::= literal_func */ + { 324, -3 }, /* (349) literal_func ::= noarg_func NK_LP NK_RP */ + { 324, -1 }, /* (350) literal_func ::= NOW */ + { 334, -1 }, /* (351) noarg_func ::= NOW */ + { 334, -1 }, /* (352) noarg_func ::= TODAY */ + { 334, -1 }, /* (353) noarg_func ::= TIMEZONE */ + { 334, -1 }, /* (354) noarg_func ::= DATABASE */ + { 334, -1 }, /* (355) noarg_func ::= CLIENT_VERSION */ + { 334, -1 }, /* (356) noarg_func ::= SERVER_VERSION */ + { 334, -1 }, /* (357) noarg_func ::= SERVER_STATUS */ + { 334, -1 }, /* (358) noarg_func ::= CURRENT_USER */ + { 334, -1 }, /* (359) noarg_func ::= USER */ + { 332, -1 }, /* (360) star_func ::= COUNT */ + { 332, -1 }, /* (361) star_func ::= FIRST */ + { 332, -1 }, /* (362) star_func ::= LAST */ + { 332, -1 }, /* (363) star_func ::= LAST_ROW */ + { 333, -1 }, /* (364) star_func_para_list ::= NK_STAR */ + { 333, -1 }, /* (365) star_func_para_list ::= other_para_list */ + { 335, -1 }, /* (366) other_para_list ::= star_func_para */ + { 335, -3 }, /* (367) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 336, -1 }, /* (368) star_func_para ::= expression */ + { 336, -3 }, /* (369) star_func_para ::= table_name NK_DOT NK_STAR */ + { 337, -3 }, /* (370) predicate ::= expression compare_op expression */ + { 337, -5 }, /* (371) predicate ::= expression BETWEEN expression AND expression */ + { 337, -6 }, /* (372) predicate ::= expression NOT BETWEEN expression AND expression */ + { 337, -3 }, /* (373) predicate ::= expression IS NULL */ + { 337, -4 }, /* (374) predicate ::= expression IS NOT NULL */ + { 337, -3 }, /* (375) predicate ::= expression in_op in_predicate_value */ + { 338, -1 }, /* (376) compare_op ::= NK_LT */ + { 338, -1 }, /* (377) compare_op ::= NK_GT */ + { 338, -1 }, /* (378) compare_op ::= NK_LE */ + { 338, -1 }, /* (379) compare_op ::= NK_GE */ + { 338, -1 }, /* (380) compare_op ::= NK_NE */ + { 338, -1 }, /* (381) compare_op ::= NK_EQ */ + { 338, -1 }, /* (382) compare_op ::= LIKE */ + { 338, -2 }, /* (383) compare_op ::= NOT LIKE */ + { 338, -1 }, /* (384) compare_op ::= MATCH */ + { 338, -1 }, /* (385) compare_op ::= NMATCH */ + { 338, -1 }, /* (386) compare_op ::= CONTAINS */ + { 339, -1 }, /* (387) in_op ::= IN */ + { 339, -2 }, /* (388) in_op ::= NOT IN */ + { 340, -3 }, /* (389) in_predicate_value ::= NK_LP expression_list NK_RP */ + { 341, -1 }, /* (390) boolean_value_expression ::= boolean_primary */ + { 341, -2 }, /* (391) boolean_value_expression ::= NOT boolean_primary */ + { 341, -3 }, /* (392) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 341, -3 }, /* (393) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 342, -1 }, /* (394) boolean_primary ::= predicate */ + { 342, -3 }, /* (395) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 343, -1 }, /* (396) common_expression ::= expression */ + { 343, -1 }, /* (397) common_expression ::= boolean_value_expression */ + { 344, 0 }, /* (398) from_clause_opt ::= */ + { 344, -2 }, /* (399) from_clause_opt ::= FROM table_reference_list */ + { 345, -1 }, /* (400) table_reference_list ::= table_reference */ + { 345, -3 }, /* (401) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 346, -1 }, /* (402) table_reference ::= table_primary */ + { 346, -1 }, /* (403) table_reference ::= joined_table */ + { 347, -2 }, /* (404) table_primary ::= table_name alias_opt */ + { 347, -4 }, /* (405) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 347, -2 }, /* (406) table_primary ::= subquery alias_opt */ + { 347, -1 }, /* (407) table_primary ::= parenthesized_joined_table */ + { 349, 0 }, /* (408) alias_opt ::= */ + { 349, -1 }, /* (409) alias_opt ::= table_alias */ + { 349, -2 }, /* (410) alias_opt ::= AS table_alias */ + { 350, -3 }, /* (411) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 350, -3 }, /* (412) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 348, -6 }, /* (413) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 351, 0 }, /* (414) join_type ::= */ + { 351, -1 }, /* (415) join_type ::= INNER */ + { 353, -12 }, /* (416) 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 */ + { 354, 0 }, /* (417) set_quantifier_opt ::= */ + { 354, -1 }, /* (418) set_quantifier_opt ::= DISTINCT */ + { 354, -1 }, /* (419) set_quantifier_opt ::= ALL */ + { 355, -1 }, /* (420) select_list ::= select_item */ + { 355, -3 }, /* (421) select_list ::= select_list NK_COMMA select_item */ + { 363, -1 }, /* (422) select_item ::= NK_STAR */ + { 363, -1 }, /* (423) select_item ::= common_expression */ + { 363, -2 }, /* (424) select_item ::= common_expression column_alias */ + { 363, -3 }, /* (425) select_item ::= common_expression AS column_alias */ + { 363, -3 }, /* (426) select_item ::= table_name NK_DOT NK_STAR */ + { 322, 0 }, /* (427) where_clause_opt ::= */ + { 322, -2 }, /* (428) where_clause_opt ::= WHERE search_condition */ + { 356, 0 }, /* (429) partition_by_clause_opt ::= */ + { 356, -3 }, /* (430) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 360, 0 }, /* (431) twindow_clause_opt ::= */ + { 360, -6 }, /* (432) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 360, -4 }, /* (433) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ + { 360, -6 }, /* (434) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 360, -8 }, /* (435) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 307, 0 }, /* (436) sliding_opt ::= */ + { 307, -4 }, /* (437) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 359, 0 }, /* (438) fill_opt ::= */ + { 359, -4 }, /* (439) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 359, -6 }, /* (440) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 364, -1 }, /* (441) fill_mode ::= NONE */ + { 364, -1 }, /* (442) fill_mode ::= PREV */ + { 364, -1 }, /* (443) fill_mode ::= NULL */ + { 364, -1 }, /* (444) fill_mode ::= LINEAR */ + { 364, -1 }, /* (445) fill_mode ::= NEXT */ + { 361, 0 }, /* (446) group_by_clause_opt ::= */ + { 361, -3 }, /* (447) group_by_clause_opt ::= GROUP BY group_by_list */ + { 365, -1 }, /* (448) group_by_list ::= expression */ + { 365, -3 }, /* (449) group_by_list ::= group_by_list NK_COMMA expression */ + { 362, 0 }, /* (450) having_clause_opt ::= */ + { 362, -2 }, /* (451) having_clause_opt ::= HAVING search_condition */ + { 357, 0 }, /* (452) range_opt ::= */ + { 357, -6 }, /* (453) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ + { 358, 0 }, /* (454) every_opt ::= */ + { 358, -4 }, /* (455) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 313, -4 }, /* (456) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 366, -1 }, /* (457) query_expression_body ::= query_primary */ + { 366, -4 }, /* (458) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 366, -3 }, /* (459) query_expression_body ::= query_expression_body UNION query_expression_body */ + { 370, -1 }, /* (460) query_primary ::= query_specification */ + { 370, -6 }, /* (461) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ + { 367, 0 }, /* (462) order_by_clause_opt ::= */ + { 367, -3 }, /* (463) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 368, 0 }, /* (464) slimit_clause_opt ::= */ + { 368, -2 }, /* (465) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 368, -4 }, /* (466) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 368, -4 }, /* (467) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 369, 0 }, /* (468) limit_clause_opt ::= */ + { 369, -2 }, /* (469) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 369, -4 }, /* (470) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 369, -4 }, /* (471) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 331, -3 }, /* (472) subquery ::= NK_LP query_expression NK_RP */ + { 352, -1 }, /* (473) search_condition ::= common_expression */ + { 371, -1 }, /* (474) sort_specification_list ::= sort_specification */ + { 371, -3 }, /* (475) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 372, -3 }, /* (476) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 373, 0 }, /* (477) ordering_specification_opt ::= */ + { 373, -1 }, /* (478) ordering_specification_opt ::= ASC */ + { 373, -1 }, /* (479) ordering_specification_opt ::= DESC */ + { 374, 0 }, /* (480) null_ordering_opt ::= */ + { 374, -2 }, /* (481) null_ordering_opt ::= NULLS FIRST */ + { 374, -2 }, /* (482) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3279,11 +3280,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,251,&yymsp[0].minor); + yy_destructor(yypParser,253,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,252,&yymsp[0].minor); + yy_destructor(yypParser,254,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3297,20 +3298,20 @@ static YYACTIONTYPE yy_reduce( case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9); case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10); case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11); -{ yy_destructor(yypParser,251,&yymsp[-2].minor); +{ yy_destructor(yypParser,253,&yymsp[-2].minor); { } - yy_destructor(yypParser,253,&yymsp[0].minor); + yy_destructor(yypParser,255,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,254,&yymsp[0].minor); +{ yy_destructor(yypParser,256,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,252,&yymsp[-1].minor); +{ yy_destructor(yypParser,254,&yymsp[-1].minor); { } - yy_destructor(yypParser,254,&yymsp[0].minor); + yy_destructor(yypParser,256,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3324,72 +3325,72 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,253,&yymsp[0].minor); + yy_destructor(yypParser,255,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy7, &yymsp[-1].minor.yy0, yymsp[0].minor.yy57); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy329, &yymsp[-1].minor.yy0, yymsp[0].minor.yy653); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy7, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy329, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy7, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy329, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy7, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy329, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy329); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy57 = 1; } +{ yymsp[1].minor.yy653 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy57 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy653 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy193, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy609, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy329); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy193, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy609, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy329); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy193 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy609 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 35: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==35); -{ yylhsminor.yy193 = yymsp[0].minor.yy193; } - yymsp[0].minor.yy193 = yylhsminor.yy193; +{ yylhsminor.yy609 = yymsp[0].minor.yy609; } + yymsp[0].minor.yy609 = yylhsminor.yy609; break; case 36: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy193 = yymsp[-2].minor.yy193 | yymsp[0].minor.yy193; } - yymsp[-2].minor.yy193 = yylhsminor.yy193; +{ yylhsminor.yy609 = yymsp[-2].minor.yy609 | yymsp[0].minor.yy609; } + yymsp[-2].minor.yy609 = yylhsminor.yy609; break; case 37: /* priv_type ::= READ */ -{ yymsp[0].minor.yy193 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy609 = PRIVILEGE_TYPE_READ; } break; case 38: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy193 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy609 = PRIVILEGE_TYPE_WRITE; } break; case 39: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy7 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy7 = yylhsminor.yy7; +{ yylhsminor.yy329 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy329 = yylhsminor.yy329; break; case 40: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy7 = yymsp[-2].minor.yy7; } - yymsp[-2].minor.yy7 = yylhsminor.yy7; +{ yylhsminor.yy329 = yymsp[-2].minor.yy329; } + yymsp[-2].minor.yy329 = yylhsminor.yy329; break; case 41: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy7, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy329, NULL); } break; case 42: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy0); } break; case 43: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 44: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy329); } break; case 45: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3406,32 +3407,32 @@ static YYACTIONTYPE yy_reduce( case 49: /* dnode_endpoint ::= NK_STRING */ case 50: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==50); case 51: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==51); - case 305: /* db_name ::= NK_ID */ yytestcase(yyruleno==305); - case 306: /* table_name ::= NK_ID */ yytestcase(yyruleno==306); - case 307: /* column_name ::= NK_ID */ yytestcase(yyruleno==307); - case 308: /* function_name ::= NK_ID */ yytestcase(yyruleno==308); - case 309: /* table_alias ::= NK_ID */ yytestcase(yyruleno==309); - case 310: /* column_alias ::= NK_ID */ yytestcase(yyruleno==310); - case 311: /* user_name ::= NK_ID */ yytestcase(yyruleno==311); - case 312: /* index_name ::= NK_ID */ yytestcase(yyruleno==312); - case 313: /* topic_name ::= NK_ID */ yytestcase(yyruleno==313); - case 314: /* stream_name ::= NK_ID */ yytestcase(yyruleno==314); - case 315: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==315); - case 350: /* noarg_func ::= NOW */ yytestcase(yyruleno==350); - case 351: /* noarg_func ::= TODAY */ yytestcase(yyruleno==351); - case 352: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==352); - case 353: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==353); - case 354: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==354); - case 355: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==355); - case 356: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==356); - case 357: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==357); - case 358: /* noarg_func ::= USER */ yytestcase(yyruleno==358); - case 359: /* star_func ::= COUNT */ yytestcase(yyruleno==359); - case 360: /* star_func ::= FIRST */ yytestcase(yyruleno==360); - case 361: /* star_func ::= LAST */ yytestcase(yyruleno==361); - case 362: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==362); -{ yylhsminor.yy7 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy7 = yylhsminor.yy7; + case 306: /* db_name ::= NK_ID */ yytestcase(yyruleno==306); + case 307: /* table_name ::= NK_ID */ yytestcase(yyruleno==307); + case 308: /* column_name ::= NK_ID */ yytestcase(yyruleno==308); + case 309: /* function_name ::= NK_ID */ yytestcase(yyruleno==309); + case 310: /* table_alias ::= NK_ID */ yytestcase(yyruleno==310); + case 311: /* column_alias ::= NK_ID */ yytestcase(yyruleno==311); + case 312: /* user_name ::= NK_ID */ yytestcase(yyruleno==312); + case 313: /* index_name ::= NK_ID */ yytestcase(yyruleno==313); + case 314: /* topic_name ::= NK_ID */ yytestcase(yyruleno==314); + case 315: /* stream_name ::= NK_ID */ yytestcase(yyruleno==315); + case 316: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==316); + case 351: /* noarg_func ::= NOW */ yytestcase(yyruleno==351); + case 352: /* noarg_func ::= TODAY */ yytestcase(yyruleno==352); + case 353: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==353); + case 354: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==354); + case 355: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==355); + case 356: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==356); + case 357: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==357); + case 358: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==358); + case 359: /* noarg_func ::= USER */ yytestcase(yyruleno==359); + case 360: /* star_func ::= COUNT */ yytestcase(yyruleno==360); + case 361: /* star_func ::= FIRST */ yytestcase(yyruleno==361); + case 362: /* star_func ::= LAST */ yytestcase(yyruleno==362); + case 363: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==363); +{ yylhsminor.yy329 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy329 = yylhsminor.yy329; break; case 52: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3464,156 +3465,156 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 62: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy419, &yymsp[-1].minor.yy7, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy737, &yymsp[-1].minor.yy329, yymsp[0].minor.yy212); } break; case 63: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy737, &yymsp[0].minor.yy329); } break; case 64: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy329); } break; case 65: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy7, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy329, yymsp[0].minor.yy212); } break; case 66: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy419 = true; } +{ yymsp[-2].minor.yy737 = true; } break; case 67: /* not_exists_opt ::= */ case 69: /* exists_opt ::= */ yytestcase(yyruleno==69); case 248: /* analyze_opt ::= */ yytestcase(yyruleno==248); case 256: /* agg_func_opt ::= */ yytestcase(yyruleno==256); - case 416: /* set_quantifier_opt ::= */ yytestcase(yyruleno==416); -{ yymsp[1].minor.yy419 = false; } + case 417: /* set_quantifier_opt ::= */ yytestcase(yyruleno==417); +{ yymsp[1].minor.yy737 = false; } break; case 68: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy419 = true; } +{ yymsp[-1].minor.yy737 = true; } break; case 70: /* db_options ::= */ -{ yymsp[1].minor.yy184 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy212 = createDefaultDatabaseOptions(pCxt); } break; case 71: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 72: /* db_options ::= db_options CACHELAST NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 73: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 74: /* db_options ::= db_options DURATION NK_INTEGER */ case 75: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==75); -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 76: /* db_options ::= db_options FSYNC NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 77: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 78: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 79: /* db_options ::= db_options KEEP integer_list */ case 80: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==80); -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_KEEP, yymsp[0].minor.yy296); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_KEEP, yymsp[0].minor.yy424); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 81: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 82: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 83: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 84: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 85: /* db_options ::= db_options STRICT NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 86: /* db_options ::= db_options WAL NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 87: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 88: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 89: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_RETENTIONS, yymsp[0].minor.yy296); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_RETENTIONS, yymsp[0].minor.yy424); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 90: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy184 = setDatabaseOption(pCxt, yymsp[-2].minor.yy184, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setDatabaseOption(pCxt, yymsp[-2].minor.yy212, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 91: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy184 = createAlterDatabaseOptions(pCxt); yylhsminor.yy184 = setAlterDatabaseOption(pCxt, yylhsminor.yy184, &yymsp[0].minor.yy139); } - yymsp[0].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterDatabaseOptions(pCxt); yylhsminor.yy212 = setAlterDatabaseOption(pCxt, yylhsminor.yy212, &yymsp[0].minor.yy245); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; case 92: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy184 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy184, &yymsp[0].minor.yy139); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy212, &yymsp[0].minor.yy245); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; case 93: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy139.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy245.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy245.val = yymsp[0].minor.yy0; } break; case 94: /* alter_db_option ::= CACHELAST NK_INTEGER */ -{ yymsp[-1].minor.yy139.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy245.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy245.val = yymsp[0].minor.yy0; } break; case 95: /* alter_db_option ::= FSYNC NK_INTEGER */ -{ yymsp[-1].minor.yy139.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy245.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy245.val = yymsp[0].minor.yy0; } break; case 96: /* alter_db_option ::= KEEP integer_list */ case 97: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==97); -{ yymsp[-1].minor.yy139.type = DB_OPTION_KEEP; yymsp[-1].minor.yy139.pList = yymsp[0].minor.yy296; } +{ yymsp[-1].minor.yy245.type = DB_OPTION_KEEP; yymsp[-1].minor.yy245.pList = yymsp[0].minor.yy424; } break; case 98: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy139.type = DB_OPTION_PAGES; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy245.type = DB_OPTION_PAGES; yymsp[-1].minor.yy245.val = yymsp[0].minor.yy0; } break; case 99: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy139.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy245.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy245.val = yymsp[0].minor.yy0; } break; case 100: /* alter_db_option ::= STRICT NK_INTEGER */ -{ yymsp[-1].minor.yy139.type = DB_OPTION_STRICT; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy245.type = DB_OPTION_STRICT; yymsp[-1].minor.yy245.val = yymsp[0].minor.yy0; } break; case 101: /* alter_db_option ::= WAL NK_INTEGER */ -{ yymsp[-1].minor.yy139.type = DB_OPTION_WAL; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy245.type = DB_OPTION_WAL; yymsp[-1].minor.yy245.val = yymsp[0].minor.yy0; } break; case 102: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy296 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy296 = yylhsminor.yy296; +{ yylhsminor.yy424 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; case 103: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 277: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==277); -{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy296 = yylhsminor.yy296; + case 278: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==278); +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; break; case 104: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy296 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy296 = yylhsminor.yy296; +{ yylhsminor.yy424 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; case 105: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy296 = yylhsminor.yy296; +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; break; case 106: /* retention_list ::= retention */ case 126: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==126); @@ -3622,264 +3623,264 @@ static YYACTIONTYPE yy_reduce( case 179: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==179); case 184: /* col_name_list ::= col_name */ yytestcase(yyruleno==184); case 231: /* func_list ::= func */ yytestcase(yyruleno==231); - case 303: /* literal_list ::= signed_literal */ yytestcase(yyruleno==303); - case 365: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==365); - case 419: /* select_list ::= select_item */ yytestcase(yyruleno==419); - case 473: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==473); -{ yylhsminor.yy296 = createNodeList(pCxt, yymsp[0].minor.yy184); } - yymsp[0].minor.yy296 = yylhsminor.yy296; + case 304: /* literal_list ::= signed_literal */ yytestcase(yyruleno==304); + case 366: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==366); + case 420: /* select_list ::= select_item */ yytestcase(yyruleno==420); + case 474: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==474); +{ yylhsminor.yy424 = createNodeList(pCxt, yymsp[0].minor.yy212); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; case 107: /* retention_list ::= retention_list NK_COMMA retention */ case 137: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==137); case 180: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==180); case 185: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==185); case 232: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==232); - case 304: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==304); - case 366: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==366); - case 420: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==420); - case 474: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==474); -{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, yymsp[0].minor.yy184); } - yymsp[-2].minor.yy296 = yylhsminor.yy296; + case 305: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==305); + case 367: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==367); + case 421: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==421); + case 475: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==475); +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, yymsp[0].minor.yy212); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; break; case 108: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy184 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 109: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 111: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==111); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy419, yymsp[-5].minor.yy184, yymsp[-3].minor.yy296, yymsp[-1].minor.yy296, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy737, yymsp[-5].minor.yy212, yymsp[-3].minor.yy424, yymsp[-1].minor.yy424, yymsp[0].minor.yy212); } break; case 110: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy296); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy424); } break; case 112: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy296); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy424); } break; case 113: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy419, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy737, yymsp[0].minor.yy212); } break; case 114: /* cmd ::= ALTER TABLE alter_table_clause */ case 115: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==115); - case 280: /* cmd ::= query_expression */ yytestcase(yyruleno==280); -{ pCxt->pRootNode = yymsp[0].minor.yy184; } + case 281: /* cmd ::= query_expression */ yytestcase(yyruleno==281); +{ pCxt->pRootNode = yymsp[0].minor.yy212; } break; case 116: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy184 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy212, yymsp[0].minor.yy212); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; case 117: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332); } - yymsp[-4].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy212, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy329, yymsp[0].minor.yy34); } + yymsp[-4].minor.yy212 = yylhsminor.yy212; break; case 118: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy184 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy184, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy7); } - yymsp[-3].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy212, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy329); } + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; case 119: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332); } - yymsp[-4].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy212, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy329, yymsp[0].minor.yy34); } + yymsp[-4].minor.yy212 = yylhsminor.yy212; break; case 120: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy184 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy7, &yymsp[0].minor.yy7); } - yymsp[-4].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy212, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy329, &yymsp[0].minor.yy329); } + yymsp[-4].minor.yy212 = yylhsminor.yy212; break; case 121: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332); } - yymsp[-4].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy212, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy329, yymsp[0].minor.yy34); } + yymsp[-4].minor.yy212 = yylhsminor.yy212; break; case 122: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy184 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy184, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy7); } - yymsp[-3].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy212, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy329); } + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; case 123: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy184 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332); } - yymsp[-4].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy212, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy329, yymsp[0].minor.yy34); } + yymsp[-4].minor.yy212 = yylhsminor.yy212; break; case 124: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy184 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy184, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy7, &yymsp[0].minor.yy7); } - yymsp[-4].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy212, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy329, &yymsp[0].minor.yy329); } + yymsp[-4].minor.yy212 = yylhsminor.yy212; break; case 125: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy184 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy184, &yymsp[-2].minor.yy7, yymsp[0].minor.yy184); } - yymsp[-5].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy212, &yymsp[-2].minor.yy329, yymsp[0].minor.yy212); } + yymsp[-5].minor.yy212 = yylhsminor.yy212; break; case 127: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 130: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==130); -{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-1].minor.yy296, yymsp[0].minor.yy184); } - yymsp[-1].minor.yy296 = yylhsminor.yy296; +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-1].minor.yy424, yymsp[0].minor.yy212); } + yymsp[-1].minor.yy424 = yylhsminor.yy424; break; case 128: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ -{ yylhsminor.yy184 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy419, yymsp[-8].minor.yy184, yymsp[-6].minor.yy184, yymsp[-5].minor.yy296, yymsp[-2].minor.yy296, yymsp[0].minor.yy184); } - yymsp[-9].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy737, yymsp[-8].minor.yy212, yymsp[-6].minor.yy212, yymsp[-5].minor.yy424, yymsp[-2].minor.yy424, yymsp[0].minor.yy212); } + yymsp[-9].minor.yy212 = yylhsminor.yy212; break; case 131: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy184 = createDropTableClause(pCxt, yymsp[-1].minor.yy419, yymsp[0].minor.yy184); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createDropTableClause(pCxt, yymsp[-1].minor.yy737, yymsp[0].minor.yy212); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; case 132: /* specific_tags_opt ::= */ case 163: /* tags_def_opt ::= */ yytestcase(yyruleno==163); - case 428: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==428); - case 445: /* group_by_clause_opt ::= */ yytestcase(yyruleno==445); - case 461: /* order_by_clause_opt ::= */ yytestcase(yyruleno==461); -{ yymsp[1].minor.yy296 = NULL; } + case 429: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==429); + case 446: /* group_by_clause_opt ::= */ yytestcase(yyruleno==446); + case 462: /* order_by_clause_opt ::= */ yytestcase(yyruleno==462); +{ yymsp[1].minor.yy424 = NULL; } break; case 133: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy296 = yymsp[-1].minor.yy296; } +{ yymsp[-2].minor.yy424 = yymsp[-1].minor.yy424; } break; case 134: /* full_table_name ::= table_name */ -{ yylhsminor.yy184 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy7, NULL); } - yymsp[0].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy329, NULL); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; case 135: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy184 = createRealTableNode(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7, NULL); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createRealTableNode(pCxt, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy329, NULL); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 138: /* column_def ::= column_name type_name */ -{ yylhsminor.yy184 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy7, yymsp[0].minor.yy332, NULL); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy329, yymsp[0].minor.yy34, NULL); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; case 139: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy184 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy7, yymsp[-2].minor.yy332, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy329, yymsp[-2].minor.yy34, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; case 140: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 141: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 142: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 143: /* type_name ::= INT */ case 144: /* type_name ::= INTEGER */ yytestcase(yyruleno==144); -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_INT); } break; case 145: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 146: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 147: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 148: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy332 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy34 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 149: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 150: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy332 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy34 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 151: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy332 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy34 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 152: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy332 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy34 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 153: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy332 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy34 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 154: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy332 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy34 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 155: /* type_name ::= JSON */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 156: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy332 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy34 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 157: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 158: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 159: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy332 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy34 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 160: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy332 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy34 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 161: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy332 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy34 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 162: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy332 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy34 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 164: /* tags_def_opt ::= tags_def */ - case 364: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==364); -{ yylhsminor.yy296 = yymsp[0].minor.yy296; } - yymsp[0].minor.yy296 = yylhsminor.yy296; + case 365: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==365); +{ yylhsminor.yy424 = yymsp[0].minor.yy424; } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; case 165: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy296 = yymsp[-1].minor.yy296; } +{ yymsp[-3].minor.yy424 = yymsp[-1].minor.yy424; } break; case 166: /* table_options ::= */ -{ yymsp[1].minor.yy184 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy212 = createDefaultTableOptions(pCxt); } break; case 167: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setTableOption(pCxt, yymsp[-2].minor.yy212, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 168: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy296); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setTableOption(pCxt, yymsp[-2].minor.yy212, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy424); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 169: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy296); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setTableOption(pCxt, yymsp[-2].minor.yy212, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy424); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 170: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-4].minor.yy184, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy296); } - yymsp[-4].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setTableOption(pCxt, yymsp[-4].minor.yy212, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy424); } + yymsp[-4].minor.yy212 = yylhsminor.yy212; break; case 171: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-2].minor.yy184, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setTableOption(pCxt, yymsp[-2].minor.yy212, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 172: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-4].minor.yy184, TABLE_OPTION_SMA, yymsp[-1].minor.yy296); } - yymsp[-4].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setTableOption(pCxt, yymsp[-4].minor.yy212, TABLE_OPTION_SMA, yymsp[-1].minor.yy424); } + yymsp[-4].minor.yy212 = yylhsminor.yy212; break; case 173: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy184 = createAlterTableOptions(pCxt); yylhsminor.yy184 = setTableOption(pCxt, yylhsminor.yy184, yymsp[0].minor.yy139.type, &yymsp[0].minor.yy139.val); } - yymsp[0].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createAlterTableOptions(pCxt); yylhsminor.yy212 = setTableOption(pCxt, yylhsminor.yy212, yymsp[0].minor.yy245.type, &yymsp[0].minor.yy245.val); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; case 174: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy184 = setTableOption(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy139.type, &yymsp[0].minor.yy139.val); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setTableOption(pCxt, yymsp[-1].minor.yy212, yymsp[0].minor.yy245.type, &yymsp[0].minor.yy245.val); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; case 175: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy139.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy245.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy245.val = yymsp[0].minor.yy0; } break; case 176: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy139.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy139.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy245.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy245.val = yymsp[0].minor.yy0; } break; case 177: /* duration_list ::= duration_literal */ - case 332: /* expression_list ::= expression */ yytestcase(yyruleno==332); -{ yylhsminor.yy296 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } - yymsp[0].minor.yy296 = yylhsminor.yy296; + case 333: /* expression_list ::= expression */ yytestcase(yyruleno==333); +{ yylhsminor.yy424 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy212)); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; case 178: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 333: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==333); -{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); } - yymsp[-2].minor.yy296 = yylhsminor.yy296; + case 334: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==334); +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, releaseRawExprNode(pCxt, yymsp[0].minor.yy212)); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; break; case 181: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy184 = createFunctionNode(pCxt, &yymsp[0].minor.yy7, NULL); } - yymsp[0].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createFunctionNode(pCxt, &yymsp[0].minor.yy329, NULL); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; case 182: /* rollup_func_name ::= FIRST */ case 183: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==183); -{ yylhsminor.yy184 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; case 186: /* col_name ::= column_name */ -{ yylhsminor.yy184 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy7); } - yymsp[0].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy329); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; case 187: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -3891,13 +3892,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; case 190: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy212, yymsp[0].minor.yy212, OP_TYPE_LIKE); } break; case 191: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy212, yymsp[0].minor.yy212, OP_TYPE_LIKE); } break; case 192: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy184, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy212, NULL, OP_TYPE_LIKE); } break; case 193: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -3912,7 +3913,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; case 197: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy184, yymsp[-1].minor.yy184, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy212, yymsp[-1].minor.yy212, OP_TYPE_EQUAL); } break; case 198: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } @@ -3931,13 +3932,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT); } break; case 204: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy329); } break; case 205: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy212); } break; case 206: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy212); } break; case 207: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } @@ -3970,7 +3971,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; case 217: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy212); } break; case 218: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } @@ -3980,699 +3981,703 @@ static YYACTIONTYPE yy_reduce( break; case 220: /* db_name_cond_opt ::= */ case 225: /* from_db_opt ::= */ yytestcase(yyruleno==225); -{ yymsp[1].minor.yy184 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy212 = createDefaultDatabaseCondValue(pCxt); } break; case 221: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy7); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy329); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; case 222: /* like_pattern_opt ::= */ case 262: /* into_opt ::= */ yytestcase(yyruleno==262); - case 397: /* from_clause_opt ::= */ yytestcase(yyruleno==397); - case 426: /* where_clause_opt ::= */ yytestcase(yyruleno==426); - case 430: /* twindow_clause_opt ::= */ yytestcase(yyruleno==430); - case 435: /* sliding_opt ::= */ yytestcase(yyruleno==435); - case 437: /* fill_opt ::= */ yytestcase(yyruleno==437); - case 449: /* having_clause_opt ::= */ yytestcase(yyruleno==449); - case 451: /* range_opt ::= */ yytestcase(yyruleno==451); - case 453: /* every_opt ::= */ yytestcase(yyruleno==453); - case 463: /* slimit_clause_opt ::= */ yytestcase(yyruleno==463); - case 467: /* limit_clause_opt ::= */ yytestcase(yyruleno==467); -{ yymsp[1].minor.yy184 = NULL; } + case 398: /* from_clause_opt ::= */ yytestcase(yyruleno==398); + case 427: /* where_clause_opt ::= */ yytestcase(yyruleno==427); + case 431: /* twindow_clause_opt ::= */ yytestcase(yyruleno==431); + case 436: /* sliding_opt ::= */ yytestcase(yyruleno==436); + case 438: /* fill_opt ::= */ yytestcase(yyruleno==438); + case 450: /* having_clause_opt ::= */ yytestcase(yyruleno==450); + case 452: /* range_opt ::= */ yytestcase(yyruleno==452); + case 454: /* every_opt ::= */ yytestcase(yyruleno==454); + case 464: /* slimit_clause_opt ::= */ yytestcase(yyruleno==464); + case 468: /* limit_clause_opt ::= */ yytestcase(yyruleno==468); +{ yymsp[1].minor.yy212 = NULL; } break; case 223: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 224: /* table_name_cond ::= table_name */ -{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy7); } - yymsp[0].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy329); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; case 226: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy7); } +{ yymsp[-1].minor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy329); } break; case 227: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy419, &yymsp[-3].minor.yy7, &yymsp[-1].minor.yy7, NULL, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy737, &yymsp[-3].minor.yy329, &yymsp[-1].minor.yy329, NULL, yymsp[0].minor.yy212); } break; case 228: /* cmd ::= DROP INDEX exists_opt index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy737, &yymsp[0].minor.yy329); } break; case 229: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy184 = createIndexOption(pCxt, yymsp[-7].minor.yy296, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), NULL, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } +{ yymsp[-9].minor.yy212 = createIndexOption(pCxt, yymsp[-7].minor.yy424, releaseRawExprNode(pCxt, yymsp[-3].minor.yy212), NULL, yymsp[-1].minor.yy212, yymsp[0].minor.yy212); } break; case 230: /* 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.yy184 = createIndexOption(pCxt, yymsp[-9].minor.yy296, releaseRawExprNode(pCxt, yymsp[-5].minor.yy184), releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } +{ yymsp[-11].minor.yy212 = createIndexOption(pCxt, yymsp[-9].minor.yy424, releaseRawExprNode(pCxt, yymsp[-5].minor.yy212), releaseRawExprNode(pCxt, yymsp[-3].minor.yy212), yymsp[-1].minor.yy212, yymsp[0].minor.yy212); } break; case 233: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy184 = createFunctionNode(pCxt, &yymsp[-3].minor.yy7, yymsp[-1].minor.yy296); } - yymsp[-3].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = createFunctionNode(pCxt, &yymsp[-3].minor.yy329, yymsp[-1].minor.yy424); } + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; case 234: /* sma_stream_opt ::= */ case 264: /* stream_options ::= */ yytestcase(yyruleno==264); -{ yymsp[1].minor.yy184 = createStreamOptions(pCxt); } +{ yymsp[1].minor.yy212 = createStreamOptions(pCxt); } break; case 235: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ case 268: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==268); -{ ((SStreamOptions*)yymsp[-2].minor.yy184)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); yylhsminor.yy184 = yymsp[-2].minor.yy184; } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ ((SStreamOptions*)yymsp[-2].minor.yy212)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy212); yylhsminor.yy212 = yymsp[-2].minor.yy212; } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 236: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy184)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); yylhsminor.yy184 = yymsp[-2].minor.yy184; } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ ((SStreamOptions*)yymsp[-2].minor.yy212)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy212); yylhsminor.yy212 = yymsp[-2].minor.yy212; } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 237: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy419, &yymsp[-2].minor.yy7, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy737, &yymsp[-2].minor.yy329, yymsp[0].minor.yy212); } break; case 238: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy419, &yymsp[-3].minor.yy7, &yymsp[0].minor.yy7, false); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy737, &yymsp[-3].minor.yy329, &yymsp[0].minor.yy329, false); } break; case 239: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy419, &yymsp[-5].minor.yy7, &yymsp[0].minor.yy7, true); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy737, &yymsp[-5].minor.yy329, &yymsp[0].minor.yy329, true); } break; case 240: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy419, &yymsp[-3].minor.yy7, yymsp[0].minor.yy184, false); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy737, &yymsp[-3].minor.yy329, yymsp[0].minor.yy212, false); } break; case 241: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy419, &yymsp[-5].minor.yy7, yymsp[0].minor.yy184, true); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy737, &yymsp[-5].minor.yy329, yymsp[0].minor.yy212, true); } break; case 242: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy737, &yymsp[0].minor.yy329); } break; case 243: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy419, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy737, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy329); } break; case 244: /* cmd ::= DESC full_table_name */ case 245: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==245); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy212); } break; case 246: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; case 247: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy419, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy737, yymsp[-1].minor.yy212, yymsp[0].minor.yy212); } break; case 249: /* analyze_opt ::= ANALYZE */ case 257: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==257); - case 417: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==417); -{ yymsp[0].minor.yy419 = true; } + case 418: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==418); +{ yymsp[0].minor.yy737 = true; } break; case 250: /* explain_options ::= */ -{ yymsp[1].minor.yy184 = createDefaultExplainOptions(pCxt); } +{ yymsp[1].minor.yy212 = createDefaultExplainOptions(pCxt); } break; case 251: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy184 = setExplainVerbose(pCxt, yymsp[-2].minor.yy184, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setExplainVerbose(pCxt, yymsp[-2].minor.yy212, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 252: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy184 = setExplainRatio(pCxt, yymsp[-2].minor.yy184, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ yylhsminor.yy212 = setExplainRatio(pCxt, yymsp[-2].minor.yy212, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 253: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ -{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy296); } +{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy424); } break; case 254: /* 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.yy419, yymsp[-8].minor.yy419, &yymsp[-5].minor.yy7, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy332, yymsp[0].minor.yy20); } +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy737, yymsp[-8].minor.yy737, &yymsp[-5].minor.yy329, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy34, yymsp[0].minor.yy610); } break; case 255: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy737, &yymsp[0].minor.yy329); } break; case 258: /* bufsize_opt ::= */ -{ yymsp[1].minor.yy20 = 0; } +{ yymsp[1].minor.yy610 = 0; } break; case 259: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ -{ yymsp[-1].minor.yy20 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy610 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 260: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy419, &yymsp[-4].minor.yy7, yymsp[-2].minor.yy184, yymsp[-3].minor.yy184, yymsp[0].minor.yy184); } +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy737, &yymsp[-4].minor.yy329, yymsp[-2].minor.yy212, yymsp[-3].minor.yy212, yymsp[0].minor.yy212); } break; case 261: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy419, &yymsp[0].minor.yy7); } +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy737, &yymsp[0].minor.yy329); } break; case 263: /* into_opt ::= INTO full_table_name */ - case 398: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==398); - case 427: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==427); - case 450: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==450); -{ yymsp[-1].minor.yy184 = yymsp[0].minor.yy184; } + case 399: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==399); + case 428: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==428); + case 451: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==451); +{ yymsp[-1].minor.yy212 = yymsp[0].minor.yy212; } break; case 265: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy184)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy184 = yymsp[-2].minor.yy184; } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ ((SStreamOptions*)yymsp[-2].minor.yy212)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy212 = yymsp[-2].minor.yy212; } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 266: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy184)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy184 = yymsp[-2].minor.yy184; } - yymsp[-2].minor.yy184 = yylhsminor.yy184; +{ ((SStreamOptions*)yymsp[-2].minor.yy212)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy212 = yymsp[-2].minor.yy212; } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; case 267: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy184)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy184)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); yylhsminor.yy184 = yymsp[-3].minor.yy184; } - yymsp[-3].minor.yy184 = yylhsminor.yy184; +{ ((SStreamOptions*)yymsp[-3].minor.yy212)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy212)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy212); yylhsminor.yy212 = yymsp[-3].minor.yy212; } + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; - case 269: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 269: /* stream_options ::= stream_options IGNORE EXPIRED */ +{ ((SStreamOptions*)yymsp[-2].minor.yy212)->ignoreExpired = true; yylhsminor.yy212 = yymsp[-2].minor.yy212; } + yymsp[-2].minor.yy212 = yylhsminor.yy212; + break; + case 270: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 270: /* cmd ::= KILL QUERY NK_STRING */ + case 271: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 271: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 272: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 272: /* cmd ::= BALANCE VGROUP */ + case 273: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 273: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 274: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 274: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy296); } + case 275: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy424); } break; - case 275: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 276: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 276: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy296 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 277: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy424 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 278: /* cmd ::= SYNCDB db_name REPLICA */ -{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy7); } + case 279: /* cmd ::= SYNCDB db_name REPLICA */ +{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy329); } break; - case 279: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } + case 280: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy212, yymsp[0].minor.yy212); } break; - case 281: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 282: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy212 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 282: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 283: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy212 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 283: /* literal ::= NK_STRING */ -{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 284: /* literal ::= NK_STRING */ +{ yylhsminor.yy212 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 284: /* literal ::= NK_BOOL */ -{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 285: /* literal ::= NK_BOOL */ +{ yylhsminor.yy212 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 285: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; + case 286: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; - case 286: /* literal ::= duration_literal */ - case 296: /* signed_literal ::= signed */ yytestcase(yyruleno==296); - case 316: /* expression ::= literal */ yytestcase(yyruleno==316); - case 317: /* expression ::= pseudo_column */ yytestcase(yyruleno==317); - case 318: /* expression ::= column_reference */ yytestcase(yyruleno==318); - case 319: /* expression ::= function_expression */ yytestcase(yyruleno==319); - case 320: /* expression ::= subquery */ yytestcase(yyruleno==320); - case 347: /* function_expression ::= literal_func */ yytestcase(yyruleno==347); - case 389: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==389); - case 393: /* boolean_primary ::= predicate */ yytestcase(yyruleno==393); - case 395: /* common_expression ::= expression */ yytestcase(yyruleno==395); - case 396: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==396); - case 399: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==399); - case 401: /* table_reference ::= table_primary */ yytestcase(yyruleno==401); - case 402: /* table_reference ::= joined_table */ yytestcase(yyruleno==402); - case 406: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==406); - case 456: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==456); - case 459: /* query_primary ::= query_specification */ yytestcase(yyruleno==459); -{ yylhsminor.yy184 = yymsp[0].minor.yy184; } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 287: /* literal ::= duration_literal */ + case 297: /* signed_literal ::= signed */ yytestcase(yyruleno==297); + case 317: /* expression ::= literal */ yytestcase(yyruleno==317); + case 318: /* expression ::= pseudo_column */ yytestcase(yyruleno==318); + case 319: /* expression ::= column_reference */ yytestcase(yyruleno==319); + case 320: /* expression ::= function_expression */ yytestcase(yyruleno==320); + case 321: /* expression ::= subquery */ yytestcase(yyruleno==321); + case 348: /* function_expression ::= literal_func */ yytestcase(yyruleno==348); + case 390: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==390); + case 394: /* boolean_primary ::= predicate */ yytestcase(yyruleno==394); + case 396: /* common_expression ::= expression */ yytestcase(yyruleno==396); + case 397: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==397); + case 400: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==400); + case 402: /* table_reference ::= table_primary */ yytestcase(yyruleno==402); + case 403: /* table_reference ::= joined_table */ yytestcase(yyruleno==403); + case 407: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==407); + case 457: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==457); + case 460: /* query_primary ::= query_specification */ yytestcase(yyruleno==460); +{ yylhsminor.yy212 = yymsp[0].minor.yy212; } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 287: /* literal ::= NULL */ -{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 288: /* literal ::= NULL */ +{ yylhsminor.yy212 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 288: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 289: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy212 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 289: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 290: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy212 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 290: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 291: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 291: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + case 292: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; - case 292: /* signed ::= NK_MINUS NK_INTEGER */ + case 293: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; - case 293: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 294: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 294: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 295: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 295: /* signed ::= NK_MINUS NK_FLOAT */ + case 296: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; - case 297: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 298: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 298: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 299: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 299: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 300: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 300: /* signed_literal ::= duration_literal */ - case 302: /* signed_literal ::= literal_func */ yytestcase(yyruleno==302); - case 367: /* star_func_para ::= expression */ yytestcase(yyruleno==367); - case 422: /* select_item ::= common_expression */ yytestcase(yyruleno==422); - case 472: /* search_condition ::= common_expression */ yytestcase(yyruleno==472); -{ yylhsminor.yy184 = releaseRawExprNode(pCxt, yymsp[0].minor.yy184); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 301: /* signed_literal ::= duration_literal */ + case 303: /* signed_literal ::= literal_func */ yytestcase(yyruleno==303); + case 368: /* star_func_para ::= expression */ yytestcase(yyruleno==368); + case 423: /* select_item ::= common_expression */ yytestcase(yyruleno==423); + case 473: /* search_condition ::= common_expression */ yytestcase(yyruleno==473); +{ yylhsminor.yy212 = releaseRawExprNode(pCxt, yymsp[0].minor.yy212); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 301: /* signed_literal ::= NULL */ -{ yylhsminor.yy184 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 302: /* signed_literal ::= NULL */ +{ yylhsminor.yy212 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 321: /* expression ::= NK_LP expression NK_RP */ - case 394: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==394); -{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 322: /* expression ::= NK_LP expression NK_RP */ + case 395: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==395); +{ yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy212)); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 322: /* expression ::= NK_PLUS expression */ + case 323: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy184)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy212)); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; - case 323: /* expression ::= NK_MINUS expression */ + case 324: /* expression ::= NK_MINUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy184), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy212), NULL)); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; - case 324: /* expression ::= expression NK_PLUS expression */ + case 325: /* expression ::= expression NK_PLUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 325: /* expression ::= expression NK_MINUS expression */ + case 326: /* expression ::= expression NK_MINUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 326: /* expression ::= expression NK_STAR expression */ + case 327: /* expression ::= expression NK_STAR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 327: /* expression ::= expression NK_SLASH expression */ + case 328: /* expression ::= expression NK_SLASH expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 328: /* expression ::= expression NK_REM expression */ + case 329: /* expression ::= expression NK_REM expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 329: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 330: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 330: /* expression ::= expression NK_BITAND expression */ + case 331: /* expression ::= expression NK_BITAND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 331: /* expression ::= expression NK_BITOR expression */ + case 332: /* expression ::= expression NK_BITOR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 334: /* column_reference ::= column_name */ -{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy7, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy7)); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 335: /* column_reference ::= column_name */ +{ yylhsminor.yy212 = createRawExprNode(pCxt, &yymsp[0].minor.yy329, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy329)); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 335: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7, createColumnNode(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy7)); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 336: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy329, createColumnNode(pCxt, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy329)); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 336: /* pseudo_column ::= ROWTS */ - case 337: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==337); - case 339: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==339); - case 340: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==340); - case 341: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==341); - case 342: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==342); - case 343: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==343); - case 349: /* literal_func ::= NOW */ yytestcase(yyruleno==349); -{ yylhsminor.yy184 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 337: /* pseudo_column ::= ROWTS */ + case 338: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==338); + case 340: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==340); + case 341: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==341); + case 342: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==342); + case 343: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==343); + case 344: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==344); + case 350: /* literal_func ::= NOW */ yytestcase(yyruleno==350); +{ yylhsminor.yy212 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 338: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy7)))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 339: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy329)))); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 344: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 345: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==345); -{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy7, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy7, yymsp[-1].minor.yy296)); } - yymsp[-3].minor.yy184 = yylhsminor.yy184; + case 345: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 346: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==346); +{ yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy329, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy329, yymsp[-1].minor.yy424)); } + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; - case 346: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ -{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-1].minor.yy332)); } - yymsp[-5].minor.yy184 = yylhsminor.yy184; + case 347: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ +{ yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy212), yymsp[-1].minor.yy34)); } + yymsp[-5].minor.yy212 = yylhsminor.yy212; break; - case 348: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy7, NULL)); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 349: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy329, NULL)); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 363: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy296 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy296 = yylhsminor.yy296; + case 364: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy424 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; - case 368: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 425: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==425); -{ yylhsminor.yy184 = createColumnNode(pCxt, &yymsp[-2].minor.yy7, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 369: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 426: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==426); +{ yylhsminor.yy212 = createColumnNode(pCxt, &yymsp[-2].minor.yy329, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 369: /* predicate ::= expression compare_op expression */ - case 374: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==374); + case 370: /* predicate ::= expression compare_op expression */ + case 375: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==375); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy496, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy290, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 370: /* predicate ::= expression BETWEEN expression AND expression */ + case 371: /* predicate ::= expression BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy184), releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy212), releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-4].minor.yy184 = yylhsminor.yy184; + yymsp[-4].minor.yy212 = yylhsminor.yy212; break; - case 371: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 372: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy184), releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy212), releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-5].minor.yy184 = yylhsminor.yy184; + yymsp[-5].minor.yy212 = yylhsminor.yy212; break; - case 372: /* predicate ::= expression IS NULL */ + case 373: /* predicate ::= expression IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), NULL)); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 373: /* predicate ::= expression IS NOT NULL */ + case 374: /* predicate ::= expression IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy212), NULL)); } - yymsp[-3].minor.yy184 = yylhsminor.yy184; + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; - case 375: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy496 = OP_TYPE_LOWER_THAN; } + case 376: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy290 = OP_TYPE_LOWER_THAN; } break; - case 376: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy496 = OP_TYPE_GREATER_THAN; } + case 377: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy290 = OP_TYPE_GREATER_THAN; } break; - case 377: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy496 = OP_TYPE_LOWER_EQUAL; } + case 378: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy290 = OP_TYPE_LOWER_EQUAL; } break; - case 378: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy496 = OP_TYPE_GREATER_EQUAL; } + case 379: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy290 = OP_TYPE_GREATER_EQUAL; } break; - case 379: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy496 = OP_TYPE_NOT_EQUAL; } + case 380: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy290 = OP_TYPE_NOT_EQUAL; } break; - case 380: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy496 = OP_TYPE_EQUAL; } + case 381: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy290 = OP_TYPE_EQUAL; } break; - case 381: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy496 = OP_TYPE_LIKE; } + case 382: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy290 = OP_TYPE_LIKE; } break; - case 382: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy496 = OP_TYPE_NOT_LIKE; } + case 383: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy290 = OP_TYPE_NOT_LIKE; } break; - case 383: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy496 = OP_TYPE_MATCH; } + case 384: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy290 = OP_TYPE_MATCH; } break; - case 384: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy496 = OP_TYPE_NMATCH; } + case 385: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy290 = OP_TYPE_NMATCH; } break; - case 385: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy496 = OP_TYPE_JSON_CONTAINS; } + case 386: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy290 = OP_TYPE_JSON_CONTAINS; } break; - case 386: /* in_op ::= IN */ -{ yymsp[0].minor.yy496 = OP_TYPE_IN; } + case 387: /* in_op ::= IN */ +{ yymsp[0].minor.yy290 = OP_TYPE_IN; } break; - case 387: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy496 = OP_TYPE_NOT_IN; } + case 388: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy290 = OP_TYPE_NOT_IN; } break; - case 388: /* in_predicate_value ::= NK_LP expression_list NK_RP */ -{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy296)); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 389: /* in_predicate_value ::= NK_LP expression_list NK_RP */ +{ yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy424)); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 390: /* boolean_value_expression ::= NOT boolean_primary */ + case 391: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy184), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy212), NULL)); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; - case 391: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 392: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 392: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 393: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy184); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy184); - yylhsminor.yy184 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy212); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy212); + yylhsminor.yy212 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 400: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy184 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy184, yymsp[0].minor.yy184, NULL); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 401: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy212 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy212, yymsp[0].minor.yy212, NULL); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 403: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy184 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy7, &yymsp[0].minor.yy7); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; + case 404: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy212 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy329, &yymsp[0].minor.yy329); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; - case 404: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy184 = createRealTableNode(pCxt, &yymsp[-3].minor.yy7, &yymsp[-1].minor.yy7, &yymsp[0].minor.yy7); } - yymsp[-3].minor.yy184 = yylhsminor.yy184; + case 405: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy212 = createRealTableNode(pCxt, &yymsp[-3].minor.yy329, &yymsp[-1].minor.yy329, &yymsp[0].minor.yy329); } + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; - case 405: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy184 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184), &yymsp[0].minor.yy7); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; + case 406: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy212 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy212), &yymsp[0].minor.yy329); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; - case 407: /* alias_opt ::= */ -{ yymsp[1].minor.yy7 = nil_token; } + case 408: /* alias_opt ::= */ +{ yymsp[1].minor.yy329 = nil_token; } break; - case 408: /* alias_opt ::= table_alias */ -{ yylhsminor.yy7 = yymsp[0].minor.yy7; } - yymsp[0].minor.yy7 = yylhsminor.yy7; + case 409: /* alias_opt ::= table_alias */ +{ yylhsminor.yy329 = yymsp[0].minor.yy329; } + yymsp[0].minor.yy329 = yylhsminor.yy329; break; - case 409: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy7 = yymsp[0].minor.yy7; } + case 410: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy329 = yymsp[0].minor.yy329; } break; - case 410: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 411: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==411); -{ yymsp[-2].minor.yy184 = yymsp[-1].minor.yy184; } + case 411: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 412: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==412); +{ yymsp[-2].minor.yy212 = yymsp[-1].minor.yy212; } break; - case 412: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy184 = createJoinTableNode(pCxt, yymsp[-4].minor.yy54, yymsp[-5].minor.yy184, yymsp[-2].minor.yy184, yymsp[0].minor.yy184); } - yymsp[-5].minor.yy184 = yylhsminor.yy184; + case 413: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy212 = createJoinTableNode(pCxt, yymsp[-4].minor.yy162, yymsp[-5].minor.yy212, yymsp[-2].minor.yy212, yymsp[0].minor.yy212); } + yymsp[-5].minor.yy212 = yylhsminor.yy212; break; - case 413: /* join_type ::= */ -{ yymsp[1].minor.yy54 = JOIN_TYPE_INNER; } + case 414: /* join_type ::= */ +{ yymsp[1].minor.yy162 = JOIN_TYPE_INNER; } break; - case 414: /* join_type ::= INNER */ -{ yymsp[0].minor.yy54 = JOIN_TYPE_INNER; } + case 415: /* join_type ::= INNER */ +{ yymsp[0].minor.yy162 = JOIN_TYPE_INNER; } break; - case 415: /* 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 416: /* 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.yy184 = createSelectStmt(pCxt, yymsp[-10].minor.yy419, yymsp[-9].minor.yy296, yymsp[-8].minor.yy184); - yymsp[-11].minor.yy184 = addWhereClause(pCxt, yymsp[-11].minor.yy184, yymsp[-7].minor.yy184); - yymsp[-11].minor.yy184 = addPartitionByClause(pCxt, yymsp[-11].minor.yy184, yymsp[-6].minor.yy296); - yymsp[-11].minor.yy184 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy184, yymsp[-2].minor.yy184); - yymsp[-11].minor.yy184 = addGroupByClause(pCxt, yymsp[-11].minor.yy184, yymsp[-1].minor.yy296); - yymsp[-11].minor.yy184 = addHavingClause(pCxt, yymsp[-11].minor.yy184, yymsp[0].minor.yy184); - yymsp[-11].minor.yy184 = addRangeClause(pCxt, yymsp[-11].minor.yy184, yymsp[-5].minor.yy184); - yymsp[-11].minor.yy184 = addEveryClause(pCxt, yymsp[-11].minor.yy184, yymsp[-4].minor.yy184); - yymsp[-11].minor.yy184 = addFillClause(pCxt, yymsp[-11].minor.yy184, yymsp[-3].minor.yy184); + yymsp[-11].minor.yy212 = createSelectStmt(pCxt, yymsp[-10].minor.yy737, yymsp[-9].minor.yy424, yymsp[-8].minor.yy212); + yymsp[-11].minor.yy212 = addWhereClause(pCxt, yymsp[-11].minor.yy212, yymsp[-7].minor.yy212); + yymsp[-11].minor.yy212 = addPartitionByClause(pCxt, yymsp[-11].minor.yy212, yymsp[-6].minor.yy424); + yymsp[-11].minor.yy212 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy212, yymsp[-2].minor.yy212); + yymsp[-11].minor.yy212 = addGroupByClause(pCxt, yymsp[-11].minor.yy212, yymsp[-1].minor.yy424); + yymsp[-11].minor.yy212 = addHavingClause(pCxt, yymsp[-11].minor.yy212, yymsp[0].minor.yy212); + yymsp[-11].minor.yy212 = addRangeClause(pCxt, yymsp[-11].minor.yy212, yymsp[-5].minor.yy212); + yymsp[-11].minor.yy212 = addEveryClause(pCxt, yymsp[-11].minor.yy212, yymsp[-4].minor.yy212); + yymsp[-11].minor.yy212 = addFillClause(pCxt, yymsp[-11].minor.yy212, yymsp[-3].minor.yy212); } break; - case 418: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy419 = false; } + case 419: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy737 = false; } break; - case 421: /* select_item ::= NK_STAR */ -{ yylhsminor.yy184 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy184 = yylhsminor.yy184; + case 422: /* select_item ::= NK_STAR */ +{ yylhsminor.yy212 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy212 = yylhsminor.yy212; break; - case 423: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy184 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184), &yymsp[0].minor.yy7); } - yymsp[-1].minor.yy184 = yylhsminor.yy184; + case 424: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy212 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy212), &yymsp[0].minor.yy329); } + yymsp[-1].minor.yy212 = yylhsminor.yy212; break; - case 424: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy184 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), &yymsp[0].minor.yy7); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 425: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy212 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), &yymsp[0].minor.yy329); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 429: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 446: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==446); - case 462: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==462); -{ yymsp[-2].minor.yy296 = yymsp[0].minor.yy296; } + case 430: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 447: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==447); + case 463: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==463); +{ yymsp[-2].minor.yy424 = yymsp[0].minor.yy424; } break; - case 431: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy184 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } + case 432: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy212 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy212), releaseRawExprNode(pCxt, yymsp[-1].minor.yy212)); } break; - case 432: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ -{ yymsp[-3].minor.yy184 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } + case 433: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ +{ yymsp[-3].minor.yy212 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy212)); } break; - case 433: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy184 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), NULL, yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } + case 434: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy212 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy212), NULL, yymsp[-1].minor.yy212, yymsp[0].minor.yy212); } break; - case 434: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy184 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy184), releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), yymsp[-1].minor.yy184, yymsp[0].minor.yy184); } + case 435: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy212 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy212), releaseRawExprNode(pCxt, yymsp[-3].minor.yy212), yymsp[-1].minor.yy212, yymsp[0].minor.yy212); } break; - case 436: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - case 454: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==454); -{ yymsp[-3].minor.yy184 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy184); } + case 437: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + case 455: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==455); +{ yymsp[-3].minor.yy212 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy212); } break; - case 438: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy184 = createFillNode(pCxt, yymsp[-1].minor.yy540, NULL); } + case 439: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy212 = createFillNode(pCxt, yymsp[-1].minor.yy294, NULL); } break; - case 439: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy184 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy296)); } + case 440: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy212 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy424)); } break; - case 440: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy540 = FILL_MODE_NONE; } + case 441: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy294 = FILL_MODE_NONE; } break; - case 441: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy540 = FILL_MODE_PREV; } + case 442: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy294 = FILL_MODE_PREV; } break; - case 442: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy540 = FILL_MODE_NULL; } + case 443: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy294 = FILL_MODE_NULL; } break; - case 443: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy540 = FILL_MODE_LINEAR; } + case 444: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy294 = FILL_MODE_LINEAR; } break; - case 444: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy540 = FILL_MODE_NEXT; } + case 445: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy294 = FILL_MODE_NEXT; } break; - case 447: /* group_by_list ::= expression */ -{ yylhsminor.yy296 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[0].minor.yy296 = yylhsminor.yy296; + case 448: /* group_by_list ::= expression */ +{ yylhsminor.yy424 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; - case 448: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy296 = addNodeToList(pCxt, yymsp[-2].minor.yy296, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy184))); } - yymsp[-2].minor.yy296 = yylhsminor.yy296; + case 449: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy212))); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; break; - case 452: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ -{ yymsp[-5].minor.yy184 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy184), releaseRawExprNode(pCxt, yymsp[-1].minor.yy184)); } + case 453: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ +{ yymsp[-5].minor.yy212 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy212), releaseRawExprNode(pCxt, yymsp[-1].minor.yy212)); } break; - case 455: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 456: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy184 = addOrderByClause(pCxt, yymsp[-3].minor.yy184, yymsp[-2].minor.yy296); - yylhsminor.yy184 = addSlimitClause(pCxt, yylhsminor.yy184, yymsp[-1].minor.yy184); - yylhsminor.yy184 = addLimitClause(pCxt, yylhsminor.yy184, yymsp[0].minor.yy184); + yylhsminor.yy212 = addOrderByClause(pCxt, yymsp[-3].minor.yy212, yymsp[-2].minor.yy424); + yylhsminor.yy212 = addSlimitClause(pCxt, yylhsminor.yy212, yymsp[-1].minor.yy212); + yylhsminor.yy212 = addLimitClause(pCxt, yylhsminor.yy212, yymsp[0].minor.yy212); } - yymsp[-3].minor.yy184 = yylhsminor.yy184; + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; - case 457: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy184 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy184, yymsp[0].minor.yy184); } - yymsp[-3].minor.yy184 = yylhsminor.yy184; + case 458: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy212 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy212, yymsp[0].minor.yy212); } + yymsp[-3].minor.yy212 = yylhsminor.yy212; break; - case 458: /* query_expression_body ::= query_expression_body UNION query_expression_body */ -{ yylhsminor.yy184 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy184, yymsp[0].minor.yy184); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 459: /* query_expression_body ::= query_expression_body UNION query_expression_body */ +{ yylhsminor.yy212 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy212, yymsp[0].minor.yy212); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 460: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ -{ yymsp[-5].minor.yy184 = yymsp[-4].minor.yy184; } - yy_destructor(yypParser,365,&yymsp[-3].minor); - yy_destructor(yypParser,366,&yymsp[-2].minor); - yy_destructor(yypParser,367,&yymsp[-1].minor); + case 461: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ +{ yymsp[-5].minor.yy212 = yymsp[-4].minor.yy212; } + yy_destructor(yypParser,367,&yymsp[-3].minor); + yy_destructor(yypParser,368,&yymsp[-2].minor); + yy_destructor(yypParser,369,&yymsp[-1].minor); break; - case 464: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 468: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==468); -{ yymsp[-1].minor.yy184 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 465: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 469: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==469); +{ yymsp[-1].minor.yy212 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 465: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 469: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==469); -{ yymsp[-3].minor.yy184 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 466: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 470: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==470); +{ yymsp[-3].minor.yy212 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 466: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 470: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==470); -{ yymsp[-3].minor.yy184 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 467: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 471: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==471); +{ yymsp[-3].minor.yy212 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 471: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy184 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy184); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 472: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy212 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy212); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 475: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy184 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy184), yymsp[-1].minor.yy394, yymsp[0].minor.yy627); } - yymsp[-2].minor.yy184 = yylhsminor.yy184; + case 476: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy212 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy212), yymsp[-1].minor.yy188, yymsp[0].minor.yy607); } + yymsp[-2].minor.yy212 = yylhsminor.yy212; break; - case 476: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy394 = ORDER_ASC; } + case 477: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy188 = ORDER_ASC; } break; - case 477: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy394 = ORDER_ASC; } + case 478: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy188 = ORDER_ASC; } break; - case 478: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy394 = ORDER_DESC; } + case 479: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy188 = ORDER_DESC; } break; - case 479: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy627 = NULL_ORDER_DEFAULT; } + case 480: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy607 = NULL_ORDER_DEFAULT; } break; - case 480: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy627 = NULL_ORDER_FIRST; } + case 481: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy607 = NULL_ORDER_FIRST; } break; - case 481: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy627 = NULL_ORDER_LAST; } + case 482: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy607 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 7de92bba0c..babd096d56 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -526,20 +526,22 @@ TEST_F(ParserInitialCTest, createStream) { memset(&expect, 0, sizeof(SCMCreateStreamReq)); }; - auto setCreateStreamReqFunc = - [&](const char* pStream, const char* pSrcDb, const char* pSql, const char* pDstStb = nullptr, int8_t igExists = 0, - int8_t triggerType = STREAM_TRIGGER_AT_ONCE, int64_t maxDelay = 0, int64_t watermark = 0) { - snprintf(expect.name, sizeof(expect.name), "0.%s", pStream); - snprintf(expect.sourceDB, sizeof(expect.sourceDB), "0.%s", pSrcDb); - if (NULL != pDstStb) { - snprintf(expect.targetStbFullName, sizeof(expect.targetStbFullName), "0.test.%s", pDstStb); - } - expect.igExists = igExists; - expect.sql = strdup(pSql); - expect.triggerType = triggerType; - expect.maxDelay = maxDelay; - expect.watermark = watermark; - }; + auto setCreateStreamReqFunc = [&](const char* pStream, const char* pSrcDb, const char* pSql, + const char* pDstStb = nullptr, int8_t igExists = 0, + int8_t triggerType = STREAM_TRIGGER_AT_ONCE, int64_t maxDelay = 0, + int64_t watermark = 0, int8_t igExpired = 0) { + snprintf(expect.name, sizeof(expect.name), "0.%s", pStream); + snprintf(expect.sourceDB, sizeof(expect.sourceDB), "0.%s", pSrcDb); + if (NULL != pDstStb) { + snprintf(expect.targetStbFullName, sizeof(expect.targetStbFullName), "0.test.%s", pDstStb); + } + expect.igExists = igExists; + expect.sql = strdup(pSql); + expect.triggerType = triggerType; + expect.maxDelay = maxDelay; + expect.watermark = watermark; + expect.igExpired = igExpired; + }; setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) { ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_CREATE_STREAM_STMT); @@ -555,6 +557,7 @@ TEST_F(ParserInitialCTest, createStream) { ASSERT_EQ(req.triggerType, expect.triggerType); ASSERT_EQ(req.maxDelay, expect.maxDelay); ASSERT_EQ(req.watermark, expect.watermark); + ASSERT_EQ(req.igExpired, expect.igExpired); tFreeSCMCreateStreamReq(&req); }); @@ -571,9 +574,10 @@ TEST_F(ParserInitialCTest, createStream) { clearCreateStreamReq(); setCreateStreamReqFunc( - "s1", "test", "create stream if not exists s1 trigger max_delay 20s watermark 10s into st1 as select * from t1", - "st1", 1, STREAM_TRIGGER_MAX_DELAY, 20 * MILLISECOND_PER_SECOND, 10 * MILLISECOND_PER_SECOND); - run("CREATE STREAM IF NOT EXISTS s1 TRIGGER MAX_DELAY 20s WATERMARK 10s INTO st1 AS SELECT * FROM t1"); + "s1", "test", + "create stream if not exists s1 trigger max_delay 20s watermark 10s ignore expired into st1 as select * from t1", + "st1", 1, STREAM_TRIGGER_MAX_DELAY, 20 * MILLISECOND_PER_SECOND, 10 * MILLISECOND_PER_SECOND, 1); + run("CREATE STREAM IF NOT EXISTS s1 TRIGGER MAX_DELAY 20s WATERMARK 10s IGNORE EXPIRED INTO st1 AS SELECT * FROM t1"); clearCreateStreamReq(); } diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index d170482c48..9dda90f77f 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -614,10 +614,7 @@ static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStm if (pCxt->pPlanCxt->streamQuery) { pWindow->triggerType = pCxt->pPlanCxt->triggerType; pWindow->watermark = pCxt->pPlanCxt->watermark; - } - - if (pCxt->pPlanCxt->rSmaQuery) { - /*pWindow->filesFactor = pCxt->pPlanCxt->filesFactor;*/ + pWindow->igExpired = pCxt->pPlanCxt->igExpired; } if (TSDB_CODE_SUCCESS == code) { diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index b1e5b542e3..f11ef7f797 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -227,8 +227,7 @@ static void scanPathOptSetScanWin(SScanLogicNode* pScan) { pScan->slidingUnit = ((SWindowLogicNode*)pParent)->slidingUnit; pScan->triggerType = ((SWindowLogicNode*)pParent)->triggerType; pScan->watermark = ((SWindowLogicNode*)pParent)->watermark; - pScan->tsColId = ((SColumnNode*)((SWindowLogicNode*)pParent)->pTspk)->colId; - pScan->filesFactor = ((SWindowLogicNode*)pParent)->filesFactor; + pScan->igExpired = ((SWindowLogicNode*)pParent)->igExpired; } } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 0f19db26a5..12e1a8a784 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -534,8 +534,7 @@ static int32_t createTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubp pTableScan->slidingUnit = pScanLogicNode->slidingUnit; pTableScan->triggerType = pScanLogicNode->triggerType; pTableScan->watermark = pScanLogicNode->watermark; - pTableScan->tsColId = pScanLogicNode->tsColId; - pTableScan->filesFactor = pScanLogicNode->filesFactor; + pTableScan->igExpired = pScanLogicNode->igExpired; return createScanPhysiNodeFinalize(pCxt, pSubplan, pScanLogicNode, (SScanPhysiNode*)pTableScan, pPhyNode); } @@ -1054,7 +1053,7 @@ static int32_t createWindowPhysiNodeFinalize(SPhysiPlanContext* pCxt, SNodeList* pWindow->triggerType = pWindowLogicNode->triggerType; pWindow->watermark = pWindowLogicNode->watermark; - pWindow->filesFactor = pWindowLogicNode->filesFactor; + pWindow->igExpired = pWindowLogicNode->igExpired; if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pWindow; From 7c3f43d6d59c0b181f980a2568d7fd6101b8f3d2 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 30 Jun 2022 16:20:43 +0800 Subject: [PATCH 45/51] refactor: tsma logic optimization --- source/dnode/vnode/src/sma/smaTimeRange.c | 63 ++++++++++++++--------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaTimeRange.c b/source/dnode/vnode/src/sma/smaTimeRange.c index 2244b91c28..ecd8db8ea9 100644 --- a/source/dnode/vnode/src/sma/smaTimeRange.c +++ b/source/dnode/vnode/src/sma/smaTimeRange.c @@ -113,7 +113,7 @@ int32_t tdProcessTSmaInsertImpl(SSma *pSma, int64_t indexUid, const char *msg) { if (!pDataBlocks) { terrno = TSDB_CODE_TSMA_INVALID_PTR; smaWarn("vgId:%d, insert tsma data failed since pDataBlocks is NULL", SMA_VID(pSma)); - return terrno; + return TSDB_CODE_FAILED; } if (taosArrayGetSize(pDataBlocks) <= 0) { @@ -127,9 +127,9 @@ int32_t tdProcessTSmaInsertImpl(SSma *pSma, int64_t indexUid, const char *msg) { return TSDB_CODE_FAILED; } - SSmaEnv *pEnv = SMA_TSMA_ENV(pSma); - SSmaStat *pStat = NULL; - STSmaStat *pItem = NULL; + SSmaEnv *pEnv = SMA_TSMA_ENV(pSma); + SSmaStat *pStat = NULL; + STSmaStat *pTsmaStat = NULL; if (!pEnv || !(pStat = SMA_ENV_STAT(pEnv))) { terrno = TSDB_CODE_TSMA_INVALID_STAT; @@ -137,32 +137,43 @@ int32_t tdProcessTSmaInsertImpl(SSma *pSma, int64_t indexUid, const char *msg) { } tdRefSmaStat(pSma, pStat); - pItem = &pStat->tsmaStat; + pTsmaStat = SMA_TSMA_STAT(pStat); - ASSERT(pItem); - - if (!pItem->pTSma) { + if (!pTsmaStat->pTSma) { STSma *pTSma = metaGetSmaInfoByIndex(SMA_META(pSma), indexUid); if (!pTSma) { - terrno = TSDB_CODE_TSMA_NO_INDEX_IN_META; - smaWarn("vgId:%d, tsma insert for smaIndex %" PRIi64 " since %s", SMA_VID(pSma), indexUid, tstrerror(terrno)); - return TSDB_CODE_FAILED; + smaError("vgId:%d, failed to get STSma while tsma insert for smaIndex %" PRIi64 " since %s", SMA_VID(pSma), + indexUid, tstrerror(terrno)); + goto _err; + } + pTsmaStat->pTSma = pTSma; + pTsmaStat->pTSchema = metaGetTbTSchema(SMA_META(pSma), pTSma->dstTbUid, -1); + if (!pTsmaStat->pTSchema) { + smaError("vgId:%d, failed to get STSchema while tsma insert for smaIndex %" PRIi64 " since %s", SMA_VID(pSma), + indexUid, tstrerror(terrno)); + goto _err; } - pItem->pTSma = pTSma; - pItem->pTSchema = metaGetTbTSchema(SMA_META(pSma), pTSma->dstTbUid, -1); - ASSERT(pItem->pTSchema); // TODO } - ASSERT(pItem->pTSma->indexUid == indexUid); + if (pTsmaStat->pTSma->indexUid != indexUid) { + terrno = TSDB_CODE_VND_APP_ERROR; + smaError("vgId:%d, tsma insert for smaIndex %" PRIi64 "(!=%" PRIi64 ") failed since %s", SMA_VID(pSma), indexUid, + pTsmaStat->pTSma->indexUid, tstrerror(terrno)); + goto _err; + } - SSubmitReq *pSubmitReq = NULL; + SSubmitReq *pSubmitReq = tdBlockToSubmit((const SArray *)msg, pTsmaStat->pTSchema, true, pTsmaStat->pTSma->dstTbUid, + pTsmaStat->pTSma->dstTbName, pTsmaStat->pTSma->dstVgId); - pSubmitReq = tdBlockToSubmit((const SArray *)msg, pItem->pTSchema, true, pItem->pTSma->dstTbUid, - pItem->pTSma->dstTbName, pItem->pTSma->dstVgId); + if (!pSubmitReq) { + smaError("vgId:%d, failed to gen submit blk while tsma insert for smaIndex %" PRIi64 " since %s", SMA_VID(pSma), + indexUid, tstrerror(terrno)); + goto _err; + } - ASSERT(pSubmitReq); // TODO - - ASSERT(!strncasecmp("td.tsma.rst.tb", pItem->pTSma->dstTbName, 14)); +#if 0 + ASSERT(!strncasecmp("td.tsma.rst.tb", pTsmaStat->pTSma->dstTbName, 14)); +#endif SRpcMsg submitReqMsg = { .msgType = TDMT_VND_SUBMIT, @@ -170,9 +181,15 @@ int32_t tdProcessTSmaInsertImpl(SSma *pSma, int64_t indexUid, const char *msg) { .contLen = ntohl(pSubmitReq->length), }; - ASSERT(tmsgPutToQueue(&pSma->pVnode->msgCb, WRITE_QUEUE, &submitReqMsg) == 0); + if (tmsgPutToQueue(&pSma->pVnode->msgCb, WRITE_QUEUE, &submitReqMsg) < 0) { + smaError("vgId:%d, failed to put SubmitReq msg while tsma insert for smaIndex %" PRIi64 " since %s", SMA_VID(pSma), + indexUid, tstrerror(terrno)); + goto _err; + } tdUnRefSmaStat(pSma, pStat); - return TSDB_CODE_SUCCESS; +_err: + tdUnRefSmaStat(pSma, pStat); + return TSDB_CODE_FAILED; } \ No newline at end of file From ca1c961f9c5364145d6ce7a02ca583c1b01a23e2 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Thu, 30 Jun 2022 16:40:17 +0800 Subject: [PATCH 46/51] fix(tmq): set last scan status --- source/dnode/vnode/src/tq/tqExec.c | 3 ++ source/libs/executor/src/scanoperator.c | 48 ++++++++++++++++--------- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index 9cdc3171f5..09cbed7392 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -85,12 +85,15 @@ int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, S tqAddBlockDataToRsp(pDataBlock, pRsp); if (pRsp->withTbName) { + pRsp->withTbName = 0; +#if 1 int64_t uid; int64_t ts; if (qGetStreamScanStatus(task, &uid, &ts) < 0) { ASSERT(0); } tqAddTbNameToRsp(pTq, uid, pRsp, workerId); +#endif } pRsp->blockNum++; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index c057485f51..10bd0520ad 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -392,6 +392,7 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) { binfo.capacity = binfo.rows; blockDataEnsureCapacity(pBlock, binfo.rows); pBlock->info = binfo; + ASSERT(binfo.uid != 0); uint32_t status = 0; int32_t code = loadDataBlock(pOperator, pTableScanInfo, pBlock, &status); @@ -419,6 +420,7 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) { pTableScanInfo->lastStatus.uid = pBlock->info.uid; pTableScanInfo->lastStatus.ts = pBlock->info.window.ekey; + ASSERT(pBlock->info.uid != 0); return pBlock; } return NULL; @@ -438,6 +440,7 @@ static SSDataBlock* doTableScanGroup(SOperatorInfo* pOperator) { while (pTableScanInfo->curTWinIdx < pTableScanInfo->cond.numOfTWindows) { SSDataBlock* p = doTableScanImpl(pOperator); if (p != NULL) { + ASSERT(p->info.uid != 0); return p; } pTableScanInfo->curTWinIdx += 1; @@ -517,6 +520,35 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) { if (pInfo->scanMode == TABLE_SCAN__TABLE_ORDER) { // check status if (pInfo->lastStatus.uid == pInfo->expStatus.uid && pInfo->lastStatus.ts == pInfo->expStatus.ts) { + while (1) { + SSDataBlock* result = doTableScanGroup(pOperator); + if (result) { + return result; + } + // if no data, switch to next table and continue scan + pInfo->currentTable++; + if (pInfo->currentTable >= taosArrayGetSize(pTaskInfo->tableqinfoList.pTableList)) { + return NULL; + } + STableKeyInfo* pTableInfo = taosArrayGet(pTaskInfo->tableqinfoList.pTableList, pInfo->currentTable); + /*pTableInfo->uid */ + tsdbSetTableId(pInfo->dataReader, pTableInfo->uid); + tsdbResetReadHandle(pInfo->dataReader, &pInfo->cond, 0); + pInfo->scanTimes = 0; + pInfo->curTWinIdx = 0; + } + } + // reset to exp table and window start from ts + tsdbSetTableId(pInfo->dataReader, pInfo->expStatus.uid); + SQueryTableDataCond tmpCond = pInfo->cond; + tmpCond.twindows[0] = (STimeWindow){ + .skey = pInfo->expStatus.ts, + .ekey = INT64_MAX, + }; + tsdbResetReadHandle(pInfo->dataReader, &tmpCond, 0); + pInfo->scanTimes = 0; + pInfo->curTWinIdx = 0; + while (1) { SSDataBlock* result = doTableScanGroup(pOperator); if (result) { return result; @@ -532,23 +564,7 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) { tsdbResetReadHandle(pInfo->dataReader, &pInfo->cond, 0); pInfo->scanTimes = 0; pInfo->curTWinIdx = 0; - pInfo->lastStatus.ts = pInfo->expStatus.ts; - pInfo->lastStatus.uid = pInfo->expStatus.uid; - return doTableScan(pOperator); } - // reset to exp table and window start from ts - tsdbSetTableId(pInfo->dataReader, pInfo->expStatus.uid); - SQueryTableDataCond tmpCond = pInfo->cond; - tmpCond.twindows[0] = (STimeWindow){ - .skey = pInfo->expStatus.ts, - .ekey = INT64_MAX, - }; - tsdbResetReadHandle(pInfo->dataReader, &tmpCond, 0); - pInfo->scanTimes = 0; - pInfo->curTWinIdx = 0; - pInfo->lastStatus.ts = pInfo->expStatus.ts; - pInfo->lastStatus.uid = pInfo->expStatus.uid; - return doTableScan(pOperator); } if (pInfo->currentGroupId == -1) { From 2ca6c5fafdebe8536728cf2e2bfc49700e5d1fb0 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 30 Jun 2022 16:56:44 +0800 Subject: [PATCH 47/51] fix: install script for3.0 (#14396) * fix: remove sudo from directory maniplation for 3.0 * fix: remove more sudo from directory maniplation * fix: packaging/release.sh * fix: remove arbitrator relatives from scripts * fix: update packaging/tools/remove.sh --- packaging/tools/remove.sh | 248 +++++++++++++++++++++++++++----------- 1 file changed, 177 insertions(+), 71 deletions(-) diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh index 413de17ee6..d34c81a4f5 100755 --- a/packaging/tools/remove.sh +++ b/packaging/tools/remove.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Script to stop the service and uninstall TDengine, but retain the config, data and log files. +# Script to stop and uninstall the service, but retain the config, data and log files. set -e #set -x @@ -11,121 +11,216 @@ RED='\033[0;31m' GREEN='\033[1;32m' NC='\033[0m' +installDir="/usr/local/taos" +serverName="taosd" +clientName="taos" +uninstallScript="rmtaos" +productName="TDengine" + #install main path -install_main_dir="/usr/local/taos" -data_link_dir="/usr/local/taos/data" -log_link_dir="/usr/local/taos/log" -cfg_link_dir="/usr/local/taos/cfg" +install_main_dir=${installDir} +data_link_dir=${installDir}/data +log_link_dir=${installDir}/log +cfg_link_dir=${installDir}/cfg bin_link_dir="/usr/bin" +local_bin_link_dir="/usr/local/bin" lib_link_dir="/usr/lib" lib64_link_dir="/usr/lib64" inc_link_dir="/usr/include" +install_nginxd_dir="/usr/local/nginxd" service_config_dir="/etc/systemd/system" -taos_service_name="taosd" - +taos_service_name=${serverName} +taosadapter_service_name="taosadapter" +tarbitrator_service_name="tarbitratord" +nginx_service_name="nginxd" csudo="" -if command -v sudo > /dev/null; then - csudo="sudo" +if command -v sudo >/dev/null; then + csudo="sudo " fi initd_mod=0 service_mod=2 -if pidof systemd &> /dev/null; then - service_mod=0 -elif $(which service &> /dev/null); then - service_mod=1 - service_config_dir="/etc/init.d" - if $(which chkconfig &> /dev/null); then - initd_mod=1 - elif $(which insserv &> /dev/null); then - initd_mod=2 - elif $(which update-rc.d &> /dev/null); then - initd_mod=3 - else - service_mod=2 - fi -else +if pidof systemd &>/dev/null; then + service_mod=0 +elif $(which service &>/dev/null); then + service_mod=1 + service_config_dir="/etc/init.d" + if $(which chkconfig &>/dev/null); then + initd_mod=1 + elif $(which insserv &>/dev/null); then + initd_mod=2 + elif $(which update-rc.d &>/dev/null); then + initd_mod=3 + else service_mod=2 + fi +else + service_mod=2 fi - -function kill_taosd() { - pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}') +function kill_taosadapter() { + pid=$(ps -ef | grep "taosadapter" | grep -v "grep" | awk '{print $2}') if [ -n "$pid" ]; then - ${csudo} kill -9 $pid || : + ${csudo}kill -9 $pid || : fi } +function kill_taosd() { + pid=$(ps -ef | grep ${serverName} | grep -v "grep" | awk '{print $2}') + if [ -n "$pid" ]; then + ${csudo}kill -9 $pid || : + fi +} + +function kill_tarbitrator() { + pid=$(ps -ef | grep "tarbitrator" | grep -v "grep" | awk '{print $2}') + if [ -n "$pid" ]; then + ${csudo}kill -9 $pid || : + fi +} function clean_bin() { - # Remove link - ${csudo} rm -f ${bin_link_dir}/taos || : - ${csudo} rm -f ${bin_link_dir}/taosd || : - ${csudo} rm -f ${bin_link_dir}/create_table || : - ${csudo} rm -f ${bin_link_dir}/tmq_sim || : - ${csudo} rm -f ${bin_link_dir}/taosdemo || : - ${csudo} rm -f ${bin_link_dir}/taosdump || : - ${csudo} rm -f ${bin_link_dir}/rmtaos || : - #${csudo} rm -f ${bin_link_dir}/set_core || : + # Remove link + ${csudo}rm -f ${bin_link_dir}/${clientName} || : + ${csudo}rm -f ${bin_link_dir}/${serverName} || : + ${csudo}rm -f ${bin_link_dir}/taosadapter || : + ${csudo}rm -f ${bin_link_dir}/taosBenchmark || : + ${csudo}rm -f ${bin_link_dir}/taosdemo || : + ${csudo}rm -f ${bin_link_dir}/taosdump || : + ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : + ${csudo}rm -f ${bin_link_dir}/tarbitrator || : + ${csudo}rm -f ${bin_link_dir}/set_core || : + ${csudo}rm -f ${bin_link_dir}/TDinsight.sh || : +} + +function clean_local_bin() { + ${csudo}rm -f ${local_bin_link_dir}/taosBenchmark || : + ${csudo}rm -f ${local_bin_link_dir}/taosdemo || : } function clean_lib() { - # Remove link - ${csudo} rm -f ${lib_link_dir}/libtaos.* || : - ${csudo} rm -f ${lib64_link_dir}/libtaos.* || : - - ${csudo} rm -f ${lib_link_dir}/libtdb.* || : - ${csudo} rm -f ${lib64_link_dir}/libtdb.* || : + # Remove link + ${csudo}rm -f ${lib_link_dir}/libtaos.* || : + ${csudo}rm -f ${lib64_link_dir}/libtaos.* || : + #${csudo}rm -rf ${v15_java_app_dir} || : } function clean_header() { - # Remove link - ${csudo} rm -f ${inc_link_dir}/taos.h || : - ${csudo} rm -f ${inc_link_dir}/taosdef.h || : - ${csudo} rm -f ${inc_link_dir}/taoserror.h || : - ${csudo} rm -f ${inc_link_dir}/taosudf.h || : + # Remove link + ${csudo}rm -f ${inc_link_dir}/taos.h || : + ${csudo}rm -f ${inc_link_dir}/taosdef.h || : + ${csudo}rm -f ${inc_link_dir}/taoserror.h || : } function clean_config() { - # Remove link - ${csudo} rm -f ${cfg_link_dir}/* || : + # Remove link + ${csudo}rm -f ${cfg_link_dir}/* || : } function clean_log() { - # Remove link - ${csudo} rm -rf ${log_link_dir} || : + # Remove link + ${csudo}rm -rf ${log_link_dir} || : } function clean_service_on_systemd() { - taosd_service_config="${service_config_dir}/${taos_service_name}.service" - if systemctl is-active --quiet ${taos_service_name}; then - echo "TDengine taosd is running, stopping it..." - ${csudo} systemctl stop ${taos_service_name} &> /dev/null || echo &> /dev/null + taosd_service_config="${service_config_dir}/${taos_service_name}.service" + if systemctl is-active --quiet ${taos_service_name}; then + echo "${productName} ${serverName} is running, stopping it..." + ${csudo}systemctl stop ${taos_service_name} &>/dev/null || echo &>/dev/null + fi + ${csudo}systemctl disable ${taos_service_name} &>/dev/null || echo &>/dev/null + ${csudo}rm -f ${taosd_service_config} + + taosadapter_service_config="${service_config_dir}/taosadapter.service" + if systemctl is-active --quiet ${taosadapter_service_name}; then + echo "${productName} taosAdapter is running, stopping it..." + ${csudo}systemctl stop ${taosadapter_service_name} &>/dev/null || echo &>/dev/null + fi + ${csudo}systemctl disable ${taosadapter_service_name} &>/dev/null || echo &>/dev/null + [ -f ${taosadapter_service_config} ] && ${csudo}rm -f ${taosadapter_service_config} + + tarbitratord_service_config="${service_config_dir}/${tarbitrator_service_name}.service" + if systemctl is-active --quiet ${tarbitrator_service_name}; then + echo "${productName} tarbitrator is running, stopping it..." + ${csudo}systemctl stop ${tarbitrator_service_name} &>/dev/null || echo &>/dev/null + fi + ${csudo}systemctl disable ${tarbitrator_service_name} &>/dev/null || echo &>/dev/null + ${csudo}rm -f ${tarbitratord_service_config} + + if [ "$verMode" == "cluster" ]; then + nginx_service_config="${service_config_dir}/${nginx_service_name}.service" + if [ -d ${install_nginxd_dir} ]; then + if systemctl is-active --quiet ${nginx_service_name}; then + echo "Nginx for ${productName} is running, stopping it..." + ${csudo}systemctl stop ${nginx_service_name} &>/dev/null || echo &>/dev/null + fi + ${csudo}systemctl disable ${nginx_service_name} &>/dev/null || echo &>/dev/null + ${csudo}rm -f ${nginx_service_config} fi - ${csudo} systemctl disable ${taos_service_name} &> /dev/null || echo &> /dev/null - ${csudo} rm -f ${taosd_service_config} + fi } function clean_service_on_sysvinit() { - echo " " + if pidof ${serverName} &>/dev/null; then + echo "${productName} ${serverName} is running, stopping it..." + ${csudo}service ${serverName} stop || : + fi + + if pidof tarbitrator &>/dev/null; then + echo "${productName} tarbitrator is running, stopping it..." + ${csudo}service tarbitratord stop || : + fi + + if ((${initd_mod} == 1)); then + if [ -e ${service_config_dir}/${serverName} ]; then + ${csudo}chkconfig --del ${serverName} || : + fi + if [ -e ${service_config_dir}/tarbitratord ]; then + ${csudo}chkconfig --del tarbitratord || : + fi + elif ((${initd_mod} == 2)); then + if [ -e ${service_config_dir}/${serverName} ]; then + ${csudo}insserv -r ${serverName} || : + fi + if [ -e ${service_config_dir}/tarbitratord ]; then + ${csudo}insserv -r tarbitratord || : + fi + elif ((${initd_mod} == 3)); then + if [ -e ${service_config_dir}/${serverName} ]; then + ${csudo}update-rc.d -f ${serverName} remove || : + fi + if [ -e ${service_config_dir}/tarbitratord ]; then + ${csudo}update-rc.d -f tarbitratord remove || : + fi + fi + + ${csudo}rm -f ${service_config_dir}/${serverName} || : + ${csudo}rm -f ${service_config_dir}/tarbitratord || : + + if $(which init &>/dev/null); then + ${csudo}init q || : + fi } function clean_service() { - if ((${service_mod}==0)); then - clean_service_on_systemd - elif ((${service_mod}==1)); then - clean_service_on_sysvinit - else - # must manual stop taosd - kill_taosd - fi + if ((${service_mod} == 0)); then + clean_service_on_systemd + elif ((${service_mod} == 1)); then + clean_service_on_sysvinit + else + kill_taosadapter + kill_taosd + kill_tarbitrator + fi } # Stop service and disable booting start. clean_service # Remove binary file and links clean_bin +# Remove links of local bin +clean_local_bin # Remove header file. clean_header # Remove lib file @@ -135,15 +230,26 @@ clean_log # Remove link configuration file clean_config # Remove data link directory -${csudo} rm -rf ${data_link_dir} || : - -${csudo} rm -rf ${install_main_dir} +${csudo}rm -rf ${data_link_dir} || : +${csudo}rm -rf ${install_main_dir} +${csudo}rm -rf ${install_nginxd_dir} if [[ -e /etc/os-release ]]; then osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release) else osinfo="" fi -echo -e "${GREEN}TDengine is removed successfully!${NC}" +if echo $osinfo | grep -qwi "ubuntu"; then + # echo "this is ubuntu system" + ${csudo}dpkg --force-all -P tdengine >/dev/null 2>&1 || : +elif echo $osinfo | grep -qwi "debian"; then + # echo "this is debian system" + ${csudo}dpkg --force-all -P tdengine >/dev/null 2>&1 || : +elif echo $osinfo | grep -qwi "centos"; then + # echo "this is centos system" + ${csudo}rpm -e --noscripts tdengine >/dev/null 2>&1 || : +fi + +echo -e "${GREEN}${productName} is removed successfully!${NC}" echo From dc769a284fe8985ef762c05313bd9d534f81e7f2 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 30 Jun 2022 17:12:03 +0800 Subject: [PATCH 48/51] feat: support 'select *, expr from ...' syntax --- source/libs/nodes/src/nodesCodeFuncs.c | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index dc293bf6c1..7440dd3f95 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -1513,34 +1513,34 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) { code = tjsonGetDoubleValue(pJson, jkTableScanPhysiPlanRatio, &pNode->ratio); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->dataRequired); + code = tjsonGetIntValue(pJson, jkTableScanPhysiPlanDataRequired, &pNode->dataRequired); } if (TSDB_CODE_SUCCESS == code) { code = jsonToNodeList(pJson, jkTableScanPhysiPlanDynamicScanFuncs, &pNode->pDynamicScanFuncs); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->interval); + code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanInterval, &pNode->interval); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->offset); + code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanOffset, &pNode->offset); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->sliding); + code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanSliding, &pNode->sliding); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->intervalUnit); + code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanIntervalUnit, &pNode->intervalUnit); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->slidingUnit); + code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanSlidingUnit, &pNode->slidingUnit); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->triggerType); + code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanTriggerType, &pNode->triggerType); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->watermark); + code = tjsonGetBigIntValue(pJson, jkTableScanPhysiPlanWatermark, &pNode->watermark); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanStartKey, &pNode->igExpired); + code = tjsonGetTinyIntValue(pJson, jkTableScanPhysiPlanIgnoreExpired, &pNode->igExpired); } if (TSDB_CODE_SUCCESS == code) { code = jsonToNodeList(pJson, jkTableScanPhysiPlanGroupTags, &pNode->pGroupTags); @@ -1819,7 +1819,7 @@ static const char* jkWindowPhysiPlanTsPk = "TsPk"; static const char* jkWindowPhysiPlanTsEnd = "TsEnd"; static const char* jkWindowPhysiPlanTriggerType = "TriggerType"; static const char* jkWindowPhysiPlanWatermark = "Watermark"; -static const char* JKWINDOWPHYSIPLANIGNOREEXPIRED = "IgnoreExpired"; +static const char* jkWindowPhysiPlanIgnoreExpired = "IgnoreExpired"; static int32_t physiWindowNodeToJson(const void* pObj, SJson* pJson) { const SWinodwPhysiNode* pNode = (const SWinodwPhysiNode*)pObj; @@ -1844,7 +1844,7 @@ static int32_t physiWindowNodeToJson(const void* pObj, SJson* pJson) { code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanWatermark, pNode->watermark); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonAddIntegerToObject(pJson, JKWINDOWPHYSIPLANIGNOREEXPIRED, pNode->igExpired); + code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanIgnoreExpired, pNode->igExpired); } return code; @@ -1867,13 +1867,13 @@ static int32_t jsonToPhysiWindowNode(const SJson* pJson, void* pObj) { code = jsonToNodeObject(pJson, jkWindowPhysiPlanTsEnd, (SNode**)&pNode->pTsEnd); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetTinyIntValue(pJson, JKWINDOWPHYSIPLANIGNOREEXPIRED, &pNode->triggerType); + code = tjsonGetTinyIntValue(pJson, jkWindowPhysiPlanTriggerType, &pNode->triggerType); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetBigIntValue(pJson, JKWINDOWPHYSIPLANIGNOREEXPIRED, &pNode->watermark); + code = tjsonGetBigIntValue(pJson, jkWindowPhysiPlanWatermark, &pNode->watermark); } if (TSDB_CODE_SUCCESS == code) { - code = tjsonGetTinyIntValue(pJson, JKWINDOWPHYSIPLANIGNOREEXPIRED, &pNode->igExpired); + code = tjsonGetTinyIntValue(pJson, jkWindowPhysiPlanIgnoreExpired, &pNode->igExpired); } return code; From 94f07836d605d8d51b9c473ae3a5de2bbb4cabd4 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Thu, 30 Jun 2022 17:25:19 +0800 Subject: [PATCH 49/51] fix(tmq): set scan rsp offset correctly --- include/libs/executor/executor.h | 2 +- source/dnode/vnode/src/tq/tq.c | 1 - source/dnode/vnode/src/tq/tqExec.c | 11 ++++---- source/libs/executor/inc/executorimpl.h | 7 +---- source/libs/executor/src/executorMain.c | 8 +++++- source/libs/executor/src/executorimpl.c | 36 ++++++++++++++++++------- source/libs/executor/src/scanoperator.c | 29 -------------------- tests/script/tsim/tmq/snapshot1.sim | 2 ++ 8 files changed, 44 insertions(+), 52 deletions(-) diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h index d3e3c58622..45fa94b3bf 100644 --- a/include/libs/executor/executor.h +++ b/include/libs/executor/executor.h @@ -172,7 +172,7 @@ int32_t qDeserializeTaskStatus(qTaskInfo_t tinfo, const char* pInput, int32_t le */ int32_t qGetStreamScanStatus(qTaskInfo_t tinfo, uint64_t* uid, int64_t* ts); -int32_t qPrepareScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts); +int32_t qStreamPrepareScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts); #ifdef __cplusplus } diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 0563b67f4a..c0d184ee11 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -389,7 +389,6 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) { // 4. send rsp if (dataRsp.blockNum != 0) { - tqOffsetResetToData(&dataRsp.rspOffset, 0, 0); if (tqSendDataRsp(pTq, pMsg, pReq, &dataRsp) < 0) { code = -1; } diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index 09cbed7392..9dd2a0258f 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -63,10 +63,11 @@ int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, S ASSERT(pExec->subType == TOPIC_SUB_TYPE__COLUMN); qTaskInfo_t task = pExec->execCol.task[workerId]; - if (qStreamScanSnapshot(task) < 0) { - ASSERT(0); - } - if (qPrepareScan(task, offset.uid, offset.ts) < 0) { + /*if (qStreamScanSnapshot(task) < 0) {*/ + /*ASSERT(0);*/ + /*}*/ + + if (qStreamPrepareScan(task, offset.uid, offset.ts) < 0) { ASSERT(0); } @@ -86,7 +87,7 @@ int32_t tqScanSnapshot(STQ* pTq, const STqExecHandle* pExec, SMqDataRsp* pRsp, S if (pRsp->withTbName) { pRsp->withTbName = 0; -#if 1 +#if 0 int64_t uid; int64_t ts; if (qGetStreamScanStatus(task, &uid, &ts) < 0) { diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 618cf50b86..9872f26b03 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -250,7 +250,7 @@ typedef struct SSampleExecInfo { enum { TABLE_SCAN__TABLE_ORDER = 1, - TABLE_SCAN__BLOCK_ORDER = 1, + TABLE_SCAN__BLOCK_ORDER = 2, }; typedef struct STableScanInfo { @@ -286,11 +286,6 @@ typedef struct STableScanInfo { int64_t ts; } lastStatus; - struct { - uint64_t uid; - int64_t ts; - } expStatus; - int8_t scanMode; } STableScanInfo; diff --git a/source/libs/executor/src/executorMain.c b/source/libs/executor/src/executorMain.c index deb4f970df..8dd8005225 100644 --- a/source/libs/executor/src/executorMain.c +++ b/source/libs/executor/src/executorMain.c @@ -231,9 +231,15 @@ int32_t qDeserializeTaskStatus(qTaskInfo_t tinfo, const char* pInput, int32_t le return decodeOperator(pTaskInfo->pRoot, pInput, len); } -int32_t qPrepareScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts) { +int32_t qStreamPrepareScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts) { SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; + if (uid == 0) { + STableKeyInfo* pTableInfo = taosArrayGet(pTaskInfo->tableqinfoList.pTableList, 0); + uid = pTableInfo->uid; + ts = INT64_MIN; + } + return doPrepareScan(pTaskInfo->pRoot, uid, ts); } diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 6fc1d2b0b4..dd48229849 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -2825,18 +2825,36 @@ int32_t doPrepareScan(SOperatorInfo* pOperator, uint64_t uid, int64_t ts) { int32_t type = pOperator->operatorType; if (type == QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) { SStreamBlockScanInfo* pScanInfo = pOperator->info; - STableScanInfo* pSnapShotScanInfo = pScanInfo->pSnapshotReadOp->info; - /**uid = pSnapShotScanInfo->scanStatus.uid;*/ - /**ts = pSnapShotScanInfo->scanStatus.t;*/ - if (pSnapShotScanInfo->lastStatus.uid != uid || pSnapShotScanInfo->lastStatus.ts != ts) { - // rebuild scan - // + pScanInfo->blockType = STREAM_INPUT__DATA_SCAN; + + STableScanInfo* pInfo = pScanInfo->pSnapshotReadOp->info; + + /*if (pSnapShotScanInfo->dataReader == NULL) {*/ + /*pSnapShotScanInfo->dataReader = tsdbReaderOpen(pHandle->vnode, &pSTInfo->cond, tableList, 0, 0);*/ + /*pSnapShotScanInfo->scanMode = TABLE_SCAN__TABLE_ORDER;*/ + /*}*/ + + if (pInfo->lastStatus.uid != uid || pInfo->lastStatus.ts != ts) { + tsdbSetTableId(pInfo->dataReader, uid); + SQueryTableDataCond tmpCond = pInfo->cond; + tmpCond.twindows[0] = (STimeWindow){ + .skey = ts, + .ekey = INT64_MAX, + }; + tsdbResetReadHandle(pInfo->dataReader, &tmpCond, 0); + pInfo->scanTimes = 0; + pInfo->curTWinIdx = 0; } + } else { - if (pOperator->pDownstream[0] == NULL) { - return TSDB_CODE_INVALID_PARA; + if (pOperator->numOfDownstream == 1) { + return doPrepareScan(pOperator->pDownstream[0], uid, ts); + } else if (pOperator->numOfDownstream == 0) { + qError("failed to find stream scan operator to set the input data block"); + return TSDB_CODE_QRY_APP_ERROR; } else { - doPrepareScan(pOperator->pDownstream[0], uid, ts); + qError("join not supported for stream block scan"); + return TSDB_CODE_QRY_APP_ERROR; } } diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 10bd0520ad..a6bf9a12f3 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -519,35 +519,6 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) { // if scan table by table if (pInfo->scanMode == TABLE_SCAN__TABLE_ORDER) { // check status - if (pInfo->lastStatus.uid == pInfo->expStatus.uid && pInfo->lastStatus.ts == pInfo->expStatus.ts) { - while (1) { - SSDataBlock* result = doTableScanGroup(pOperator); - if (result) { - return result; - } - // if no data, switch to next table and continue scan - pInfo->currentTable++; - if (pInfo->currentTable >= taosArrayGetSize(pTaskInfo->tableqinfoList.pTableList)) { - return NULL; - } - STableKeyInfo* pTableInfo = taosArrayGet(pTaskInfo->tableqinfoList.pTableList, pInfo->currentTable); - /*pTableInfo->uid */ - tsdbSetTableId(pInfo->dataReader, pTableInfo->uid); - tsdbResetReadHandle(pInfo->dataReader, &pInfo->cond, 0); - pInfo->scanTimes = 0; - pInfo->curTWinIdx = 0; - } - } - // reset to exp table and window start from ts - tsdbSetTableId(pInfo->dataReader, pInfo->expStatus.uid); - SQueryTableDataCond tmpCond = pInfo->cond; - tmpCond.twindows[0] = (STimeWindow){ - .skey = pInfo->expStatus.ts, - .ekey = INT64_MAX, - }; - tsdbResetReadHandle(pInfo->dataReader, &tmpCond, 0); - pInfo->scanTimes = 0; - pInfo->curTWinIdx = 0; while (1) { SSDataBlock* result = doTableScanGroup(pOperator); if (result) { diff --git a/tests/script/tsim/tmq/snapshot1.sim b/tests/script/tsim/tmq/snapshot1.sim index 8c4a719006..9226c475cb 100644 --- a/tests/script/tsim/tmq/snapshot1.sim +++ b/tests/script/tsim/tmq/snapshot1.sim @@ -133,6 +133,8 @@ endi $totalMsgCons = $totalMsgOfOneTopic + $totalMsgOfStb $sumOfRows = $data[0][3] + $data[1][3] if $sumOfRows != $totalMsgCons then + print actual: $sumOfRows + print expect: $totalMsgCons return -1 endi From 82bd8a560f0f522f96de5065ee0fc6f6bcef7d9f Mon Sep 17 00:00:00 2001 From: slzhou Date: Thu, 30 Jun 2022 17:28:49 +0800 Subject: [PATCH 50/51] fix: reserved column should not be copied --- source/libs/executor/src/executorimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 95782ce001..e2e281d877 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1348,7 +1348,7 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowR SColumnInfoData* pSrc = taosArrayGet(px->pDataBlock, i); SColumnInfoData* pDst = taosArrayGet(pBlock->pDataBlock, i); // it is a reserved column for scalar function, and no data in this column yet. - if (pDst->pData == NULL) { + if (pDst->pData == NULL || pSrc->pData == NULL) { continue; } From 2ac9a78d58bb1fbae41a75178e202eaa860ed021 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 30 Jun 2022 17:52:34 +0800 Subject: [PATCH 51/51] feat: support 'select *, expr from ...' syntax --- tests/test/c/tmqSim.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/tests/test/c/tmqSim.c b/tests/test/c/tmqSim.c index 81fa72d15a..38ee543f10 100644 --- a/tests/test/c/tmqSim.c +++ b/tests/test/c/tmqSim.c @@ -124,15 +124,13 @@ char* getCurrentTimeString(char* timeString) { return timeString; } -static void tmqStop(int signum, void *info, void *ctx) { +static void tmqStop(int signum, void* info, void* ctx) { running = 0; char tmpString[128]; - taosFprintfFile(g_fp, "%s tmqStop() receive stop signal[%d]\n", getCurrentTimeString(tmpString), signum); + taosFprintfFile(g_fp, "%s tmqStop() receive stop signal[%d]\n", getCurrentTimeString(tmpString), signum); } -static void tmqSetSignalHandle() { - taosSetSignal(SIGINT, tmqStop); -} +static void tmqSetSignalHandle() { taosSetSignal(SIGINT, tmqStop); } void initLogFile() { char filename[256]; @@ -433,7 +431,7 @@ static void dumpToFileForCheck(TdFilePtr pFile, TAOS_ROW row, TAOS_FIELD* fields int32_t precision) { for (int32_t i = 0; i < num_fields; i++) { if (i > 0) { - taosFprintfFile(pFile, "\n"); + taosFprintfFile(pFile, ","); } shellDumpFieldToFile(pFile, (const char*)row[i], fields + i, length[i], precision); } @@ -463,16 +461,16 @@ static int32_t msg_process(TAOS_RES* msg, SThreadInfo* pInfo, int32_t msgIndex) int32_t precision = taos_result_precision(msg); const char* tbName = tmq_get_table_name(msg); - #if 0 +#if 0 // get schema //============================== stub =================================================// for (int32_t i = 0; i < numOfFields; i++) { taosFprintfFile(g_fp, "%02d: name: %s, type: %d, len: %d\n", i, fields[i].name, fields[i].type, fields[i].bytes); } //============================== stub =================================================// - #endif +#endif - dumpToFileForCheck(pInfo->pConsumeRowsFile, row, fields, length, numOfFields, precision); + dumpToFileForCheck(pInfo->pConsumeRowsFile, row, fields, length, numOfFields, precision); taos_print_row(buf, row, fields, numOfFields); @@ -523,15 +521,15 @@ int32_t notifyMainScript(SThreadInfo* pInfo, int32_t cmdId) { static int32_t g_once_commit_flag = 0; static void tmq_commit_cb_print(tmq_t* tmq, int32_t code, void* param) { - pError("tmq_commit_cb_print() commit %d\n", code); + pError("tmq_commit_cb_print() commit %d\n", code); - if (0 == g_once_commit_flag) { - g_once_commit_flag = 1; - notifyMainScript((SThreadInfo*)param, (int32_t)NOTIFY_CMD_START_COMMIT); + if (0 == g_once_commit_flag) { + g_once_commit_flag = 1; + notifyMainScript((SThreadInfo*)param, (int32_t)NOTIFY_CMD_START_COMMIT); } - - char tmpString[128]; - taosFprintfFile(g_fp, "%s tmq_commit_cb_print() be called\n", getCurrentTimeString(tmpString)); + + char tmpString[128]; + taosFprintfFile(g_fp, "%s tmq_commit_cb_print() be called\n", getCurrentTimeString(tmpString)); } void build_consumer(SThreadInfo* pInfo) { @@ -683,13 +681,13 @@ void* consumeThreadFunc(void* param) { pInfo->taos = taos_connect(NULL, "root", "taosdata", NULL, 0); if (pInfo->taos == NULL) { taosFprintfFile(g_fp, "taos_connect() fail, can not notify and save consume result to main scripte\n"); - return NULL; + return NULL; } build_consumer(pInfo); build_topic_list(pInfo); if ((NULL == pInfo->tmq) || (NULL == pInfo->topicList)) { - taosFprintfFile(g_fp, "create consumer fail! tmq is null or topicList is null\n"); + taosFprintfFile(g_fp, "create consumer fail! tmq is null or topicList is null\n"); assert(0); return NULL; } @@ -697,7 +695,7 @@ void* consumeThreadFunc(void* param) { int32_t err = tmq_subscribe(pInfo->tmq, pInfo->topicList); if (err != 0) { pError("tmq_subscribe() fail, reason: %s\n", tmq_err2str(err)); - taosFprintfFile(g_fp, "tmq_subscribe() fail! reason: %s\n", tmq_err2str(err)); + taosFprintfFile(g_fp, "tmq_subscribe() fail! reason: %s\n", tmq_err2str(err)); assert(0); return NULL; } @@ -718,13 +716,13 @@ void* consumeThreadFunc(void* param) { err = tmq_unsubscribe(pInfo->tmq); if (err != 0) { pError("tmq_unsubscribe() fail, reason: %s\n", tmq_err2str(err)); - taosFprintfFile(g_fp, "tmq_unsubscribe()! reason: %s\n", tmq_err2str(err)); + taosFprintfFile(g_fp, "tmq_unsubscribe()! reason: %s\n", tmq_err2str(err)); } err = tmq_consumer_close(pInfo->tmq); if (err != 0) { pError("tmq_consumer_close() fail, reason: %s\n", tmq_err2str(err)); - taosFprintfFile(g_fp, "tmq_consumer_close()! reason: %s\n", tmq_err2str(err)); + taosFprintfFile(g_fp, "tmq_consumer_close()! reason: %s\n", tmq_err2str(err)); } pInfo->tmq = NULL; @@ -871,4 +869,3 @@ int main(int32_t argc, char* argv[]) { return 0; } -