From 1db0c05529a632856cc3c9a2ca55fc95ee8dfc94 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 2 Dec 2022 21:48:32 +0800 Subject: [PATCH 01/63] fix(query): check null ptr before dereferencing it. --- source/dnode/mnode/impl/src/mndUser.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndUser.c b/source/dnode/mnode/impl/src/mndUser.c index 9f4b9fc2de..685e1ece68 100644 --- a/source/dnode/mnode/impl/src/mndUser.c +++ b/source/dnode/mnode/impl/src/mndUser.c @@ -168,6 +168,8 @@ _OVER: static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw) { terrno = TSDB_CODE_OUT_OF_MEMORY; + SUserObj *pUser = NULL; // fix the un-initialized local parameter error, caused by log print + SSdbRow *pRow = NULL; int8_t sver = 0; if (sdbGetRawSoftVer(pRaw, &sver) != 0) goto _OVER; @@ -177,10 +179,10 @@ static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw) { goto _OVER; } - SSdbRow *pRow = sdbAllocRow(sizeof(SUserObj)); + pRow = sdbAllocRow(sizeof(SUserObj)); if (pRow == NULL) goto _OVER; - SUserObj *pUser = sdbGetRowObj(pRow); + pUser = sdbGetRowObj(pRow); if (pUser == NULL) goto _OVER; int32_t dataPos = 0; @@ -225,9 +227,12 @@ static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw) { _OVER: if (terrno != 0) { - mError("user:%s, failed to decode from raw:%p since %s", pUser->user, pRaw, terrstr()); - taosHashCleanup(pUser->readDbs); - taosHashCleanup(pUser->writeDbs); + if (pUser != NULL) { + mError("user:%s, failed to decode from raw:%p since %s", pUser->user, pRaw, terrstr()); + taosHashCleanup(pUser->readDbs); + taosHashCleanup(pUser->writeDbs); + } + taosMemoryFreeClear(pRow); return NULL; } From 4a121d40d6490b5c78c0326635d6010c9a86c013 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 3 Dec 2022 13:47:51 +0800 Subject: [PATCH 02/63] fix(query): fix syntax error. --- source/libs/executor/src/executorimpl.c | 1 + source/libs/executor/src/scanoperator.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index b408e32061..ea4b37cf0b 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1580,6 +1580,7 @@ void destroyOperatorInfo(SOperatorInfo* pOperator) { int32_t optrDefaultBufFn(SOperatorInfo* pOperator) { if (pOperator->blocking) { ASSERT(0); + return 0; } else { return 0; } diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 0d245f0815..54d7182ac3 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -3032,8 +3032,10 @@ void fillTableCountScanDataBlock(STableCountScanSupp* pSupp, char* dbName, char* if (pSupp->dbNameSlotId != -1) { ASSERT(strlen(dbName)); SColumnInfoData* colInfoData = taosArrayGet(pRes->pDataBlock, pSupp->dbNameSlotId); - char varDbName[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - strncpy(varDataVal(varDbName), dbName, strlen(dbName)); + + char varDbName[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + tstrncpy(varDataVal(varDbName), dbName, TSDB_DB_NAME_LEN); + varDataSetLen(varDbName, strlen(dbName)); colDataAppend(colInfoData, 0, varDbName, false); } @@ -3042,7 +3044,7 @@ void fillTableCountScanDataBlock(STableCountScanSupp* pSupp, char* dbName, char* SColumnInfoData* colInfoData = taosArrayGet(pRes->pDataBlock, pSupp->stbNameSlotId); if (strlen(stbName) != 0) { char varStbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - strncpy(varDataVal(varStbName), stbName, strlen(stbName)); + strncpy(varDataVal(varStbName), stbName, TSDB_TABLE_NAME_LEN); varDataSetLen(varStbName, strlen(stbName)); colDataAppend(colInfoData, 0, varStbName, false); } else { From e025ffcdc376db26dbbde1e1827ec273dbc57383 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sun, 4 Dec 2022 19:13:18 +0800 Subject: [PATCH 03/63] refact: remove redundant error codes --- include/util/taoserror.h | 18 +++++++++--------- source/util/src/terror.c | 9 --------- source/util/src/tref.c | 4 ++-- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 739e14790d..4f53894166 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -72,7 +72,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0102) // #define TSDB_CODE_COM_INVALID_CFG_MSG TAOS_DEF_ERROR_CODE(0, 0x0103) // 2.x #define TSDB_CODE_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x0104) // -#define TSDB_CODE_REF_NO_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0105) // internal +// #define TSDB_CODE_REF_NO_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0105) // 2.x #define TSDB_CODE_REF_FULL TAOS_DEF_ERROR_CODE(0, 0x0106) // internal #define TSDB_CODE_REF_ID_REMOVED TAOS_DEF_ERROR_CODE(0, 0x0107) // internal #define TSDB_CODE_REF_INVALID_ID TAOS_DEF_ERROR_CODE(0, 0x0108) // internal @@ -173,12 +173,12 @@ int32_t* taosGetErrno(); #define TSDB_CODE_MND_INVALID_QUERY_ID TAOS_DEF_ERROR_CODE(0, 0x030C) #define TSDB_CODE_MND_INVALID_STREAM_ID TAOS_DEF_ERROR_CODE(0, 0x030D) #define TSDB_CODE_MND_INVALID_CONN_ID TAOS_DEF_ERROR_CODE(0, 0x030E) -#define TSDB_CODE_MND_MNODE_IS_RUNNING TAOS_DEF_ERROR_CODE(0, 0x0310) -#define TSDB_CODE_MND_FAILED_TO_CONFIG_SYNC TAOS_DEF_ERROR_CODE(0, 0x0311) -#define TSDB_CODE_MND_FAILED_TO_START_SYNC TAOS_DEF_ERROR_CODE(0, 0x0312) -#define TSDB_CODE_MND_FAILED_TO_CREATE_DIR TAOS_DEF_ERROR_CODE(0, 0x0313) -#define TSDB_CODE_MND_FAILED_TO_INIT_STEP TAOS_DEF_ERROR_CODE(0, 0x0314) -#define TSDB_CODE_MND_USER_DISABLED TAOS_DEF_ERROR_CODE(0, 0x0315) +// #define TSDB_CODE_MND_MNODE_IS_RUNNING TAOS_DEF_ERROR_CODE(0, 0x0310) // 2.x +// #define TSDB_CODE_MND_FAILED_TO_CONFIG_SYNC TAOS_DEF_ERROR_CODE(0, 0x0311) // 2.x +// #define TSDB_CODE_MND_FAILED_TO_START_SYNC TAOS_DEF_ERROR_CODE(0, 0x0312) // 2.x +// #define TSDB_CODE_MND_FAILED_TO_CREATE_DIR TAOS_DEF_ERROR_CODE(0, 0x0313) // 2.x +// #define TSDB_CODE_MND_FAILED_TO_INIT_STEP TAOS_DEF_ERROR_CODE(0, 0x0314) // 2.x +// #define TSDB_CODE_MND_USER_DISABLED TAOS_DEF_ERROR_CODE(0, 0x0315) // 2.x // mnode-sdb #define TSDB_CODE_SDB_OBJ_ALREADY_THERE TAOS_DEF_ERROR_CODE(0, 0x0320) @@ -512,7 +512,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_TQ_INVALID_CONFIG TAOS_DEF_ERROR_CODE(0, 0x0A00) #define TSDB_CODE_TQ_INIT_FAILED TAOS_DEF_ERROR_CODE(0, 0x0A01) #define TSDB_CODE_TQ_NO_DISK_PERMISSIONS TAOS_DEF_ERROR_CODE(0, 0x0A03) -#define TSDB_CODE_TQ_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x0A04) +// #define TSDB_CODE_TQ_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x0A04) // #define TSDB_CODE_TQ_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0A05) #define TSDB_CODE_TQ_FILE_ALREADY_EXISTS TAOS_DEF_ERROR_CODE(0, 0x0A06) #define TSDB_CODE_TQ_FAILED_TO_CREATE_DIR TAOS_DEF_ERROR_CODE(0, 0x0A07) @@ -698,7 +698,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_RSMA_INVALID_ENV TAOS_DEF_ERROR_CODE(0, 0x3150) #define TSDB_CODE_RSMA_INVALID_STAT TAOS_DEF_ERROR_CODE(0, 0x3151) #define TSDB_CODE_RSMA_QTASKINFO_CREATE TAOS_DEF_ERROR_CODE(0, 0x3152) -#define TSDB_CODE_RSMA_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x3153) +// #define TSDB_CODE_RSMA_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x3153) #define TSDB_CODE_RSMA_REMOVE_EXISTS TAOS_DEF_ERROR_CODE(0, 0x3154) #define TSDB_CODE_RSMA_FETCH_MSG_MSSED_UP TAOS_DEF_ERROR_CODE(0, 0x3155) #define TSDB_CODE_RSMA_EMPTY_INFO TAOS_DEF_ERROR_CODE(0, 0x3156) diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 479cb027c7..34627a2752 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -57,7 +57,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TIME_UNSYNCED, "Client and server's t TAOS_DEFINE_ERROR(TSDB_CODE_OPS_NOT_SUPPORT, "Operation not supported") TAOS_DEFINE_ERROR(TSDB_CODE_OUT_OF_MEMORY, "Out of Memory") TAOS_DEFINE_ERROR(TSDB_CODE_FILE_CORRUPTED, "Data file corrupted") -TAOS_DEFINE_ERROR(TSDB_CODE_REF_NO_MEMORY, "Ref out of memory") TAOS_DEFINE_ERROR(TSDB_CODE_REF_FULL, "too many Ref Objs") TAOS_DEFINE_ERROR(TSDB_CODE_REF_ID_REMOVED, "Ref ID is removed") TAOS_DEFINE_ERROR(TSDB_CODE_REF_INVALID_ID, "Invalid Ref ID") @@ -145,12 +144,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_SHOWOBJ, "Data expired") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_QUERY_ID, "Invalid query id") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_STREAM_ID, "Invalid stream id") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_CONN_ID, "Invalid connection id") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_MNODE_IS_RUNNING, "mnode is alreay running") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_FAILED_TO_CONFIG_SYNC, "failed to config sync") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_FAILED_TO_START_SYNC, "failed to start sync") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_FAILED_TO_CREATE_DIR, "failed to create mnode dir") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_FAILED_TO_INIT_STEP, "failed to init components") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_USER_DISABLED, "User is disabled") // mnode-sdb TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_ALREADY_THERE, "Object already there") @@ -418,7 +411,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_SYN_INTERNAL_ERROR, "Sync internal error") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_INVALID_CONFIG, "TQ invalid config") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_INIT_FAILED, "TQ init falied") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_NO_DISK_PERMISSIONS, "TQ no disk permissions") -TAOS_DEFINE_ERROR(TSDB_CODE_TQ_FILE_CORRUPTED, "TQ file corrupted") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_FILE_ALREADY_EXISTS, "TQ file already exists") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_FAILED_TO_CREATE_DIR, "TQ failed to create dir") TAOS_DEFINE_ERROR(TSDB_CODE_TQ_META_NO_SUCH_KEY, "TQ meta no such key") @@ -596,7 +588,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSMA_NO_INDEX_IN_CACHE, "No tsma index in ca TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_ENV, "Invalid rsma env") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_STAT, "Invalid rsma state") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_QTASKINFO_CREATE, "Rsma qtaskinfo creation error") -TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_FILE_CORRUPTED, "Rsma file corrupted") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_REMOVE_EXISTS, "Rsma remove exists") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_FETCH_MSG_MSSED_UP, "Rsma fetch msg is messed up") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_EMPTY_INFO, "Rsma info is empty") diff --git a/source/util/src/tref.c b/source/util/src/tref.c index b4322464e2..26c9cb82c4 100644 --- a/source/util/src/tref.c +++ b/source/util/src/tref.c @@ -67,14 +67,14 @@ int32_t taosOpenRef(int32_t max, RefFp fp) { nodeList = taosMemoryCalloc(sizeof(SRefNode *), (size_t)max); if (nodeList == NULL) { - terrno = TSDB_CODE_REF_NO_MEMORY; + terrno = TSDB_CODE_NO_MEMORY; return -1; } lockedBy = taosMemoryCalloc(sizeof(int64_t), (size_t)max); if (lockedBy == NULL) { taosMemoryFree(nodeList); - terrno = TSDB_CODE_REF_NO_MEMORY; + terrno = TSDB_CODE_NO_MEMORY; return -1; } From ae0ad8a973ac3d35acd1d34bf26ff5bbeed0cfd0 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sun, 4 Dec 2022 19:33:59 +0800 Subject: [PATCH 04/63] refact: remove redundant error codes --- include/util/taoserror.h | 6 +++--- source/dnode/mnode/impl/src/mndShow.c | 4 ++-- source/util/src/terror.c | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 4f53894166..4bee24ffa4 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -163,7 +163,7 @@ int32_t* taosGetErrno(); // #define TSDB_CODE_MND_ACTION_NEED_REPROCESSEDTAOS_DEF_ERROR_CODE(0, 0x0302) // 2.x #define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0303) // #define TSDB_CODE_MND_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0304) // 2.x -#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0305) +// #define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0305) // 2.x // #define TSDB_CODE_MND_INVALID_MSG_VERSION TAOS_DEF_ERROR_CODE(0, 0x0306) // 2.x // #define TSDB_CODE_MND_INVALID_MSG_LEN TAOS_DEF_ERROR_CODE(0, 0x0307) // 2.x // #define TSDB_CODE_MND_INVALID_MSG_TYPE TAOS_DEF_ERROR_CODE(0, 0x0308) // 2.x @@ -171,14 +171,14 @@ int32_t* taosGetErrno(); // #define TSDB_CODE_MND_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x030A) // 2.x #define TSDB_CODE_MND_INVALID_SHOWOBJ TAOS_DEF_ERROR_CODE(0, 0x030B) #define TSDB_CODE_MND_INVALID_QUERY_ID TAOS_DEF_ERROR_CODE(0, 0x030C) -#define TSDB_CODE_MND_INVALID_STREAM_ID TAOS_DEF_ERROR_CODE(0, 0x030D) +// #define TSDB_CODE_MND_INVALID_STREAM_ID TAOS_DEF_ERROR_CODE(0, 0x030D) // 2.x #define TSDB_CODE_MND_INVALID_CONN_ID TAOS_DEF_ERROR_CODE(0, 0x030E) // #define TSDB_CODE_MND_MNODE_IS_RUNNING TAOS_DEF_ERROR_CODE(0, 0x0310) // 2.x // #define TSDB_CODE_MND_FAILED_TO_CONFIG_SYNC TAOS_DEF_ERROR_CODE(0, 0x0311) // 2.x // #define TSDB_CODE_MND_FAILED_TO_START_SYNC TAOS_DEF_ERROR_CODE(0, 0x0312) // 2.x // #define TSDB_CODE_MND_FAILED_TO_CREATE_DIR TAOS_DEF_ERROR_CODE(0, 0x0313) // 2.x // #define TSDB_CODE_MND_FAILED_TO_INIT_STEP TAOS_DEF_ERROR_CODE(0, 0x0314) // 2.x -// #define TSDB_CODE_MND_USER_DISABLED TAOS_DEF_ERROR_CODE(0, 0x0315) // 2.x +#define TSDB_CODE_MND_USER_DISABLED TAOS_DEF_ERROR_CODE(0, 0x0315) // mnode-sdb #define TSDB_CODE_SDB_OBJ_ALREADY_THERE TAOS_DEF_ERROR_CODE(0, 0x0320) diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index ec2e844ba5..6a7e2aaa51 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -198,9 +198,9 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { } if (retrieveReq.showId == 0) { - STableMetaRsp *pMeta = (STableMetaRsp *)taosHashGet(pMnode->infosMeta, retrieveReq.tb, strlen(retrieveReq.tb)); + STableMetaRsp *pMeta = taosHashGet(pMnode->infosMeta, retrieveReq.tb, strlen(retrieveReq.tb)); if (pMeta == NULL) { - pMeta = (STableMetaRsp *)taosHashGet(pMnode->perfsMeta, retrieveReq.tb, strlen(retrieveReq.tb)); + pMeta = taosHashGet(pMnode->perfsMeta, retrieveReq.tb, strlen(retrieveReq.tb)); if (pMeta == NULL) { terrno = TSDB_CODE_MND_INVALID_SYS_TABLENAME; mError("failed to process show-retrieve req:%p since %s", pShow, terrstr()); diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 34627a2752..f8355ef54b 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -139,11 +139,10 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSC_NOT_STABLE_ERROR, "Table is not a super // mnode-common TAOS_DEFINE_ERROR(TSDB_CODE_MND_NO_RIGHTS, "Insufficient privilege for operation") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_CONNECTION, "Invalid message connection") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_SHOWOBJ, "Data expired") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_QUERY_ID, "Invalid query id") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_STREAM_ID, "Invalid stream id") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_CONN_ID, "Invalid connection id") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_USER_DISABLED, "User is disabled") // mnode-sdb TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_ALREADY_THERE, "Object already there") From fcebc8ce89871e8853db59e330d90803d967a5f2 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sun, 4 Dec 2022 19:41:17 +0800 Subject: [PATCH 05/63] refact: remove redundant error codes --- source/util/src/tref.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/util/src/tref.c b/source/util/src/tref.c index 26c9cb82c4..75a16b0ad7 100644 --- a/source/util/src/tref.c +++ b/source/util/src/tref.c @@ -67,14 +67,14 @@ int32_t taosOpenRef(int32_t max, RefFp fp) { nodeList = taosMemoryCalloc(sizeof(SRefNode *), (size_t)max); if (nodeList == NULL) { - terrno = TSDB_CODE_NO_MEMORY; + terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } lockedBy = taosMemoryCalloc(sizeof(int64_t), (size_t)max); if (lockedBy == NULL) { taosMemoryFree(nodeList); - terrno = TSDB_CODE_NO_MEMORY; + terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } @@ -164,7 +164,7 @@ int64_t taosAddRef(int32_t rsetId, void *p) { pNode = taosMemoryCalloc(sizeof(SRefNode), 1); if (pNode == NULL) { - terrno = TSDB_CODE_REF_NO_MEMORY; + terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } From c726d1870b3970b7d49f4f6973e854c73255b04d Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sun, 4 Dec 2022 20:11:24 +0800 Subject: [PATCH 06/63] refact: remove redundant error codes --- include/util/taoserror.h | 19 ++++++++++--------- source/util/src/terror.c | 3 --- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 4bee24ffa4..e352cfb569 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -181,17 +181,18 @@ int32_t* taosGetErrno(); #define TSDB_CODE_MND_USER_DISABLED TAOS_DEF_ERROR_CODE(0, 0x0315) // mnode-sdb -#define TSDB_CODE_SDB_OBJ_ALREADY_THERE TAOS_DEF_ERROR_CODE(0, 0x0320) -// #define TSDB_CODE_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0321) // 2.x -#define TSDB_CODE_SDB_INVALID_TABLE_TYPE TAOS_DEF_ERROR_CODE(0, 0x0322) +#define TSDB_CODE_SDB_OBJ_ALREADY_THERE TAOS_DEF_ERROR_CODE(0, 0x0320) // internal +// #define TSDB_CODE_MND_SDB_ERROR TAOS_DEF_ERROR_CODE(0, 0x0321) // 2.x +#define TSDB_CODE_SDB_INVALID_TABLE_TYPE TAOS_DEF_ERROR_CODE(0, 0x0322) // internal #define TSDB_CODE_SDB_OBJ_NOT_THERE TAOS_DEF_ERROR_CODE(0, 0x0323) -#define TSDB_CODE_SDB_INVALID_KEY_TYPE TAOS_DEF_ERROR_CODE(0, 0x0325) -#define TSDB_CODE_SDB_INVALID_ACTION_TYPE TAOS_DEF_ERROR_CODE(0, 0x0326) -#define TSDB_CODE_SDB_INVALID_STATUS_TYPE TAOS_DEF_ERROR_CODE(0, 0x0327) -#define TSDB_CODE_SDB_INVALID_DATA_VER TAOS_DEF_ERROR_CODE(0, 0x0328) -#define TSDB_CODE_SDB_INVALID_DATA_LEN TAOS_DEF_ERROR_CODE(0, 0x0329) +// #define TSDB_CODE_MND_SDB_INVAID_META_ROW TAOS_DEF_ERROR_CODE(0, 0x0324) // 2.x +// #define TSDB_CODE_SDB_INVALID_KEY_TYPE TAOS_DEF_ERROR_CODE(0, 0x0325) // 2.x +#define TSDB_CODE_SDB_INVALID_ACTION_TYPE TAOS_DEF_ERROR_CODE(0, 0x0326) // internal +// #define TSDB_CODE_SDB_INVALID_STATUS_TYPE TAOS_DEF_ERROR_CODE(0, 0x0327) // unused +#define TSDB_CODE_SDB_INVALID_DATA_VER TAOS_DEF_ERROR_CODE(0, 0x0328) // internal +#define TSDB_CODE_SDB_INVALID_DATA_LEN TAOS_DEF_ERROR_CODE(0, 0x0329) // internal #define TSDB_CODE_SDB_INVALID_DATA_CONTENT TAOS_DEF_ERROR_CODE(0, 0x032A) -#define TSDB_CODE_SDB_INVALID_WAl_VER TAOS_DEF_ERROR_CODE(0, 0x032B) +// #define TSDB_CODE_SDB_INVALID_WAl_VER TAOS_DEF_ERROR_CODE(0, 0x032B) // unused #define TSDB_CODE_SDB_OBJ_CREATING TAOS_DEF_ERROR_CODE(0, 0x032C) #define TSDB_CODE_SDB_OBJ_DROPPING TAOS_DEF_ERROR_CODE(0, 0x032D) diff --git a/source/util/src/terror.c b/source/util/src/terror.c index f8355ef54b..656d775ea4 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -148,13 +148,10 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_USER_DISABLED, "User is disabled") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_ALREADY_THERE, "Object already there") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_TABLE_TYPE, "Invalid table type") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_NOT_THERE, "Object not there") -TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_KEY_TYPE, "Invalid key type") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_ACTION_TYPE, "Invalid action type") -TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_STATUS_TYPE, "Invalid status type") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_DATA_VER, "Invalid raw data version") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_DATA_LEN, "Invalid raw data len") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_DATA_CONTENT, "Invalid raw data content") -TAOS_DEFINE_ERROR(TSDB_CODE_SDB_INVALID_WAl_VER, "Invalid wal version") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_CREATING, "Object is creating") TAOS_DEFINE_ERROR(TSDB_CODE_SDB_OBJ_DROPPING, "Object is dropping") From 6b7c5408842ddaf473366b061630a5b417c895f2 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 5 Dec 2022 10:14:18 +0800 Subject: [PATCH 07/63] fix: use tdbTrace to reduce 135 debug log output --- source/libs/tdb/src/db/tdbPCache.c | 22 +++++++++------------- source/libs/tdb/src/db/tdbPage.c | 12 ++++++------ source/libs/tdb/src/db/tdbPager.c | 2 +- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/source/libs/tdb/src/db/tdbPCache.c b/source/libs/tdb/src/db/tdbPCache.c index 425e494ab6..b67fe562eb 100644 --- a/source/libs/tdb/src/db/tdbPCache.c +++ b/source/libs/tdb/src/db/tdbPCache.c @@ -184,9 +184,9 @@ SPage *tdbPCacheFetch(SPCache *pCache, const SPgid *pPgid, TXN *pTxn) { // TDB_PAGE_PGNO(pPage), pPage, nRef); if (pPage) { - tdbDebug("pcache/fetch page %p/%d/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id, nRef); + tdbTrace("pcache/fetch page %p/%d/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id, nRef); } else { - tdbDebug("pcache/fetch page %p", pPage); + tdbTrace("pcache/fetch page %p", pPage); } return pPage; @@ -202,7 +202,7 @@ void tdbPCacheRelease(SPCache *pCache, SPage *pPage, TXN *pTxn) { tdbPCacheLock(pCache); nRef = tdbUnrefPage(pPage); - tdbDebug("pcache/release page %p/%d/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id, nRef); + tdbTrace("pcache/release page %p/%d/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id, nRef); if (nRef == 0) { // test the nRef again to make sure // it is safe th handle the page @@ -221,8 +221,6 @@ void tdbPCacheRelease(SPCache *pCache, SPage *pPage, TXN *pTxn) { // } } tdbPCacheUnlock(pCache); - // printf("thread %" PRId64 " relas page %d pgno %d pPage %p nRef %d\n", taosGetSelfPthreadId(), pPage->id, - // TDB_PAGE_PGNO(pPage), pPage, nRef); } int tdbPCacheGetPageSize(SPCache *pCache) { return pCache->szPage; } @@ -335,8 +333,7 @@ static void tdbPCachePinPage(SPCache *pCache, SPage *pPage) { pCache->nRecyclable--; - // printf("pin page %d pgno %d pPage %p\n", pPage->id, TDB_PAGE_PGNO(pPage), pPage); - tdbDebug("pcache/pin page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); + tdbTrace("pcache/pin page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); } } @@ -349,7 +346,7 @@ static void tdbPCacheUnpinPage(SPCache *pCache, SPage *pPage) { ASSERT(pPage->pLruNext == NULL); - tdbDebug("pCache:%p unpin page %p/%d/%d, nPages:%d", pCache, pPage, TDB_PAGE_PGNO(pPage), pPage->id, pCache->nPages); + tdbTrace("pCache:%p unpin page %p/%d/%d, nPages:%d", pCache, pPage, TDB_PAGE_PGNO(pPage), pPage->id, pCache->nPages); if (pPage->id < pCache->nPages) { pPage->pLruPrev = &(pCache->lru); pPage->pLruNext = pCache->lru.pLruNext; @@ -359,9 +356,9 @@ static void tdbPCacheUnpinPage(SPCache *pCache, SPage *pPage) { pCache->nRecyclable++; // printf("unpin page %d pgno %d pPage %p\n", pPage->id, TDB_PAGE_PGNO(pPage), pPage); - tdbDebug("pcache/unpin page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); + tdbTrace("pcache/unpin page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); } else { - tdbDebug("pcache destroy page: %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); + tdbTrace("pcache destroy page: %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); tdbPCacheRemovePageFromHash(pCache, pPage); tdbPageDestroy(pPage, tdbDefaultFree, NULL); @@ -381,7 +378,7 @@ static void tdbPCacheRemovePageFromHash(SPCache *pCache, SPage *pPage) { // printf("rmv page %d to hash, pgno %d, pPage %p\n", pPage->id, TDB_PAGE_PGNO(pPage), pPage); } - tdbDebug("pcache/remove page %p/%d/%d from hash %" PRIu32, pPage, TDB_PAGE_PGNO(pPage), pPage->id, h); + tdbTrace("pcache/remove page %p/%d/%d from hash %" PRIu32, pPage, TDB_PAGE_PGNO(pPage), pPage->id, h); } static void tdbPCacheAddPageToHash(SPCache *pCache, SPage *pPage) { @@ -392,8 +389,7 @@ static void tdbPCacheAddPageToHash(SPCache *pCache, SPage *pPage) { pCache->nPage++; - // printf("add page %d to hash, pgno %d, pPage %p\n", pPage->id, TDB_PAGE_PGNO(pPage), pPage); - tdbDebug("pcache/add page %p/%d/%d to hash %" PRIu32, pPage, TDB_PAGE_PGNO(pPage), pPage->id, h); + tdbTrace("pcache/add page %p/%d/%d to hash %" PRIu32, pPage, TDB_PAGE_PGNO(pPage), pPage->id, h); } static int tdbPCacheOpenImpl(SPCache *pCache) { diff --git a/source/libs/tdb/src/db/tdbPage.c b/source/libs/tdb/src/db/tdbPage.c index 0653b6fc36..ac2725d8ec 100644 --- a/source/libs/tdb/src/db/tdbPage.c +++ b/source/libs/tdb/src/db/tdbPage.c @@ -81,7 +81,7 @@ int tdbPageDestroy(SPage *pPage, void (*xFree)(void *arg, void *ptr), void *arg) ASSERT(xFree); for (int iOvfl = 0; iOvfl < pPage->nOverflow; iOvfl++) { - tdbDebug("tdbPage/destroy/free ovfl cell: %p/%p", pPage->apOvfl[iOvfl], pPage); + tdbTrace("tdbPage/destroy/free ovfl cell: %p/%p", pPage->apOvfl[iOvfl], pPage); tdbOsFree(pPage->apOvfl[iOvfl]); } @@ -92,7 +92,7 @@ int tdbPageDestroy(SPage *pPage, void (*xFree)(void *arg, void *ptr), void *arg) } void tdbPageZero(SPage *pPage, u8 szAmHdr, int (*xCellSize)(const SPage *, SCell *, int, TXN *, SBTree *pBt)) { - tdbDebug("page/zero: %p %" PRIu8 " %p", pPage, szAmHdr, xCellSize); + tdbTrace("page/zero: %p %" PRIu8 " %p", pPage, szAmHdr, xCellSize); pPage->pPageHdr = pPage->pData + szAmHdr; TDB_PAGE_NCELLS_SET(pPage, 0); TDB_PAGE_CCELLS_SET(pPage, pPage->pageSize - sizeof(SPageFtr)); @@ -109,7 +109,7 @@ void tdbPageZero(SPage *pPage, u8 szAmHdr, int (*xCellSize)(const SPage *, SCell } void tdbPageInit(SPage *pPage, u8 szAmHdr, int (*xCellSize)(const SPage *, SCell *, int, TXN *, SBTree *pBt)) { - tdbDebug("page/init: %p %" PRIu8 " %p", pPage, szAmHdr, xCellSize); + tdbTrace("page/init: %p %" PRIu8 " %p", pPage, szAmHdr, xCellSize); pPage->pPageHdr = pPage->pData + szAmHdr; pPage->pCellIdx = pPage->pPageHdr + TDB_PAGE_HDR_SIZE(pPage); pPage->pFreeStart = pPage->pCellIdx + TDB_PAGE_OFFSET_SIZE(pPage) * TDB_PAGE_NCELLS(pPage); @@ -154,7 +154,7 @@ int tdbPageInsertCell(SPage *pPage, int idx, SCell *pCell, int szCell, u8 asOvfl pNewCell = (SCell *)tdbOsMalloc(szCell); memcpy(pNewCell, pCell, szCell); - tdbDebug("tdbPage/insert/new ovfl cell: %p/%p", pNewCell, pPage); + tdbTrace("tdbPage/insert/new ovfl cell: %p/%p", pNewCell, pPage); pPage->apOvfl[iOvfl] = pNewCell; pPage->aiOvfl[iOvfl] = idx; @@ -204,7 +204,7 @@ int tdbPageDropCell(SPage *pPage, int idx, TXN *pTxn, SBTree *pBt) { if (pPage->aiOvfl[iOvfl] == idx) { // remove the over flow cell tdbOsFree(pPage->apOvfl[iOvfl]); - tdbDebug("tdbPage/drop/free ovfl cell: %p", pPage->apOvfl[iOvfl]); + tdbTrace("tdbPage/drop/free ovfl cell: %p", pPage->apOvfl[iOvfl]); for (; (++iOvfl) < pPage->nOverflow;) { pPage->aiOvfl[iOvfl - 1] = pPage->aiOvfl[iOvfl] - 1; pPage->apOvfl[iOvfl - 1] = pPage->apOvfl[iOvfl]; @@ -257,7 +257,7 @@ void tdbPageCopy(SPage *pFromPage, SPage *pToPage, int deepCopyOvfl) { int szCell = (*pFromPage->xCellSize)(pFromPage, pFromPage->apOvfl[iOvfl], 0, NULL, NULL); pNewCell = (SCell *)tdbOsMalloc(szCell); memcpy(pNewCell, pFromPage->apOvfl[iOvfl], szCell); - tdbDebug("tdbPage/copy/new ovfl cell: %p/%p/%p", pNewCell, pToPage, pFromPage); + tdbTrace("tdbPage/copy/new ovfl cell: %p/%p/%p", pNewCell, pToPage, pFromPage); } pToPage->apOvfl[iOvfl] = pNewCell; diff --git a/source/libs/tdb/src/db/tdbPager.c b/source/libs/tdb/src/db/tdbPager.c index 7f0fdf9efc..f638ec25a3 100644 --- a/source/libs/tdb/src/db/tdbPager.c +++ b/source/libs/tdb/src/db/tdbPager.c @@ -239,7 +239,7 @@ int tdbPagerWrite(SPager *pPager, SPage *pPage) { // ref page one more time so the page will not be release tdbRefPage(pPage); - tdbDebug("pager/mdirty page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); + tdbTrace("pager/mdirty page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); // Set page as dirty pPage->isDirty = 1; From 3d3e4b6d833b227e3731af21377aa50166803b4f Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Mon, 5 Dec 2022 10:18:14 +0800 Subject: [PATCH 08/63] fix(sync): fix snapshot receiver waiting time --- source/libs/sync/src/syncSnapshot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index a316d78cdb..b8ecbe7515 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -548,6 +548,7 @@ _START_RECEIVER: sNTrace(pSyncNode, "snapshot receiver pre waitting for true time, now:%" PRId64 ", stime:%" PRId64, timeNow, pMsg->startTime); taosMsleep(10); + timeNow = taosGetTimestampMs(); } if (snapshotReceiverIsStart(pReceiver)) { @@ -883,9 +884,9 @@ int32_t syncNodeOnSnapshotReply(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) { // receive ack is finish, close sender if (pMsg->ack == SYNC_SNAPSHOT_SEQ_END) { snapshotSenderStop(pSender, true); - SSyncLogReplMgr* pMgr = syncNodeGetLogReplMgr(pSyncNode, &pMsg->srcId); + SSyncLogReplMgr *pMgr = syncNodeGetLogReplMgr(pSyncNode, &pMsg->srcId); if (pMgr) { - syncLogReplMgrReset(pMgr); + syncLogReplMgrReset(pMgr); } return 0; } From b6dfb0358586f2e3776846562bf8e4a64f8fc37c Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 5 Dec 2022 10:31:09 +0800 Subject: [PATCH 09/63] docs: update connector matrix with nodejs ws sql support (#18687) --- docs/en/14-reference/03-connector/index.mdx | 2 +- docs/zh/08-connector/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/14-reference/03-connector/index.mdx b/docs/en/14-reference/03-connector/index.mdx index 54031db618..d743c50143 100644 --- a/docs/en/14-reference/03-connector/index.mdx +++ b/docs/en/14-reference/03-connector/index.mdx @@ -62,7 +62,7 @@ The different database framework specifications for various programming language | **Parameter Binding** | Not supported | Not supported | Not supported | Support | Not supported | Support | | **Subscription (TMQ) ** | Not supported | Not supported | Not supported | Not supported | Not supported | Support | | **Schemaless** | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | -| **Bulk Pulling (based on WebSocket) ** | Support | Support | Not Supported | support | Not Supported | Supported | +| **Bulk Pulling (based on WebSocket) ** | Support | Support | Not Supported | support | Support | Support | | **DataFrame** | Not supported | Support | Not supported | Not supported | Not supported | Not supported | :::warning diff --git a/docs/zh/08-connector/index.md b/docs/zh/08-connector/index.md index eecf564b90..c79dfbbc20 100644 --- a/docs/zh/08-connector/index.md +++ b/docs/zh/08-connector/index.md @@ -62,7 +62,7 @@ TDengine 版本更新往往会增加新的功能特性,列表中的连接器 | **参数绑定** | 暂不支持 | 暂不支持 | 暂不支持 | 支持 | 暂不支持 | 支持 | | **数据订阅(TMQ)** | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 支持 | | **Schemaless** | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | -| **批量拉取(基于 WebSocket)** | 支持 | 支持 | 暂不支持 | 支持 | 暂不支持 | 支持 | +| **批量拉取(基于 WebSocket)** | 支持 | 支持 | 暂不支持 | 支持 | 支持 | 支持 | | **DataFrame** | 不支持 | 支持 | 不支持 | 不支持 | 不支持 | 不支持 | :::warning From 449ca165c12bb0239b5b6b1480b19b7144d02e4a Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 5 Dec 2022 11:04:20 +0800 Subject: [PATCH 10/63] docs: update connector matrix for go ws stmt (#18688) --- docs/en/14-reference/03-connector/index.mdx | 2 +- docs/zh/08-connector/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/14-reference/03-connector/index.mdx b/docs/en/14-reference/03-connector/index.mdx index d743c50143..8e44e7342d 100644 --- a/docs/en/14-reference/03-connector/index.mdx +++ b/docs/en/14-reference/03-connector/index.mdx @@ -59,7 +59,7 @@ The different database framework specifications for various programming language | -------------------------------------- | ------------- | --------------- | ------------- | ------------- | ------------- | ------------- | | **Connection Management** | Support | Support | Support | Support | Support | Support | | **Regular Query** | Support | Support | Support | Support | Support | Support | -| **Parameter Binding** | Not supported | Not supported | Not supported | Support | Not supported | Support | +| **Parameter Binding** | Not supported | Not supported | support | Support | Not supported | Support | | **Subscription (TMQ) ** | Not supported | Not supported | Not supported | Not supported | Not supported | Support | | **Schemaless** | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | | **Bulk Pulling (based on WebSocket) ** | Support | Support | Not Supported | support | Support | Support | diff --git a/docs/zh/08-connector/index.md b/docs/zh/08-connector/index.md index c79dfbbc20..a79a0bb373 100644 --- a/docs/zh/08-connector/index.md +++ b/docs/zh/08-connector/index.md @@ -59,7 +59,7 @@ TDengine 版本更新往往会增加新的功能特性,列表中的连接器 | ------------------------------ | -------- | ---------- | -------- | -------- | ----------- | -------- | | **连接管理** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | | **普通查询** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | -| **参数绑定** | 暂不支持 | 暂不支持 | 暂不支持 | 支持 | 暂不支持 | 支持 | +| **参数绑定** | 暂不支持 | 暂不支持 | 支持 | 支持 | 暂不支持 | 支持 | | **数据订阅(TMQ)** | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 支持 | | **Schemaless** | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | | **批量拉取(基于 WebSocket)** | 支持 | 支持 | 暂不支持 | 支持 | 支持 | 支持 | From 5cfc7c451bfae125248a0aca344ad9a845e9772e Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 5 Dec 2022 11:13:25 +0800 Subject: [PATCH 11/63] docs: update connector matrix for go ws tmq (#18690) --- docs/en/14-reference/03-connector/index.mdx | 2 +- docs/zh/08-connector/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/14-reference/03-connector/index.mdx b/docs/en/14-reference/03-connector/index.mdx index 8e44e7342d..fd7dabf130 100644 --- a/docs/en/14-reference/03-connector/index.mdx +++ b/docs/en/14-reference/03-connector/index.mdx @@ -60,7 +60,7 @@ The different database framework specifications for various programming language | **Connection Management** | Support | Support | Support | Support | Support | Support | | **Regular Query** | Support | Support | Support | Support | Support | Support | | **Parameter Binding** | Not supported | Not supported | support | Support | Not supported | Support | -| **Subscription (TMQ) ** | Not supported | Not supported | Not supported | Not supported | Not supported | Support | +| **Subscription (TMQ) ** | Not supported | Not supported | support | Not supported | Not supported | Support | | **Schemaless** | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | | **Bulk Pulling (based on WebSocket) ** | Support | Support | Not Supported | support | Support | Support | | **DataFrame** | Not supported | Support | Not supported | Not supported | Not supported | Not supported | diff --git a/docs/zh/08-connector/index.md b/docs/zh/08-connector/index.md index a79a0bb373..bba9ffaddc 100644 --- a/docs/zh/08-connector/index.md +++ b/docs/zh/08-connector/index.md @@ -60,7 +60,7 @@ TDengine 版本更新往往会增加新的功能特性,列表中的连接器 | **连接管理** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | | **普通查询** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | | **参数绑定** | 暂不支持 | 暂不支持 | 支持 | 支持 | 暂不支持 | 支持 | -| **数据订阅(TMQ)** | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 支持 | +| **数据订阅(TMQ)** | 暂不支持 | 暂不支持 | 支持 | 暂不支持 | 暂不支持 | 支持 | | **Schemaless** | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | | **批量拉取(基于 WebSocket)** | 支持 | 支持 | 暂不支持 | 支持 | 支持 | 支持 | | **DataFrame** | 不支持 | 支持 | 不支持 | 不支持 | 不支持 | 不支持 | From 35b958a1c4611d2b2da7b151816203455bd8f78d Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 5 Dec 2022 11:17:14 +0800 Subject: [PATCH 12/63] fix: commit tdb in write thread --- source/dnode/vnode/src/meta/metaCommit.c | 8 +++++++- source/dnode/vnode/src/vnd/vnodeCommit.c | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/dnode/vnode/src/meta/metaCommit.c b/source/dnode/vnode/src/meta/metaCommit.c index b2cd85e9fa..5eb27679bb 100644 --- a/source/dnode/vnode/src/meta/metaCommit.c +++ b/source/dnode/vnode/src/meta/metaCommit.c @@ -43,7 +43,13 @@ int metaBegin(SMeta *pMeta, int8_t fromSys) { TXN *metaGetTxn(SMeta *pMeta) { return pMeta->txn; } int metaCommit(SMeta *pMeta, TXN *txn) { return tdbCommit(pMeta->pEnv, txn); } int metaFinishCommit(SMeta *pMeta, TXN *txn) { return tdbPostCommit(pMeta->pEnv, txn); } -int metaPrepareAsyncCommit(SMeta *pMeta) { return tdbPrepareAsyncCommit(pMeta->pEnv, pMeta->txn); } +int metaPrepareAsyncCommit(SMeta *pMeta) { + // return tdbPrepareAsyncCommit(pMeta->pEnv, pMeta->txn); + int code = 0; + code = tdbCommit(pMeta->pEnv, pMeta->txn); + + return code; +} // abort the meta txn int metaAbort(SMeta *pMeta) { return tdbAbort(pMeta->pEnv, pMeta->txn); } diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index f9a598fec6..cd56468371 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -193,7 +193,6 @@ static void vnodePrepareCommit(SVnode *pVnode) { metaPrepareAsyncCommit(pVnode->pMeta); smaPrepareAsyncCommit(pVnode->pSma); - vnodeBufPoolUnRef(pVnode->inUse); pVnode->inUse = NULL; } @@ -283,11 +282,6 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { syncBeginSnapshot(pVnode->sync, pVnode->state.applied); // commit each sub-system - if (metaCommit(pVnode->pMeta, pInfo->txn) < 0) { - code = TSDB_CODE_FAILED; - TSDB_CHECK_CODE(code, lino, _exit); - } - code = tsdbCommit(pVnode->pTsdb, pInfo); TSDB_CHECK_CODE(code, lino, _exit); From bfeaab4c5036472f680347a494de7dc2860741b2 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 5 Dec 2022 11:22:58 +0800 Subject: [PATCH 13/63] docs: update connector matrix for go ws bulkpulling (#18691) --- docs/en/14-reference/03-connector/index.mdx | 2 +- docs/zh/08-connector/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/14-reference/03-connector/index.mdx b/docs/en/14-reference/03-connector/index.mdx index fd7dabf130..ba8dbb85d4 100644 --- a/docs/en/14-reference/03-connector/index.mdx +++ b/docs/en/14-reference/03-connector/index.mdx @@ -62,7 +62,7 @@ The different database framework specifications for various programming language | **Parameter Binding** | Not supported | Not supported | support | Support | Not supported | Support | | **Subscription (TMQ) ** | Not supported | Not supported | support | Not supported | Not supported | Support | | **Schemaless** | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | -| **Bulk Pulling (based on WebSocket) ** | Support | Support | Not Supported | support | Support | Support | +| **Bulk Pulling (based on WebSocket) ** | Support | Support | Support | support | Support | Support | | **DataFrame** | Not supported | Support | Not supported | Not supported | Not supported | Not supported | :::warning diff --git a/docs/zh/08-connector/index.md b/docs/zh/08-connector/index.md index bba9ffaddc..a28a7cd66c 100644 --- a/docs/zh/08-connector/index.md +++ b/docs/zh/08-connector/index.md @@ -62,7 +62,7 @@ TDengine 版本更新往往会增加新的功能特性,列表中的连接器 | **参数绑定** | 暂不支持 | 暂不支持 | 支持 | 支持 | 暂不支持 | 支持 | | **数据订阅(TMQ)** | 暂不支持 | 暂不支持 | 支持 | 暂不支持 | 暂不支持 | 支持 | | **Schemaless** | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | 暂不支持 | -| **批量拉取(基于 WebSocket)** | 支持 | 支持 | 暂不支持 | 支持 | 支持 | 支持 | +| **批量拉取(基于 WebSocket)** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | | **DataFrame** | 不支持 | 支持 | 不支持 | 不支持 | 不支持 | 不支持 | :::warning From e18da31a5d39c313527f44c873432d4fd29a0f81 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Mon, 5 Dec 2022 12:00:12 +0800 Subject: [PATCH 14/63] enh(query): add timetruncate function ignore timezone option for 1d --- source/libs/function/src/builtins.c | 24 ++++++++++++-- source/libs/scalar/src/sclfunc.c | 49 ++++++++++++++++++++++++++--- 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index fe010786eb..470a8a2cf2 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -1924,7 +1924,8 @@ static int32_t translateToUnixtimestamp(SFunctionNode* pFunc, char* pErrBuf, int } static int32_t translateTimeTruncate(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { - if (2 != LIST_LENGTH(pFunc->pParameterList)) { + int32_t numOfParams = LIST_LENGTH(pFunc->pParameterList); + if (2 != numOfParams && 3 != numOfParams) { return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); } @@ -1935,9 +1936,7 @@ static int32_t translateTimeTruncate(SFunctionNode* pFunc, char* pErrBuf, int32_ return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } - // add database precision as param uint8_t dbPrec = pFunc->node.resType.precision; - int32_t ret = validateTimeUnitParam(dbPrec, (SValueNode*)nodesListGetNode(pFunc->pParameterList, 1)); if (ret == TIME_UNIT_TOO_SMALL) { return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, @@ -1948,11 +1947,30 @@ static int32_t translateTimeTruncate(SFunctionNode* pFunc, char* pErrBuf, int32_ "TIMETRUNCATE function time unit parameter should be one of the following: [1b, 1u, 1a, 1s, 1m, 1h, 1d, 1w]"); } + if (3 == numOfParams) { + uint8_t para3Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 2))->resType.type; + if (!IS_INTEGER_TYPE(para3Type)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + SValueNode* pValue = (SValueNode*)nodesListGetNode(pFunc->pParameterList, 2); + if (pValue->datum.i != 0 && pValue->datum.i != 1) { + return invaildFuncParaValueErrMsg(pErrBuf, len, pFunc->functionName); + } + } + + // add database precision as param + int32_t code = addDbPrecisonParam(&pFunc->pParameterList, dbPrec); if (code != TSDB_CODE_SUCCESS) { return code; } + // add client timezone as param + code = addTimezoneParam(pFunc->pParameterList); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes, .type = TSDB_DATA_TYPE_TIMESTAMP}; return TSDB_CODE_SUCCESS; diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index d261d572f0..1de8a35308 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -1174,12 +1174,35 @@ int32_t toJsonFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOu } /** Time functions **/ +static int64_t offsetFromTz(char *timezone, int64_t factor) { + char *minStr = &timezone[3]; + int64_t minutes = taosStr2Int64(minStr, NULL, 10); + memset(minStr, 0, strlen(minStr)); + int64_t hours = taosStr2Int64(timezone, NULL, 10); + int64_t seconds = hours * 3600 + minutes * 60; + + return seconds * factor; + +} + int32_t timeTruncateFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { int32_t type = GET_PARAM_TYPE(&pInput[0]); int64_t timeUnit, timePrec, timeVal = 0; + bool ignoreTz = true; + char timezone[20] = {0}; + GET_TYPED_DATA(timeUnit, int64_t, GET_PARAM_TYPE(&pInput[1]), pInput[1].columnData->pData); - GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[2]), pInput[2].columnData->pData); + + int32_t timePrecIdx = 2, timeZoneIdx = 3; + if (inputNum == 5) { + timePrecIdx += 1; + timeZoneIdx += 1; + GET_TYPED_DATA(ignoreTz, bool, GET_PARAM_TYPE(&pInput[2]), pInput[2].columnData->pData); + } + + GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[timePrecIdx]), pInput[timePrecIdx].columnData->pData); + memcpy(timezone, varDataVal(pInput[timeZoneIdx].columnData->pData), varDataLen(pInput[timeZoneIdx].columnData->pData)); int64_t factor = TSDB_TICK_PER_SECOND(timePrec); int64_t unit = timeUnit * 1000 / factor; @@ -1294,13 +1317,29 @@ int32_t timeTruncateFunction(SScalarParam *pInput, int32_t inputNum, SScalarPara } case 86400000: { /* 1d */ if (tsDigits == TSDB_TIME_PRECISION_MILLI_DIGITS) { - timeVal = timeVal / 1000 / 86400 * 86400 * 1000; + if (ignoreTz) { + timeVal = timeVal - (timeVal + offsetFromTz(timezone, 1000)) % (86400L * 1000); + } else { + timeVal = timeVal / 1000 / 86400 * 86400 * 1000; + } } else if (tsDigits == TSDB_TIME_PRECISION_MICRO_DIGITS) { - timeVal = timeVal / 1000000 / 86400 * 86400 * 1000000; + if (ignoreTz) { + timeVal = timeVal - (timeVal + offsetFromTz(timezone, 1000000)) % (86400L * 1000000); + } else { + timeVal = timeVal / 1000000 / 86400 * 86400 * 1000000; + } } else if (tsDigits == TSDB_TIME_PRECISION_NANO_DIGITS) { - timeVal = timeVal / 1000000000 / 86400 * 86400 * 1000000000; + if (ignoreTz) { + timeVal = timeVal - (timeVal + offsetFromTz(timezone, 1000000000)) % (86400L * 1000000000); + } else { + timeVal = timeVal / 1000000000 / 86400 * 86400 * 1000000000; + } } else if (tsDigits <= TSDB_TIME_PRECISION_SEC_DIGITS) { - timeVal = timeVal * factor / factor / 86400 * 86400 * factor; + if (ignoreTz) { + timeVal = (timeVal - (timeVal + offsetFromTz(timezone, 1)) % (86400L)) * factor; + } else { + timeVal = timeVal * factor / factor / 86400 * 86400 * factor; + } } else { colDataAppendNULL(pOutput->columnData, i); continue; From 470e0f2d23dfd4110f87ec53351b268213ed308f Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Mon, 5 Dec 2022 12:00:50 +0800 Subject: [PATCH 15/63] fix timetruncate test cases --- tests/system-test/2-query/timetruncate.py | 58 +++++++++++++++-------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/tests/system-test/2-query/timetruncate.py b/tests/system-test/2-query/timetruncate.py index 32d6ef98e9..a59180c2b1 100644 --- a/tests/system-test/2-query/timetruncate.py +++ b/tests/system-test/2-query/timetruncate.py @@ -30,7 +30,7 @@ class TDTestCase: self.stbname = f'{self.dbname}.stb' self.ctbname = f'{self.dbname}.ctb' - def check_ms_timestamp(self,unit,date_time): + def check_ms_timestamp(self,unit,date_time, ignore_tz): if unit.lower() == '1a': for i in range(len(self.ts_str)): ts_result = self.get_time.get_ms_timestamp(str(tdSql.queryResult[i][0])) @@ -50,13 +50,17 @@ class TDTestCase: elif unit.lower() == '1d': for i in range(len(self.ts_str)): ts_result = self.get_time.get_ms_timestamp(str(tdSql.queryResult[i][0])) - tdSql.checkEqual(ts_result,int(date_time[i]/1000/60/60/24)*24*60*60*1000) + if ignore_tz == 0: + tdSql.checkEqual(ts_result,int(date_time[i]/1000/60/60/24)*24*60*60*1000) + else: + # assuming the client timezone is UTC+0800 + tdSql.checkEqual(ts_result,int(date_time[i] - (date_time[i] + 8 * 3600 * 1000) % (86400 * 1000))) elif unit.lower() == '1w': for i in range(len(self.ts_str)): ts_result = self.get_time.get_ms_timestamp(str(tdSql.queryResult[i][0])) tdSql.checkEqual(ts_result,int(date_time[i]/1000/60/60/24/7)*7*24*60*60*1000) - def check_us_timestamp(self,unit,date_time): + def check_us_timestamp(self,unit,date_time, ignore_tz): if unit.lower() == '1u': for i in range(len(self.ts_str)): ts_result = self.get_time.get_us_timestamp(str(tdSql.queryResult[i][0])) @@ -80,13 +84,17 @@ class TDTestCase: elif unit.lower() == '1d': for i in range(len(self.ts_str)): ts_result = self.get_time.get_us_timestamp(str(tdSql.queryResult[i][0])) - tdSql.checkEqual(ts_result,int(date_time[i]/1000/1000/60/60/24)*24*60*60*1000*1000 ) + if ignore_tz == 0: + tdSql.checkEqual(ts_result,int(date_time[i]/1000/1000/60/60/24)*24*60*60*1000*1000 ) + else: + # assuming the client timezone is UTC+0800 + tdSql.checkEqual(ts_result,int(date_time[i] - (date_time[i] + 8 * 3600 * 1000000) % (86400 * 1000000))) elif unit.lower() == '1w': for i in range(len(self.ts_str)): ts_result = self.get_time.get_us_timestamp(str(tdSql.queryResult[i][0])) tdSql.checkEqual(ts_result,int(date_time[i]/1000/1000/60/60/24/7)*7*24*60*60*1000*1000) - def check_ns_timestamp(self,unit,date_time): + def check_ns_timestamp(self,unit,date_time, ignore_tz): if unit.lower() == '1b': for i in range(len(self.ts_str)): if self.rest_tag != 'rest': @@ -114,21 +122,26 @@ class TDTestCase: elif unit.lower() == '1d': for i in range(len(self.ts_str)): if self.rest_tag != 'rest': - tdSql.checkEqual(tdSql.queryResult[i][0],int(date_time[i]*1000/1000/1000/1000/1000/60/60/24)*24*60*60*1000*1000*1000 ) + if ignore_tz == 0: + tdSql.checkEqual(tdSql.queryResult[i][0],int(date_time[i]*1000/1000/1000/1000/1000/60/60/24)*24*60*60*1000*1000*1000 ) + else: + # assuming the client timezone is UTC+0800 + tdSql.checkEqual(tdSql.queryResult[i][0],int(date_time[i] - (date_time[i] + 8 * 3600 * 1000000) % (86400 * 1000000))) elif unit.lower() == '1w': for i in range(len(self.ts_str)): if self.rest_tag != 'rest': tdSql.checkEqual(tdSql.queryResult[i][0],int(date_time[i]*1000/1000/1000/1000/1000/60/60/24/7)*7*24*60*60*1000*1000*1000) - def check_tb_type(self,unit,tb_type): + def check_tb_type(self,unit,tb_type,ignore_tz): if tb_type.lower() == 'ntb': - tdSql.query(f'select timetruncate(ts,{unit}) from {self.ntbname}') + tdSql.query(f'select timetruncate(ts,{unit},{ignore_tz}) from {self.ntbname}') elif tb_type.lower() == 'ctb': - tdSql.query(f'select timetruncate(ts,{unit}) from {self.ctbname}') + tdSql.query(f'select timetruncate(ts,{unit},{ignore_tz}) from {self.ctbname}') elif tb_type.lower() == 'stb': - tdSql.query(f'select timetruncate(ts,{unit}) from {self.stbname}') + tdSql.query(f'select timetruncate(ts,{unit},{ignore_tz}) from {self.stbname}') def data_check(self,date_time,precision,tb_type): + tz_options = [0, 1] for unit in self.time_unit: if (unit.lower() == '1u' and precision.lower() == 'ms') or (unit.lower() == '1b' and precision.lower() == 'us') or (unit.lower() == '1b' and precision.lower() == 'ms'): if tb_type.lower() == 'ntb': @@ -138,17 +151,20 @@ class TDTestCase: elif tb_type.lower() == 'stb': tdSql.error(f'select timetruncate(ts,{unit}) from {self.stbname}') elif precision.lower() == 'ms': - self.check_tb_type(unit,tb_type) - tdSql.checkRows(len(self.ts_str)) - self.check_ms_timestamp(unit,date_time) + for ignore_tz in tz_options: + self.check_tb_type(unit,tb_type,ignore_tz) + tdSql.checkRows(len(self.ts_str)) + self.check_ms_timestamp(unit,date_time,ignore_tz) elif precision.lower() == 'us': - self.check_tb_type(unit,tb_type) - tdSql.checkRows(len(self.ts_str)) - self.check_us_timestamp(unit,date_time) + for ignore_tz in tz_options: + self.check_tb_type(unit,tb_type,ignore_tz) + tdSql.checkRows(len(self.ts_str)) + self.check_us_timestamp(unit,date_time,ignore_tz) elif precision.lower() == 'ns': - self.check_tb_type(unit,tb_type) - tdSql.checkRows(len(self.ts_str)) - self.check_ns_timestamp(unit,date_time) + for ignore_tz in tz_options: + self.check_tb_type(unit,tb_type, ignore_tz) + tdSql.checkRows(len(self.ts_str)) + self.check_ns_timestamp(unit,date_time,ignore_tz) for unit in self.error_unit: if tb_type.lower() == 'ntb': tdSql.error(f'select timetruncate(ts,{unit}) from {self.ntbname}') @@ -181,8 +197,8 @@ class TDTestCase: date_time = self.get_time.time_transform(self.ts_str,precision) self.data_check(date_time,precision,'ctb') self.data_check(date_time,precision,'stb') - - + + def run(self): self.function_check_ntb() self.function_check_stb() From 896921521fac86797498ea54d83bc2dab6acedc2 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Mon, 5 Dec 2022 12:32:00 +0800 Subject: [PATCH 16/63] add cn/en docs for ignore_timezone description --- docs/en/12-taos-sql/10-function.md | 12 ++++++++++-- docs/zh/12-taos-sql/10-function.md | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md index 6145d8c00c..046f94b397 100644 --- a/docs/en/12-taos-sql/10-function.md +++ b/docs/en/12-taos-sql/10-function.md @@ -532,7 +532,12 @@ TIMEDIFF(expr1, expr2 [, time_unit]) #### TIMETRUNCATE ```sql -TIMETRUNCATE(expr, time_unit) +TIMETRUNCATE(expr, time_unit [, ignore_timezone]) + +ignore_timezone: { + 0 + | 1 +} ``` **Description**: Truncate the input timestamp with unit specified by `time_unit` @@ -548,7 +553,10 @@ TIMETRUNCATE(expr, time_unit) 1b (nanoseconds), 1u (microseconds), 1a (milliseconds), 1s (seconds), 1m (minutes), 1h (hours), 1d (days), or 1w (weeks) - The precision of the returned timestamp is same as the precision set for the current data base in use - If the input data is not formatted as a timestamp, the returned value is null. - +- If `1d` is used as time_unit to truncate the timestamp, `ignore_timezone` option can be set to indicate if the returned result is affected by client timezone or not. + For example, if client timezone is set to UTC+0800, TIMETRUNCATE('2020-01-01 23:00:00', 1d, 0) will return '2020-01-01 08:00:00'. + Otherwise, TIMETRUNCATE('2020-01-01 23:00:00', 1d, 1) will return '2020-01-01 00:00:00'. + If `ignore_timezone` option is omitted, the default value is set to 1. #### TIMEZONE diff --git a/docs/zh/12-taos-sql/10-function.md b/docs/zh/12-taos-sql/10-function.md index a8a1edc9a6..afe90b8a93 100644 --- a/docs/zh/12-taos-sql/10-function.md +++ b/docs/zh/12-taos-sql/10-function.md @@ -533,7 +533,12 @@ TIMEDIFF(expr1, expr2 [, time_unit]) #### TIMETRUNCATE ```sql -TIMETRUNCATE(expr, time_unit) +TIMETRUNCATE(expr, time_unit [, ignore_timezone]) + +ignore_timezone: { + 0 + | 1 +} ``` **功能说明**:将时间戳按照指定时间单位 time_unit 进行截断。 @@ -549,6 +554,11 @@ TIMETRUNCATE(expr, time_unit) 1b(纳秒), 1u(微秒),1a(毫秒),1s(秒),1m(分),1h(小时),1d(天), 1w(周)。 - 返回的时间戳精度与当前 DATABASE 设置的时间精度一致。 - 输入包含不符合时间日期格式的字符串则返回 NULL。 +- 当使用 1d 作为时间单位对时间戳进行截断时, 可通过设置 ignore_timezone 参数指定返回结果的显示是否忽略客户端时区的影响。 + 例如客户端所配置时区为 UTC+0800, 则 TIMETRUNCATE('2020-01-01 23:00:00', 1d, 0) 返回结果为 '2020-01-01 08:00:00'。 + 而使用 TIMETRUNCATE('2020-01-01 23:00:00', 1d, 1) 设置忽略时区时,返回结果为 '2020-01-01 00:00:00' + ignore_timezone 如果忽略的话,则默认值为 1 。 + #### TIMEZONE @@ -1085,7 +1095,7 @@ ignore_negative: { ```sql DIFF(expr [, ignore_negative]) - + ignore_negative: { 0 | 1 From 6474ae3fd68e4e29ab87158c9973d8d43bd8a8fd Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Mon, 5 Dec 2022 12:32:00 +0800 Subject: [PATCH 17/63] add cn/en docs for ignore_timezone description --- docs/en/12-taos-sql/10-function.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md index 046f94b397..f0daf4b82a 100644 --- a/docs/en/12-taos-sql/10-function.md +++ b/docs/en/12-taos-sql/10-function.md @@ -553,7 +553,7 @@ ignore_timezone: { 1b (nanoseconds), 1u (microseconds), 1a (milliseconds), 1s (seconds), 1m (minutes), 1h (hours), 1d (days), or 1w (weeks) - The precision of the returned timestamp is same as the precision set for the current data base in use - If the input data is not formatted as a timestamp, the returned value is null. -- If `1d` is used as time_unit to truncate the timestamp, `ignore_timezone` option can be set to indicate if the returned result is affected by client timezone or not. +- If `1d` is used as `time_unit` to truncate the timestamp, `ignore_timezone` option can be set to indicate if the returned result is affected by client timezone or not. For example, if client timezone is set to UTC+0800, TIMETRUNCATE('2020-01-01 23:00:00', 1d, 0) will return '2020-01-01 08:00:00'. Otherwise, TIMETRUNCATE('2020-01-01 23:00:00', 1d, 1) will return '2020-01-01 00:00:00'. If `ignore_timezone` option is omitted, the default value is set to 1. From 3939c96a92914c970f2b692cd6b258929163f8d2 Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Mon, 5 Dec 2022 12:35:57 +0800 Subject: [PATCH 18/63] refactor(sync): modify/use default config value --- source/libs/sync/inc/syncEnv.h | 14 ++++++-------- source/libs/sync/src/syncMain.c | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/source/libs/sync/inc/syncEnv.h b/source/libs/sync/inc/syncEnv.h index 265da9703d..4dc5f58cfe 100644 --- a/source/libs/sync/inc/syncEnv.h +++ b/source/libs/sync/inc/syncEnv.h @@ -22,14 +22,12 @@ extern "C" { #include "syncInt.h" -#define TIMER_MAX_MS 0x7FFFFFFF -#define ENV_TICK_TIMER_MS 1000 -#define PING_TIMER_MS 5000 -#define ELECT_TIMER_MS_MIN 2500 -#define ELECT_TIMER_MS_MAX (ELECT_TIMER_MS_MIN * 2) -#define ELECT_TIMER_MS_RANGE (ELECT_TIMER_MS_MAX - ELECT_TIMER_MS_MIN) -#define HEARTBEAT_TIMER_MS 1000 -#define HEARTBEAT_TICK_NUM 20 +#define TIMER_MAX_MS 0x7FFFFFFF +#define ENV_TICK_TIMER_MS 1000 +#define PING_TIMER_MS 5000 +#define ELECT_TIMER_MS_MIN 2500 +#define HEARTBEAT_TIMER_MS 1000 +#define HEARTBEAT_TICK_NUM 20 typedef struct SSyncEnv { uint8_t isStart; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index a00b639a9c..b89383bef3 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -1025,8 +1025,8 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { } // timer ms init pSyncNode->pingBaseLine = PING_TIMER_MS; - pSyncNode->electBaseLine = ELECT_TIMER_MS_MIN; - pSyncNode->hbBaseLine = HEARTBEAT_TIMER_MS; + pSyncNode->electBaseLine = tsElectInterval; + pSyncNode->hbBaseLine = tsHeartbeatInterval; // init ping timer pSyncNode->pPingTimer = NULL; @@ -2384,7 +2384,7 @@ bool syncNodeHeartbeatReplyTimeout(SSyncNode* pSyncNode) { continue; } - if (tsNow - recvTime > SYNC_HEART_TIMEOUT_MS) { + if (tsNow - recvTime > tsHeartbeatTimeout) { toCount++; } } From 1cc0df89ab2fdc991840dcb81b24354692d3689e Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 5 Dec 2022 14:19:31 +0800 Subject: [PATCH 19/63] fix(shell): forbid record password in taos_history file --- tools/shell/src/shellEngine.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 118a6caf7a..22b2d59143 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -113,6 +113,13 @@ int32_t shellRunSingleCommand(char *command) { } void shellRecordCommandToHistory(char *command) { + if (strncasecmp(command, "create user ", 12) == 0 || strncasecmp(command, "alter user ", 11) == 0) { + if (taosStrCaseStr(command, " pass ")) { + // have password command forbid record to history because security + return; + } + } + SShellHistory *pHistory = &shell.history; if (pHistory->hstart == pHistory->hend || pHistory->hist[(pHistory->hend + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE] == NULL || @@ -135,7 +142,7 @@ int32_t shellRunCommand(char *command, bool recordHistory) { } // add help or help; - if(strcmp(command, "help") == 0 || strcmp(command, "help;") == 0) { + if(strncasecmp(command, "help ", 5) == 0) { showHelp(); return 0; } From 83f7c7c2d08d5e0779801c23b328665325211293 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 5 Dec 2022 14:36:34 +0800 Subject: [PATCH 20/63] fix(shell): forbid record password in taos_history file --- tools/shell/src/shellEngine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 22b2d59143..98d9e67522 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -142,7 +142,7 @@ int32_t shellRunCommand(char *command, bool recordHistory) { } // add help or help; - if(strncasecmp(command, "help ", 5) == 0) { + if(strncasecmp(command, "help;", 5) == 0) { showHelp(); return 0; } From 85ff9eaacfe021765532ef98ae0f18cdd58a7b6b Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Mon, 5 Dec 2022 14:40:46 +0800 Subject: [PATCH 21/63] test:commit commit of tmq consumer in crashGen --- tests/pytest/crash_gen/crash_gen_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytest/crash_gen/crash_gen_main.py b/tests/pytest/crash_gen/crash_gen_main.py index f8c5f970c5..49b68965d0 100755 --- a/tests/pytest/crash_gen/crash_gen_main.py +++ b/tests/pytest/crash_gen/crash_gen_main.py @@ -2025,7 +2025,7 @@ class TdSuperTable: conf.set("enable.auto.commit", "true") def tmq_commit_cb_print(tmq, resp, offset, param=None): print(f"commit: {resp}, tmq: {tmq}, offset: {offset}, param: {param}") - conf.set_auto_commit_cb(tmq_commit_cb_print, None) + # conf.set_auto_commit_cb(tmq_commit_cb_print, None) consumer = conf.new_consumer() topic_list = TaosTmqList() for topic in current_topic_list: From 2f37e915a02c36d510c0aaed48ba92035f1d15b1 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Mon, 5 Dec 2022 14:41:55 +0800 Subject: [PATCH 22/63] test: temp commit --- tests/pytest/crash_gen/crash_gen_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytest/crash_gen/crash_gen_main.py b/tests/pytest/crash_gen/crash_gen_main.py index 49b68965d0..84413af225 100755 --- a/tests/pytest/crash_gen/crash_gen_main.py +++ b/tests/pytest/crash_gen/crash_gen_main.py @@ -2025,7 +2025,7 @@ class TdSuperTable: conf.set("enable.auto.commit", "true") def tmq_commit_cb_print(tmq, resp, offset, param=None): print(f"commit: {resp}, tmq: {tmq}, offset: {offset}, param: {param}") - # conf.set_auto_commit_cb(tmq_commit_cb_print, None) + # conf.set_auto_commit_cb(tmq_commit_cb_print, None) consumer = conf.new_consumer() topic_list = TaosTmqList() for topic in current_topic_list: From 8c85bda40856db35ac8cad370d0beaa90ee5d0b4 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 5 Dec 2022 15:13:03 +0800 Subject: [PATCH 23/63] fix: disable tmq auto commit callback temporarily --- tests/pytest/crash_gen/crash_gen_main.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/pytest/crash_gen/crash_gen_main.py b/tests/pytest/crash_gen/crash_gen_main.py index 4140728dcd..1056ac4fcd 100755 --- a/tests/pytest/crash_gen/crash_gen_main.py +++ b/tests/pytest/crash_gen/crash_gen_main.py @@ -2022,11 +2022,10 @@ class TdSuperTable: conf.set("group.id", "tg2") conf.set("td.connect.user", "root") conf.set("td.connect.pass", "taosdata") - conf.set("enable.auto. - ", "true") - def tmq_commit_cb_print(tmq, resp, offset, param=None): - print(f"commit: {resp}, tmq: {tmq}, offset: {offset}, param: {param}") - conf.set_auto_commit_cb(tmq_commit_cb_print, None) + conf.set("enable.auto.commit", "true") +# def tmq_commit_cb_print(tmq, resp, offset, param=None): +# print(f"commit: {resp}, tmq: {tmq}, offset: {offset}, param: {param}") +# conf.set_auto_commit_cb(tmq_commit_cb_print, None) consumer = conf.new_consumer() topic_list = TaosTmqList() for topic in current_topic_list: From 7c56979ac6e1f6fbdf9db11a8d6286d6b40bba8a Mon Sep 17 00:00:00 2001 From: huolibo Date: Mon, 5 Dec 2022 16:09:14 +0800 Subject: [PATCH 24/63] fix: add 'JNI_RESULT_SET_NULL' error code (#18697) * fix: add JNI_RESULT_SET_NULL error code * doc: add jni error log desc * fix: add error reason --- source/client/src/clientJniConnector.c | 9 ++++----- source/client/src/clientTmqConnector.c | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/source/client/src/clientJniConnector.c b/source/client/src/clientJniConnector.c index b5a6ebadee..34fc480432 100644 --- a/source/client/src/clientJniConnector.c +++ b/source/client/src/clientJniConnector.c @@ -136,7 +136,7 @@ int32_t check_for_params(jobject jobj, jlong conn, jlong res) { } if ((TAOS_RES *)res == NULL) { - jniError("jobj:%p, conn:%p, res is null", jobj, (TAOS *)conn); + jniError("jobj:%p, conn:%p, param res is null", jobj, (TAOS *)conn); return JNI_RESULT_SET_NULL; } @@ -393,9 +393,8 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_freeResultSetImp( return code; } - taos_free_result((void *)res); jniDebug("jobj:%p, conn:%p, free resultset:%p", jobj, (TAOS *)con, (void *)res); - + taos_free_result((void *)res); return JNI_SUCCESS; } @@ -489,7 +488,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn numOfFields); return JNI_FETCH_END; } else { - jniDebug("jobj:%p, conn:%p, interrupted query", jobj, tscon); + jniDebug("jobj:%p, conn:%p, interrupted query. fetch row error code: %d, msg:%s", jobj, tscon, code, taos_errstr(result)); return JNI_RESULT_SET_NULL; } } @@ -584,7 +583,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchBlockImp(JNI jniDebug("jobj:%p, conn:%p, resultset:%p, no data to retrieve", jobj, tscon, (void *)res); return JNI_FETCH_END; } else { - jniError("jobj:%p, conn:%p, query interrupted", jobj, tscon); + jniError("jobj:%p, conn:%p, query interrupted. fetch block error code:%d, msg:%s", jobj, tscon, error_code, taos_errstr(tres)); return JNI_RESULT_SET_NULL; } } diff --git a/source/client/src/clientTmqConnector.c b/source/client/src/clientTmqConnector.c index 42988b16fe..ccfc4980bc 100644 --- a/source/client/src/clientTmqConnector.c +++ b/source/client/src/clientTmqConnector.c @@ -303,7 +303,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_fetchRawBlockImp( jniDebug("jobj:%p, conn:%p, resultset:%p, no data to retrieve", jobj, tscon, (void *)res); return JNI_FETCH_END; } else { - jniError("jobj:%p, conn:%p, query interrupted", jobj, tscon); + jniError("jobj:%p, conn:%p, query interrupted, tmq fetch block error code:%d, msg:%s", jobj, tscon, error_code, taos_errstr(tres)); return JNI_RESULT_SET_NULL; } } From 136937d69a52983762b33f1c730da254bedd309e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 5 Dec 2022 17:05:07 +0800 Subject: [PATCH 25/63] fix(query): insert null column sma firstly. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 38 ++++++++++++++++++++------ 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 5dd9293118..77a2306fce 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -4055,6 +4055,29 @@ void tsdbRetrieveDataBlockInfo(const STsdbReader* pReader, int32_t* rows, uint64 } } + +static void doFillNullColSMA(SBlockLoadSuppInfo* pSup, int32_t numOfRows, int32_t numOfCols) { + // do fill all null column value SMA info + int32_t i = 0, j = 0; + int32_t size = (int32_t) taosArrayGetSize(pSup->pColAgg); + + while (j < numOfCols && i < size) { + SColumnDataAgg* pAgg = taosArrayGet(pSup->pColAgg, i); + if (pAgg->colId == pSup->colId[j]) { + i += 1; + j += 1; + } else if (pAgg->colId < pSup->colId[j]) { + i += 1; + } else if (pSup->colId[j] < pAgg->colId) { + if (pSup->colId[j] != PRIMARYKEY_TIMESTAMP_COL_ID) { + SColumnDataAgg nullColAgg = {.colId = pSup->colId[j], .numOfNull = numOfRows}; + taosArrayPush(pSup->pColAgg, &nullColAgg); + } + j += 1; + } + } +} + int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg ***pBlockSMA, bool* allHave) { int32_t code = 0; *allHave = false; @@ -4110,6 +4133,10 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg ***pBlockS pResBlock->pBlockAgg = taosMemoryCalloc(num, sizeof(SColumnDataAgg)); } + // do fill all null column value SMA info + doFillNullColSMA(pSup, pBlock->nRow, numOfCols); + + i = 0, j = 0; while (j < numOfCols && i < size) { SColumnDataAgg* pAgg = taosArrayGet(pSup->pColAgg, i); if (pAgg->colId == pSup->colId[j]) { @@ -4119,15 +4146,8 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg ***pBlockS } else if (pAgg->colId < pSup->colId[j]) { i += 1; } else if (pSup->colId[j] < pAgg->colId) { - if (pSup->colId[j] == PRIMARYKEY_TIMESTAMP_COL_ID) { - pResBlock->pBlockAgg[pSup->slotId[j]] = &pSup->tsColAgg; - } else { - // all date in this block are null - SColumnDataAgg nullColAgg = {.colId = pSup->colId[j], .numOfNull = pBlock->nRow}; - taosArrayPush(pSup->pColAgg, &nullColAgg); - - pResBlock->pBlockAgg[pSup->slotId[j]] = taosArrayGetLast(pSup->pColAgg); - } + ASSERT(pSup->colId[j] == PRIMARYKEY_TIMESTAMP_COL_ID); + pResBlock->pBlockAgg[pSup->slotId[j]] = &pSup->tsColAgg; j += 1; } } From d7a38aeae9080edcb78358f6bb371692aefd29bf Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao@163.com> Date: Mon, 5 Dec 2022 16:01:53 +0800 Subject: [PATCH 26/63] fix:stddev\fisrt\last combine function --- source/libs/function/src/builtinsimpl.c | 51 +++++++------- tests/script/tsim/stream/session1.sim | 94 +++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 26 deletions(-) diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 20de7f73bf..a9145ac69d 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -423,6 +423,8 @@ typedef struct SGroupKeyInfo { (_p).val = (_v); \ } while (0) +static int32_t firstLastTransferInfoImpl(SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst); + bool functionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (pResultInfo->initialized) { return false; @@ -457,11 +459,12 @@ int32_t firstCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); SFirstLastRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); - if (pSResInfo->numOfRes != 0 && (pDResInfo->numOfRes == 0 || pDBuf->ts > pSBuf->ts)) { - memcpy(pDBuf->buf, pSBuf->buf, bytes); - pDBuf->ts = pSBuf->ts; - pDResInfo->numOfRes = 1; + if (TSDB_CODE_SUCCESS == firstLastTransferInfoImpl(pSBuf, pDBuf, true)) { + pDBuf->hasResult = true; } + + pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); + pDResInfo->isNullRes &= pSResInfo->isNullRes; return TSDB_CODE_SUCCESS; } @@ -1274,17 +1277,8 @@ int32_t stddevCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SStddevRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); int16_t type = pDBuf->type == TSDB_DATA_TYPE_NULL ? pSBuf->type : pDBuf->type; - if (IS_SIGNED_NUMERIC_TYPE(type)) { - pDBuf->isum += pSBuf->isum; - pDBuf->quadraticISum += pSBuf->quadraticISum; - } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { - pDBuf->usum += pSBuf->usum; - pDBuf->quadraticUSum += pSBuf->quadraticUSum; - } else { - pDBuf->dsum += pSBuf->dsum; - pDBuf->quadraticDSum += pSBuf->quadraticDSum; - } - pDBuf->count += pSBuf->count; + stddevTransferInfo(pSBuf, pDBuf); + pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); pDResInfo->isNullRes &= pSResInfo->isNullRes; return TSDB_CODE_SUCCESS; @@ -2289,16 +2283,15 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) { return TSDB_CODE_SUCCESS; } -static void firstLastTransferInfo(SqlFunctionCtx* pCtx, SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst, - int32_t rowIndex) { +static int32_t firstLastTransferInfoImpl(SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst) { if (pOutput->hasResult) { if (isFirst) { if (pInput->ts > pOutput->ts) { - return; + return TSDB_CODE_FAILED; } } else { if (pInput->ts < pOutput->ts) { - return; + return TSDB_CODE_FAILED; } } } @@ -2308,9 +2301,15 @@ static void firstLastTransferInfo(SqlFunctionCtx* pCtx, SFirstLastRes* pInput, S pOutput->bytes = pInput->bytes; memcpy(pOutput->buf, pInput->buf, pOutput->bytes); - firstlastSaveTupleData(pCtx->pSrcBlock, rowIndex, pCtx, pOutput); + return TSDB_CODE_SUCCESS; +} - pOutput->hasResult = true; +static void firstLastTransferInfo(SqlFunctionCtx* pCtx, SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst, + int32_t rowIndex) { + if (TSDB_CODE_SUCCESS == firstLastTransferInfoImpl(pInput, pOutput, isFirst)) { + firstlastSaveTupleData(pCtx->pSrcBlock, rowIndex, pCtx, pOutput); + pOutput->hasResult = true; + } } static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx* pCtx, bool isFirstQuery) { @@ -2378,7 +2377,6 @@ int32_t firstLastPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { return 1; } -// todo rewrite: int32_t lastCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); SFirstLastRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); @@ -2387,11 +2385,12 @@ int32_t lastCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); SFirstLastRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); - if (pSResInfo->numOfRes != 0 && (pDResInfo->numOfRes == 0 || pDBuf->ts < pSBuf->ts)) { - memcpy(pDBuf->buf, pSBuf->buf, bytes); - pDBuf->ts = pSBuf->ts; - pDResInfo->numOfRes = 1; + if (TSDB_CODE_SUCCESS == firstLastTransferInfoImpl(pSBuf, pDBuf, false)) { + pDBuf->hasResult = true; } + + pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); + pDResInfo->isNullRes &= pSResInfo->isNullRes; return TSDB_CODE_SUCCESS; } diff --git a/tests/script/tsim/stream/session1.sim b/tests/script/tsim/stream/session1.sim index ee6eefde26..f535fd619f 100644 --- a/tests/script/tsim/stream/session1.sim +++ b/tests/script/tsim/stream/session1.sim @@ -197,4 +197,98 @@ if $data01 != 1 then return -1 endi +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams3 trigger at_once into streamt3 as select _wstart, count(*) c1 from t1 where a > 5 session(ts, 5s); +sql insert into t1 values(1648791213000,1,2,3,1.0); + +$loop_count = 0 +loop13: +sleep 200 + +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +# row 0 +if $rows != 0 then + print =====rows=$rows + goto loop13 +endi + +sql insert into t1 values(1648791213000,6,2,3,1.0); + +$loop_count = 0 +loop14: +sleep 200 +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop14 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); + +$loop_count = 0 +loop15: +sleep 200 +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 0 then + print =====rows=$rows + goto loop15 +endi + + +sql insert into t1 values(1648791223000,2,2,3,1.0); +sql insert into t1 values(1648791223000,10,2,3,1.0); +sql insert into t1 values(1648791233000,10,2,3,1.0); + +$loop_count = 0 +loop16: +sleep 200 +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 2 then + print =====rows=$rows + goto loop16 +endi + +sql insert into t1 values(1648791233000,2,2,3,1.0); + +$loop_count = 0 +loop17: +sleep 200 +sql select * from streamt3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 1 then + print =====rows=$rows + goto loop17 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT From f8b75e3ac14fd5722abe64ba58a9cf3e5a5eeab0 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 5 Dec 2022 17:54:26 +0800 Subject: [PATCH 27/63] fix(log): ignore create log error --- source/client/src/clientEnv.c | 4 ++-- source/libs/function/src/udfd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index f4b18a373b..93398d337d 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -397,8 +397,8 @@ void taos_init_imp(void) { deltaToUtcInitOnce(); if (taosCreateLog("taoslog", 10, configDir, NULL, NULL, NULL, NULL, 1) != 0) { - tscInitRes = -1; - return; + // ignore create log failed, only print + printf(" WARING: Create taoslog failed. configDir=%s\n", configDir); } if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1) != 0) { diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index afadf7401d..2f3db636c8 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -1019,8 +1019,8 @@ int main(int argc, char *argv[]) { } if (udfdInitLog() != 0) { + // ignore create log failed, because this error no matter printf("failed to start since init log error\n"); - return -1; } if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 0) != 0) { From a1ed4b334ca0aa7e99734b40a57f6b54f4c5aa9a Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Mon, 5 Dec 2022 18:50:19 +0800 Subject: [PATCH 28/63] fix(sync): close snapshot receiver in pre-close --- source/dnode/vnode/src/vnd/vnodeSync.c | 11 +---------- source/libs/sync/src/syncMain.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 1c2139c95d..aa215a852f 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -606,16 +606,7 @@ void vnodeSyncPreClose(SVnode *pVnode) { vInfo("vgId:%d, pre close sync", pVnode->config.vgId); syncLeaderTransfer(pVnode->sync); syncPreStop(pVnode->sync); -#if 0 - while (syncSnapshotRecving(pVnode->sync)) { - vInfo("vgId:%d, snapshot is recving", pVnode->config.vgId); - taosMsleep(300); - } - while (syncSnapshotSending(pVnode->sync)) { - vInfo("vgId:%d, snapshot is sending", pVnode->config.vgId); - taosMsleep(300); - } -#endif + taosThreadMutexLock(&pVnode->lock); if (pVnode->blocked) { vInfo("vgId:%d, post block after close sync", pVnode->config.vgId); diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index b89383bef3..f9fee9ab90 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -1221,6 +1221,26 @@ int32_t syncNodeStartStandBy(SSyncNode* pSyncNode) { } void syncNodePreClose(SSyncNode* pSyncNode) { + if (pSyncNode != NULL && pSyncNode->pFsm != NULL && pSyncNode->pFsm->FpApplyQueueItems != NULL) { + while (1) { + int32_t aqItems = pSyncNode->pFsm->FpApplyQueueItems(pSyncNode->pFsm); + sTrace("vgId:%d, pre close, %d items in apply queue", pSyncNode->vgId, aqItems); + if (aqItems == 0) { + break; + } + taosMsleep(20); + } + } + + if (pSyncNode->pNewNodeReceiver != NULL) { + if (snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) { + snapshotReceiverForceStop(pSyncNode->pNewNodeReceiver); + } + + snapshotReceiverDestroy(pSyncNode->pNewNodeReceiver); + pSyncNode->pNewNodeReceiver = NULL; + } + // stop elect timer syncNodeStopElectTimer(pSyncNode); From 0c26308ae78fca6f027d19e324f09ecbe1834efa Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 5 Dec 2022 20:10:09 +0800 Subject: [PATCH 29/63] fix: add redirect error code and fix no error msg issue --- include/libs/qcom/query.h | 17 ++++++++--------- source/libs/scheduler/inc/schInt.h | 4 ++++ source/libs/scheduler/src/schJob.c | 4 ++++ source/libs/scheduler/src/schTask.c | 10 +++++++--- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index ffb982af8e..91ec5f52e5 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -262,24 +262,23 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t (NEED_CLIENT_RM_TBLMETA_ERROR(_code) || NEED_CLIENT_REFRESH_VG_ERROR(_code) || \ NEED_CLIENT_REFRESH_TBLMETA_ERROR(_code)) -#define SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR || (_code) == TSDB_CODE_VND_STOPPED) +#define SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR || (_code) == TSDB_CODE_VND_STOPPED || (_code) == TSDB_CODE_APP_IS_STARTING || (_code) == TSDB_CODE_APP_IS_STOPPING) #define SYNC_SELF_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_RESTORING || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR) -#define SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) (false) // used later +#define SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_MNODE_NOT_FOUND) + +#define NO_RET_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL) #define NEED_REDIRECT_ERROR(_code) \ - ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL || \ - (_code) == TSDB_CODE_MNODE_NOT_FOUND || SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || \ - SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) || \ - (_code) == TSDB_CODE_APP_IS_STARTING || (_code) == TSDB_CODE_APP_IS_STOPPING) + (NO_RET_REDIRECT_ERROR(_code) || SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || \ + SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code)) + #define NEED_CLIENT_RM_TBLMETA_REQ(_type) \ ((_type) == TDMT_VND_CREATE_TABLE || (_type) == TDMT_MND_CREATE_STB || (_type) == TDMT_VND_DROP_TABLE || \ (_type) == TDMT_MND_DROP_STB) #define NEED_SCHEDULER_REDIRECT_ERROR(_code) \ - ((_code) == TSDB_CODE_MNODE_NOT_FOUND || SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || \ - SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) || \ - (_code) == TSDB_CODE_APP_IS_STARTING || (_code) == TSDB_CODE_APP_IS_STOPPING) + (SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code)) #define REQUEST_TOTAL_EXEC_TIMES 2 diff --git a/source/libs/scheduler/inc/schInt.h b/source/libs/scheduler/inc/schInt.h index 77aafa9a27..39118910f1 100644 --- a/source/libs/scheduler/inc/schInt.h +++ b/source/libs/scheduler/inc/schInt.h @@ -293,6 +293,7 @@ typedef struct SSchJob { void *chkKillParam; SSchTask *fetchTask; int32_t errCode; + int32_t redirectCode; SRWLatch resLock; SExecResult execRes; void *fetchRes; // TODO free it or not @@ -331,6 +332,9 @@ extern SSchedulerMgmt schMgmt; ((_job)->attr.localExec && SCH_IS_QUERY_JOB(_job) && (!SCH_IS_INSERT_JOB(_job)) && \ (!SCH_IS_DATA_BIND_QRY_TASK(_task))) +#define SCH_UPDATE_REDICT_CODE(job, _code) atomic_val_compare_exchange_32(&((job)->redirectCode), 0, _code) +#define SCH_GET_REDICT_CODE(job, _code) (((!NO_RET_REDIRECT_ERROR(_code)) || (job)->redirectCode == 0) ? (_code) : (job)->redirectCode) + #define SCH_SET_TASK_STATUS(task, st) atomic_store_8(&(task)->status, st) #define SCH_GET_TASK_STATUS(task) atomic_load_8(&(task)->status) #define SCH_GET_TASK_STATUS_STR(task) jobTaskStatusStr(SCH_GET_TASK_STATUS(task)) diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 2d41cc287c..d422f0e88f 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -481,6 +481,10 @@ _return: } int32_t schProcessOnJobFailure(SSchJob *pJob, int32_t errCode) { + if (TSDB_CODE_SCH_IGNORE_ERROR == errCode) { + return TSDB_CODE_SCH_IGNORE_ERROR; + } + schUpdateJobErrCode(pJob, errCode); int32_t code = atomic_load_32(&pJob->errCode); diff --git a/source/libs/scheduler/src/schTask.c b/source/libs/scheduler/src/schTask.c index 0f15002d9b..cd69834924 100644 --- a/source/libs/scheduler/src/schTask.c +++ b/source/libs/scheduler/src/schTask.c @@ -340,7 +340,7 @@ int32_t schRescheduleTask(SSchJob *pJob, SSchTask *pTask) { return TSDB_CODE_SUCCESS; } -int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet) { +int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet, int32_t rspCode) { SSchRedirectCtx *pCtx = &pTask->redirectCtx; if (!pCtx->inRedirect) { pCtx->inRedirect = true; @@ -380,7 +380,7 @@ int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet) if (lastTime > tsMaxRetryWaitTime) { SCH_TASK_DLOG("task no more redirect retry since timeout, now:%" PRId64 ", start:%" PRId64 ", max:%d, total:%d", nowTs, pCtx->startTs, tsMaxRetryWaitTime, pCtx->totalTimes); - SCH_ERR_RET(TSDB_CODE_TIMEOUT_ERROR); + SCH_ERR_RET(SCH_GET_REDICT_CODE(pJob, rspCode)); } pCtx->periodMs *= tsRedirectFactor; @@ -415,7 +415,11 @@ int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, SDataBuf *pData, int32 pTask->retryTimes = 0; } - SCH_ERR_JRET(schChkUpdateRedirectCtx(pJob, pTask, pData ? pData->pEpSet : NULL)); + if (!NO_RET_REDIRECT_ERROR(rspCode)) { + SCH_UPDATE_REDICT_CODE(pJob, rspCode); + } + + SCH_ERR_JRET(schChkUpdateRedirectCtx(pJob, pTask, pData ? pData->pEpSet : NULL, rspCode)); pTask->waitRetry = true; From 9e04f42635524535a2d8658c74ee55edacf0dc81 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 5 Dec 2022 20:20:48 +0800 Subject: [PATCH 30/63] fix(query): check for neighbor block when merging data block. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 34 +++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 77a2306fce..fbf3327290 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -214,6 +214,7 @@ static bool hasDataInLastBlock(SLastBlockReader* pLastBlockReader); static int32_t doBuildDataBlock(STsdbReader* pReader); static TSDBKEY getCurrentKeyInBuf(STableBlockScanInfo* pScanInfo, STsdbReader* pReader); static bool hasDataInFileBlock(const SBlockData* pBlockData, const SFileBlockDumpInfo* pDumpInfo); +static void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter); static bool outOfTimeWindow(int64_t ts, STimeWindow* pWindow) { return (ts > pWindow->ekey) || (ts < pWindow->skey); } @@ -2477,6 +2478,37 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { SDataBlk* pBlock = getCurrentBlock(&pReader->status.blockIter); if (pDumpInfo->rowIndex >= pBlock->nRow || pDumpInfo->rowIndex < 0) { + + int32_t nextIndex = -1; + SBlockIndex bIndex = {0}; + bool hasNeighbor = getNeighborBlockOfSameTable(pBlockInfo, pBlockScanInfo, &nextIndex, pReader->order, &bIndex); + if (!hasNeighbor) { // do nothing + return 0; + } + + bool overlap = overlapWithNeighborBlock(pBlock, &bIndex, pReader->order); + + if (overlap) { // load next block + SReaderStatus* pStatus = &pReader->status; + SDataBlockIter* pBlockIter = &pStatus->blockIter; + + // 1. find the next neighbor block in the scan block list + SFileDataBlockInfo fb = {.uid = pBlockInfo->uid, .tbBlockIdx = nextIndex}; + int32_t neighborIndex = findFileBlockInfoIndex(pBlockIter, &fb); + + // 2. remove it from the scan block list + setFileBlockActiveInBlockIter(pBlockIter, neighborIndex, step); + + // 3. load the neighbor block, and set it to be the currently accessed file data block + code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pBlockInfo->uid); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + // 4. check the data values + initBlockDumpInfo(pReader, pBlockIter); + } + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); break; } @@ -2888,7 +2920,7 @@ static int32_t buildBlockFromBufferSequentially(STsdbReader* pReader) { } // set the correct start position in case of the first/last file block, according to the query time window -static void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter) { +void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter) { SDataBlk* pBlock = getCurrentBlock(pBlockIter); SReaderStatus* pStatus = &pReader->status; From b107518b006e429eaac442cf8ea2436877bf1fc6 Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Mon, 5 Dec 2022 20:24:25 +0800 Subject: [PATCH 31/63] fix(sync): when FpApplyQueueItems return -1, break loop --- source/libs/sync/src/syncMain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index f9fee9ab90..59e5e968e7 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -1225,7 +1225,7 @@ void syncNodePreClose(SSyncNode* pSyncNode) { while (1) { int32_t aqItems = pSyncNode->pFsm->FpApplyQueueItems(pSyncNode->pFsm); sTrace("vgId:%d, pre close, %d items in apply queue", pSyncNode->vgId, aqItems); - if (aqItems == 0) { + if (aqItems == 0 || aqItems == -1) { break; } taosMsleep(20); From d5b493677b7f9e74c5f08a1c403a8ce93d501eae Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 5 Dec 2022 20:39:37 +0800 Subject: [PATCH 32/63] fix(query): set column sma into the correct position. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index fbf3327290..7717a2371b 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -4088,10 +4088,12 @@ void tsdbRetrieveDataBlockInfo(const STsdbReader* pReader, int32_t* rows, uint64 } -static void doFillNullColSMA(SBlockLoadSuppInfo* pSup, int32_t numOfRows, int32_t numOfCols) { +static void doFillNullColSMA(SBlockLoadSuppInfo* pSup, int32_t numOfRows, int32_t numOfCols, + SColumnDataAgg* pTsAgg) { // do fill all null column value SMA info int32_t i = 0, j = 0; int32_t size = (int32_t) taosArrayGetSize(pSup->pColAgg); + taosArrayInsert(pSup->pColAgg, 0, pTsAgg); while (j < numOfCols && i < size) { SColumnDataAgg* pAgg = taosArrayGet(pSup->pColAgg, i); @@ -4103,7 +4105,7 @@ static void doFillNullColSMA(SBlockLoadSuppInfo* pSup, int32_t numOfRows, int32_ } else if (pSup->colId[j] < pAgg->colId) { if (pSup->colId[j] != PRIMARYKEY_TIMESTAMP_COL_ID) { SColumnDataAgg nullColAgg = {.colId = pSup->colId[j], .numOfNull = numOfRows}; - taosArrayPush(pSup->pColAgg, &nullColAgg); + taosArrayInsert(pSup->pColAgg, i ,&nullColAgg); } j += 1; } @@ -4166,7 +4168,7 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg ***pBlockS } // do fill all null column value SMA info - doFillNullColSMA(pSup, pBlock->nRow, numOfCols); + doFillNullColSMA(pSup, pBlock->nRow, numOfCols, pTsAgg); i = 0, j = 0; while (j < numOfCols && i < size) { From 0ce44c400bbb7e08d65d1bb932f76591b275c84f Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 5 Dec 2022 22:08:06 +0800 Subject: [PATCH 33/63] fix: csharp test case (#18706) * fix: csharp test case * fix: return -1 if failed --- docs/examples/csharp/wsConnect/Program.cs | 12 +++++++----- docs/examples/csharp/wsInsert/Program.cs | 11 +++++++---- docs/examples/csharp/wsQuery/Program.cs | 13 +++++++++---- docs/examples/csharp/wsStmt/Program.cs | 13 ++++++++----- tests/docs-examples-test/csharp.sh | 10 +++++----- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/docs/examples/csharp/wsConnect/Program.cs b/docs/examples/csharp/wsConnect/Program.cs index f9a56c842f..a534bb8a65 100644 --- a/docs/examples/csharp/wsConnect/Program.cs +++ b/docs/examples/csharp/wsConnect/Program.cs @@ -5,22 +5,24 @@ namespace Examples { public class WSConnExample { - static void Main(string[] args) + static int Main(string[] args) { string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); if (wsConn == IntPtr.Zero) { - throw new Exception("get WS connection failed"); + Console.WriteLine("get WS connection failed"); + return -1; } else { Console.WriteLine("Establish connect success."); + // close connection. + LibTaosWS.WSClose(wsConn); } - // close connection. - LibTaosWS.WSClose(wsConn); + return 0; } } -} \ No newline at end of file +} diff --git a/docs/examples/csharp/wsInsert/Program.cs b/docs/examples/csharp/wsInsert/Program.cs index 1f2d0a6725..7fa6af805c 100644 --- a/docs/examples/csharp/wsInsert/Program.cs +++ b/docs/examples/csharp/wsInsert/Program.cs @@ -5,7 +5,7 @@ namespace Examples { public class WSInsertExample { - static void Main(string[] args) + static int Main(string[] args) { string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); @@ -13,7 +13,8 @@ namespace Examples // Assert if connection is validate if (wsConn == IntPtr.Zero) { - throw new Exception("get WS connection failed"); + Console.WriteLine("get WS connection failed"); + return -1; } else { @@ -36,6 +37,8 @@ namespace Examples // close connection. LibTaosWS.WSClose(wsConn); + + return 0; } static void ValidInsert(string desc, IntPtr wsRes) @@ -43,7 +46,7 @@ namespace Examples int code = LibTaosWS.WSErrorNo(wsRes); if (code != 0) { - throw new Exception($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); + Console.WriteLine($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); } else { @@ -55,4 +58,4 @@ namespace Examples } // Establish connect success. // create table success affect 0 rows, cost 3717542 nanoseconds -// insert data success affect 8 rows, cost 2613637 nanoseconds \ No newline at end of file +// insert data success affect 8 rows, cost 2613637 nanoseconds diff --git a/docs/examples/csharp/wsQuery/Program.cs b/docs/examples/csharp/wsQuery/Program.cs index a220cae903..8ee900a05a 100644 --- a/docs/examples/csharp/wsQuery/Program.cs +++ b/docs/examples/csharp/wsQuery/Program.cs @@ -7,13 +7,14 @@ namespace Examples { public class WSQueryExample { - static void Main(string[] args) + static int Main(string[] args) { string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); if (wsConn == IntPtr.Zero) { - throw new Exception("get WS connection failed"); + Console.WriteLine("get WS connection failed"); + return -1; } else { @@ -28,7 +29,9 @@ namespace Examples int code = LibTaosWS.WSErrorNo(wsRes); if (code != 0) { - throw new Exception($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); + Console.WriteLine($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); + LibTaosWS.WSFreeResult(wsRes); + return -1; } // get meta data @@ -58,6 +61,8 @@ namespace Examples // close connection. LibTaosWS.WSClose(wsConn); + + return 0; } } } @@ -71,4 +76,4 @@ namespace Examples // 1538548685000 | 10.3 | 219 | 0.31 | California.SanFrancisco | 2 | // 1538548695000 | 12.6 | 218 | 0.33 | California.SanFrancisco | 2 | // 1538548696800 | 12.3 | 221 | 0.31 | California.SanFrancisco | 2 | -// 1538548696650 | 10.3 | 218 | 0.25 | California.SanFrancisco | 3 | \ No newline at end of file +// 1538548696650 | 10.3 | 218 | 0.25 | California.SanFrancisco | 3 | diff --git a/docs/examples/csharp/wsStmt/Program.cs b/docs/examples/csharp/wsStmt/Program.cs index 8af807ec39..f8673357db 100644 --- a/docs/examples/csharp/wsStmt/Program.cs +++ b/docs/examples/csharp/wsStmt/Program.cs @@ -7,7 +7,7 @@ namespace Examples { public class WSStmtExample { - static void Main(string[] args) + static int Main(string[] args) { const string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; const string table = "meters"; @@ -21,7 +21,8 @@ namespace Examples IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); if (wsConn == IntPtr.Zero) { - throw new Exception($"get WS connection failed"); + Console.WriteLine($"get WS connection failed"); + return -1; } else { @@ -66,18 +67,20 @@ namespace Examples } else { - throw new Exception("Init STMT failed..."); + Console.WriteLine("Init STMT failed..."); } // close connection. LibTaosWS.WSClose(wsConn); + + return 0; } static void ValidStmtStep(int code, IntPtr wsStmt, string desc) { if (code != 0) { - throw new Exception($"{desc} failed,reason: {LibTaosWS.WSErrorStr(wsStmt)}, code: {code}"); + Console.WriteLine($"{desc} failed,reason: {LibTaosWS.WSErrorStr(wsStmt)}, code: {code}"); } else { @@ -92,4 +95,4 @@ namespace Examples // WSStmtBindParamBatch success... // WSStmtAddBatch success... // WSStmtExecute success... -// WS STMT insert 5 rows... \ No newline at end of file +// WS STMT insert 5 rows... diff --git a/tests/docs-examples-test/csharp.sh b/tests/docs-examples-test/csharp.sh index 21c19b9b3d..c08ffd6d62 100644 --- a/tests/docs-examples-test/csharp.sh +++ b/tests/docs-examples-test/csharp.sh @@ -28,10 +28,10 @@ taos -s "drop database if exists test" dotnet run --project optsJSON/optsJSON.csproj taos -s "create database if not exists test" -# dotnet run --project wsConnect/wsConnect.csproj -# dotnet run --project wsInsert/wsInsert.csproj -# dotnet run --project wsStmt/wsStmt.csproj -# dotnet run --project wsQuery/wsQuery.csproj +dotnet run --project wsConnect/wsConnect.csproj +dotnet run --project wsInsert/wsInsert.csproj +dotnet run --project wsStmt/wsStmt.csproj +dotnet run --project wsQuery/wsQuery.csproj taos -s "drop database if exists test" -taos -s "drop database if exists power" \ No newline at end of file +taos -s "drop database if exists power" From 114943ddb00a7c4cb618c51559ed4e24b50681de Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 5 Dec 2022 22:28:26 +0800 Subject: [PATCH 34/63] fix(query): set the correct flag when no neighbors exist. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 7717a2371b..a4581f5472 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2483,12 +2483,11 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { SBlockIndex bIndex = {0}; bool hasNeighbor = getNeighborBlockOfSameTable(pBlockInfo, pBlockScanInfo, &nextIndex, pReader->order, &bIndex); if (!hasNeighbor) { // do nothing - return 0; + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); + break; } - bool overlap = overlapWithNeighborBlock(pBlock, &bIndex, pReader->order); - - if (overlap) { // load next block + if (overlapWithNeighborBlock(pBlock, &bIndex, pReader->order)) { // load next block SReaderStatus* pStatus = &pReader->status; SDataBlockIter* pBlockIter = &pStatus->blockIter; @@ -2502,15 +2501,16 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { // 3. load the neighbor block, and set it to be the currently accessed file data block code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pBlockInfo->uid); if (code != TSDB_CODE_SUCCESS) { - return code; + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); + break; } // 4. check the data values initBlockDumpInfo(pReader, pBlockIter); + } else { + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); + break; } - - setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); - break; } } } From 4be196491e6671e383187bc703a826cbc87f9bc2 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Mon, 5 Dec 2022 22:39:18 +0800 Subject: [PATCH 35/63] add fail-fast --- include/libs/transport/trpc.h | 6 +++ source/libs/transport/inc/transportInt.h | 4 ++ source/libs/transport/src/trans.c | 4 ++ source/libs/transport/src/transCli.c | 57 ++++++++++++++++++++++-- 4 files changed, 68 insertions(+), 3 deletions(-) diff --git a/include/libs/transport/trpc.h b/include/libs/transport/trpc.h index d761813db1..87f753e6aa 100644 --- a/include/libs/transport/trpc.h +++ b/include/libs/transport/trpc.h @@ -72,6 +72,7 @@ typedef struct SRpcMsg { typedef void (*RpcCfp)(void *parent, SRpcMsg *, SEpSet *epset); typedef bool (*RpcRfp)(int32_t code, tmsg_t msgType); typedef bool (*RpcTfp)(int32_t code, tmsg_t msgType); +typedef bool (*RpcFFfp)(tmsg_t msgType); typedef void (*RpcDfp)(void *ahandle); typedef struct SRpcInit { @@ -90,6 +91,9 @@ typedef struct SRpcInit { int32_t retryMaxInterval; // retry max interval int64_t retryMaxTimouet; + int32_t failFastThreshold; + int32_t failFastInterval; + int32_t compressSize; // -1: no compress, 0 : all data compressed, size: compress data if larger than size int8_t encryption; // encrypt or not @@ -107,6 +111,8 @@ typedef struct SRpcInit { // destroy client ahandle; RpcDfp dfp; + // fail fast fp + RpcFFfp ffp; void *parent; } SRpcInit; diff --git a/source/libs/transport/inc/transportInt.h b/source/libs/transport/inc/transportInt.h index 833937aa41..57aba67b1d 100644 --- a/source/libs/transport/inc/transportInt.h +++ b/source/libs/transport/inc/transportInt.h @@ -57,10 +57,14 @@ typedef struct { int32_t retryMaxInterval; // retry max interval int32_t retryMaxTimouet; + int32_t failFastThreshold; + int32_t failFastInterval; + void (*cfp)(void* parent, SRpcMsg*, SEpSet*); bool (*retry)(int32_t code, tmsg_t msgType); bool (*startTimer)(int32_t code, tmsg_t msgType); void (*destroyFp)(void* ahandle); + bool (*failFastFp)(tmsg_t msgType); int index; void* parent; diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c index c6a5cfdc95..0eac12f7c5 100644 --- a/source/libs/transport/src/trans.c +++ b/source/libs/transport/src/trans.c @@ -56,11 +56,15 @@ void* rpcOpen(const SRpcInit* pInit) { pRpc->retryMaxInterval = pInit->retryMaxInterval; pRpc->retryMaxTimouet = pInit->retryMaxTimouet; + pRpc->failFastThreshold = pInit->failFastThreshold; + pRpc->failFastInterval = pInit->failFastInterval; + // register callback handle pRpc->cfp = pInit->cfp; pRpc->retry = pInit->rfp; pRpc->startTimer = pInit->tfp; pRpc->destroyFp = pInit->dfp; + pRpc->failFastFp = pInit->ffp; pRpc->numOfThreads = pInit->numOfThreads > TSDB_MAX_RPC_THREADS ? TSDB_MAX_RPC_THREADS : pInit->numOfThreads; if (pRpc->numOfThreads <= 0) { diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 7339d487d1..3e9b27dc67 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -84,6 +84,8 @@ typedef struct SCliThrd { SHashObj* fqdn2ipCache; SCvtAddr cvtAddr; + SHashObj* failFastCache; + SCliMsg* stopMsg; bool quit; @@ -96,6 +98,13 @@ typedef struct SCliObj { SCliThrd** pThreadObj; } SCliObj; +typedef struct { + int32_t reinit; + int64_t timestamp; + int32_t count; + int32_t threshold; + int64_t interval; +} SFailFastItem; // conn pool // add expire timeout and capacity limit static void* createConnPool(int size); @@ -853,7 +862,7 @@ void cliSend(SCliConn* pConn) { int status = uv_write(req, (uv_stream_t*)pConn->stream, &wb, 1, cliSendCb); if (status != 0) { - tGError("%s conn %p failed to sent msg:%s, errmsg:%s", CONN_GET_INST_LABEL(pConn), pConn, TMSG_INFO(pMsg->msgType), + tGError("%s conn %p failed to send msg:%s, errmsg:%s", CONN_GET_INST_LABEL(pConn), pConn, TMSG_INFO(pMsg->msgType), uv_err_name(status)); cliHandleExcept(pConn); } @@ -863,7 +872,6 @@ _RETURN: } void cliConnCb(uv_connect_t* req, int status) { - // impl later SCliConn* pConn = req->data; SCliThrd* pThrd = pConn->hostThrd; @@ -875,7 +883,29 @@ void cliConnCb(uv_connect_t* req, int status) { } if (status != 0) { - tError("%s conn %p failed to connect server:%s", CONN_GET_INST_LABEL(pConn), pConn, uv_strerror(status)); + tError("%s conn %p failed to connect to %s:%d, reason:%s", CONN_GET_INST_LABEL(pConn), pConn, pConn->ip, + pConn->port, uv_strerror(status)); + SCliMsg* pMsg = transQueueGet(&pConn->cliMsgs, 0); + if (REQUEST_NO_RESP(&pMsg->msg)) { + char* ip = pConn->ip; + uint32_t port = pConn->port; + char key[TSDB_FQDN_LEN + 64] = {0}; + CONN_CONSTRUCT_HASH_KEY(key, ip, port); + + SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key)); + int64_t cTimestamp = taosGetTimestampMs(); + if (item != NULL) { + if (cTimestamp - item->timestamp < ((STrans*)pThrd->pTransInst)->failFastInterval) { + item->count++; + } else { + item->count = 1; + item->timestamp = cTimestamp; + } + } else { + SFailFastItem item = {.count = 1, .timestamp = cTimestamp}; + taosHashPut(pThrd->failFastCache, key, strlen(key), &item, sizeof(SFailFastItem)); + } + } cliHandleExcept(pConn); return; } @@ -1027,6 +1057,25 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) { return; } + if (REQUEST_NO_RESP(&pMsg->msg)) { + char* ip = EPSET_GET_INUSE_IP(&pCtx->epSet); + uint32_t port = EPSET_GET_INUSE_PORT(&pCtx->epSet); + char key[TSDB_FQDN_LEN + 64] = {0}; + CONN_CONSTRUCT_HASH_KEY(key, ip, port); + + SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key)); + if (item != NULL) { + int32_t elapse = taosGetTimestampMs() - item->timestamp; + if (item->count >= pTransInst->failFastThreshold && elapse <= pTransInst->failFastInterval) { + STraceId* trace = &(pMsg->msg.info.traceId); + tGTrace("%s, msg %p cancel to send, reason: failed to connect %s:%d: count: %d, at %d", pTransInst->label, pMsg, + ip, port, item->count, elapse); + destroyCmsg(pMsg); + return; + } + } + } + bool ignore = false; SCliConn* conn = cliGetConn(pMsg, pThrd, &ignore); if (ignore == true) { @@ -1299,6 +1348,8 @@ static SCliThrd* createThrdObj(void* trans) { pThrd->destroyAhandleFp = pTransInst->destroyFp; pThrd->fqdn2ipCache = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); + pThrd->failFastCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); + pThrd->quit = false; return pThrd; } From 3f1a0cefbbb3735fb9bf47473e03ddb6bf534d86 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Mon, 5 Dec 2022 14:27:18 +0800 Subject: [PATCH 36/63] fix: walSaveMeta ahead of deleting WAL files as gc in walEndSnapshot delete WAL files in descending order during walRollback --- include/libs/wal/wal.h | 2 ++ source/libs/wal/src/walMeta.c | 4 ++- source/libs/wal/src/walMgmt.c | 13 ++++++- source/libs/wal/src/walRead.c | 2 +- source/libs/wal/src/walWrite.c | 62 +++++++++++++++++----------------- 5 files changed, 49 insertions(+), 34 deletions(-) diff --git a/include/libs/wal/wal.h b/include/libs/wal/wal.h index 936f11c41a..8b9fc84334 100644 --- a/include/libs/wal/wal.h +++ b/include/libs/wal/wal.h @@ -107,6 +107,8 @@ typedef struct SWal { TdFilePtr pIdxFile; int32_t writeCur; SArray *fileInfoSet; // SArray + // gc + SArray *toDeleteFiles; // SArray // status int64_t totSize; int64_t lastRollSeq; diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 64dde15e76..8e6628bb21 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -24,7 +24,9 @@ bool FORCE_INLINE walLogExist(SWal* pWal, int64_t ver) { return !walIsEmpty(pWal) && walGetFirstVer(pWal) <= ver && walGetLastVer(pWal) >= ver; } -bool FORCE_INLINE walIsEmpty(SWal* pWal) { return pWal->vers.firstVer == -1; } +bool FORCE_INLINE walIsEmpty(SWal* pWal) { + return (pWal->vers.firstVer == -1 || pWal->vers.lastVer < pWal->vers.firstVer); // [firstVer, lastVer + 1) +} int64_t FORCE_INLINE walGetFirstVer(SWal* pWal) { return pWal->vers.firstVer; } diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c index a683ceb2b1..f53088fac6 100644 --- a/source/libs/wal/src/walMgmt.c +++ b/source/libs/wal/src/walMgmt.c @@ -121,7 +121,16 @@ SWal *walOpen(const char *path, SWalCfg *pCfg) { pWal->writeCur = -1; pWal->fileInfoSet = taosArrayInit(8, sizeof(SWalFileInfo)); if (pWal->fileInfoSet == NULL) { - wError("vgId:%d, path:%s, failed to init taosArray %s", pWal->cfg.vgId, pWal->path, strerror(errno)); + wError("vgId:%d, failed to init taosArray of fileInfoSet due to %s. path:%s", pWal->cfg.vgId, strerror(errno), + pWal->path); + goto _err; + } + + // init gc + pWal->toDeleteFiles = taosArrayInit(8, sizeof(SWalFileInfo)); + if (pWal->toDeleteFiles == NULL) { + wError("vgId:%d, failed to init taosArray of toDeleteFiles due to %s. path:%s", pWal->cfg.vgId, strerror(errno), + pWal->path); goto _err; } @@ -203,6 +212,8 @@ void walClose(SWal *pWal) { pWal->pIdxFile = NULL; taosArrayDestroy(pWal->fileInfoSet); pWal->fileInfoSet = NULL; + taosArrayDestroy(pWal->toDeleteFiles); + pWal->toDeleteFiles = NULL; void *pIter = NULL; while (1) { diff --git a/source/libs/wal/src/walRead.c b/source/libs/wal/src/walRead.c index 76266d338b..ed02d29e3b 100644 --- a/source/libs/wal/src/walRead.c +++ b/source/libs/wal/src/walRead.c @@ -489,7 +489,7 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) { int32_t code; bool seeked = false; - if (pReader->pWal->vers.firstVer == -1) { + if (walIsEmpty(pReader->pWal)) { terrno = TSDB_CODE_WAL_LOG_NOT_EXIST; return -1; } diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 2dde0de39b..a5c7bf1abd 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -120,9 +120,9 @@ int32_t walRollback(SWal *pWal, int64_t ver) { return -1; } - // delete files + // delete files in descending order int fileSetSize = taosArrayGetSize(pWal->fileInfoSet); - for (int i = pWal->writeCur + 1; i < fileSetSize; i++) { + for (int i = fileSetSize - 1; i >= pWal->writeCur + 1; i--) { walBuildLogName(pWal, ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, i))->firstVer, fnameStr); wDebug("vgId:%d, wal remove file %s for rollback", pWal->cfg.vgId, fnameStr); taosRemoveFile(fnameStr); @@ -217,14 +217,9 @@ int32_t walRollback(SWal *pWal, int64_t ver) { pWal->vers.lastVer = ver - 1; if (pWal->vers.lastVer < pWal->vers.firstVer) { ASSERT(pWal->vers.lastVer == pWal->vers.firstVer - 1); - pWal->vers.firstVer = -1; } ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->lastVer = ver - 1; ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->fileSize = entry.offset; - if (((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->lastVer < ver - 1) { - ASSERT(((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->fileSize == 0); - ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->firstVer = -1; - } taosCloseFile(&pIdxFile); taosCloseFile(&pLogFile); @@ -338,6 +333,7 @@ int32_t walEndSnapshot(SWal *pWal) { } else { wDebug("vgId:%d, wal no remove", pWal->cfg.vgId); } + // iterate files, until the searched result for (SWalFileInfo *iter = pWal->fileInfoSet->pData; iter < pInfo; iter++) { wDebug("vgId:%d, wal check remove file %" PRId64 "(file size %" PRId64 " close ts %" PRId64 @@ -350,34 +346,17 @@ int32_t walEndSnapshot(SWal *pWal) { wDebug("vgId:%d, check pass", pWal->cfg.vgId); deleteCnt++; newTotSize -= iter->fileSize; + taosArrayPush(pWal->toDeleteFiles, iter); } wDebug("vgId:%d, check not pass", pWal->cfg.vgId); } - wDebug("vgId:%d, wal should delete %d files", pWal->cfg.vgId, deleteCnt); - int32_t actualDelete = 0; - char fnameStr[WAL_FILE_LEN]; - // remove file - for (int i = 0; i < deleteCnt; i++) { - pInfo = taosArrayGet(pWal->fileInfoSet, i); - walBuildLogName(pWal, pInfo->firstVer, fnameStr); - wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr); - if (taosRemoveFile(fnameStr) < 0) { - goto UPDATE_META; - } - walBuildIdxName(pWal, pInfo->firstVer, fnameStr); - wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr); - if (taosRemoveFile(fnameStr) < 0) { - ASSERT(0); - } - actualDelete++; - } UPDATE_META: // make new array, remove files - taosArrayPopFrontBatch(pWal->fileInfoSet, actualDelete); + taosArrayPopFrontBatch(pWal->fileInfoSet, deleteCnt); if (taosArrayGetSize(pWal->fileInfoSet) == 0) { pWal->writeCur = -1; - pWal->vers.firstVer = -1; + pWal->vers.firstVer = pWal->vers.lastVer + 1; } else { pWal->vers.firstVer = ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, 0))->firstVer; } @@ -392,6 +371,26 @@ int32_t walEndSnapshot(SWal *pWal) { goto END; } + // delete files + deleteCnt = taosArrayGetSize(pWal->toDeleteFiles); + wDebug("vgId:%d, wal should delete %d files", pWal->cfg.vgId, deleteCnt); + char fnameStr[WAL_FILE_LEN]; + for (int i = 0; i < deleteCnt; i++) { + pInfo = taosArrayGet(pWal->toDeleteFiles, i); + walBuildLogName(pWal, pInfo->firstVer, fnameStr); + wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr); + if (taosRemoveFile(fnameStr) < 0 && errno != ENOENT) { + wError("vgId:%d, failed to remove log file %s due to %s", pWal->cfg.vgId, fnameStr, strerror(errno)); + goto END; + } + walBuildIdxName(pWal, pInfo->firstVer, fnameStr); + wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr); + if (taosRemoveFile(fnameStr) < 0 && errno != ENOENT) { + ASSERT(0); + } + } + taosArrayClear(pWal->toDeleteFiles); + END: taosThreadMutexUnlock(&pWal->mutex); return code; @@ -489,9 +488,7 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy SWalFileInfo *pFileInfo = walGetCurFileInfo(pWal); ASSERT(pFileInfo != NULL); - if (pFileInfo->firstVer == -1) { - pFileInfo->firstVer = index; - } + ASSERT(pFileInfo->firstVer != -1); pWal->writeHead.head.version = index; pWal->writeHead.head.bodyLen = bodyLen; pWal->writeHead.head.msgType = msgType; @@ -527,7 +524,10 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy } // set status - if (pWal->vers.firstVer == -1) pWal->vers.firstVer = index; + if (pWal->vers.firstVer == -1) { + ASSERT(index == 0); + pWal->vers.firstVer = 0; + } pWal->vers.lastVer = index; pWal->totSize += sizeof(SWalCkHead) + bodyLen; pFileInfo->lastVer = index; From 9ce9d2150748310480d6e3bd3f563707b1e98774 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 6 Dec 2022 10:30:14 +0800 Subject: [PATCH 37/63] support fail fast --- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 9 +++++++++ source/libs/transport/src/transCli.c | 8 +++++--- source/os/src/osTime.c | 2 +- source/util/src/tlog.c | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 12aba130d5..04c12abcf9 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -48,6 +48,11 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) { return (*msgFp)(pWrapper->pMgmt, pMsg); } +static bool dmFailFastFp(tmsg_t msgType) { + // add more msg type later + return msgType == TDMT_SYNC_HEARTBEAT; +} + static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { SDnodeTrans *pTrans = &pDnode->trans; int32_t code = -1; @@ -260,6 +265,10 @@ int32_t dmInitClient(SDnode *pDnode) { rpcInit.retryMaxInterval = tsRedirectMaxPeriod; rpcInit.retryMaxTimouet = tsMaxRetryWaitTime; + rpcInit.failFastInterval = 1000; // interval threshold(ms) + rpcInit.failFastThreshold = 3; // failed threshold + rpcInit.ffp = dmFailFastFp; + pTrans->clientRpc = rpcOpen(&rpcInit); if (pTrans->clientRpc == NULL) { dError("failed to init dnode rpc client"); diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 3e9b27dc67..c74d9839c8 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -886,7 +886,8 @@ void cliConnCb(uv_connect_t* req, int status) { tError("%s conn %p failed to connect to %s:%d, reason:%s", CONN_GET_INST_LABEL(pConn), pConn, pConn->ip, pConn->port, uv_strerror(status)); SCliMsg* pMsg = transQueueGet(&pConn->cliMsgs, 0); - if (REQUEST_NO_RESP(&pMsg->msg)) { + STrans* pTransInst = pThrd->pTransInst; + if (REQUEST_NO_RESP(&pMsg->msg) && (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) { char* ip = pConn->ip; uint32_t port = pConn->port; char key[TSDB_FQDN_LEN + 64] = {0}; @@ -895,7 +896,7 @@ void cliConnCb(uv_connect_t* req, int status) { SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key)); int64_t cTimestamp = taosGetTimestampMs(); if (item != NULL) { - if (cTimestamp - item->timestamp < ((STrans*)pThrd->pTransInst)->failFastInterval) { + if (cTimestamp - item->timestamp < pTransInst->failFastInterval) { item->count++; } else { item->count = 1; @@ -1057,7 +1058,7 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) { return; } - if (REQUEST_NO_RESP(&pMsg->msg)) { + if (REQUEST_NO_RESP(&pMsg->msg) && (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) { char* ip = EPSET_GET_INUSE_IP(&pCtx->epSet); uint32_t port = EPSET_GET_INUSE_PORT(&pCtx->epSet); char key[TSDB_FQDN_LEN + 64] = {0}; @@ -1376,6 +1377,7 @@ static void destroyThrdObj(SCliThrd* pThrd) { taosMemoryFree(pThrd->prepare); taosMemoryFree(pThrd->loop); taosHashCleanup(pThrd->fqdn2ipCache); + taosHashCleanup(pThrd->failFastCache); taosMemoryFree(pThrd); } diff --git a/source/os/src/osTime.c b/source/os/src/osTime.c index 68dfba14e9..cd4324a592 100644 --- a/source/os/src/osTime.c +++ b/source/os/src/osTime.c @@ -572,7 +572,7 @@ int32_t taosClockGetTime(int clock_id, struct timespec *pTS) { offsetInitFinished = true; } else { while (!offsetInitFinished) - ; // Ensure initialization is completed. + ; // Ensure initialization is completed. } GetSystemTimeAsFileTime(&f); diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index fc9d90c985..be1db74f1a 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -496,7 +496,7 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons if (!osLogSpaceAvailable()) return; if (!(dflag & DEBUG_FILE) && !(dflag & DEBUG_SCREEN)) return; - char *buffer = taosMemoryMalloc(LOG_MAX_LINE_DUMP_BUFFER_SIZE); + char *buffer = taosMemoryMalloc(LOG_MAX_LINE_DUMP_BUFFER_SIZE); int32_t len = taosBuildLogHead(buffer, flags); va_list argpointer; From 4e87bcc97af1008d47f8c2034032e8c9dee23757 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 6 Dec 2022 10:53:31 +0800 Subject: [PATCH 38/63] support fail fast --- source/libs/transport/src/transCli.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index c74d9839c8..dad3806d3f 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -896,7 +896,8 @@ void cliConnCb(uv_connect_t* req, int status) { SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key)); int64_t cTimestamp = taosGetTimestampMs(); if (item != NULL) { - if (cTimestamp - item->timestamp < pTransInst->failFastInterval) { + int32_t elapse = cTimestamp - item->timestamp; + if (elapse >= 0 && elapse <= pTransInst->failFastInterval) { item->count++; } else { item->count = 1; @@ -1066,8 +1067,8 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) { SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key)); if (item != NULL) { - int32_t elapse = taosGetTimestampMs() - item->timestamp; - if (item->count >= pTransInst->failFastThreshold && elapse <= pTransInst->failFastInterval) { + int32_t elapse = (int32_t)(taosGetTimestampMs() - item->timestamp); + if (item->count >= pTransInst->failFastThreshold && (elapse >= 0 && elapse <= pTransInst->failFastInterval)) { STraceId* trace = &(pMsg->msg.info.traceId); tGTrace("%s, msg %p cancel to send, reason: failed to connect %s:%d: count: %d, at %d", pTransInst->label, pMsg, ip, port, item->count, elapse); From 2e900918bbea58ec6c74b124683870b02fd5f136 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 6 Dec 2022 12:02:32 +0800 Subject: [PATCH 39/63] enh: allow any user to create a topic --- source/dnode/mnode/impl/inc/mndDef.h | 1 + source/dnode/mnode/impl/src/mndTopic.c | 14 ++++++++++---- tests/script/tsim/user/privilege_db.sim | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 9961828747..8fc7f29c02 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -473,6 +473,7 @@ void* tDecodeSMqOffsetObj(void* buf, SMqOffsetObj* pOffset); typedef struct { char name[TSDB_TOPIC_FNAME_LEN]; char db[TSDB_DB_FNAME_LEN]; + char createUser[TSDB_USER_LEN]; int64_t createTime; int64_t updateTime; int64_t uid; diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index eea74c6dd8..f12fde80b5 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -28,7 +28,7 @@ #include "parser.h" #include "tname.h" -#define MND_TOPIC_VER_NUMBER 1 +#define MND_TOPIC_VER_NUMBER 2 #define MND_TOPIC_RESERVE_SIZE 64 static int32_t mndTopicActionInsert(SSdb *pSdb, SMqTopicObj *pTopic); @@ -93,6 +93,7 @@ SSdbRaw *mndTopicActionEncode(SMqTopicObj *pTopic) { int32_t dataPos = 0; SDB_SET_BINARY(pRaw, dataPos, pTopic->name, TSDB_TOPIC_FNAME_LEN, TOPIC_ENCODE_OVER); SDB_SET_BINARY(pRaw, dataPos, pTopic->db, TSDB_DB_FNAME_LEN, TOPIC_ENCODE_OVER); + SDB_SET_BINARY(pRaw, dataPos, pTopic->createUser, TSDB_USER_LEN, TOPIC_ENCODE_OVER); SDB_SET_INT64(pRaw, dataPos, pTopic->createTime, TOPIC_ENCODE_OVER); SDB_SET_INT64(pRaw, dataPos, pTopic->updateTime, TOPIC_ENCODE_OVER); SDB_SET_INT64(pRaw, dataPos, pTopic->uid, TOPIC_ENCODE_OVER); @@ -159,7 +160,7 @@ SSdbRow *mndTopicActionDecode(SSdbRaw *pRaw) { int8_t sver = 0; if (sdbGetRawSoftVer(pRaw, &sver) != 0) goto TOPIC_DECODE_OVER; - if (sver != MND_TOPIC_VER_NUMBER) { + if (sver != 1 && sver != 2) { terrno = TSDB_CODE_SDB_INVALID_DATA_VER; goto TOPIC_DECODE_OVER; } @@ -174,6 +175,9 @@ SSdbRow *mndTopicActionDecode(SSdbRaw *pRaw) { int32_t dataPos = 0; SDB_GET_BINARY(pRaw, dataPos, pTopic->name, TSDB_TOPIC_FNAME_LEN, TOPIC_DECODE_OVER); SDB_GET_BINARY(pRaw, dataPos, pTopic->db, TSDB_DB_FNAME_LEN, TOPIC_DECODE_OVER); + if (sver >= 2) { + SDB_GET_BINARY(pRaw, dataPos, pTopic->createUser, TSDB_USER_LEN, TOPIC_DECODE_OVER); + } SDB_GET_INT64(pRaw, dataPos, &pTopic->createTime, TOPIC_DECODE_OVER); SDB_GET_INT64(pRaw, dataPos, &pTopic->updateTime, TOPIC_DECODE_OVER); SDB_GET_INT64(pRaw, dataPos, &pTopic->uid, TOPIC_DECODE_OVER); @@ -358,11 +362,13 @@ static int32_t extractTopicTbInfo(SNode *pAst, SMqTopicObj *pTopic) { return 0; } -static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *pCreate, SDbObj *pDb) { +static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *pCreate, SDbObj *pDb, + const char *userName) { mInfo("topic:%s to create", pCreate->name); SMqTopicObj topicObj = {0}; tstrncpy(topicObj.name, pCreate->name, TSDB_TOPIC_FNAME_LEN); tstrncpy(topicObj.db, pDb->name, TSDB_DB_FNAME_LEN); + tstrncpy(topicObj.createUser, userName, TSDB_USER_LEN); topicObj.createTime = taosGetTimestampMs(); topicObj.updateTime = topicObj.createTime; topicObj.uid = mndGenerateUid(pCreate->name, strlen(pCreate->name)); @@ -578,7 +584,7 @@ static int32_t mndProcessCreateTopicReq(SRpcMsg *pReq) { goto _OVER; } - code = mndCreateTopic(pMnode, pReq, &createTopicReq, pDb); + code = mndCreateTopic(pMnode, pReq, &createTopicReq, pDb, pReq->info.conn.user); if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; _OVER: diff --git a/tests/script/tsim/user/privilege_db.sim b/tests/script/tsim/user/privilege_db.sim index 79e3754c2f..afeb0277ae 100644 --- a/tests/script/tsim/user/privilege_db.sim +++ b/tests/script/tsim/user/privilege_db.sim @@ -93,6 +93,6 @@ sql_error drop database d2; sql_error create stable d1.st (ts timestamp, i int) tags (j int) sql create stable d2.st (ts timestamp, i int) tags (j int) -sql_error create topic topic_2 as select ts, i from stb +sql create topic topic_2 as select ts, i from stb system sh/exec.sh -n dnode1 -s stop -x SIGINT From 8985f5513cfaf78c60b578e19e5ab433b4fd4862 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 6 Dec 2022 12:48:11 +0800 Subject: [PATCH 40/63] enh: allow any user to create a topic --- source/dnode/mnode/impl/src/mndTopic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index f12fde80b5..ad45ceda80 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -580,7 +580,7 @@ static int32_t mndProcessCreateTopicReq(SRpcMsg *pReq) { goto _OVER; } - if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_TOPIC) != 0) { + if (mndCheckTopicPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_TOPIC, NULL) != 0) { goto _OVER; } @@ -704,7 +704,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { } #endif - if (mndCheckDbPrivilegeByName(pMnode, pReq->info.conn.user, MND_OPER_READ_DB, pTopic->db) != 0) { + if (mndCheckTopicPrivilege(pMnode, pReq->info.conn.user, MND_OPER_DROP_TOPIC, pTopic) != 0) { return -1; } From d16d38aeb5c6e62a75449185ff29e8b3476def32 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 6 Dec 2022 12:48:58 +0800 Subject: [PATCH 41/63] test: adjust cases --- tests/script/tsim/user/privilege_db.sim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/script/tsim/user/privilege_db.sim b/tests/script/tsim/user/privilege_db.sim index afeb0277ae..ab77326e69 100644 --- a/tests/script/tsim/user/privilege_db.sim +++ b/tests/script/tsim/user/privilege_db.sim @@ -7,7 +7,7 @@ print =============== create db sql create database d1 vgroups 1; sql use d1 sql create table stb (ts timestamp, i int) tags (j int) -sql create topic topic_1 as select ts, i from stb +# sql create topic topic_1 as select ts, i from stb sql create database d2 vgroups 1; sql create database d3 vgroups 1; @@ -93,6 +93,6 @@ sql_error drop database d2; sql_error create stable d1.st (ts timestamp, i int) tags (j int) sql create stable d2.st (ts timestamp, i int) tags (j int) -sql create topic topic_2 as select ts, i from stb +#sql create topic topic_2 as select ts, i from stb system sh/exec.sh -n dnode1 -s stop -x SIGINT From 577a203541a8152be54fb632ce392a11da6b04ac Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Tue, 6 Dec 2022 12:50:59 +0800 Subject: [PATCH 42/63] fix: synchronize access of pWalHandle with mutex in raftLogGetEntry --- source/libs/sync/src/syncRaftLog.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/libs/sync/src/syncRaftLog.c b/source/libs/sync/src/syncRaftLog.c index f51fe344df..018ac5bb7d 100644 --- a/source/libs/sync/src/syncRaftLog.c +++ b/source/libs/sync/src/syncRaftLog.c @@ -234,18 +234,17 @@ int32_t raftLogGetEntry(struct SSyncLogStore* pLogStore, SyncIndex index, SSyncR *ppEntry = NULL; - // SWalReadHandle* pWalHandle = walOpenReadHandle(pWal); + int64_t ts1 = taosGetTimestampNs(); + taosThreadMutexLock(&(pData->mutex)); + SWalReader* pWalHandle = pData->pWalHandle; if (pWalHandle == NULL) { terrno = TSDB_CODE_SYN_INTERNAL_ERROR; sError("vgId:%d, wal handle is NULL", pData->pSyncNode->vgId); - + taosThreadMutexUnlock(&(pData->mutex)); return -1; } - int64_t ts1 = taosGetTimestampNs(); - taosThreadMutexLock(&(pData->mutex)); - int64_t ts2 = taosGetTimestampNs(); code = walReadVer(pWalHandle, index); int64_t ts3 = taosGetTimestampNs(); From 51ee2f80ac57caf5cbe38bd585e2f54a99f668bb Mon Sep 17 00:00:00 2001 From: kailixu Date: Tue, 6 Dec 2022 13:16:06 +0800 Subject: [PATCH 43/63] fix: dataDir process for multi-tier storage --- source/util/src/tconfig.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index 3d05f80acf..609a386367 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -293,7 +293,7 @@ static int32_t cfgSetTfsItem(SConfig *pCfg, const char *name, const char *value, } SDiskCfg cfg = {0}; - tstrncpy(cfg.dir, value, sizeof(cfg.dir)); + tstrncpy(cfg.dir, pItem->str, sizeof(cfg.dir)); cfg.level = level ? atoi(level) : 0; cfg.primary = primary ? atoi(primary) : 1; void *ret = taosArrayPush(pItem->array, &cfg); @@ -660,12 +660,13 @@ int32_t cfgLoadFromEnvVar(SConfig *pConfig) { if (vlen3 != 0) value3[vlen3] = 0; } + code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_VAR); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_ENV_VAR); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_VAR); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } uInfo("load from env variables cfg success"); @@ -702,12 +703,13 @@ int32_t cfgLoadFromEnvCmd(SConfig *pConfig, const char **envCmd) { if (vlen3 != 0) value3[vlen3] = 0; } + code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_CMD); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_ENV_CMD); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_CMD); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } uInfo("load from env cmd cfg success"); @@ -766,12 +768,13 @@ int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *envFile) { if (vlen3 != 0) value3[vlen3] = 0; } + code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_FILE); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_ENV_FILE); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_FILE); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } taosCloseFile(&pFile); @@ -825,12 +828,13 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) { if (vlen3 != 0) value3[vlen3] = 0; } + code = cfgSetItem(pConfig, name, value, CFG_STYPE_CFG_FILE); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_CFG_FILE); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_CFG_FILE); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } taosCloseFile(&pFile); @@ -989,12 +993,14 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) { paGetToken(value2 + vlen2 + 1, &value3, &vlen3); if (vlen3 != 0) value3[vlen3] = 0; } + + code = cfgSetItem(pConfig, name, value, CFG_STYPE_APOLLO_URL); + if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; + if (strcasecmp(name, "dataDir") == 0) { code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_APOLLO_URL); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } - code = cfgSetItem(pConfig, name, value, CFG_STYPE_APOLLO_URL); - if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } } tjsonDelete(pJson); From 346f71f9d30f1f1f3a2049570d91174cc4b79f8f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 6 Dec 2022 13:23:59 +0800 Subject: [PATCH 44/63] enh: allow any user to create a topic --- source/dnode/mnode/impl/src/mndTopic.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index ad45ceda80..e271eedd17 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -369,6 +369,11 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq * tstrncpy(topicObj.name, pCreate->name, TSDB_TOPIC_FNAME_LEN); tstrncpy(topicObj.db, pDb->name, TSDB_DB_FNAME_LEN); tstrncpy(topicObj.createUser, userName, TSDB_USER_LEN); + + if (mndCheckTopicPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_TOPIC, &topicObj) != 0) { + return -1; + } + topicObj.createTime = taosGetTimestampMs(); topicObj.updateTime = topicObj.createTime; topicObj.uid = mndGenerateUid(pCreate->name, strlen(pCreate->name)); @@ -580,10 +585,6 @@ static int32_t mndProcessCreateTopicReq(SRpcMsg *pReq) { goto _OVER; } - if (mndCheckTopicPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_TOPIC, NULL) != 0) { - goto _OVER; - } - code = mndCreateTopic(pMnode, pReq, &createTopicReq, pDb, pReq->info.conn.user); if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; @@ -640,7 +641,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { } } - if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_DROP_TOPIC) != 0) { + if (mndCheckTopicPrivilege(pMnode, pReq->info.conn.user, MND_OPER_DROP_TOPIC, pTopic) != 0) { mndReleaseTopic(pMnode, pTopic); return -1; } @@ -704,10 +705,6 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { } #endif - if (mndCheckTopicPrivilege(pMnode, pReq->info.conn.user, MND_OPER_DROP_TOPIC, pTopic) != 0) { - return -1; - } - STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB_INSIDE, pReq, "drop-topic"); mndTransSetDbName(pTrans, pTopic->db, NULL); if (pTrans == NULL) { From 4d9c1b345368890bf30c46edacd56effd5abfa29 Mon Sep 17 00:00:00 2001 From: sunpeng Date: Tue, 6 Dec 2022 13:28:37 +0800 Subject: [PATCH 45/63] feat: update taosadapter branch (#18729) --- cmake/taosadapter_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in index 2a7b76d768..d702b9967e 100644 --- a/cmake/taosadapter_CMakeLists.txt.in +++ b/cmake/taosadapter_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosadapter ExternalProject_Add(taosadapter GIT_REPOSITORY https://github.com/taosdata/taosadapter.git - GIT_TAG e07f41b + GIT_TAG 0dfad5b SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From 0254e90ce61e9804c177c25d7398ed182fdab853 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 6 Dec 2022 13:42:59 +0800 Subject: [PATCH 46/63] avoid null pointer --- source/libs/transport/src/transCli.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index dad3806d3f..187e17fc30 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -887,7 +887,8 @@ void cliConnCb(uv_connect_t* req, int status) { pConn->port, uv_strerror(status)); SCliMsg* pMsg = transQueueGet(&pConn->cliMsgs, 0); STrans* pTransInst = pThrd->pTransInst; - if (REQUEST_NO_RESP(&pMsg->msg) && (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) { + if (pMsg != NULL && REQUEST_NO_RESP(&pMsg->msg) && + (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) { char* ip = pConn->ip; uint32_t port = pConn->port; char key[TSDB_FQDN_LEN + 64] = {0}; From 28bc1bde9b344c5c3021c72bc70d1378745bcebb Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 6 Dec 2022 15:28:55 +0800 Subject: [PATCH 47/63] test: add cases for create and drop topic --- tests/script/tsim/user/privilege_db.sim | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/script/tsim/user/privilege_db.sim b/tests/script/tsim/user/privilege_db.sim index ab77326e69..b708fdab64 100644 --- a/tests/script/tsim/user/privilege_db.sim +++ b/tests/script/tsim/user/privilege_db.sim @@ -6,8 +6,8 @@ sql connect print =============== create db sql create database d1 vgroups 1; sql use d1 -sql create table stb (ts timestamp, i int) tags (j int) -# sql create topic topic_1 as select ts, i from stb +sql create table d1_stb (ts timestamp, i int) tags (j int) +sql create topic d1_topic_1 as select ts, i from d1_stb sql create database d2 vgroups 1; sql create database d3 vgroups 1; @@ -72,7 +72,6 @@ sql REVOKE read,write ON d1.* from user1; sql REVOKE read,write ON d2.* from user1; sql REVOKE read,write ON *.* from user1; - print =============== create users sql create user u1 PASS 'taosdata' sql select * from information_schema.ins_users @@ -92,7 +91,17 @@ sql_error drop database d1; sql_error drop database d2; sql_error create stable d1.st (ts timestamp, i int) tags (j int) -sql create stable d2.st (ts timestamp, i int) tags (j int) -#sql create topic topic_2 as select ts, i from stb +sql use d2 +sql create table d2_stb (ts timestamp, i int) tags (j int) + +# Insufficient privilege for operation +sql_error create topic d2_topic_1 as select ts, i from d2_stb + +sql use d1 +# Insufficient privilege for operation +sql_error drop topic d1_topic_1 +sql create topic d1_topic_2 as select ts, i from d1_stb + +sql drop topic d1_topic_2 system sh/exec.sh -n dnode1 -s stop -x SIGINT From a693b9a2d6ad0e5831cf22d8a6862a9cf24758fd Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 6 Dec 2022 15:29:45 +0800 Subject: [PATCH 48/63] fix(query):remove invalid destroy appinst operation. --- source/client/src/clientEnv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 93398d337d..d27757119a 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -231,10 +231,9 @@ void destroyTscObj(void *pObj) { tscDebug("connObj 0x%" PRIx64 " p:%p destroyed, remain inst totalConn:%" PRId64, pTscObj->id, pTscObj, pTscObj->pAppInfo->numOfConns); - int64_t connNum = atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); - if (0 == connNum) { - destroyAppInst(pTscObj->pAppInfo); - } + // In any cases, we should not free app inst here. Or an race condition rise. + /*int64_t connNum = */atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); + taosThreadMutexDestroy(&pTscObj->mutex); taosMemoryFree(pTscObj); From 2f1afb9bf0fce767b4b13e8cef55c01d019f8b16 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 6 Dec 2022 15:30:08 +0800 Subject: [PATCH 49/63] fix(query):fix typo --- source/client/src/clientEnv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index d27757119a..7564d91330 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -231,7 +231,7 @@ void destroyTscObj(void *pObj) { tscDebug("connObj 0x%" PRIx64 " p:%p destroyed, remain inst totalConn:%" PRId64, pTscObj->id, pTscObj, pTscObj->pAppInfo->numOfConns); - // In any cases, we should not free app inst here. Or an race condition rise. + // In any cases, we should not free app inst here. Or an race condition rises. /*int64_t connNum = */atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); taosThreadMutexDestroy(&pTscObj->mutex); From 68e014977a7e0e58a90aee28151a1ebbd028312b Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 6 Dec 2022 15:45:45 +0800 Subject: [PATCH 50/63] enh: speed up drop dnode and avoid snapshot transfer --- source/dnode/mnode/impl/src/mndVgroup.c | 77 +++++++++++++++++-------- 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index b4ea8ee125..ea8bb581e0 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1126,34 +1126,61 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, } if (!force) { - mInfo("vgId:%d, will add 1 vnode", pVgroup->vgId); - if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; - for (int32_t i = 0; i < newVg.replica - 1; ++i) { - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; - } - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; - - mInfo("vgId:%d, will remove 1 vnode", pVgroup->vgId); - newVg.replica--; - SVnodeGid del = newVg.vnodeGid[vnIndex]; - newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; - memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); - { - SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); - if (pRaw == NULL) return -1; - if (mndTransAppendRedolog(pTrans, pRaw) != 0) { - sdbFreeRaw(pRaw); - return -1; + if (newVg.replica == 1) { + mInfo("vgId:%d, will add 1 vnode, replca:1", pVgroup->vgId); + if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; + for (int32_t i = 0; i < newVg.replica - 1; ++i) { + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; } - (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); - } + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; - if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; - for (int32_t i = 0; i < newVg.replica; ++i) { - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; + mInfo("vgId:%d, will remove 1 vnode, replca:2", pVgroup->vgId); + newVg.replica--; + SVnodeGid del = newVg.vnodeGid[vnIndex]; + newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; + memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); + { + SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); + if (pRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRaw) != 0) { + sdbFreeRaw(pRaw); + return -1; + } + (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); + } + + if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; + for (int32_t i = 0; i < newVg.replica; ++i) { + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; + } + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; + } else { // new replica == 3 + mInfo("vgId:%d, will add 1 vnode, replca:3", pVgroup->vgId); + if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; + mInfo("vgId:%d, will remove 1 vnode, replca:4", pVgroup->vgId); + newVg.replica--; + SVnodeGid del = newVg.vnodeGid[vnIndex]; + newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; + memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); + { + SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); + if (pRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRaw) != 0) { + sdbFreeRaw(pRaw); + return -1; + } + (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); + } + + if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; + for (int32_t i = 0; i < newVg.replica - 1; ++i) { + if (i == vnIndex) continue; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; + } + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[vnIndex]) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; } - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; } else { mInfo("vgId:%d, will add 1 vnode and force remove 1 vnode", pVgroup->vgId); if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; From 78c5cc2b6b30e6fdfe6d1e6363fdc999eef31ff8 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 6 Dec 2022 15:49:57 +0800 Subject: [PATCH 51/63] fix: fix task redirect issue --- source/libs/scheduler/inc/schInt.h | 2 +- source/libs/scheduler/src/schRemote.c | 2 ++ source/libs/scheduler/src/schTask.c | 7 +------ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/source/libs/scheduler/inc/schInt.h b/source/libs/scheduler/inc/schInt.h index 39118910f1..48df7e36a3 100644 --- a/source/libs/scheduler/inc/schInt.h +++ b/source/libs/scheduler/inc/schInt.h @@ -377,7 +377,7 @@ extern SSchedulerMgmt schMgmt; #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_MERGE_TASK_NETWORK_ERR(_task, _code, _len) \ - (SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task)))) + (SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task)) || (_task)->redirectCtx.inRedirect)) #define SCH_REDIRECT_MSGTYPE(_msgType) \ ((_msgType) == TDMT_SCH_LINK_BROKEN || (_msgType) == TDMT_SCH_QUERY || (_msgType) == TDMT_SCH_MERGE_QUERY || \ (_msgType) == TDMT_SCH_FETCH || (_msgType) == TDMT_SCH_MERGE_FETCH) diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index 560ce0bdc3..c23b461b47 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -156,6 +156,8 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa SCH_RET(schHandleRedirect(pJob, pTask, (SDataBuf *)pMsg, rspCode)); } + pTask->redirectCtx.inRedirect = false; + switch (msgType) { case TDMT_VND_COMMIT_RSP: { SCH_ERR_JRET(rspCode); diff --git a/source/libs/scheduler/src/schTask.c b/source/libs/scheduler/src/schTask.c index cd69834924..8e60222ca6 100644 --- a/source/libs/scheduler/src/schTask.c +++ b/source/libs/scheduler/src/schTask.c @@ -362,17 +362,12 @@ int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet, } pCtx->totalTimes++; + pCtx->roundTimes++; if (SCH_IS_DATA_BIND_TASK(pTask) && pEpSet) { pCtx->roundTotal = pEpSet->numOfEps; - pCtx->roundTimes = 0; - - pTask->delayExecMs = 0; - - goto _return; } - pCtx->roundTimes++; if (pCtx->roundTimes >= pCtx->roundTotal) { int64_t nowTs = taosGetTimestampMs(); From bc413b8fff2120aec1e819f11ab5ebcab1fdf94f Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 6 Dec 2022 16:07:11 +0800 Subject: [PATCH 52/63] feat: add stream option 'delete_mark' --- include/common/tmsg.h | 4 + include/common/ttokendef.h | 379 +- include/libs/nodes/cmdnodes.h | 4 + include/libs/nodes/plannodes.h | 3 + include/libs/planner/planner.h | 1 + include/util/tdef.h | 19 +- source/common/src/tmsg.c | 10 +- source/dnode/mnode/impl/inc/mndDef.h | 1 + source/dnode/mnode/impl/inc/mndScheduler.h | 2 +- source/dnode/mnode/impl/src/mndScheduler.c | 3 +- source/dnode/mnode/impl/src/mndSma.c | 2 + source/dnode/mnode/impl/src/mndStb.c | 6 +- source/libs/nodes/src/nodesCloneFuncs.c | 2 + source/libs/nodes/src/nodesCodeFuncs.c | 28 + source/libs/nodes/src/nodesMsgFuncs.c | 7 + source/libs/nodes/src/nodesUtilFuncs.c | 35 +- source/libs/parser/inc/parAst.h | 3 +- source/libs/parser/inc/sql.y | 6 +- source/libs/parser/src/parAstCreater.c | 3 + source/libs/parser/src/parTokenizer.c | 1 + source/libs/parser/src/parTranslater.c | 87 +- source/libs/parser/src/sql.c | 5917 ++++++++++--------- source/libs/parser/test/parInitialCTest.cpp | 104 +- source/libs/planner/src/planLogicCreater.c | 1 + source/libs/planner/src/planOptimizer.c | 1 + source/libs/planner/src/planPhysiCreater.c | 1 + source/libs/planner/test/planOtherTest.cpp | 2 +- source/libs/planner/test/planTestUtil.cpp | 1 + 28 files changed, 3419 insertions(+), 3214 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index fcb155e43e..470b7bba7e 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -504,6 +504,8 @@ typedef struct { char* pComment; char* pAst1; char* pAst2; + int64_t deleteMark1; + int64_t deleteMark2; } SMCreateStbReq; int32_t tSerializeSMCreateStbReq(void* buf, int32_t bufLen, SMCreateStbReq* pReq); @@ -2017,6 +2019,7 @@ typedef struct { typedef struct { int64_t maxdelay[2]; int64_t watermark[2]; + int64_t deleteMark[2]; int32_t qmsgLen[2]; char* qmsg[2]; // pAst:qmsg:SRetention => trigger aggr task1/2 } SRSmaParam; @@ -2738,6 +2741,7 @@ typedef struct { char* tagsFilter; char* sql; char* ast; + int64_t deleteMark; } SMCreateSmaReq; int32_t tSerializeSMCreateSmaReq(void* buf, int32_t bufLen, SMCreateSmaReq* pReq); diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index ccf91600db..fc630cfdc0 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -147,195 +147,196 @@ #define TK_ROLLUP 129 #define TK_TTL 130 #define TK_SMA 131 -#define TK_FIRST 132 -#define TK_LAST 133 -#define TK_SHOW 134 -#define TK_PRIVILEGES 135 -#define TK_DATABASES 136 -#define TK_TABLES 137 -#define TK_STABLES 138 -#define TK_MNODES 139 -#define TK_QNODES 140 -#define TK_FUNCTIONS 141 -#define TK_INDEXES 142 -#define TK_ACCOUNTS 143 -#define TK_APPS 144 -#define TK_CONNECTIONS 145 -#define TK_LICENCES 146 -#define TK_GRANTS 147 -#define TK_QUERIES 148 -#define TK_SCORES 149 -#define TK_TOPICS 150 -#define TK_VARIABLES 151 -#define TK_CLUSTER 152 -#define TK_BNODES 153 -#define TK_SNODES 154 -#define TK_TRANSACTIONS 155 -#define TK_DISTRIBUTED 156 -#define TK_CONSUMERS 157 -#define TK_SUBSCRIPTIONS 158 -#define TK_VNODES 159 -#define TK_LIKE 160 -#define TK_TBNAME 161 -#define TK_QTAGS 162 -#define TK_AS 163 -#define TK_INDEX 164 -#define TK_FUNCTION 165 -#define TK_INTERVAL 166 -#define TK_TOPIC 167 -#define TK_WITH 168 -#define TK_META 169 -#define TK_CONSUMER 170 -#define TK_GROUP 171 -#define TK_DESC 172 -#define TK_DESCRIBE 173 -#define TK_RESET 174 -#define TK_QUERY 175 -#define TK_CACHE 176 -#define TK_EXPLAIN 177 -#define TK_ANALYZE 178 -#define TK_VERBOSE 179 -#define TK_NK_BOOL 180 -#define TK_RATIO 181 -#define TK_NK_FLOAT 182 -#define TK_OUTPUTTYPE 183 -#define TK_AGGREGATE 184 -#define TK_BUFSIZE 185 -#define TK_STREAM 186 -#define TK_INTO 187 -#define TK_TRIGGER 188 -#define TK_AT_ONCE 189 -#define TK_WINDOW_CLOSE 190 -#define TK_IGNORE 191 -#define TK_EXPIRED 192 -#define TK_FILL_HISTORY 193 -#define TK_SUBTABLE 194 -#define TK_KILL 195 -#define TK_CONNECTION 196 -#define TK_TRANSACTION 197 -#define TK_BALANCE 198 -#define TK_VGROUP 199 -#define TK_MERGE 200 -#define TK_REDISTRIBUTE 201 -#define TK_SPLIT 202 -#define TK_DELETE 203 -#define TK_INSERT 204 -#define TK_NULL 205 -#define TK_NK_QUESTION 206 -#define TK_NK_ARROW 207 -#define TK_ROWTS 208 -#define TK_QSTART 209 -#define TK_QEND 210 -#define TK_QDURATION 211 -#define TK_WSTART 212 -#define TK_WEND 213 -#define TK_WDURATION 214 -#define TK_IROWTS 215 -#define TK_CAST 216 -#define TK_NOW 217 -#define TK_TODAY 218 -#define TK_TIMEZONE 219 -#define TK_CLIENT_VERSION 220 -#define TK_SERVER_VERSION 221 -#define TK_SERVER_STATUS 222 -#define TK_CURRENT_USER 223 -#define TK_COUNT 224 -#define TK_LAST_ROW 225 -#define TK_CASE 226 -#define TK_END 227 -#define TK_WHEN 228 -#define TK_THEN 229 -#define TK_ELSE 230 -#define TK_BETWEEN 231 -#define TK_IS 232 -#define TK_NK_LT 233 -#define TK_NK_GT 234 -#define TK_NK_LE 235 -#define TK_NK_GE 236 -#define TK_NK_NE 237 -#define TK_MATCH 238 -#define TK_NMATCH 239 -#define TK_CONTAINS 240 -#define TK_IN 241 -#define TK_JOIN 242 -#define TK_INNER 243 -#define TK_SELECT 244 -#define TK_DISTINCT 245 -#define TK_WHERE 246 -#define TK_PARTITION 247 -#define TK_BY 248 -#define TK_SESSION 249 -#define TK_STATE_WINDOW 250 -#define TK_SLIDING 251 -#define TK_FILL 252 -#define TK_VALUE 253 -#define TK_NONE 254 -#define TK_PREV 255 -#define TK_LINEAR 256 -#define TK_NEXT 257 -#define TK_HAVING 258 -#define TK_RANGE 259 -#define TK_EVERY 260 -#define TK_ORDER 261 -#define TK_SLIMIT 262 -#define TK_SOFFSET 263 -#define TK_LIMIT 264 -#define TK_OFFSET 265 -#define TK_ASC 266 -#define TK_NULLS 267 -#define TK_ABORT 268 -#define TK_AFTER 269 -#define TK_ATTACH 270 -#define TK_BEFORE 271 -#define TK_BEGIN 272 -#define TK_BITAND 273 -#define TK_BITNOT 274 -#define TK_BITOR 275 -#define TK_BLOCKS 276 -#define TK_CHANGE 277 -#define TK_COMMA 278 -#define TK_COMPACT 279 -#define TK_CONCAT 280 -#define TK_CONFLICT 281 -#define TK_COPY 282 -#define TK_DEFERRED 283 -#define TK_DELIMITERS 284 -#define TK_DETACH 285 -#define TK_DIVIDE 286 -#define TK_DOT 287 -#define TK_EACH 288 -#define TK_FAIL 289 -#define TK_FILE 290 -#define TK_FOR 291 -#define TK_GLOB 292 -#define TK_ID 293 -#define TK_IMMEDIATE 294 -#define TK_IMPORT 295 -#define TK_INITIALLY 296 -#define TK_INSTEAD 297 -#define TK_ISNULL 298 -#define TK_KEY 299 -#define TK_MODULES 300 -#define TK_NK_BITNOT 301 -#define TK_NK_SEMI 302 -#define TK_NOTNULL 303 -#define TK_OF 304 -#define TK_PLUS 305 -#define TK_PRIVILEGE 306 -#define TK_RAISE 307 -#define TK_REPLACE 308 -#define TK_RESTRICT 309 -#define TK_ROW 310 -#define TK_SEMI 311 -#define TK_STAR 312 -#define TK_STATEMENT 313 -#define TK_STRING 314 -#define TK_TIMES 315 -#define TK_UPDATE 316 -#define TK_VALUES 317 -#define TK_VARIABLE 318 -#define TK_VIEW 319 -#define TK_WAL 320 +#define TK_DELETE_MARK 132 +#define TK_FIRST 133 +#define TK_LAST 134 +#define TK_SHOW 135 +#define TK_PRIVILEGES 136 +#define TK_DATABASES 137 +#define TK_TABLES 138 +#define TK_STABLES 139 +#define TK_MNODES 140 +#define TK_QNODES 141 +#define TK_FUNCTIONS 142 +#define TK_INDEXES 143 +#define TK_ACCOUNTS 144 +#define TK_APPS 145 +#define TK_CONNECTIONS 146 +#define TK_LICENCES 147 +#define TK_GRANTS 148 +#define TK_QUERIES 149 +#define TK_SCORES 150 +#define TK_TOPICS 151 +#define TK_VARIABLES 152 +#define TK_CLUSTER 153 +#define TK_BNODES 154 +#define TK_SNODES 155 +#define TK_TRANSACTIONS 156 +#define TK_DISTRIBUTED 157 +#define TK_CONSUMERS 158 +#define TK_SUBSCRIPTIONS 159 +#define TK_VNODES 160 +#define TK_LIKE 161 +#define TK_TBNAME 162 +#define TK_QTAGS 163 +#define TK_AS 164 +#define TK_INDEX 165 +#define TK_FUNCTION 166 +#define TK_INTERVAL 167 +#define TK_TOPIC 168 +#define TK_WITH 169 +#define TK_META 170 +#define TK_CONSUMER 171 +#define TK_GROUP 172 +#define TK_DESC 173 +#define TK_DESCRIBE 174 +#define TK_RESET 175 +#define TK_QUERY 176 +#define TK_CACHE 177 +#define TK_EXPLAIN 178 +#define TK_ANALYZE 179 +#define TK_VERBOSE 180 +#define TK_NK_BOOL 181 +#define TK_RATIO 182 +#define TK_NK_FLOAT 183 +#define TK_OUTPUTTYPE 184 +#define TK_AGGREGATE 185 +#define TK_BUFSIZE 186 +#define TK_STREAM 187 +#define TK_INTO 188 +#define TK_TRIGGER 189 +#define TK_AT_ONCE 190 +#define TK_WINDOW_CLOSE 191 +#define TK_IGNORE 192 +#define TK_EXPIRED 193 +#define TK_FILL_HISTORY 194 +#define TK_SUBTABLE 195 +#define TK_KILL 196 +#define TK_CONNECTION 197 +#define TK_TRANSACTION 198 +#define TK_BALANCE 199 +#define TK_VGROUP 200 +#define TK_MERGE 201 +#define TK_REDISTRIBUTE 202 +#define TK_SPLIT 203 +#define TK_DELETE 204 +#define TK_INSERT 205 +#define TK_NULL 206 +#define TK_NK_QUESTION 207 +#define TK_NK_ARROW 208 +#define TK_ROWTS 209 +#define TK_QSTART 210 +#define TK_QEND 211 +#define TK_QDURATION 212 +#define TK_WSTART 213 +#define TK_WEND 214 +#define TK_WDURATION 215 +#define TK_IROWTS 216 +#define TK_CAST 217 +#define TK_NOW 218 +#define TK_TODAY 219 +#define TK_TIMEZONE 220 +#define TK_CLIENT_VERSION 221 +#define TK_SERVER_VERSION 222 +#define TK_SERVER_STATUS 223 +#define TK_CURRENT_USER 224 +#define TK_COUNT 225 +#define TK_LAST_ROW 226 +#define TK_CASE 227 +#define TK_END 228 +#define TK_WHEN 229 +#define TK_THEN 230 +#define TK_ELSE 231 +#define TK_BETWEEN 232 +#define TK_IS 233 +#define TK_NK_LT 234 +#define TK_NK_GT 235 +#define TK_NK_LE 236 +#define TK_NK_GE 237 +#define TK_NK_NE 238 +#define TK_MATCH 239 +#define TK_NMATCH 240 +#define TK_CONTAINS 241 +#define TK_IN 242 +#define TK_JOIN 243 +#define TK_INNER 244 +#define TK_SELECT 245 +#define TK_DISTINCT 246 +#define TK_WHERE 247 +#define TK_PARTITION 248 +#define TK_BY 249 +#define TK_SESSION 250 +#define TK_STATE_WINDOW 251 +#define TK_SLIDING 252 +#define TK_FILL 253 +#define TK_VALUE 254 +#define TK_NONE 255 +#define TK_PREV 256 +#define TK_LINEAR 257 +#define TK_NEXT 258 +#define TK_HAVING 259 +#define TK_RANGE 260 +#define TK_EVERY 261 +#define TK_ORDER 262 +#define TK_SLIMIT 263 +#define TK_SOFFSET 264 +#define TK_LIMIT 265 +#define TK_OFFSET 266 +#define TK_ASC 267 +#define TK_NULLS 268 +#define TK_ABORT 269 +#define TK_AFTER 270 +#define TK_ATTACH 271 +#define TK_BEFORE 272 +#define TK_BEGIN 273 +#define TK_BITAND 274 +#define TK_BITNOT 275 +#define TK_BITOR 276 +#define TK_BLOCKS 277 +#define TK_CHANGE 278 +#define TK_COMMA 279 +#define TK_COMPACT 280 +#define TK_CONCAT 281 +#define TK_CONFLICT 282 +#define TK_COPY 283 +#define TK_DEFERRED 284 +#define TK_DELIMITERS 285 +#define TK_DETACH 286 +#define TK_DIVIDE 287 +#define TK_DOT 288 +#define TK_EACH 289 +#define TK_FAIL 290 +#define TK_FILE 291 +#define TK_FOR 292 +#define TK_GLOB 293 +#define TK_ID 294 +#define TK_IMMEDIATE 295 +#define TK_IMPORT 296 +#define TK_INITIALLY 297 +#define TK_INSTEAD 298 +#define TK_ISNULL 299 +#define TK_KEY 300 +#define TK_MODULES 301 +#define TK_NK_BITNOT 302 +#define TK_NK_SEMI 303 +#define TK_NOTNULL 304 +#define TK_OF 305 +#define TK_PLUS 306 +#define TK_PRIVILEGE 307 +#define TK_RAISE 308 +#define TK_REPLACE 309 +#define TK_RESTRICT 310 +#define TK_ROW 311 +#define TK_SEMI 312 +#define TK_STAR 313 +#define TK_STATEMENT 314 +#define TK_STRING 315 +#define TK_TIMES 316 +#define TK_UPDATE 317 +#define TK_VALUES 318 +#define TK_VARIABLE 319 +#define TK_VIEW 320 +#define TK_WAL 321 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index e69c6e747d..b1054e7b85 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -133,6 +133,9 @@ typedef struct STableOptions { SNodeList* pWatermark; int64_t watermark1; int64_t watermark2; + SNodeList* pDeleteMark; + int64_t deleteMark1; + int64_t deleteMark2; SNodeList* pRollupFuncs; int32_t ttl; SNodeList* pSma; @@ -383,6 +386,7 @@ typedef struct SStreamOptions { int8_t triggerType; SNode* pDelay; SNode* pWatermark; + SNode* pDeleteMark; int8_t fillHistory; int8_t ignoreExpired; } SStreamOptions; diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 574d41db58..d62bdb93cf 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -91,6 +91,7 @@ typedef struct SScanLogicNode { SNode* pTagIndexCond; int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; SArray* pSmaIndexes; SNodeList* pGroupTags; @@ -213,6 +214,7 @@ typedef struct SWindowLogicNode { SNode* pStateExpr; int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; EWindowAlgorithm windowAlgo; EOrder inputTsOrder; @@ -440,6 +442,7 @@ typedef struct SWinodwPhysiNode { SNode* pTsEnd; // window end timestamp int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; EOrder inputTsOrder; EOrder outputTsOrder; diff --git a/include/libs/planner/planner.h b/include/libs/planner/planner.h index 82f5c478c1..f7bd68393e 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; + int64_t deleteMark; int8_t igExpired; char* pMsg; int32_t msgLen; diff --git a/include/util/tdef.h b/include/util/tdef.h index 6ce7b737a8..58c8c1b51a 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -280,7 +280,7 @@ typedef enum ELogicConditionType { #define TSDB_DNODE_ROLE_MGMT 1 #define TSDB_DNODE_ROLE_VNODE 2 -#define TSDB_MAX_REPLICA 5 +#define TSDB_MAX_REPLICA 5 #define TSDB_SYNC_LOG_BUFFER_SIZE 4096 #define TSDB_TBNAME_COLUMN_INDEX (-1) @@ -381,13 +381,16 @@ typedef enum ELogicConditionType { #define TSDB_DB_MIN_WAL_SEGMENT_SIZE 0 #define TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE 0 -#define TSDB_MIN_ROLLUP_MAX_DELAY 1 // unit millisecond -#define TSDB_MAX_ROLLUP_MAX_DELAY (15 * 60 * 1000) -#define TSDB_MIN_ROLLUP_WATERMARK 0 // unit millisecond -#define TSDB_MAX_ROLLUP_WATERMARK (15 * 60 * 1000) -#define TSDB_DEFAULT_ROLLUP_WATERMARK 5000 -#define TSDB_MIN_TABLE_TTL 0 -#define TSDB_DEFAULT_TABLE_TTL 0 +#define TSDB_MIN_ROLLUP_MAX_DELAY 1 // unit millisecond +#define TSDB_MAX_ROLLUP_MAX_DELAY (15 * 60 * 1000) +#define TSDB_MIN_ROLLUP_WATERMARK 0 // unit millisecond +#define TSDB_MAX_ROLLUP_WATERMARK (15 * 60 * 1000) +#define TSDB_DEFAULT_ROLLUP_WATERMARK 5000 +#define TSDB_MIN_ROLLUP_DELETE_MARK 0 // unit millisecond +#define TSDB_MAX_ROLLUP_DELETE_MARK INT64_MAX +#define TSDB_DEFAULT_ROLLUP_DELETE_MARK 900000 // 900s +#define TSDB_MIN_TABLE_TTL 0 +#define TSDB_DEFAULT_TABLE_TTL 0 #define TSDB_MIN_EXPLAIN_RATIO 0 #define TSDB_MAX_EXPLAIN_RATIO 1 diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 5b16a55ae3..00929a1836 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -551,6 +551,8 @@ int32_t tSerializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pReq if (pReq->ast2Len > 0) { if (tEncodeBinary(&encoder, pReq->pAst2, pReq->ast2Len) < 0) return -1; } + if (tEncodeI64(&encoder, pReq->deleteMark1) < 0) return -1; + if (tEncodeI64(&encoder, pReq->deleteMark2) < 0) return -1; tEndEncode(&encoder); @@ -644,6 +646,9 @@ int32_t tDeserializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pR if (tDecodeCStrTo(&decoder, pReq->pAst2) < 0) return -1; } + if (tDecodeI64(&decoder, &pReq->deleteMark1) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->deleteMark2) < 0) return -1; + tEndDecode(&decoder); tDecoderClear(&decoder); return 0; @@ -822,6 +827,7 @@ int32_t tSerializeSMCreateSmaReq(void *buf, int32_t bufLen, SMCreateSmaReq *pReq if (pReq->astLen > 0) { if (tEncodeBinary(&encoder, pReq->ast, pReq->astLen) < 0) return -1; } + if (tEncodeI64(&encoder, pReq->deleteMark) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -870,7 +876,7 @@ int32_t tDeserializeSMCreateSmaReq(void *buf, int32_t bufLen, SMCreateSmaReq *pR if (pReq->ast == NULL) return -1; if (tDecodeCStrTo(&decoder, pReq->ast) < 0) return -1; } - + if (tDecodeI64(&decoder, &pReq->deleteMark) < 0) return -1; tEndDecode(&decoder); tDecoderClear(&decoder); return 0; @@ -992,7 +998,7 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) { if (tEncodeI32(&encoder, vlen) < 0) return -1; for (int32_t i = 0; i < vlen; ++i) { SVnodeLoad *pload = taosArrayGet(pReq->pVloads, i); - int64_t reserved = 0; + int64_t reserved = 0; if (tEncodeI32(&encoder, pload->vgId) < 0) return -1; if (tEncodeI8(&encoder, pload->syncState) < 0) return -1; if (tEncodeI8(&encoder, pload->syncRestore) < 0) return -1; diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 9961828747..3d36259485 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -644,6 +644,7 @@ typedef struct { // 3.0.20 int64_t checkpointFreq; // ms int64_t currentTick; // do not serialize + int64_t deleteMark; } SStreamObj; int32_t tEncodeSStreamObj(SEncoder* pEncoder, const SStreamObj* pObj); diff --git a/source/dnode/mnode/impl/inc/mndScheduler.h b/source/dnode/mnode/impl/inc/mndScheduler.h index db81d8843e..23085c53ee 100644 --- a/source/dnode/mnode/impl/inc/mndScheduler.h +++ b/source/dnode/mnode/impl/inc/mndScheduler.h @@ -28,7 +28,7 @@ void mndCleanupScheduler(SMnode* pMnode); int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscribeObj* pSub); int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64_t uid, int8_t triggerType, - int64_t watermark); + int64_t watermark, int64_t deleteMark); int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream); diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index f71bd1c626..af1a29def0 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -42,7 +42,7 @@ static int32_t mndAddTaskToTaskSet(SArray* pArray, SStreamTask* pTask) { } int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64_t uid, int8_t triggerType, - int64_t watermark) { + int64_t watermark, int64_t deleteMark) { SNode* pAst = NULL; SQueryPlan* pPlan = NULL; terrno = TSDB_CODE_SUCCESS; @@ -64,6 +64,7 @@ int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64 .rSmaQuery = true, .triggerType = triggerType, .watermark = watermark, + .deleteMark = deleteMark, }; if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) { diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index f9d0a9b9ba..e6a6e6ae5b 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -534,6 +534,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea streamObj.sql = strdup(pCreate->sql); streamObj.smaId = smaObj.uid; streamObj.watermark = pCreate->watermark; + streamObj.deleteMark = pCreate->deleteMark; streamObj.fillHistory = STREAM_FILL_HISTORY_ON; streamObj.trigger = STREAM_TRIGGER_WINDOW_CLOSE; streamObj.triggerParam = pCreate->maxDelay; @@ -574,6 +575,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea .streamQuery = true, .triggerType = streamObj.trigger, .watermark = streamObj.watermark, + .deleteMark = streamObj.deleteMark, }; if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) { diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 2ed4fde509..c611cfb6e1 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -450,13 +450,15 @@ static void *mndBuildVCreateStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pSt req.rsmaParam.watermark[1] = pStb->watermark[1]; if (pStb->ast1Len > 0) { if (mndConvertRsmaTask(&req.rsmaParam.qmsg[0], &req.rsmaParam.qmsgLen[0], pStb->pAst1, pStb->uid, - STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[0]) < 0) { + STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[0], + req.rsmaParam.deleteMark[0]) < 0) { goto _err; } } if (pStb->ast2Len > 0) { if (mndConvertRsmaTask(&req.rsmaParam.qmsg[1], &req.rsmaParam.qmsgLen[1], pStb->pAst2, pStb->uid, - STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[1]) < 0) { + STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[1], + req.rsmaParam.deleteMark[1]) < 0) { goto _err; } } diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 5b3e8ce5a9..5d20dbd764 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -378,6 +378,7 @@ static int32_t logicScanCopy(const SScanLogicNode* pSrc, SScanLogicNode* pDst) { CLONE_NODE_FIELD(pTagIndexCond); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); + COPY_SCALAR_FIELD(deleteMark); COPY_SCALAR_FIELD(igExpired); CLONE_NODE_LIST_FIELD(pGroupTags); COPY_SCALAR_FIELD(groupSort); @@ -463,6 +464,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(deleteMark); COPY_SCALAR_FIELD(igExpired); COPY_SCALAR_FIELD(windowAlgo); COPY_SCALAR_FIELD(inputTsOrder); diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 352e78c2fc..d062ed34c4 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -819,6 +819,7 @@ static const char* jkWindowLogicPlanTspk = "Tspk"; static const char* jkWindowLogicPlanStateExpr = "StateExpr"; static const char* jkWindowLogicPlanTriggerType = "TriggerType"; static const char* jkWindowLogicPlanWatermark = "Watermark"; +static const char* jkWindowLogicPlanDeleteMark = "DeleteMark"; static int32_t logicWindowNodeToJson(const void* pObj, SJson* pJson) { const SWindowLogicNode* pNode = (const SWindowLogicNode*)pObj; @@ -860,6 +861,9 @@ static int32_t logicWindowNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowLogicPlanWatermark, pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkWindowLogicPlanDeleteMark, pNode->deleteMark); + } return code; } @@ -904,6 +908,9 @@ static int32_t jsonToLogicWindowNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = tjsonGetBigIntValue(pJson, jkWindowLogicPlanWatermark, &pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkWindowLogicPlanDeleteMark, &pNode->deleteMark); + } return code; } @@ -2004,6 +2011,7 @@ static const char* jkWindowPhysiPlanTsPk = "TsPk"; static const char* jkWindowPhysiPlanTsEnd = "TsEnd"; static const char* jkWindowPhysiPlanTriggerType = "TriggerType"; static const char* jkWindowPhysiPlanWatermark = "Watermark"; +static const char* jkWindowPhysiPlanDeleteMark = "DeleteMark"; static const char* jkWindowPhysiPlanIgnoreExpired = "IgnoreExpired"; static const char* jkWindowPhysiPlanInputTsOrder = "InputTsOrder"; static const char* jkWindowPhysiPlanOutputTsOrder = "outputTsOrder"; @@ -2031,6 +2039,9 @@ static int32_t physiWindowNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanWatermark, pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanDeleteMark, pNode->deleteMark); + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanIgnoreExpired, pNode->igExpired); } @@ -2069,6 +2080,9 @@ static int32_t jsonToPhysiWindowNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = tjsonGetBigIntValue(pJson, jkWindowPhysiPlanWatermark, &pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkWindowPhysiPlanDeleteMark, &pNode->deleteMark); + } if (TSDB_CODE_SUCCESS == code) { code = tjsonGetTinyIntValue(pJson, jkWindowPhysiPlanIgnoreExpired, &pNode->igExpired); } @@ -3532,6 +3546,18 @@ static int32_t groupingSetNodeToJson(const void* pObj, SJson* pJson) { return code; } +static int32_t jsonToGroupingSetNode(const SJson* pJson, void* pObj) { + SGroupingSetNode* pNode = (SGroupingSetNode*)pObj; + + int32_t code = TSDB_CODE_SUCCESS; + tjsonGetNumberValue(pJson, jkGroupingSetType, pNode->groupingSetType, code); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkGroupingSetParameter, &pNode->pParameterList); + } + + return code; +} + static const char* jkOrderByExprExpr = "Expr"; static const char* jkOrderByExprOrder = "Order"; static const char* jkOrderByExprNullOrder = "NullOrder"; @@ -4729,6 +4755,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToRealTableNode(pJson, pObj); case QUERY_NODE_TEMP_TABLE: return jsonToTempTableNode(pJson, pObj); + case QUERY_NODE_GROUPING_SET: + return jsonToGroupingSetNode(pJson, pObj); case QUERY_NODE_ORDER_BY_EXPR: return jsonToOrderByExprNode(pJson, pObj); case QUERY_NODE_LIMIT: diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index bf6cd33af7..cc9cb31d18 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -2607,6 +2607,7 @@ enum { PHY_WINDOW_CODE_TS_END, PHY_WINDOW_CODE_TRIGGER_TYPE, PHY_WINDOW_CODE_WATERMARK, + PHY_WINDOW_CODE_DELETE_MARK, PHY_WINDOW_CODE_IG_EXPIRED, PHY_WINDOW_CODE_INPUT_TS_ORDER, PHY_WINDOW_CODE_OUTPUT_TS_ORDER, @@ -2635,6 +2636,9 @@ static int32_t physiWindowNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { if (TSDB_CODE_SUCCESS == code) { code = tlvEncodeI64(pEncoder, PHY_WINDOW_CODE_WATERMARK, pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeI64(pEncoder, PHY_WINDOW_CODE_DELETE_MARK, pNode->deleteMark); + } if (TSDB_CODE_SUCCESS == code) { code = tlvEncodeI8(pEncoder, PHY_WINDOW_CODE_IG_EXPIRED, pNode->igExpired); } @@ -2679,6 +2683,9 @@ static int32_t msgToPhysiWindowNode(STlvDecoder* pDecoder, void* pObj) { case PHY_WINDOW_CODE_WATERMARK: code = tlvDecodeI64(pTlv, &pNode->watermark); break; + case PHY_WINDOW_CODE_DELETE_MARK: + code = tlvDecodeI64(pTlv, &pNode->deleteMark); + break; case PHY_WINDOW_CODE_IG_EXPIRED: code = tlvDecodeI8(pTlv, &pNode->igExpired); break; diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index de51e9d9f3..cd5ae7ad6e 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -596,6 +596,13 @@ static void destroyWinodwPhysiNode(SWinodwPhysiNode* pNode) { nodesDestroyNode(pNode->pTsEnd); } +static void destroyPartitionPhysiNode(SPartitionPhysiNode* pNode) { + destroyPhysiNode((SPhysiNode*)pNode); + nodesDestroyList(pNode->pExprs); + nodesDestroyList(pNode->pPartitionKeys); + nodesDestroyList(pNode->pTargets); +} + static void destroyScanPhysiNode(SScanPhysiNode* pNode) { destroyPhysiNode((SPhysiNode*)pNode); nodesDestroyList(pNode->pScanCols); @@ -733,6 +740,7 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyList(pOptions->pWatermark); nodesDestroyList(pOptions->pRollupFuncs); nodesDestroyList(pOptions->pSma); + nodesDestroyList(pOptions->pDeleteMark); break; } case QUERY_NODE_INDEX_OPTIONS: { @@ -750,6 +758,7 @@ void nodesDestroyNode(SNode* pNode) { SStreamOptions* pOptions = (SStreamOptions*)pNode; nodesDestroyNode(pOptions->pDelay); nodesDestroyNode(pOptions->pWatermark); + nodesDestroyNode(pOptions->pDeleteMark); break; } case QUERY_NODE_LEFT_VALUE: // no pointer field @@ -905,6 +914,8 @@ void nodesDestroyNode(SNode* pNode) { SCreateStreamStmt* pStmt = (SCreateStreamStmt*)pNode; nodesDestroyNode((SNode*)pStmt->pOptions); nodesDestroyNode(pStmt->pQuery); + nodesDestroyList(pStmt->pTags); + nodesDestroyNode(pStmt->pSubtable); break; } case QUERY_NODE_DROP_STREAM_STMT: // no pointer field @@ -1020,6 +1031,8 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pLogicNode->pTagIndexCond); taosArrayDestroyEx(pLogicNode->pSmaIndexes, destroySmaIndex); nodesDestroyList(pLogicNode->pGroupTags); + nodesDestroyList(pLogicNode->pTags); + nodesDestroyNode(pLogicNode->pSubtable); break; } case QUERY_NODE_LOGIC_PLAN_JOIN: { @@ -1092,6 +1105,8 @@ void nodesDestroyNode(SNode* pNode) { SPartitionLogicNode* pLogicNode = (SPartitionLogicNode*)pNode; destroyLogicNode((SLogicNode*)pLogicNode); nodesDestroyList(pLogicNode->pPartitionKeys); + nodesDestroyList(pLogicNode->pTags); + nodesDestroyNode(pLogicNode->pSubtable); break; } case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: { @@ -1122,10 +1137,10 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: case QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN: - case QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN: destroyScanPhysiNode((SScanPhysiNode*)pNode); break; - case QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN: { + case QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN: + case QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN: { SLastRowScanPhysiNode* pPhyNode = (SLastRowScanPhysiNode*)pNode; destroyScanPhysiNode((SScanPhysiNode*)pNode); nodesDestroyList(pPhyNode->pGroupTags); @@ -1139,6 +1154,8 @@ void nodesDestroyNode(SNode* pNode) { destroyScanPhysiNode((SScanPhysiNode*)pNode); nodesDestroyList(pPhyNode->pDynamicScanFuncs); nodesDestroyList(pPhyNode->pGroupTags); + nodesDestroyList(pPhyNode->pTags); + nodesDestroyNode(pPhyNode->pSubtable); break; } case QUERY_NODE_PHYSICAL_PLAN_PROJECT: { @@ -1215,13 +1232,15 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pPhyNode->pStateKey); break; } - case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { + destroyPartitionPhysiNode((SPartitionPhysiNode*)pNode); + break; + } case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: { - SPartitionPhysiNode* pPhyNode = (SPartitionPhysiNode*)pNode; - destroyPhysiNode((SPhysiNode*)pPhyNode); - nodesDestroyList(pPhyNode->pExprs); - nodesDestroyList(pPhyNode->pPartitionKeys); - nodesDestroyList(pPhyNode->pTargets); + SStreamPartitionPhysiNode* pPhyNode = (SStreamPartitionPhysiNode*)pNode; + destroyPartitionPhysiNode((SPartitionPhysiNode*)pPhyNode); + nodesDestroyList(pPhyNode->pTags); + nodesDestroyNode(pPhyNode->pSubtable); break; } case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: { diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index a6c56f3ae4..ef67c7536f 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -72,7 +72,8 @@ typedef enum ETableOptionType { TABLE_OPTION_WATERMARK, TABLE_OPTION_ROLLUP, TABLE_OPTION_TTL, - TABLE_OPTION_SMA + TABLE_OPTION_SMA, + TABLE_OPTION_DELETE_MARK } ETableOptionType; typedef struct SAlterOption { diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 6521161244..b060f7fc83 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -362,6 +362,7 @@ table_options(A) ::= table_options(B) WATERMARK duration_list(C). table_options(A) ::= table_options(B) ROLLUP NK_LP rollup_func_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_ROLLUP, C); } table_options(A) ::= table_options(B) TTL NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_TTL, &C); } table_options(A) ::= table_options(B) SMA NK_LP col_name_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_SMA, C); } +table_options(A) ::= table_options(B) DELETE_MARK duration_list(C). { A = setTableOption(pCxt, B, TABLE_OPTION_DELETE_MARK, C); } alter_table_options(A) ::= alter_table_option(B). { A = createAlterTableOptions(pCxt); A = setTableOption(pCxt, A, B.type, &B.val); } alter_table_options(A) ::= alter_table_options(B) alter_table_option(C). { A = setTableOption(pCxt, B, C.type, &C.val); } @@ -475,8 +476,9 @@ func_list(A) ::= func_list(B) NK_COMMA func(C). func(A) ::= function_name(B) NK_LP expression_list(C) NK_RP. { A = createFunctionNode(pCxt, &B, C); } sma_stream_opt(A) ::= . { A = createStreamOptions(pCxt); } -sma_stream_opt(A) ::= stream_options(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; } -sma_stream_opt(A) ::= stream_options(B) MAX_DELAY duration_literal(C). { ((SStreamOptions*)B)->pDelay = releaseRawExprNode(pCxt, C); A = B; } +sma_stream_opt(A) ::= sma_stream_opt(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; } +sma_stream_opt(A) ::= sma_stream_opt(B) MAX_DELAY duration_literal(C). { ((SStreamOptions*)B)->pDelay = releaseRawExprNode(pCxt, C); A = B; } +sma_stream_opt(A) ::= sma_stream_opt(B) DELETE_MARK duration_literal(C). { ((SStreamOptions*)B)->pDeleteMark = releaseRawExprNode(pCxt, C); A = B; } /************************************************ create/drop topic ***************************************************/ cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B) AS query_or_subquery(C). { pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, A, &B, C); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 40fb422c49..b23adaabb5 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -1124,6 +1124,9 @@ SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType case TABLE_OPTION_SMA: ((STableOptions*)pOptions)->pSma = pVal; break; + case TABLE_OPTION_DELETE_MARK: + ((STableOptions*)pOptions)->pDeleteMark = pVal; + break; default: break; } diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 7123173161..e62b2f0f5a 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -74,6 +74,7 @@ static SKeyword keywordTable[] = { {"DATABASES", TK_DATABASES}, {"DBS", TK_DBS}, {"DELETE", TK_DELETE}, + {"DELETE_MARK", TK_DELETE_MARK}, {"DESC", TK_DESC}, {"DESCRIBE", TK_DESCRIBE}, {"DISTINCT", TK_DISTINCT}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 049d18e20a..85a4e70124 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -3804,10 +3804,11 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS return buildCreateDbRetentions(pStmt->pOptions->pRetentions, pReq); } -static int32_t checkRangeOption(STranslateContext* pCxt, int32_t code, const char* pName, int32_t val, int32_t minVal, - int32_t maxVal) { +static int32_t checkRangeOption(STranslateContext* pCxt, int32_t code, const char* pName, int64_t val, int64_t minVal, + int64_t maxVal) { if (val >= 0 && (val < minVal || val > maxVal)) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, code, "Invalid option %s: %d valid range: [%d, %d]", pName, val, + return generateSyntaxErrMsgExt(&pCxt->msgBuf, code, + "Invalid option %s: %" PRId64 " valid range: [%" PRId64 ", %" PRId64 "]", pName, val, minVal, maxVal); } return TSDB_CODE_SUCCESS; @@ -3818,8 +3819,8 @@ static int32_t checkDbRangeOption(STranslateContext* pCxt, const char* pName, in return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_DB_OPTION, pName, val, minVal, maxVal); } -static int32_t checkTableRangeOption(STranslateContext* pCxt, const char* pName, int32_t val, int32_t minVal, - int32_t maxVal) { +static int32_t checkTableRangeOption(STranslateContext* pCxt, const char* pName, int64_t val, int64_t minVal, + int64_t maxVal) { return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_TABLE_OPTION, pName, val, minVal, maxVal); } @@ -4463,6 +4464,37 @@ static int32_t checkTableWatermarkOption(STranslateContext* pCxt, STableOptions* return code; } +static int32_t getTableDeleteMarkOption(STranslateContext* pCxt, SValueNode* pVal, int64_t* pMaxDelay) { + return getTableDelayOrWatermarkOption(pCxt, "delete_mark", TSDB_MIN_ROLLUP_DELETE_MARK, TSDB_MAX_ROLLUP_DELETE_MARK, + pVal, pMaxDelay); +} + +static int32_t checkTableDeleteMarkOption(STranslateContext* pCxt, STableOptions* pOptions, bool createStable, + SDbCfgInfo* pDbCfg) { + if (NULL == pOptions->pDeleteMark) { + return TSDB_CODE_SUCCESS; + } + + if (!createStable || NULL == pDbCfg->pRetensions) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TABLE_OPTION, + "Invalid option delete_mark: Only supported for create super table in databases " + "configured with the 'RETENTIONS' option"); + } + + if (LIST_LENGTH(pOptions->pDeleteMark) > 2) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TABLE_OPTION, "Invalid option delete_mark"); + } + + int32_t code = + getTableDeleteMarkOption(pCxt, (SValueNode*)nodesListGetNode(pOptions->pDeleteMark, 0), &pOptions->deleteMark1); + if (TSDB_CODE_SUCCESS == code && 2 == LIST_LENGTH(pOptions->pDeleteMark)) { + code = + getTableDeleteMarkOption(pCxt, (SValueNode*)nodesListGetNode(pOptions->pDeleteMark, 1), &pOptions->deleteMark2); + } + + return code; +} + static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt, bool createStable) { if (NULL != strchr(pStmt->tableName, '.')) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME, @@ -4482,6 +4514,9 @@ static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt if (TSDB_CODE_SUCCESS == code) { code = checkTableWatermarkOption(pCxt, pStmt->pOptions, createStable, &dbCfg); } + if (TSDB_CODE_SUCCESS == code) { + code = checkTableDeleteMarkOption(pCxt, pStmt->pOptions, createStable, &dbCfg); + } if (TSDB_CODE_SUCCESS == code) { code = checkTableRollupOption(pCxt, pStmt->pOptions->pRollupFuncs, createStable, &dbCfg); } @@ -4749,6 +4784,8 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm pReq->delay2 = pStmt->pOptions->maxDelay2; pReq->watermark1 = pStmt->pOptions->watermark1; pReq->watermark2 = pStmt->pOptions->watermark2; + pReq->deleteMark1 = pStmt->pOptions->deleteMark1; + pReq->deleteMark2 = pStmt->pOptions->deleteMark2; pReq->colVer = 1; pReq->tagVer = 1; pReq->source = TD_REQ_FROM_APP; @@ -5144,20 +5181,34 @@ static int32_t buildCreateSmaReq(STranslateContext* pCxt, SCreateIndexStmt* pStm (NULL != pStmt->pOptions->pSliding ? ((SValueNode*)pStmt->pOptions->pSliding)->datum.i : pReq->interval); pReq->slidingUnit = (NULL != pStmt->pOptions->pSliding ? ((SValueNode*)pStmt->pOptions->pSliding)->unit : pReq->intervalUnit); + + int32_t code = TSDB_CODE_SUCCESS; if (NULL != pStmt->pOptions->pStreamOptions) { SStreamOptions* pStreamOpt = (SStreamOptions*)pStmt->pOptions->pStreamOptions; - pReq->maxDelay = (NULL != pStreamOpt->pDelay ? ((SValueNode*)pStreamOpt->pDelay)->datum.i : -1); - pReq->watermark = (NULL != pStreamOpt->pWatermark ? ((SValueNode*)pStreamOpt->pWatermark)->datum.i - : TSDB_DEFAULT_ROLLUP_WATERMARK); - if (pReq->watermark < TSDB_MIN_ROLLUP_WATERMARK) { - pReq->watermark = TSDB_MIN_ROLLUP_WATERMARK; + if (NULL != pStreamOpt->pDelay) { + code = getTableMaxDelayOption(pCxt, (SValueNode*)pStreamOpt->pDelay, &pReq->maxDelay); + } else { + pReq->maxDelay = -1; } - if (pReq->watermark > TSDB_MAX_ROLLUP_WATERMARK) { - pReq->watermark = TSDB_MAX_ROLLUP_WATERMARK; + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pStreamOpt->pWatermark) { + code = getTableWatermarkOption(pCxt, (SValueNode*)pStreamOpt->pWatermark, &pReq->watermark); + } else { + pReq->watermark = TSDB_DEFAULT_ROLLUP_WATERMARK; + } + } + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pStreamOpt->pDeleteMark) { + code = getTableDeleteMarkOption(pCxt, (SValueNode*)pStreamOpt->pDeleteMark, &pReq->deleteMark); + } else { + pReq->deleteMark = TSDB_DEFAULT_ROLLUP_DELETE_MARK; + } } } - int32_t code = getSmaIndexDstVgId(pCxt, pStmt->dbName, pStmt->tableName, &pReq->dstVgId); + if (TSDB_CODE_SUCCESS == code) { + code = getSmaIndexDstVgId(pCxt, pStmt->dbName, pStmt->tableName, &pReq->dstVgId); + } if (TSDB_CODE_SUCCESS == code) { code = getSmaIndexSql(pCxt, &pReq->sql, &pReq->sqlLen); } @@ -5185,16 +5236,6 @@ static int32_t checkCreateSmaIndex(STranslateContext* pCxt, SCreateIndexStmt* pS code = doTranslateValue(pCxt, (SValueNode*)pStmt->pOptions->pSliding); } - if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pOptions->pStreamOptions) { - SStreamOptions* pStreamOpt = (SStreamOptions*)pStmt->pOptions->pStreamOptions; - if (NULL != pStreamOpt->pWatermark) { - code = doTranslateValue(pCxt, (SValueNode*)pStreamOpt->pWatermark); - } - if (TSDB_CODE_SUCCESS == code && NULL != pStreamOpt->pDelay) { - code = doTranslateValue(pCxt, (SValueNode*)pStreamOpt->pDelay); - } - } - return code; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 616793e897..b4d4a3457e 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 456 +#define YYNOCODE 457 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EOrder yy50; - int64_t yy93; - SNode* yy104; - bool yy185; - int32_t yy196; - EJoinType yy228; - EFillMode yy246; - SAlterOption yy557; - SNodeList* yy616; - SDataType yy640; - EOperatorType yy668; - int8_t yy695; - SToken yy737; - ENullOrder yy793; + EOperatorType yy20; + int8_t yy33; + SAlterOption yy123; + SNode* yy148; + SToken yy199; + EFillMode yy334; + bool yy397; + SNodeList* yy404; + EJoinType yy470; + ENullOrder yy499; + int64_t yy525; + SDataType yy530; + int32_t yy706; + EOrder yy898; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 707 -#define YYNRULE 538 -#define YYNTOKEN 321 -#define YY_MAX_SHIFT 706 -#define YY_MIN_SHIFTREDUCE 1049 -#define YY_MAX_SHIFTREDUCE 1586 -#define YY_ERROR_ACTION 1587 -#define YY_ACCEPT_ACTION 1588 -#define YY_NO_ACTION 1589 -#define YY_MIN_REDUCE 1590 -#define YY_MAX_REDUCE 2127 +#define YYNSTATE 710 +#define YYNRULE 540 +#define YYNTOKEN 322 +#define YY_MAX_SHIFT 709 +#define YY_MIN_SHIFTREDUCE 1052 +#define YY_MAX_SHIFTREDUCE 1591 +#define YY_ERROR_ACTION 1592 +#define YY_ACCEPT_ACTION 1593 +#define YY_NO_ACTION 1594 +#define YY_MIN_REDUCE 1595 +#define YY_MAX_REDUCE 2134 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,703 +216,694 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2544) +#define YY_ACTTAB_COUNT (2410) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 396, 2103, 349, 1858, 455, 2098, 456, 1626, 33, 274, - /* 10 */ 156, 578, 43, 41, 1517, 464, 168, 456, 1626, 1747, - /* 20 */ 357, 2102, 1368, 36, 35, 2099, 2101, 42, 40, 39, - /* 30 */ 38, 37, 595, 1447, 158, 1366, 1943, 329, 1844, 1698, - /* 40 */ 524, 540, 36, 35, 579, 2098, 42, 40, 39, 38, - /* 50 */ 37, 1394, 540, 522, 348, 520, 2098, 1855, 1442, 25, - /* 60 */ 2104, 174, 370, 16, 156, 2099, 561, 1961, 1791, 1792, - /* 70 */ 1374, 2104, 174, 1748, 2103, 575, 2099, 561, 2098, 572, - /* 80 */ 1912, 595, 612, 43, 41, 42, 40, 39, 38, 37, - /* 90 */ 159, 357, 1602, 1368, 2102, 1797, 12, 322, 2099, 2100, - /* 100 */ 11, 10, 350, 540, 1447, 1942, 1366, 2098, 62, 1977, - /* 110 */ 131, 1795, 100, 1944, 616, 1946, 1947, 611, 703, 606, - /* 120 */ 258, 603, 2104, 174, 171, 212, 2030, 2099, 561, 1442, - /* 130 */ 351, 2026, 1449, 1450, 16, 39, 38, 37, 473, 1476, - /* 140 */ 163, 1374, 2045, 402, 176, 1930, 490, 486, 482, 478, - /* 150 */ 209, 362, 2056, 80, 1790, 1792, 1926, 46, 58, 1797, - /* 160 */ 85, 1423, 1432, 1252, 1253, 1797, 326, 12, 2042, 255, - /* 170 */ 2038, 571, 361, 124, 570, 1795, 1741, 2098, 1393, 226, - /* 180 */ 1369, 1795, 1367, 317, 1922, 1928, 340, 81, 555, 703, - /* 190 */ 207, 1840, 559, 174, 1477, 606, 1490, 2099, 561, 1613, - /* 200 */ 58, 461, 182, 1449, 1450, 1372, 1373, 457, 1422, 1425, - /* 210 */ 1426, 1427, 1428, 1429, 1430, 1431, 608, 604, 1440, 1441, - /* 220 */ 1443, 1444, 1445, 1446, 1448, 1451, 2, 510, 509, 508, - /* 230 */ 560, 595, 1423, 1432, 2098, 128, 504, 1395, 82, 319, - /* 240 */ 503, 502, 585, 1912, 583, 1588, 501, 507, 1514, 559, - /* 250 */ 174, 1369, 500, 1367, 2099, 561, 206, 200, 1612, 205, - /* 260 */ 438, 550, 469, 1468, 1543, 32, 355, 1471, 1472, 1473, - /* 270 */ 1474, 1475, 1479, 1480, 1481, 1482, 1372, 1373, 198, 1422, - /* 280 */ 1425, 1426, 1427, 1428, 1429, 1430, 1431, 608, 604, 1440, - /* 290 */ 1441, 1443, 1444, 1445, 1446, 1448, 1451, 2, 170, 9, - /* 300 */ 43, 41, 1912, 506, 505, 177, 177, 46, 357, 372, - /* 310 */ 1368, 1784, 547, 1541, 1542, 1544, 1545, 190, 189, 1305, - /* 320 */ 1306, 1447, 1943, 1366, 1210, 638, 637, 636, 1214, 635, - /* 330 */ 1216, 1217, 634, 1219, 631, 1393, 1225, 628, 1227, 1228, - /* 340 */ 625, 622, 391, 97, 556, 551, 1442, 1101, 177, 1100, - /* 350 */ 540, 16, 454, 1961, 2098, 459, 1632, 132, 1374, 674, - /* 360 */ 672, 613, 211, 393, 389, 1737, 1912, 567, 612, 2104, - /* 370 */ 174, 43, 41, 1452, 2099, 561, 29, 1961, 1102, 357, - /* 380 */ 257, 1368, 36, 35, 12, 554, 42, 40, 39, 38, - /* 390 */ 37, 1942, 1447, 463, 1366, 1977, 459, 1632, 160, 1944, - /* 400 */ 616, 1946, 1947, 611, 596, 606, 703, 1943, 36, 35, - /* 410 */ 2045, 58, 42, 40, 39, 38, 37, 1442, 123, 264, - /* 420 */ 1449, 1450, 647, 50, 553, 494, 36, 35, 539, 1374, - /* 430 */ 42, 40, 39, 38, 37, 1745, 2041, 1170, 1961, 541, - /* 440 */ 2067, 147, 146, 644, 643, 642, 613, 91, 579, 1423, - /* 450 */ 1432, 1912, 58, 612, 560, 44, 2050, 1510, 2098, 36, - /* 460 */ 35, 1856, 1394, 42, 40, 39, 38, 37, 1369, 1738, - /* 470 */ 1367, 1396, 1172, 559, 174, 1611, 1942, 703, 2099, 561, - /* 480 */ 1977, 1345, 1346, 161, 1944, 616, 1946, 1947, 611, 1513, - /* 490 */ 606, 1449, 1450, 1372, 1373, 47, 1422, 1425, 1426, 1427, - /* 500 */ 1428, 1429, 1430, 1431, 608, 604, 1440, 1441, 1443, 1444, - /* 510 */ 1445, 1446, 1448, 1451, 2, 1553, 1082, 1610, 1609, 1912, - /* 520 */ 1423, 1432, 1591, 113, 1087, 1088, 112, 111, 110, 109, - /* 530 */ 108, 107, 106, 105, 104, 562, 2119, 265, 266, 1369, - /* 540 */ 9, 1367, 7, 113, 1722, 1608, 112, 111, 110, 109, - /* 550 */ 108, 107, 106, 105, 104, 1084, 1393, 1087, 1088, 177, - /* 560 */ 649, 1912, 1912, 155, 1372, 1373, 1478, 1422, 1425, 1426, - /* 570 */ 1427, 1428, 1429, 1430, 1431, 608, 604, 1440, 1441, 1443, - /* 580 */ 1444, 1445, 1446, 1448, 1451, 2, 43, 41, 568, 1912, - /* 590 */ 706, 515, 1392, 1101, 357, 1100, 1368, 1840, 319, 596, - /* 600 */ 177, 585, 596, 583, 281, 1521, 525, 1447, 184, 1366, - /* 610 */ 1943, 1393, 58, 52, 235, 641, 123, 596, 1607, 167, - /* 620 */ 225, 9, 572, 499, 1102, 696, 692, 688, 684, 279, - /* 630 */ 1745, 179, 1442, 1745, 360, 518, 80, 30, 168, 1374, - /* 640 */ 512, 1961, 156, 177, 1374, 224, 661, 1483, 1745, 613, - /* 650 */ 127, 1747, 647, 131, 1912, 1659, 612, 43, 41, 1740, - /* 660 */ 1845, 1723, 1912, 596, 1606, 357, 98, 1368, 1721, 272, - /* 670 */ 44, 147, 146, 644, 643, 642, 1734, 400, 1447, 1942, - /* 680 */ 1366, 1605, 64, 1977, 1730, 63, 100, 1944, 616, 1946, - /* 690 */ 1947, 611, 703, 606, 1745, 395, 134, 394, 143, 2001, - /* 700 */ 2030, 363, 592, 1442, 351, 2026, 1449, 1450, 1912, 156, - /* 710 */ 535, 574, 172, 2038, 2039, 1374, 129, 2043, 1747, 1732, - /* 720 */ 510, 509, 508, 473, 186, 1912, 1457, 572, 128, 504, - /* 730 */ 649, 1604, 1393, 503, 502, 1423, 1432, 1601, 260, 501, - /* 740 */ 507, 12, 1590, 36, 35, 500, 1396, 42, 40, 39, - /* 750 */ 38, 37, 1424, 1396, 1369, 1339, 1367, 229, 131, 227, - /* 760 */ 177, 77, 1775, 703, 76, 1736, 122, 121, 120, 119, - /* 770 */ 118, 117, 116, 115, 114, 1912, 1926, 1449, 1450, 1372, - /* 780 */ 1373, 1912, 1422, 1425, 1426, 1427, 1428, 1429, 1430, 1431, - /* 790 */ 608, 604, 1440, 1441, 1443, 1444, 1445, 1446, 1448, 1451, - /* 800 */ 2, 316, 498, 1391, 1922, 1928, 1423, 1432, 1600, 1840, - /* 810 */ 432, 2045, 598, 445, 2002, 606, 444, 173, 2038, 2039, - /* 820 */ 188, 129, 2043, 1797, 497, 1369, 1656, 1367, 1599, 1899, - /* 830 */ 1598, 416, 1533, 446, 31, 133, 418, 2040, 2001, 1796, - /* 840 */ 36, 35, 1597, 1596, 42, 40, 39, 38, 37, 1728, - /* 850 */ 1372, 1373, 1912, 1422, 1425, 1426, 1427, 1428, 1429, 1430, - /* 860 */ 1431, 608, 604, 1440, 1441, 1443, 1444, 1445, 1446, 1448, - /* 870 */ 1451, 2, 1912, 1424, 1912, 36, 35, 379, 330, 42, - /* 880 */ 40, 39, 38, 37, 1393, 645, 1912, 1912, 1788, 183, - /* 890 */ 406, 680, 679, 678, 677, 367, 234, 676, 675, 135, - /* 900 */ 670, 669, 668, 667, 666, 665, 664, 663, 149, 659, - /* 910 */ 658, 657, 366, 365, 654, 653, 652, 651, 650, 442, - /* 920 */ 1595, 1943, 437, 436, 435, 434, 431, 430, 429, 428, - /* 930 */ 427, 423, 422, 421, 420, 331, 413, 412, 411, 2102, - /* 940 */ 408, 407, 328, 157, 600, 596, 2002, 596, 292, 36, - /* 950 */ 35, 564, 1961, 42, 40, 39, 38, 37, 596, 401, - /* 960 */ 575, 410, 290, 66, 1912, 1912, 65, 612, 1854, 369, - /* 970 */ 312, 2103, 424, 145, 1943, 1594, 1745, 1853, 1745, 312, - /* 980 */ 1593, 596, 11, 10, 194, 451, 449, 1720, 1395, 1745, - /* 990 */ 1942, 572, 596, 646, 1977, 425, 1788, 100, 1944, 616, - /* 1000 */ 1946, 1947, 611, 6, 606, 1961, 139, 1827, 230, 171, - /* 1010 */ 540, 2030, 1745, 613, 2098, 351, 2026, 1699, 1912, 1912, - /* 1020 */ 612, 58, 131, 1745, 1912, 1424, 51, 596, 286, 2104, - /* 1030 */ 174, 1775, 596, 217, 2099, 561, 215, 2057, 1931, 1583, - /* 1040 */ 607, 471, 596, 1942, 233, 219, 472, 1977, 218, 1926, - /* 1050 */ 100, 1944, 616, 1946, 1947, 611, 364, 606, 1745, 99, - /* 1060 */ 596, 1943, 2118, 1745, 2030, 1576, 354, 353, 351, 2026, - /* 1070 */ 662, 640, 1715, 1745, 1742, 1377, 1382, 1922, 1928, 2064, - /* 1080 */ 596, 175, 2038, 2039, 83, 129, 2043, 1447, 606, 1375, - /* 1090 */ 1603, 1745, 1961, 403, 536, 647, 67, 74, 73, 399, - /* 1100 */ 613, 48, 181, 3, 1943, 1912, 404, 612, 137, 2070, - /* 1110 */ 125, 1745, 1442, 548, 147, 146, 644, 643, 642, 1376, - /* 1120 */ 315, 1930, 596, 387, 1374, 385, 381, 377, 374, 371, - /* 1130 */ 1942, 257, 1926, 1582, 1977, 1961, 576, 100, 1944, 616, - /* 1140 */ 1946, 1947, 611, 613, 606, 75, 1646, 96, 1912, 2118, - /* 1150 */ 612, 2030, 252, 1745, 1639, 351, 2026, 93, 419, 210, - /* 1160 */ 1922, 1928, 352, 528, 221, 596, 2092, 220, 511, 177, - /* 1170 */ 565, 606, 602, 1942, 596, 1943, 513, 1977, 60, 269, - /* 1180 */ 100, 1944, 616, 1946, 1947, 611, 596, 606, 591, 596, - /* 1190 */ 1637, 1933, 2118, 246, 2030, 1962, 1745, 563, 351, 2026, - /* 1200 */ 593, 596, 368, 594, 540, 1745, 1961, 1510, 2098, 2049, - /* 1210 */ 1585, 1586, 516, 223, 613, 275, 222, 1745, 1943, 1912, - /* 1220 */ 1745, 612, 1380, 2104, 174, 239, 45, 262, 2099, 561, - /* 1230 */ 140, 1540, 1745, 144, 1383, 145, 1378, 60, 1849, 1627, - /* 1240 */ 1935, 1785, 573, 2060, 1942, 254, 1130, 251, 1977, 1961, - /* 1250 */ 45, 100, 1944, 616, 1946, 1947, 611, 613, 606, 1386, - /* 1260 */ 1388, 1943, 1912, 2005, 612, 2030, 1379, 45, 620, 351, - /* 1270 */ 2026, 604, 1440, 1441, 1443, 1444, 1445, 1446, 241, 1316, - /* 1280 */ 267, 1131, 4, 588, 1633, 1943, 271, 1942, 1203, 655, - /* 1290 */ 1484, 1977, 1961, 144, 100, 1944, 616, 1946, 1947, 611, - /* 1300 */ 613, 606, 1, 1433, 145, 1912, 2003, 612, 2030, 373, - /* 1310 */ 378, 1150, 351, 2026, 656, 327, 1961, 126, 144, 1368, - /* 1320 */ 285, 1231, 282, 1332, 613, 187, 405, 1396, 1850, 1912, - /* 1330 */ 1942, 612, 1366, 698, 1977, 334, 1148, 100, 1944, 616, - /* 1340 */ 1946, 1947, 611, 1943, 606, 409, 1235, 440, 414, 599, - /* 1350 */ 1391, 2030, 426, 1842, 1942, 351, 2026, 1242, 1977, 433, - /* 1360 */ 447, 101, 1944, 616, 1946, 1947, 611, 1374, 606, 439, - /* 1370 */ 1240, 148, 441, 448, 1961, 2030, 191, 450, 452, 2029, - /* 1380 */ 2026, 1397, 613, 453, 462, 1399, 1943, 1912, 465, 612, - /* 1390 */ 197, 199, 466, 1398, 467, 1400, 468, 335, 202, 333, - /* 1400 */ 332, 470, 496, 204, 474, 78, 498, 79, 208, 1104, - /* 1410 */ 491, 492, 1942, 493, 1943, 703, 1977, 1961, 495, 101, - /* 1420 */ 1944, 616, 1946, 1947, 611, 613, 606, 102, 497, 1735, - /* 1430 */ 1912, 318, 612, 2030, 214, 1731, 216, 601, 2026, 527, - /* 1440 */ 150, 151, 529, 1733, 1729, 1961, 152, 153, 228, 530, - /* 1450 */ 1889, 231, 537, 610, 549, 614, 582, 5, 1912, 1977, - /* 1460 */ 612, 2061, 101, 1944, 616, 1946, 1947, 611, 283, 606, - /* 1470 */ 534, 2071, 544, 1943, 2076, 546, 2030, 1369, 237, 1367, - /* 1480 */ 321, 2026, 240, 1942, 531, 2075, 341, 1977, 558, 552, - /* 1490 */ 307, 1944, 616, 1946, 1947, 611, 609, 606, 597, 1995, - /* 1500 */ 545, 543, 1372, 1373, 1961, 542, 250, 569, 342, 566, - /* 1510 */ 2121, 245, 613, 1510, 130, 1395, 2046, 1912, 345, 612, - /* 1520 */ 577, 141, 142, 580, 581, 1888, 1860, 586, 259, 347, - /* 1530 */ 88, 1943, 589, 248, 164, 2052, 249, 247, 1746, 590, - /* 1540 */ 90, 57, 1942, 2011, 92, 1789, 1977, 284, 1716, 101, - /* 1550 */ 1944, 616, 1946, 1947, 611, 2097, 606, 253, 287, 1943, - /* 1560 */ 618, 278, 1961, 2030, 699, 700, 49, 301, 2027, 310, - /* 1570 */ 613, 309, 702, 289, 291, 1912, 1906, 612, 1905, 311, - /* 1580 */ 71, 1904, 1903, 72, 1900, 1943, 375, 376, 1360, 1361, - /* 1590 */ 1961, 180, 1898, 380, 382, 383, 384, 1897, 613, 386, - /* 1600 */ 1942, 1896, 388, 1912, 1977, 612, 1895, 160, 1944, 616, - /* 1610 */ 1946, 1947, 611, 1894, 606, 390, 1961, 1335, 392, 1334, - /* 1620 */ 1871, 1870, 397, 1869, 613, 398, 1868, 1296, 1942, 1912, - /* 1630 */ 1835, 612, 1977, 1834, 1832, 300, 1944, 616, 1946, 1947, - /* 1640 */ 611, 136, 606, 1831, 1830, 1833, 1829, 1828, 1826, 2068, - /* 1650 */ 1825, 1824, 185, 415, 1942, 1943, 1823, 417, 1977, 1822, - /* 1660 */ 1821, 161, 1944, 616, 1946, 1947, 611, 1820, 606, 1819, - /* 1670 */ 1818, 1817, 1816, 1815, 1943, 1298, 1802, 138, 1807, 557, - /* 1680 */ 1814, 1813, 1812, 1811, 1810, 1809, 1961, 1808, 1806, 1805, - /* 1690 */ 1804, 346, 443, 1799, 613, 1803, 1801, 1800, 1798, 1912, - /* 1700 */ 1178, 612, 1661, 1660, 1658, 1961, 1622, 192, 195, 1932, - /* 1710 */ 193, 458, 169, 610, 2120, 1090, 69, 1621, 1912, 1089, - /* 1720 */ 612, 460, 1884, 1878, 1942, 1867, 196, 1866, 1977, 203, - /* 1730 */ 70, 308, 1944, 616, 1946, 1947, 611, 1943, 606, 201, - /* 1740 */ 1852, 1724, 1657, 1942, 1655, 475, 477, 1977, 1653, 479, - /* 1750 */ 307, 1944, 616, 1946, 1947, 611, 476, 606, 1943, 1996, - /* 1760 */ 480, 1651, 1649, 1123, 483, 481, 484, 485, 1961, 487, - /* 1770 */ 489, 1636, 488, 356, 1635, 1618, 613, 1726, 1246, 1245, - /* 1780 */ 1943, 1912, 1725, 612, 59, 1169, 1168, 1167, 1166, 1961, - /* 1790 */ 1165, 671, 1160, 673, 358, 1162, 1647, 613, 1161, 1159, - /* 1800 */ 336, 1943, 1912, 1640, 612, 337, 1942, 1638, 514, 338, - /* 1810 */ 1977, 1961, 213, 308, 1944, 616, 1946, 1947, 611, 613, - /* 1820 */ 606, 517, 1617, 1943, 1912, 519, 612, 1942, 1616, 521, - /* 1830 */ 1615, 1977, 1961, 523, 308, 1944, 616, 1946, 1947, 611, - /* 1840 */ 613, 606, 1352, 103, 1943, 1912, 1883, 612, 24, 526, - /* 1850 */ 1341, 1877, 1865, 1977, 1961, 532, 303, 1944, 616, 1946, - /* 1860 */ 1947, 611, 613, 606, 1863, 17, 2103, 1912, 26, 612, - /* 1870 */ 1942, 56, 14, 1555, 1977, 1961, 53, 293, 1944, 616, - /* 1880 */ 1946, 1947, 611, 613, 606, 232, 238, 1943, 1912, 236, - /* 1890 */ 612, 162, 1942, 533, 154, 339, 1977, 1539, 1532, 294, - /* 1900 */ 1944, 616, 1946, 1947, 611, 538, 606, 244, 242, 27, - /* 1910 */ 243, 28, 1933, 1942, 84, 1943, 61, 1977, 1961, 19, - /* 1920 */ 295, 1944, 616, 1946, 1947, 611, 613, 606, 1575, 1576, - /* 1930 */ 1570, 1912, 1569, 612, 343, 1574, 1573, 344, 1507, 1506, - /* 1940 */ 256, 1943, 18, 165, 1864, 1862, 1961, 55, 1861, 20, - /* 1950 */ 1350, 261, 1537, 263, 613, 1349, 1942, 54, 584, 1912, - /* 1960 */ 1977, 612, 1859, 299, 1944, 616, 1946, 1947, 611, 15, - /* 1970 */ 606, 587, 1961, 268, 86, 1851, 87, 89, 270, 93, - /* 1980 */ 613, 273, 21, 1459, 1942, 1912, 10, 612, 1977, 1384, - /* 1990 */ 1469, 304, 1944, 616, 1946, 1947, 611, 8, 606, 1943, - /* 2000 */ 1458, 1437, 1980, 605, 166, 1435, 34, 178, 1434, 1407, - /* 2010 */ 1942, 615, 13, 22, 1977, 1415, 1943, 296, 1944, 616, - /* 2020 */ 1946, 1947, 611, 1232, 606, 23, 617, 619, 621, 359, - /* 2030 */ 1961, 623, 1229, 1226, 626, 624, 627, 629, 613, 1220, - /* 2040 */ 1218, 632, 630, 1912, 1224, 612, 633, 1961, 1223, 1209, - /* 2050 */ 1222, 1221, 94, 1241, 95, 613, 276, 639, 1237, 1943, - /* 2060 */ 1912, 68, 612, 1156, 1121, 1155, 648, 1154, 1942, 1153, - /* 2070 */ 1152, 1176, 1977, 1151, 1149, 305, 1944, 616, 1946, 1947, - /* 2080 */ 611, 1147, 606, 1943, 1146, 1942, 1145, 277, 660, 1977, - /* 2090 */ 1961, 1143, 297, 1944, 616, 1946, 1947, 611, 613, 606, - /* 2100 */ 1142, 1141, 1140, 1912, 1139, 612, 1138, 1137, 1127, 1136, - /* 2110 */ 1173, 1171, 1133, 1132, 1961, 1129, 1128, 1654, 1126, 681, - /* 2120 */ 1652, 1650, 613, 682, 683, 685, 1943, 1912, 1942, 612, - /* 2130 */ 687, 691, 1977, 689, 1648, 306, 1944, 616, 1946, 1947, - /* 2140 */ 611, 693, 606, 1943, 686, 690, 695, 694, 1634, 697, - /* 2150 */ 1079, 1614, 1942, 280, 701, 705, 1977, 1961, 704, 298, - /* 2160 */ 1944, 616, 1946, 1947, 611, 613, 606, 1370, 288, 1943, - /* 2170 */ 1912, 1589, 612, 1589, 1961, 1589, 1589, 1589, 1589, 1589, - /* 2180 */ 1589, 1589, 613, 1589, 1589, 1589, 1943, 1912, 1589, 612, - /* 2190 */ 1589, 1589, 1589, 1589, 1589, 1942, 1589, 1589, 1589, 1977, - /* 2200 */ 1961, 1589, 313, 1944, 616, 1946, 1947, 611, 613, 606, - /* 2210 */ 1589, 1589, 1942, 1912, 1589, 612, 1977, 1961, 1589, 314, - /* 2220 */ 1944, 616, 1946, 1947, 611, 613, 606, 1589, 1589, 1943, - /* 2230 */ 1912, 1589, 612, 1589, 1589, 1589, 1589, 1589, 1942, 1589, - /* 2240 */ 1589, 1589, 1977, 1589, 1589, 1955, 1944, 616, 1946, 1947, - /* 2250 */ 611, 1943, 606, 1589, 1589, 1942, 1589, 1589, 1589, 1977, - /* 2260 */ 1961, 1589, 1954, 1944, 616, 1946, 1947, 611, 613, 606, - /* 2270 */ 1589, 1589, 1589, 1912, 1589, 612, 1589, 1589, 1589, 1589, - /* 2280 */ 1589, 1589, 1961, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 2290 */ 613, 1589, 1589, 1589, 1589, 1912, 1589, 612, 1942, 1589, - /* 2300 */ 1589, 1589, 1977, 1589, 1589, 1953, 1944, 616, 1946, 1947, - /* 2310 */ 611, 1589, 606, 1943, 1589, 1589, 1589, 1589, 1589, 1589, - /* 2320 */ 1942, 1589, 1589, 1589, 1977, 1589, 1589, 323, 1944, 616, - /* 2330 */ 1946, 1947, 611, 1589, 606, 1943, 1589, 1589, 1589, 1589, - /* 2340 */ 1589, 1589, 1589, 1589, 1961, 1589, 1589, 1589, 1589, 1589, - /* 2350 */ 1589, 1589, 613, 1589, 1589, 1589, 1589, 1912, 1589, 612, - /* 2360 */ 1589, 1589, 1589, 1589, 1589, 1589, 1961, 1589, 1589, 1589, - /* 2370 */ 1589, 1589, 1589, 1589, 613, 1589, 1589, 1589, 1589, 1912, - /* 2380 */ 1589, 612, 1942, 1589, 1589, 1589, 1977, 1589, 1589, 324, - /* 2390 */ 1944, 616, 1946, 1947, 611, 1589, 606, 1943, 1589, 1589, - /* 2400 */ 1589, 1589, 1589, 1589, 1942, 1589, 1589, 1589, 1977, 1589, - /* 2410 */ 1589, 320, 1944, 616, 1946, 1947, 611, 1943, 606, 1589, - /* 2420 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1961, 1589, - /* 2430 */ 1589, 1589, 1589, 1589, 1589, 1589, 613, 1589, 1589, 1589, - /* 2440 */ 1589, 1912, 1589, 612, 1589, 1589, 1589, 1589, 1961, 1589, - /* 2450 */ 1589, 1589, 1589, 1589, 1589, 1589, 613, 1589, 1589, 1589, - /* 2460 */ 1943, 1912, 1589, 612, 1589, 1589, 1942, 1589, 1589, 1589, - /* 2470 */ 1977, 1589, 1589, 325, 1944, 616, 1946, 1947, 611, 1589, - /* 2480 */ 606, 1589, 1589, 1589, 1589, 1589, 614, 1589, 1589, 1589, - /* 2490 */ 1977, 1961, 1589, 303, 1944, 616, 1946, 1947, 611, 613, - /* 2500 */ 606, 1589, 1589, 1589, 1912, 1589, 612, 1589, 1589, 1589, - /* 2510 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 2520 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1942, - /* 2530 */ 1589, 1589, 1589, 1977, 1589, 1589, 302, 1944, 616, 1946, - /* 2540 */ 1947, 611, 1589, 606, + /* 0 */ 1950, 458, 157, 459, 1631, 566, 167, 1703, 467, 2105, + /* 10 */ 459, 1631, 43, 41, 1522, 365, 1651, 2110, 1796, 1798, + /* 20 */ 360, 2105, 1373, 1595, 565, 173, 598, 332, 1850, 2106, + /* 30 */ 567, 1968, 1741, 1452, 405, 1371, 1664, 2109, 514, 581, + /* 40 */ 52, 2106, 2108, 1933, 1919, 399, 614, 122, 121, 120, + /* 50 */ 119, 118, 117, 116, 115, 114, 464, 1750, 1447, 597, + /* 60 */ 36, 35, 460, 16, 42, 40, 39, 38, 37, 1949, + /* 70 */ 1379, 1929, 1935, 1984, 318, 597, 100, 1951, 618, 1953, + /* 80 */ 1954, 613, 608, 608, 258, 597, 1526, 546, 170, 1938, + /* 90 */ 2037, 2105, 1398, 476, 354, 2033, 12, 2052, 1462, 1950, + /* 100 */ 1933, 513, 512, 511, 1398, 1968, 2111, 173, 175, 128, + /* 110 */ 507, 2106, 567, 560, 506, 505, 2063, 158, 706, 1607, + /* 120 */ 504, 510, 58, 2049, 85, 561, 503, 598, 1929, 1935, + /* 130 */ 1968, 1398, 1085, 1454, 1455, 1104, 1593, 1103, 615, 608, + /* 140 */ 2110, 123, 1846, 1919, 2105, 614, 43, 41, 497, 1558, + /* 150 */ 210, 46, 559, 181, 360, 1727, 1373, 1399, 1750, 1950, + /* 160 */ 2109, 46, 1428, 1437, 2106, 2107, 1105, 1452, 1949, 1371, + /* 170 */ 598, 1087, 1984, 1090, 1091, 100, 1951, 618, 1953, 1954, + /* 180 */ 613, 1374, 608, 1372, 123, 134, 62, 141, 2008, 2037, + /* 190 */ 1968, 502, 1447, 354, 2033, 33, 274, 16, 581, 375, + /* 200 */ 1398, 1750, 652, 1919, 1379, 614, 1377, 1378, 1398, 1427, + /* 210 */ 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, + /* 220 */ 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, 1949, 97, + /* 230 */ 12, 2110, 1984, 1950, 1429, 100, 1951, 618, 1953, 1954, + /* 240 */ 613, 546, 608, 132, 1397, 2105, 1429, 170, 1400, 2037, + /* 250 */ 556, 1742, 706, 354, 2033, 42, 40, 39, 38, 37, + /* 260 */ 2111, 173, 9, 650, 1968, 2106, 567, 1454, 1455, 1797, + /* 270 */ 1798, 176, 615, 1309, 1310, 2064, 58, 1919, 58, 614, + /* 280 */ 43, 41, 146, 145, 647, 646, 645, 143, 360, 1400, + /* 290 */ 1373, 58, 1399, 1950, 509, 508, 1428, 1437, 1618, 578, + /* 300 */ 176, 1452, 1949, 1371, 457, 598, 1984, 462, 1637, 100, + /* 310 */ 1951, 618, 1953, 1954, 613, 1374, 608, 1372, 225, 178, + /* 320 */ 643, 2012, 169, 2037, 1968, 1581, 1447, 354, 2033, 1483, + /* 330 */ 131, 16, 615, 562, 557, 1790, 1750, 1919, 1379, 614, + /* 340 */ 1377, 1378, 1919, 1427, 1430, 1431, 1432, 1433, 1434, 1435, + /* 350 */ 1436, 610, 606, 1445, 1446, 1448, 1449, 1450, 1451, 1453, + /* 360 */ 1456, 2, 1949, 9, 12, 1950, 1984, 677, 675, 100, + /* 370 */ 1951, 618, 1953, 1954, 613, 398, 608, 397, 82, 320, + /* 380 */ 58, 2125, 531, 2037, 529, 80, 706, 354, 2033, 255, + /* 390 */ 2045, 577, 257, 124, 576, 441, 1968, 2105, 2071, 127, + /* 400 */ 30, 1454, 1455, 541, 612, 1256, 1257, 406, 1745, 1919, + /* 410 */ 1488, 614, 565, 173, 43, 41, 1457, 2106, 567, 585, + /* 420 */ 407, 1379, 360, 1725, 1373, 176, 47, 176, 1846, 351, + /* 430 */ 1428, 1437, 1861, 257, 1949, 1452, 185, 1371, 1984, 183, + /* 440 */ 176, 310, 1951, 618, 1953, 1954, 613, 650, 608, 1374, + /* 450 */ 2003, 1372, 466, 189, 188, 462, 1637, 36, 35, 664, + /* 460 */ 1447, 42, 40, 39, 38, 37, 146, 145, 647, 646, + /* 470 */ 645, 143, 1379, 77, 1377, 1378, 76, 1427, 1430, 1431, + /* 480 */ 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, 1446, 1448, + /* 490 */ 1449, 1450, 1451, 1453, 1456, 2, 598, 1617, 44, 598, + /* 500 */ 1739, 1950, 1803, 513, 512, 511, 1398, 598, 1803, 353, + /* 510 */ 403, 128, 507, 404, 1735, 364, 506, 505, 1801, 1616, + /* 520 */ 706, 413, 504, 510, 1801, 352, 363, 1750, 503, 176, + /* 530 */ 1750, 650, 1968, 155, 155, 1454, 1455, 1104, 1750, 1103, + /* 540 */ 615, 1919, 1752, 1752, 527, 1919, 1538, 614, 43, 41, + /* 550 */ 146, 145, 647, 646, 645, 143, 360, 525, 1373, 523, + /* 560 */ 1737, 1950, 598, 1919, 1428, 1437, 394, 1173, 1105, 1452, + /* 570 */ 1949, 1371, 598, 578, 1984, 176, 427, 100, 1951, 618, + /* 580 */ 1953, 1954, 613, 1374, 608, 1372, 428, 396, 392, 2010, + /* 590 */ 1733, 2037, 1968, 1750, 1447, 354, 2033, 226, 230, 9, + /* 600 */ 615, 7, 1175, 1750, 131, 1919, 1379, 614, 1377, 1378, + /* 610 */ 80, 1427, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, + /* 620 */ 606, 1445, 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, + /* 630 */ 1949, 167, 44, 1746, 1984, 366, 605, 100, 1951, 618, + /* 640 */ 1953, 1954, 613, 155, 608, 265, 266, 1615, 1429, 2125, + /* 650 */ 264, 2037, 1752, 1851, 706, 354, 2033, 1614, 1950, 1728, + /* 660 */ 1350, 1351, 580, 171, 2045, 2046, 2099, 129, 2050, 1454, + /* 670 */ 1455, 36, 35, 6, 29, 42, 40, 39, 38, 37, + /* 680 */ 36, 35, 43, 41, 42, 40, 39, 38, 37, 1968, + /* 690 */ 360, 1919, 1373, 91, 598, 598, 2077, 615, 1428, 1437, + /* 700 */ 1613, 1919, 1919, 1452, 614, 1371, 1803, 25, 474, 475, + /* 710 */ 39, 38, 37, 329, 600, 1743, 2009, 1374, 602, 1372, + /* 720 */ 2009, 476, 1801, 609, 155, 1750, 1750, 1949, 1447, 227, + /* 730 */ 1612, 1984, 1780, 1753, 159, 1951, 618, 1953, 1954, 613, + /* 740 */ 1379, 608, 1377, 1378, 1919, 1427, 1430, 1431, 1432, 1433, + /* 750 */ 1434, 1435, 1436, 610, 606, 1445, 1446, 1448, 1449, 1450, + /* 760 */ 1451, 1453, 1456, 2, 36, 35, 12, 1950, 42, 40, + /* 770 */ 39, 38, 37, 1846, 1919, 547, 2074, 566, 1548, 1473, + /* 780 */ 317, 2105, 1396, 2052, 187, 598, 642, 1611, 706, 435, + /* 790 */ 1610, 1609, 448, 1596, 1606, 447, 565, 173, 1968, 1747, + /* 800 */ 1726, 2106, 567, 1454, 1455, 1605, 615, 1608, 1604, 2048, + /* 810 */ 419, 1919, 449, 614, 113, 421, 1750, 112, 111, 110, + /* 820 */ 109, 108, 107, 106, 105, 104, 553, 1546, 1547, 1549, + /* 830 */ 1550, 1919, 1428, 1437, 1919, 1919, 532, 665, 1919, 1720, + /* 840 */ 1984, 598, 598, 306, 1951, 618, 1953, 1954, 613, 1919, + /* 850 */ 608, 1374, 1919, 1372, 1603, 139, 367, 333, 1661, 36, + /* 860 */ 35, 1519, 652, 42, 40, 39, 38, 37, 2109, 409, + /* 870 */ 1401, 1401, 1750, 1750, 2052, 1602, 1377, 1378, 1515, 1427, + /* 880 */ 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, + /* 890 */ 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, 1919, 445, + /* 900 */ 2047, 1704, 440, 439, 438, 437, 434, 433, 432, 431, + /* 910 */ 430, 426, 425, 424, 423, 334, 416, 415, 414, 1919, + /* 920 */ 411, 410, 331, 683, 682, 681, 680, 370, 144, 679, + /* 930 */ 678, 135, 673, 672, 671, 670, 669, 668, 667, 666, + /* 940 */ 148, 662, 661, 660, 369, 368, 657, 656, 655, 654, + /* 950 */ 653, 156, 1601, 1600, 598, 1599, 294, 36, 35, 357, + /* 960 */ 356, 42, 40, 39, 38, 37, 1598, 1950, 542, 1387, + /* 970 */ 292, 66, 598, 133, 65, 644, 2008, 252, 1794, 1401, + /* 980 */ 1452, 51, 1380, 36, 35, 1750, 582, 42, 40, 39, + /* 990 */ 38, 37, 193, 454, 452, 585, 1919, 1919, 1968, 1919, + /* 1000 */ 11, 10, 337, 1750, 648, 1447, 615, 1794, 1862, 554, + /* 1010 */ 1919, 1919, 325, 614, 182, 235, 573, 1379, 1213, 640, + /* 1020 */ 639, 638, 1217, 637, 1219, 1220, 636, 1222, 633, 58, + /* 1030 */ 1228, 630, 1230, 1231, 627, 624, 1949, 209, 288, 598, + /* 1040 */ 1984, 1780, 1803, 100, 1951, 618, 1953, 1954, 613, 649, + /* 1050 */ 608, 584, 1794, 269, 1481, 2125, 216, 2037, 1802, 214, + /* 1060 */ 211, 354, 2033, 709, 338, 604, 336, 335, 99, 499, + /* 1070 */ 1750, 246, 2056, 501, 598, 162, 1906, 281, 1373, 1090, + /* 1080 */ 1091, 493, 489, 485, 481, 208, 2057, 1515, 593, 1833, + /* 1090 */ 598, 1371, 166, 546, 501, 500, 1495, 2105, 699, 695, + /* 1100 */ 691, 687, 279, 1518, 595, 1750, 74, 73, 402, 578, + /* 1110 */ 1482, 180, 2111, 173, 67, 570, 500, 2106, 567, 598, + /* 1120 */ 1382, 1750, 81, 234, 382, 206, 1379, 569, 1388, 316, + /* 1130 */ 1383, 1969, 390, 596, 388, 384, 380, 377, 374, 98, + /* 1140 */ 131, 48, 272, 3, 137, 1381, 125, 371, 1588, 60, + /* 1150 */ 1750, 1855, 113, 1391, 1393, 112, 111, 110, 109, 108, + /* 1160 */ 107, 106, 105, 104, 75, 606, 1445, 1446, 1448, 1449, + /* 1170 */ 1450, 1451, 239, 218, 706, 594, 217, 1950, 176, 45, + /* 1180 */ 598, 32, 358, 1476, 1477, 1478, 1479, 1480, 1484, 1485, + /* 1190 */ 1486, 1487, 205, 199, 275, 204, 1644, 1642, 472, 172, + /* 1200 */ 2045, 2046, 1545, 129, 2050, 1950, 220, 222, 1968, 219, + /* 1210 */ 221, 1750, 260, 262, 197, 50, 615, 140, 516, 519, + /* 1220 */ 545, 1919, 142, 614, 233, 241, 1590, 1591, 1940, 1344, + /* 1230 */ 96, 229, 1320, 11, 10, 1632, 1968, 1374, 574, 1372, + /* 1240 */ 93, 422, 1587, 144, 615, 1133, 1949, 658, 1950, 1919, + /* 1250 */ 1984, 614, 2067, 100, 1951, 618, 1953, 1954, 613, 60, + /* 1260 */ 608, 45, 1377, 1378, 83, 601, 267, 2037, 1385, 1153, + /* 1270 */ 590, 354, 2033, 1791, 1949, 271, 1950, 1942, 1984, 1968, + /* 1280 */ 1134, 101, 1951, 618, 1953, 1954, 613, 615, 608, 579, + /* 1290 */ 254, 31, 1919, 1384, 614, 2037, 1206, 36, 35, 2036, + /* 1300 */ 2033, 42, 40, 39, 38, 37, 251, 1968, 45, 622, + /* 1310 */ 1, 142, 1489, 4, 1438, 615, 144, 1949, 659, 1950, + /* 1320 */ 1919, 1984, 614, 1638, 101, 1951, 618, 1953, 1954, 613, + /* 1330 */ 376, 608, 126, 381, 330, 571, 142, 1950, 2037, 1337, + /* 1340 */ 1151, 282, 603, 2033, 186, 616, 408, 1401, 1856, 1984, + /* 1350 */ 1968, 443, 101, 1951, 618, 1953, 1954, 613, 612, 608, + /* 1360 */ 412, 287, 1234, 1919, 1238, 614, 2037, 417, 1968, 1245, + /* 1370 */ 324, 2033, 701, 1396, 429, 1848, 615, 436, 442, 444, + /* 1380 */ 1950, 1919, 190, 614, 450, 1243, 451, 453, 1949, 147, + /* 1390 */ 455, 1402, 1984, 518, 456, 310, 1951, 618, 1953, 1954, + /* 1400 */ 613, 611, 608, 599, 2002, 465, 1949, 1404, 528, 468, + /* 1410 */ 1984, 1968, 1403, 160, 1951, 618, 1953, 1954, 613, 615, + /* 1420 */ 608, 196, 224, 469, 1919, 198, 614, 1405, 1937, 470, + /* 1430 */ 201, 473, 471, 1950, 1107, 203, 477, 521, 1896, 1933, + /* 1440 */ 78, 1937, 515, 79, 496, 533, 498, 223, 494, 1949, + /* 1450 */ 207, 495, 1933, 1984, 1950, 102, 101, 1951, 618, 1953, + /* 1460 */ 1954, 613, 228, 608, 1968, 568, 2126, 1929, 1935, 343, + /* 1470 */ 2037, 319, 615, 535, 1740, 2034, 213, 1919, 608, 614, + /* 1480 */ 1929, 1935, 355, 373, 64, 1968, 1736, 63, 215, 149, + /* 1490 */ 1895, 608, 150, 615, 372, 1738, 1734, 151, 1919, 152, + /* 1500 */ 614, 536, 1949, 543, 283, 231, 1984, 550, 1950, 159, + /* 1510 */ 1951, 618, 1953, 1954, 613, 555, 608, 537, 540, 237, + /* 1520 */ 588, 2068, 578, 1949, 2078, 546, 552, 1984, 344, 2105, + /* 1530 */ 304, 1951, 618, 1953, 1954, 613, 546, 608, 240, 1968, + /* 1540 */ 2105, 558, 5, 551, 2111, 173, 564, 615, 548, 2106, + /* 1550 */ 567, 2075, 1919, 131, 614, 2111, 173, 549, 248, 2059, + /* 1560 */ 2106, 567, 1950, 36, 35, 245, 345, 42, 40, 39, + /* 1570 */ 38, 37, 250, 1515, 563, 575, 572, 1949, 130, 1950, + /* 1580 */ 2128, 1984, 249, 2083, 160, 1951, 618, 1953, 1954, 613, + /* 1590 */ 2082, 608, 163, 1968, 247, 1400, 583, 259, 349, 2104, + /* 1600 */ 253, 615, 2053, 348, 284, 1950, 1919, 586, 614, 587, + /* 1610 */ 1968, 1867, 174, 2045, 2046, 359, 129, 2050, 615, 591, + /* 1620 */ 1866, 1865, 350, 1919, 88, 614, 285, 592, 286, 57, + /* 1630 */ 90, 1949, 92, 1950, 1751, 1984, 1968, 2127, 311, 1951, + /* 1640 */ 618, 1953, 1954, 613, 615, 608, 2018, 1795, 1949, 1919, + /* 1650 */ 1721, 614, 1984, 289, 620, 311, 1951, 618, 1953, 1954, + /* 1660 */ 613, 278, 608, 702, 1968, 703, 705, 49, 298, 361, + /* 1670 */ 291, 312, 615, 313, 1949, 302, 1950, 1919, 1984, 614, + /* 1680 */ 293, 295, 1951, 618, 1953, 1954, 613, 1913, 608, 321, + /* 1690 */ 322, 1912, 1950, 71, 1911, 1910, 72, 1907, 378, 379, + /* 1700 */ 1365, 1366, 1949, 179, 383, 1905, 1984, 1968, 385, 311, + /* 1710 */ 1951, 618, 1953, 1954, 613, 615, 608, 386, 387, 154, + /* 1720 */ 1919, 1904, 614, 1968, 389, 1903, 1902, 391, 393, 1901, + /* 1730 */ 1340, 615, 1339, 395, 1878, 534, 1919, 1877, 614, 400, + /* 1740 */ 401, 1876, 1875, 1950, 1841, 1949, 1300, 1840, 1838, 1984, + /* 1750 */ 136, 1837, 296, 1951, 618, 1953, 1954, 613, 1836, 608, + /* 1760 */ 1839, 1949, 1835, 1834, 1832, 1984, 1831, 1830, 297, 1951, + /* 1770 */ 618, 1953, 1954, 613, 1968, 608, 184, 546, 418, 1829, + /* 1780 */ 420, 2105, 615, 1828, 1827, 1826, 1950, 1919, 1825, 614, + /* 1790 */ 1824, 1823, 1822, 1821, 1820, 1819, 2111, 173, 1818, 1817, + /* 1800 */ 1816, 2106, 567, 1950, 1815, 1814, 1813, 138, 1812, 1811, + /* 1810 */ 1810, 1809, 1949, 1808, 1807, 1806, 1984, 1968, 1302, 303, + /* 1820 */ 1951, 618, 1953, 1954, 613, 615, 608, 1805, 1804, 446, + /* 1830 */ 1919, 1666, 614, 191, 1968, 1665, 1181, 1663, 192, 1627, + /* 1840 */ 1093, 168, 615, 1092, 194, 1626, 69, 1919, 1891, 614, + /* 1850 */ 1939, 1885, 195, 1874, 1873, 1949, 1950, 70, 200, 1984, + /* 1860 */ 202, 1858, 307, 1951, 618, 1953, 1954, 613, 461, 608, + /* 1870 */ 463, 1729, 1949, 1950, 1662, 1660, 1984, 478, 479, 299, + /* 1880 */ 1951, 618, 1953, 1954, 613, 480, 608, 1968, 1126, 1658, + /* 1890 */ 482, 483, 1656, 486, 1654, 615, 484, 487, 488, 490, + /* 1900 */ 1919, 492, 614, 1641, 1968, 1640, 1623, 1731, 491, 1249, + /* 1910 */ 1730, 1250, 615, 1172, 1171, 1170, 1169, 1919, 1168, 614, + /* 1920 */ 212, 59, 1163, 1165, 1950, 1949, 674, 1652, 676, 1984, + /* 1930 */ 1164, 1162, 308, 1951, 618, 1953, 1954, 613, 339, 608, + /* 1940 */ 1645, 1950, 1949, 340, 1643, 341, 1984, 517, 520, 300, + /* 1950 */ 1951, 618, 1953, 1954, 613, 1968, 608, 1622, 1621, 522, + /* 1960 */ 524, 1620, 1357, 615, 526, 103, 1355, 1950, 1919, 1354, + /* 1970 */ 614, 530, 1968, 24, 1890, 1884, 1346, 538, 1872, 1870, + /* 1980 */ 615, 17, 14, 2110, 1950, 1919, 53, 614, 1560, 18, + /* 1990 */ 56, 243, 28, 1949, 26, 236, 539, 1984, 1968, 232, + /* 2000 */ 309, 1951, 618, 1953, 1954, 613, 615, 608, 342, 153, + /* 2010 */ 1949, 1919, 238, 614, 1984, 1968, 1544, 301, 1951, 618, + /* 2020 */ 1953, 1954, 613, 615, 608, 161, 544, 1537, 1919, 244, + /* 2030 */ 614, 242, 27, 1940, 84, 1950, 1949, 61, 19, 1575, + /* 2040 */ 1984, 1574, 346, 314, 1951, 618, 1953, 1954, 613, 1580, + /* 2050 */ 608, 1581, 1579, 1949, 1578, 347, 1512, 1984, 256, 1511, + /* 2060 */ 315, 1951, 618, 1953, 1954, 613, 1968, 608, 55, 164, + /* 2070 */ 1871, 1869, 1868, 20, 615, 589, 1857, 263, 1950, 1919, + /* 2080 */ 261, 614, 1542, 15, 54, 268, 86, 87, 89, 273, + /* 2090 */ 93, 270, 10, 21, 1950, 1464, 8, 1463, 1987, 1389, + /* 2100 */ 1442, 607, 165, 177, 1949, 1440, 34, 1474, 1984, 1968, + /* 2110 */ 1439, 1962, 1951, 618, 1953, 1954, 613, 615, 608, 13, + /* 2120 */ 1420, 22, 1919, 1412, 614, 1968, 617, 23, 619, 1235, + /* 2130 */ 621, 362, 623, 615, 1232, 625, 626, 628, 1919, 629, + /* 2140 */ 614, 1229, 1223, 631, 1221, 1950, 632, 1949, 634, 635, + /* 2150 */ 1227, 1984, 1212, 1226, 1961, 1951, 618, 1953, 1954, 613, + /* 2160 */ 641, 608, 94, 1949, 276, 95, 1225, 1984, 1244, 68, + /* 2170 */ 1960, 1951, 618, 1953, 1954, 613, 1968, 608, 1224, 1240, + /* 2180 */ 1124, 651, 1159, 1158, 615, 1157, 1156, 1155, 1950, 1919, + /* 2190 */ 1154, 614, 1179, 1152, 1150, 1149, 1148, 663, 277, 1146, + /* 2200 */ 1145, 1144, 1143, 1142, 1141, 1950, 1140, 1139, 1176, 1174, + /* 2210 */ 1136, 1135, 1132, 1131, 1949, 1130, 1659, 1129, 1984, 1968, + /* 2220 */ 684, 326, 1951, 618, 1953, 1954, 613, 615, 608, 686, + /* 2230 */ 1657, 685, 1919, 688, 614, 689, 1968, 1655, 690, 692, + /* 2240 */ 693, 694, 1653, 696, 615, 697, 698, 1639, 700, 1919, + /* 2250 */ 1082, 614, 1619, 280, 704, 708, 1375, 1949, 1950, 1594, + /* 2260 */ 290, 1984, 707, 1594, 327, 1951, 618, 1953, 1954, 613, + /* 2270 */ 1594, 608, 1594, 1594, 1949, 1950, 1594, 1594, 1984, 1594, + /* 2280 */ 1594, 323, 1951, 618, 1953, 1954, 613, 1594, 608, 1968, + /* 2290 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 615, 1594, 1594, + /* 2300 */ 1594, 1594, 1919, 1594, 614, 1594, 1968, 1594, 1594, 1594, + /* 2310 */ 1594, 1594, 1594, 1594, 615, 1594, 1594, 1594, 1594, 1919, + /* 2320 */ 1594, 614, 1594, 1594, 1594, 1594, 1950, 1949, 1594, 1594, + /* 2330 */ 1594, 1984, 1594, 1594, 328, 1951, 618, 1953, 1954, 613, + /* 2340 */ 1594, 608, 1594, 1594, 616, 1594, 1594, 1594, 1984, 1594, + /* 2350 */ 1594, 306, 1951, 618, 1953, 1954, 613, 1968, 608, 1594, + /* 2360 */ 1594, 1594, 1594, 1594, 1594, 615, 1594, 1594, 1594, 1594, + /* 2370 */ 1919, 1594, 614, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 2380 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 2390 */ 1594, 1594, 1594, 1594, 1594, 1949, 1594, 1594, 1594, 1984, + /* 2400 */ 1594, 1594, 305, 1951, 618, 1953, 1954, 613, 1594, 608, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 385, 426, 347, 0, 328, 430, 330, 331, 415, 416, - /* 10 */ 355, 385, 12, 13, 14, 328, 355, 330, 331, 364, - /* 20 */ 20, 446, 22, 8, 9, 450, 451, 12, 13, 14, - /* 30 */ 15, 16, 20, 33, 339, 35, 324, 376, 377, 344, - /* 40 */ 21, 426, 8, 9, 370, 430, 12, 13, 14, 15, - /* 50 */ 16, 20, 426, 34, 380, 36, 430, 383, 58, 44, - /* 60 */ 445, 446, 385, 63, 355, 450, 451, 355, 369, 370, - /* 70 */ 70, 445, 446, 364, 426, 363, 450, 451, 430, 332, - /* 80 */ 368, 20, 370, 12, 13, 12, 13, 14, 15, 16, - /* 90 */ 323, 20, 325, 22, 446, 355, 96, 63, 450, 451, - /* 100 */ 1, 2, 362, 426, 33, 393, 35, 430, 4, 397, - /* 110 */ 363, 371, 400, 401, 402, 403, 404, 405, 118, 407, - /* 120 */ 58, 63, 445, 446, 412, 33, 414, 450, 451, 58, - /* 130 */ 418, 419, 132, 133, 63, 14, 15, 16, 62, 105, - /* 140 */ 48, 70, 399, 332, 432, 357, 54, 55, 56, 57, - /* 150 */ 58, 366, 440, 338, 369, 370, 368, 96, 96, 355, - /* 160 */ 98, 161, 162, 132, 133, 355, 362, 96, 425, 422, - /* 170 */ 423, 424, 362, 426, 427, 371, 361, 430, 20, 128, - /* 180 */ 180, 371, 182, 372, 396, 397, 398, 95, 20, 118, - /* 190 */ 98, 363, 445, 446, 160, 407, 97, 450, 451, 324, - /* 200 */ 96, 14, 374, 132, 133, 205, 206, 20, 208, 209, + /* 0 */ 325, 329, 340, 331, 332, 427, 356, 345, 329, 431, + /* 10 */ 331, 332, 12, 13, 14, 367, 0, 427, 370, 371, + /* 20 */ 20, 431, 22, 0, 446, 447, 333, 377, 378, 451, + /* 30 */ 452, 356, 358, 33, 333, 35, 0, 447, 22, 364, + /* 40 */ 347, 451, 452, 369, 369, 385, 371, 24, 25, 26, + /* 50 */ 27, 28, 29, 30, 31, 32, 14, 364, 58, 20, + /* 60 */ 8, 9, 20, 63, 12, 13, 14, 15, 16, 394, + /* 70 */ 70, 397, 398, 398, 373, 20, 401, 402, 403, 404, + /* 80 */ 405, 406, 408, 408, 58, 20, 14, 427, 413, 358, + /* 90 */ 415, 431, 20, 62, 419, 420, 96, 400, 14, 325, + /* 100 */ 369, 65, 66, 67, 20, 356, 446, 447, 433, 73, + /* 110 */ 74, 451, 452, 364, 78, 79, 441, 324, 118, 326, + /* 120 */ 84, 85, 96, 426, 98, 20, 90, 333, 397, 398, + /* 130 */ 356, 20, 4, 133, 134, 20, 322, 22, 364, 408, + /* 140 */ 427, 347, 364, 369, 431, 371, 12, 13, 354, 97, + /* 150 */ 35, 96, 403, 375, 20, 0, 22, 20, 364, 325, + /* 160 */ 447, 96, 162, 163, 451, 452, 51, 33, 394, 35, + /* 170 */ 333, 43, 398, 45, 46, 401, 402, 403, 404, 405, + /* 180 */ 406, 181, 408, 183, 347, 411, 4, 413, 414, 415, + /* 190 */ 356, 354, 58, 419, 420, 416, 417, 63, 364, 385, + /* 200 */ 20, 364, 62, 369, 70, 371, 206, 207, 20, 209, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 222, 223, 224, 225, 226, 65, 66, 67, - /* 230 */ 426, 20, 161, 162, 430, 73, 74, 20, 187, 188, - /* 240 */ 78, 79, 191, 368, 193, 321, 84, 85, 4, 445, - /* 250 */ 446, 180, 90, 182, 450, 451, 164, 165, 324, 167, - /* 260 */ 80, 166, 170, 205, 205, 231, 232, 233, 234, 235, - /* 270 */ 236, 237, 238, 239, 240, 241, 205, 206, 186, 208, - /* 280 */ 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - /* 290 */ 219, 220, 221, 222, 223, 224, 225, 226, 354, 228, - /* 300 */ 12, 13, 368, 341, 342, 244, 244, 96, 20, 385, - /* 310 */ 22, 367, 253, 254, 255, 256, 257, 137, 138, 161, - /* 320 */ 162, 33, 324, 35, 109, 110, 111, 112, 113, 114, - /* 330 */ 115, 116, 117, 118, 119, 20, 121, 122, 123, 124, - /* 340 */ 125, 126, 175, 336, 249, 250, 58, 20, 244, 22, - /* 350 */ 426, 63, 329, 355, 430, 332, 333, 350, 70, 341, - /* 360 */ 342, 363, 35, 196, 197, 358, 368, 44, 370, 445, - /* 370 */ 446, 12, 13, 14, 450, 451, 2, 355, 51, 20, - /* 380 */ 163, 22, 8, 9, 96, 363, 12, 13, 14, 15, - /* 390 */ 16, 393, 33, 329, 35, 397, 332, 333, 400, 401, - /* 400 */ 402, 403, 404, 405, 332, 407, 118, 324, 8, 9, - /* 410 */ 399, 96, 12, 13, 14, 15, 16, 58, 346, 127, - /* 420 */ 132, 133, 108, 163, 402, 353, 8, 9, 168, 70, - /* 430 */ 12, 13, 14, 15, 16, 363, 425, 35, 355, 441, - /* 440 */ 442, 127, 128, 129, 130, 131, 363, 336, 370, 161, - /* 450 */ 162, 368, 96, 370, 426, 96, 242, 243, 430, 8, - /* 460 */ 9, 383, 20, 12, 13, 14, 15, 16, 180, 358, - /* 470 */ 182, 20, 70, 445, 446, 324, 393, 118, 450, 451, - /* 480 */ 397, 189, 190, 400, 401, 402, 403, 404, 405, 245, - /* 490 */ 407, 132, 133, 205, 206, 96, 208, 209, 210, 211, - /* 500 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 510 */ 222, 223, 224, 225, 226, 97, 4, 324, 324, 368, - /* 520 */ 161, 162, 0, 21, 45, 46, 24, 25, 26, 27, - /* 530 */ 28, 29, 30, 31, 32, 452, 453, 127, 128, 180, - /* 540 */ 228, 182, 230, 21, 0, 324, 24, 25, 26, 27, - /* 550 */ 28, 29, 30, 31, 32, 43, 20, 45, 46, 244, - /* 560 */ 62, 368, 368, 163, 205, 206, 160, 208, 209, 210, - /* 570 */ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - /* 580 */ 221, 222, 223, 224, 225, 226, 12, 13, 265, 368, - /* 590 */ 19, 4, 20, 20, 20, 22, 22, 363, 188, 332, - /* 600 */ 244, 191, 332, 193, 33, 14, 19, 33, 374, 35, - /* 610 */ 324, 20, 96, 346, 163, 107, 346, 332, 324, 48, - /* 620 */ 33, 228, 332, 353, 51, 54, 55, 56, 57, 58, - /* 630 */ 363, 346, 58, 363, 347, 48, 338, 231, 355, 70, - /* 640 */ 53, 355, 355, 244, 70, 58, 70, 241, 363, 363, - /* 650 */ 352, 364, 108, 363, 368, 0, 370, 12, 13, 361, - /* 660 */ 377, 0, 368, 332, 324, 20, 95, 22, 0, 98, - /* 670 */ 96, 127, 128, 129, 130, 131, 356, 346, 33, 393, - /* 680 */ 35, 324, 95, 397, 356, 98, 400, 401, 402, 403, - /* 690 */ 404, 405, 118, 407, 363, 179, 410, 181, 412, 413, - /* 700 */ 414, 347, 131, 58, 418, 419, 132, 133, 368, 355, - /* 710 */ 389, 421, 422, 423, 424, 70, 426, 427, 364, 356, - /* 720 */ 65, 66, 67, 62, 58, 368, 14, 332, 73, 74, - /* 730 */ 62, 324, 20, 78, 79, 161, 162, 324, 167, 84, - /* 740 */ 85, 96, 0, 8, 9, 90, 20, 12, 13, 14, - /* 750 */ 15, 16, 161, 20, 180, 184, 182, 186, 363, 348, - /* 760 */ 244, 95, 351, 118, 98, 357, 24, 25, 26, 27, - /* 770 */ 28, 29, 30, 31, 32, 368, 368, 132, 133, 205, - /* 780 */ 206, 368, 208, 209, 210, 211, 212, 213, 214, 215, - /* 790 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - /* 800 */ 226, 18, 108, 20, 396, 397, 161, 162, 324, 363, - /* 810 */ 27, 399, 411, 30, 413, 407, 33, 422, 423, 424, - /* 820 */ 374, 426, 427, 355, 130, 180, 0, 182, 324, 0, - /* 830 */ 324, 48, 97, 50, 2, 410, 53, 425, 413, 371, - /* 840 */ 8, 9, 324, 324, 12, 13, 14, 15, 16, 356, - /* 850 */ 205, 206, 368, 208, 209, 210, 211, 212, 213, 214, - /* 860 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - /* 870 */ 225, 226, 368, 161, 368, 8, 9, 48, 95, 12, - /* 880 */ 13, 14, 15, 16, 20, 365, 368, 368, 368, 163, - /* 890 */ 107, 65, 66, 67, 68, 69, 163, 71, 72, 73, - /* 900 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - /* 910 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 136, - /* 920 */ 324, 324, 139, 140, 141, 142, 143, 144, 145, 146, - /* 930 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 3, - /* 940 */ 157, 158, 159, 18, 411, 332, 413, 332, 23, 8, - /* 950 */ 9, 44, 355, 12, 13, 14, 15, 16, 332, 346, - /* 960 */ 363, 346, 37, 38, 368, 368, 41, 370, 382, 385, - /* 970 */ 384, 3, 346, 44, 324, 324, 363, 382, 363, 384, - /* 980 */ 324, 332, 1, 2, 59, 60, 61, 0, 20, 363, - /* 990 */ 393, 332, 332, 365, 397, 346, 368, 400, 401, 402, - /* 1000 */ 403, 404, 405, 39, 407, 355, 346, 0, 356, 412, - /* 1010 */ 426, 414, 363, 363, 430, 418, 419, 344, 368, 368, - /* 1020 */ 370, 96, 363, 363, 368, 161, 97, 332, 348, 445, - /* 1030 */ 446, 351, 332, 100, 450, 451, 103, 440, 357, 172, - /* 1040 */ 356, 346, 332, 393, 58, 100, 346, 397, 103, 368, - /* 1050 */ 400, 401, 402, 403, 404, 405, 346, 407, 363, 134, - /* 1060 */ 332, 324, 412, 363, 414, 97, 12, 13, 418, 419, - /* 1070 */ 343, 356, 345, 363, 346, 35, 22, 396, 397, 429, - /* 1080 */ 332, 422, 423, 424, 98, 426, 427, 33, 407, 35, - /* 1090 */ 325, 363, 355, 22, 346, 108, 107, 172, 173, 174, - /* 1100 */ 363, 42, 177, 44, 324, 368, 35, 370, 42, 378, - /* 1110 */ 44, 363, 58, 443, 127, 128, 129, 130, 131, 35, - /* 1120 */ 195, 357, 332, 198, 70, 200, 201, 202, 203, 204, - /* 1130 */ 393, 163, 368, 266, 397, 355, 346, 400, 401, 402, - /* 1140 */ 403, 404, 405, 363, 407, 156, 0, 96, 368, 412, - /* 1150 */ 370, 414, 454, 363, 0, 418, 419, 106, 151, 334, - /* 1160 */ 396, 397, 398, 385, 100, 332, 429, 103, 22, 244, - /* 1170 */ 263, 407, 118, 393, 332, 324, 22, 397, 44, 346, - /* 1180 */ 400, 401, 402, 403, 404, 405, 332, 407, 346, 332, - /* 1190 */ 0, 47, 412, 437, 414, 355, 363, 261, 418, 419, - /* 1200 */ 346, 332, 334, 346, 426, 363, 355, 243, 430, 429, - /* 1210 */ 132, 133, 22, 100, 363, 346, 103, 363, 324, 368, - /* 1220 */ 363, 370, 182, 445, 446, 44, 44, 44, 450, 451, - /* 1230 */ 44, 97, 363, 44, 180, 44, 182, 44, 378, 331, - /* 1240 */ 96, 367, 428, 378, 393, 447, 35, 420, 397, 355, - /* 1250 */ 44, 400, 401, 402, 403, 404, 405, 363, 407, 205, - /* 1260 */ 206, 324, 368, 412, 370, 414, 182, 44, 44, 418, - /* 1270 */ 419, 217, 218, 219, 220, 221, 222, 223, 97, 97, - /* 1280 */ 97, 70, 246, 97, 0, 324, 97, 393, 97, 13, - /* 1290 */ 97, 397, 355, 44, 400, 401, 402, 403, 404, 405, - /* 1300 */ 363, 407, 431, 97, 44, 368, 412, 370, 414, 395, - /* 1310 */ 48, 35, 418, 419, 13, 394, 355, 44, 44, 22, - /* 1320 */ 97, 97, 387, 178, 363, 42, 375, 20, 378, 368, - /* 1330 */ 393, 370, 35, 49, 397, 37, 35, 400, 401, 402, - /* 1340 */ 403, 404, 405, 324, 407, 375, 97, 160, 373, 412, - /* 1350 */ 20, 414, 332, 332, 393, 418, 419, 97, 397, 375, - /* 1360 */ 94, 400, 401, 402, 403, 404, 405, 70, 407, 373, - /* 1370 */ 97, 97, 373, 340, 355, 414, 332, 332, 332, 418, - /* 1380 */ 419, 20, 363, 326, 326, 20, 324, 368, 391, 370, - /* 1390 */ 338, 338, 370, 20, 333, 20, 386, 99, 338, 101, - /* 1400 */ 102, 333, 104, 338, 332, 338, 108, 338, 338, 52, - /* 1410 */ 335, 335, 393, 326, 324, 118, 397, 355, 355, 400, - /* 1420 */ 401, 402, 403, 404, 405, 363, 407, 332, 130, 355, - /* 1430 */ 368, 326, 370, 414, 355, 355, 355, 418, 419, 194, - /* 1440 */ 355, 355, 392, 355, 355, 355, 355, 355, 336, 185, - /* 1450 */ 368, 336, 332, 363, 252, 393, 251, 258, 368, 397, - /* 1460 */ 370, 378, 400, 401, 402, 403, 404, 405, 391, 407, - /* 1470 */ 370, 378, 368, 324, 436, 368, 414, 180, 381, 182, - /* 1480 */ 418, 419, 381, 393, 390, 436, 368, 397, 171, 368, - /* 1490 */ 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - /* 1500 */ 260, 259, 205, 206, 355, 247, 395, 264, 267, 262, - /* 1510 */ 455, 438, 363, 243, 363, 20, 399, 368, 333, 370, - /* 1520 */ 332, 381, 381, 368, 368, 368, 368, 368, 336, 368, - /* 1530 */ 336, 324, 165, 434, 436, 439, 433, 435, 363, 379, - /* 1540 */ 336, 96, 393, 417, 96, 368, 397, 351, 345, 400, - /* 1550 */ 401, 402, 403, 404, 405, 449, 407, 448, 332, 324, - /* 1560 */ 359, 336, 355, 414, 36, 327, 388, 349, 419, 349, - /* 1570 */ 363, 349, 326, 337, 322, 368, 0, 370, 0, 384, - /* 1580 */ 187, 0, 0, 42, 0, 324, 35, 199, 35, 35, - /* 1590 */ 355, 35, 0, 199, 35, 35, 199, 0, 363, 199, - /* 1600 */ 393, 0, 35, 368, 397, 370, 0, 400, 401, 402, - /* 1610 */ 403, 404, 405, 0, 407, 22, 355, 182, 35, 180, - /* 1620 */ 0, 0, 176, 0, 363, 175, 0, 47, 393, 368, - /* 1630 */ 0, 370, 397, 0, 0, 400, 401, 402, 403, 404, - /* 1640 */ 405, 42, 407, 0, 0, 0, 0, 0, 0, 442, - /* 1650 */ 0, 0, 151, 35, 393, 324, 0, 151, 397, 0, - /* 1660 */ 0, 400, 401, 402, 403, 404, 405, 0, 407, 0, - /* 1670 */ 0, 0, 0, 0, 324, 22, 0, 42, 0, 444, - /* 1680 */ 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, - /* 1690 */ 0, 360, 135, 0, 363, 0, 0, 0, 0, 368, - /* 1700 */ 35, 370, 0, 0, 0, 355, 0, 58, 42, 47, - /* 1710 */ 58, 47, 44, 363, 453, 14, 39, 0, 368, 14, - /* 1720 */ 370, 47, 0, 0, 393, 0, 40, 0, 397, 171, - /* 1730 */ 39, 400, 401, 402, 403, 404, 405, 324, 407, 39, - /* 1740 */ 0, 0, 0, 393, 0, 35, 39, 397, 0, 35, - /* 1750 */ 400, 401, 402, 403, 404, 405, 48, 407, 324, 409, - /* 1760 */ 48, 0, 0, 64, 35, 39, 48, 39, 355, 35, - /* 1770 */ 39, 0, 48, 360, 0, 0, 363, 0, 35, 22, - /* 1780 */ 324, 368, 0, 370, 105, 35, 35, 22, 35, 355, - /* 1790 */ 35, 44, 22, 44, 360, 35, 0, 363, 35, 35, - /* 1800 */ 22, 324, 368, 0, 370, 22, 393, 0, 50, 22, - /* 1810 */ 397, 355, 103, 400, 401, 402, 403, 404, 405, 363, - /* 1820 */ 407, 35, 0, 324, 368, 35, 370, 393, 0, 35, - /* 1830 */ 0, 397, 355, 22, 400, 401, 402, 403, 404, 405, - /* 1840 */ 363, 407, 97, 20, 324, 368, 0, 370, 96, 393, - /* 1850 */ 35, 0, 0, 397, 355, 22, 400, 401, 402, 403, - /* 1860 */ 404, 405, 363, 407, 0, 44, 3, 368, 96, 370, - /* 1870 */ 393, 44, 248, 97, 397, 355, 163, 400, 401, 402, - /* 1880 */ 403, 404, 405, 363, 407, 165, 97, 324, 368, 96, - /* 1890 */ 370, 96, 393, 163, 183, 163, 397, 97, 97, 400, - /* 1900 */ 401, 402, 403, 404, 405, 169, 407, 47, 96, 96, - /* 1910 */ 44, 44, 47, 393, 96, 324, 3, 397, 355, 44, - /* 1920 */ 400, 401, 402, 403, 404, 405, 363, 407, 97, 97, - /* 1930 */ 35, 368, 35, 370, 35, 35, 35, 35, 97, 97, - /* 1940 */ 47, 324, 248, 47, 0, 0, 355, 44, 0, 96, - /* 1950 */ 35, 97, 97, 96, 363, 35, 393, 242, 192, 368, - /* 1960 */ 397, 370, 0, 400, 401, 402, 403, 404, 405, 248, - /* 1970 */ 407, 166, 355, 96, 96, 0, 39, 96, 164, 106, - /* 1980 */ 363, 47, 44, 227, 393, 368, 2, 370, 397, 22, - /* 1990 */ 205, 400, 401, 402, 403, 404, 405, 229, 407, 324, - /* 2000 */ 227, 97, 96, 96, 47, 97, 96, 47, 97, 97, - /* 2010 */ 393, 207, 96, 96, 397, 22, 324, 400, 401, 402, - /* 2020 */ 403, 404, 405, 97, 407, 96, 107, 35, 96, 35, - /* 2030 */ 355, 35, 97, 97, 35, 96, 96, 35, 363, 97, - /* 2040 */ 97, 35, 96, 368, 120, 370, 96, 355, 120, 22, - /* 2050 */ 120, 120, 96, 35, 96, 363, 44, 108, 22, 324, - /* 2060 */ 368, 96, 370, 35, 64, 35, 63, 35, 393, 35, - /* 2070 */ 35, 70, 397, 35, 35, 400, 401, 402, 403, 404, - /* 2080 */ 405, 35, 407, 324, 35, 393, 35, 44, 93, 397, - /* 2090 */ 355, 35, 400, 401, 402, 403, 404, 405, 363, 407, - /* 2100 */ 35, 22, 35, 368, 22, 370, 35, 35, 22, 35, - /* 2110 */ 70, 35, 35, 35, 355, 35, 35, 0, 35, 35, - /* 2120 */ 0, 0, 363, 48, 39, 35, 324, 368, 393, 370, - /* 2130 */ 39, 39, 397, 35, 0, 400, 401, 402, 403, 404, - /* 2140 */ 405, 35, 407, 324, 48, 48, 39, 48, 0, 35, - /* 2150 */ 35, 0, 393, 22, 21, 20, 397, 355, 21, 400, - /* 2160 */ 401, 402, 403, 404, 405, 363, 407, 22, 22, 324, - /* 2170 */ 368, 456, 370, 456, 355, 456, 456, 456, 456, 456, - /* 2180 */ 456, 456, 363, 456, 456, 456, 324, 368, 456, 370, - /* 2190 */ 456, 456, 456, 456, 456, 393, 456, 456, 456, 397, - /* 2200 */ 355, 456, 400, 401, 402, 403, 404, 405, 363, 407, - /* 2210 */ 456, 456, 393, 368, 456, 370, 397, 355, 456, 400, - /* 2220 */ 401, 402, 403, 404, 405, 363, 407, 456, 456, 324, - /* 2230 */ 368, 456, 370, 456, 456, 456, 456, 456, 393, 456, - /* 2240 */ 456, 456, 397, 456, 456, 400, 401, 402, 403, 404, - /* 2250 */ 405, 324, 407, 456, 456, 393, 456, 456, 456, 397, - /* 2260 */ 355, 456, 400, 401, 402, 403, 404, 405, 363, 407, - /* 2270 */ 456, 456, 456, 368, 456, 370, 456, 456, 456, 456, - /* 2280 */ 456, 456, 355, 456, 456, 456, 456, 456, 456, 456, - /* 2290 */ 363, 456, 456, 456, 456, 368, 456, 370, 393, 456, - /* 2300 */ 456, 456, 397, 456, 456, 400, 401, 402, 403, 404, - /* 2310 */ 405, 456, 407, 324, 456, 456, 456, 456, 456, 456, - /* 2320 */ 393, 456, 456, 456, 397, 456, 456, 400, 401, 402, - /* 2330 */ 403, 404, 405, 456, 407, 324, 456, 456, 456, 456, - /* 2340 */ 456, 456, 456, 456, 355, 456, 456, 456, 456, 456, - /* 2350 */ 456, 456, 363, 456, 456, 456, 456, 368, 456, 370, - /* 2360 */ 456, 456, 456, 456, 456, 456, 355, 456, 456, 456, - /* 2370 */ 456, 456, 456, 456, 363, 456, 456, 456, 456, 368, - /* 2380 */ 456, 370, 393, 456, 456, 456, 397, 456, 456, 400, - /* 2390 */ 401, 402, 403, 404, 405, 456, 407, 324, 456, 456, - /* 2400 */ 456, 456, 456, 456, 393, 456, 456, 456, 397, 456, - /* 2410 */ 456, 400, 401, 402, 403, 404, 405, 324, 407, 456, - /* 2420 */ 456, 456, 456, 456, 456, 456, 456, 456, 355, 456, - /* 2430 */ 456, 456, 456, 456, 456, 456, 363, 456, 456, 456, - /* 2440 */ 456, 368, 456, 370, 456, 456, 456, 456, 355, 456, - /* 2450 */ 456, 456, 456, 456, 456, 456, 363, 456, 456, 456, - /* 2460 */ 324, 368, 456, 370, 456, 456, 393, 456, 456, 456, - /* 2470 */ 397, 456, 456, 400, 401, 402, 403, 404, 405, 456, - /* 2480 */ 407, 456, 456, 456, 456, 456, 393, 456, 456, 456, - /* 2490 */ 397, 355, 456, 400, 401, 402, 403, 404, 405, 363, - /* 2500 */ 407, 456, 456, 456, 368, 456, 370, 456, 456, 456, - /* 2510 */ 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - /* 2520 */ 456, 456, 456, 456, 456, 456, 456, 456, 456, 393, - /* 2530 */ 456, 456, 456, 397, 456, 456, 400, 401, 402, 403, - /* 2540 */ 404, 405, 456, 407, + /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 394, 337, + /* 230 */ 96, 3, 398, 325, 162, 401, 402, 403, 404, 405, + /* 240 */ 406, 427, 408, 351, 20, 431, 162, 413, 20, 415, + /* 250 */ 167, 359, 118, 419, 420, 12, 13, 14, 15, 16, + /* 260 */ 446, 447, 229, 108, 356, 451, 452, 133, 134, 370, + /* 270 */ 371, 245, 364, 162, 163, 441, 96, 369, 96, 371, + /* 280 */ 12, 13, 127, 128, 129, 130, 131, 132, 20, 20, + /* 290 */ 22, 96, 20, 325, 342, 343, 162, 163, 325, 333, + /* 300 */ 245, 33, 394, 35, 330, 333, 398, 333, 334, 401, + /* 310 */ 402, 403, 404, 405, 406, 181, 408, 183, 128, 347, + /* 320 */ 107, 413, 355, 415, 356, 97, 58, 419, 420, 161, + /* 330 */ 364, 63, 364, 250, 251, 368, 364, 369, 70, 371, + /* 340 */ 206, 207, 369, 209, 210, 211, 212, 213, 214, 215, + /* 350 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + /* 360 */ 226, 227, 394, 229, 96, 325, 398, 342, 343, 401, + /* 370 */ 402, 403, 404, 405, 406, 180, 408, 182, 188, 189, + /* 380 */ 96, 413, 192, 415, 194, 339, 118, 419, 420, 423, + /* 390 */ 424, 425, 164, 427, 428, 80, 356, 431, 430, 353, + /* 400 */ 232, 133, 134, 389, 364, 133, 134, 22, 362, 369, + /* 410 */ 242, 371, 446, 447, 12, 13, 14, 451, 452, 371, + /* 420 */ 35, 70, 20, 0, 22, 245, 96, 245, 364, 381, + /* 430 */ 162, 163, 384, 164, 394, 33, 58, 35, 398, 375, + /* 440 */ 245, 401, 402, 403, 404, 405, 406, 108, 408, 181, + /* 450 */ 410, 183, 330, 138, 139, 333, 334, 8, 9, 70, + /* 460 */ 58, 12, 13, 14, 15, 16, 127, 128, 129, 130, + /* 470 */ 131, 132, 70, 95, 206, 207, 98, 209, 210, 211, + /* 480 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + /* 490 */ 222, 223, 224, 225, 226, 227, 333, 325, 96, 333, + /* 500 */ 357, 325, 356, 65, 66, 67, 20, 333, 356, 363, + /* 510 */ 347, 73, 74, 347, 357, 363, 78, 79, 372, 325, + /* 520 */ 118, 347, 84, 85, 372, 348, 348, 364, 90, 245, + /* 530 */ 364, 108, 356, 356, 356, 133, 134, 20, 364, 22, + /* 540 */ 364, 369, 365, 365, 21, 369, 97, 371, 12, 13, + /* 550 */ 127, 128, 129, 130, 131, 132, 20, 34, 22, 36, + /* 560 */ 357, 325, 333, 369, 162, 163, 176, 35, 51, 33, + /* 570 */ 394, 35, 333, 333, 398, 245, 347, 401, 402, 403, + /* 580 */ 404, 405, 406, 181, 408, 183, 347, 197, 198, 413, + /* 590 */ 357, 415, 356, 364, 58, 419, 420, 127, 357, 229, + /* 600 */ 364, 231, 70, 364, 364, 369, 70, 371, 206, 207, + /* 610 */ 339, 209, 210, 211, 212, 213, 214, 215, 216, 217, + /* 620 */ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + /* 630 */ 394, 356, 96, 362, 398, 348, 63, 401, 402, 403, + /* 640 */ 404, 405, 406, 356, 408, 127, 128, 325, 162, 413, + /* 650 */ 132, 415, 365, 378, 118, 419, 420, 325, 325, 0, + /* 660 */ 190, 191, 422, 423, 424, 425, 430, 427, 428, 133, + /* 670 */ 134, 8, 9, 39, 2, 12, 13, 14, 15, 16, + /* 680 */ 8, 9, 12, 13, 12, 13, 14, 15, 16, 356, + /* 690 */ 20, 369, 22, 337, 333, 333, 379, 364, 162, 163, + /* 700 */ 325, 369, 369, 33, 371, 35, 356, 44, 347, 347, + /* 710 */ 14, 15, 16, 363, 412, 359, 414, 181, 412, 183, + /* 720 */ 414, 62, 372, 357, 356, 364, 364, 394, 58, 349, + /* 730 */ 325, 398, 352, 365, 401, 402, 403, 404, 405, 406, + /* 740 */ 70, 408, 206, 207, 369, 209, 210, 211, 212, 213, + /* 750 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + /* 760 */ 224, 225, 226, 227, 8, 9, 96, 325, 12, 13, + /* 770 */ 14, 15, 16, 364, 369, 442, 443, 427, 206, 206, + /* 780 */ 18, 431, 20, 400, 375, 333, 357, 325, 118, 27, + /* 790 */ 325, 325, 30, 0, 325, 33, 446, 447, 356, 347, + /* 800 */ 0, 451, 452, 133, 134, 325, 364, 326, 325, 426, + /* 810 */ 48, 369, 50, 371, 21, 53, 364, 24, 25, 26, + /* 820 */ 27, 28, 29, 30, 31, 32, 254, 255, 256, 257, + /* 830 */ 258, 369, 162, 163, 369, 369, 394, 344, 369, 346, + /* 840 */ 398, 333, 333, 401, 402, 403, 404, 405, 406, 369, + /* 850 */ 408, 181, 369, 183, 325, 347, 347, 95, 0, 8, + /* 860 */ 9, 4, 62, 12, 13, 14, 15, 16, 3, 107, + /* 870 */ 20, 20, 364, 364, 400, 325, 206, 207, 244, 209, + /* 880 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + /* 890 */ 220, 221, 222, 223, 224, 225, 226, 227, 369, 137, + /* 900 */ 426, 345, 140, 141, 142, 143, 144, 145, 146, 147, + /* 910 */ 148, 149, 150, 151, 152, 153, 154, 155, 156, 369, + /* 920 */ 158, 159, 160, 65, 66, 67, 68, 69, 44, 71, + /* 930 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + /* 940 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + /* 950 */ 92, 18, 325, 325, 333, 325, 23, 8, 9, 12, + /* 960 */ 13, 12, 13, 14, 15, 16, 325, 325, 347, 22, + /* 970 */ 37, 38, 333, 411, 41, 366, 414, 455, 369, 20, + /* 980 */ 33, 97, 35, 8, 9, 364, 347, 12, 13, 14, + /* 990 */ 15, 16, 59, 60, 61, 371, 369, 369, 356, 369, + /* 1000 */ 1, 2, 37, 364, 366, 58, 364, 369, 384, 444, + /* 1010 */ 369, 369, 63, 371, 164, 164, 44, 70, 109, 110, + /* 1020 */ 111, 112, 113, 114, 115, 116, 117, 118, 119, 96, + /* 1030 */ 121, 122, 123, 124, 125, 126, 394, 335, 349, 333, + /* 1040 */ 398, 352, 356, 401, 402, 403, 404, 405, 406, 366, + /* 1050 */ 408, 385, 369, 347, 105, 413, 100, 415, 372, 103, + /* 1060 */ 33, 419, 420, 19, 99, 118, 101, 102, 135, 104, + /* 1070 */ 364, 438, 430, 108, 333, 48, 0, 33, 22, 45, + /* 1080 */ 46, 54, 55, 56, 57, 58, 243, 244, 347, 0, + /* 1090 */ 333, 35, 48, 427, 108, 130, 97, 431, 54, 55, + /* 1100 */ 56, 57, 58, 246, 347, 364, 173, 174, 175, 333, + /* 1110 */ 161, 178, 446, 447, 107, 44, 130, 451, 452, 333, + /* 1120 */ 35, 364, 95, 164, 48, 98, 70, 262, 181, 196, + /* 1130 */ 183, 356, 199, 347, 201, 202, 203, 204, 205, 95, + /* 1140 */ 364, 42, 98, 44, 42, 35, 44, 335, 173, 44, + /* 1150 */ 364, 379, 21, 206, 207, 24, 25, 26, 27, 28, + /* 1160 */ 29, 30, 31, 32, 157, 218, 219, 220, 221, 222, + /* 1170 */ 223, 224, 44, 100, 118, 131, 103, 325, 245, 44, + /* 1180 */ 333, 232, 233, 234, 235, 236, 237, 238, 239, 240, + /* 1190 */ 241, 242, 165, 166, 347, 168, 0, 0, 171, 423, + /* 1200 */ 424, 425, 97, 427, 428, 325, 100, 100, 356, 103, + /* 1210 */ 103, 364, 168, 44, 187, 164, 364, 44, 22, 22, + /* 1220 */ 169, 369, 44, 371, 58, 97, 133, 134, 47, 185, + /* 1230 */ 96, 187, 97, 1, 2, 332, 356, 181, 266, 183, + /* 1240 */ 106, 152, 267, 44, 364, 35, 394, 13, 325, 369, + /* 1250 */ 398, 371, 379, 401, 402, 403, 404, 405, 406, 44, + /* 1260 */ 408, 44, 206, 207, 98, 413, 97, 415, 183, 35, + /* 1270 */ 97, 419, 420, 368, 394, 97, 325, 96, 398, 356, + /* 1280 */ 70, 401, 402, 403, 404, 405, 406, 364, 408, 429, + /* 1290 */ 448, 2, 369, 183, 371, 415, 97, 8, 9, 419, + /* 1300 */ 420, 12, 13, 14, 15, 16, 421, 356, 44, 44, + /* 1310 */ 432, 44, 97, 247, 97, 364, 44, 394, 13, 325, + /* 1320 */ 369, 398, 371, 0, 401, 402, 403, 404, 405, 406, + /* 1330 */ 396, 408, 44, 48, 395, 264, 44, 325, 415, 179, + /* 1340 */ 35, 387, 419, 420, 42, 394, 376, 20, 379, 398, + /* 1350 */ 356, 161, 401, 402, 403, 404, 405, 406, 364, 408, + /* 1360 */ 376, 97, 97, 369, 97, 371, 415, 374, 356, 97, + /* 1370 */ 419, 420, 49, 20, 333, 333, 364, 376, 374, 374, + /* 1380 */ 325, 369, 333, 371, 94, 97, 341, 333, 394, 97, + /* 1390 */ 333, 20, 398, 4, 327, 401, 402, 403, 404, 405, + /* 1400 */ 406, 407, 408, 409, 410, 327, 394, 20, 19, 391, + /* 1410 */ 398, 356, 20, 401, 402, 403, 404, 405, 406, 364, + /* 1420 */ 408, 339, 33, 371, 369, 339, 371, 20, 358, 334, + /* 1430 */ 339, 334, 386, 325, 52, 339, 333, 48, 369, 369, + /* 1440 */ 339, 358, 53, 339, 327, 195, 356, 58, 336, 394, + /* 1450 */ 339, 336, 369, 398, 325, 333, 401, 402, 403, 404, + /* 1460 */ 405, 406, 337, 408, 356, 453, 454, 397, 398, 399, + /* 1470 */ 415, 327, 364, 393, 356, 420, 356, 369, 408, 371, + /* 1480 */ 397, 398, 399, 385, 95, 356, 356, 98, 356, 356, + /* 1490 */ 369, 408, 356, 364, 385, 356, 356, 356, 369, 356, + /* 1500 */ 371, 186, 394, 333, 391, 337, 398, 369, 325, 401, + /* 1510 */ 402, 403, 404, 405, 406, 253, 408, 390, 371, 382, + /* 1520 */ 252, 379, 333, 394, 379, 427, 369, 398, 369, 431, + /* 1530 */ 401, 402, 403, 404, 405, 406, 427, 408, 382, 356, + /* 1540 */ 431, 369, 259, 261, 446, 447, 172, 364, 248, 451, + /* 1550 */ 452, 443, 369, 364, 371, 446, 447, 260, 435, 440, + /* 1560 */ 451, 452, 325, 8, 9, 439, 268, 12, 13, 14, + /* 1570 */ 15, 16, 396, 244, 445, 265, 263, 394, 364, 325, + /* 1580 */ 456, 398, 434, 437, 401, 402, 403, 404, 405, 406, + /* 1590 */ 437, 408, 437, 356, 436, 20, 333, 337, 361, 450, + /* 1600 */ 449, 364, 400, 334, 382, 325, 369, 369, 371, 369, + /* 1610 */ 356, 369, 423, 424, 425, 361, 427, 428, 364, 166, + /* 1620 */ 369, 369, 369, 369, 337, 371, 382, 380, 352, 96, + /* 1630 */ 337, 394, 96, 325, 364, 398, 356, 454, 401, 402, + /* 1640 */ 403, 404, 405, 406, 364, 408, 418, 369, 394, 369, + /* 1650 */ 346, 371, 398, 333, 360, 401, 402, 403, 404, 405, + /* 1660 */ 406, 337, 408, 36, 356, 328, 327, 388, 350, 361, + /* 1670 */ 338, 350, 364, 392, 394, 350, 325, 369, 398, 371, + /* 1680 */ 323, 401, 402, 403, 404, 405, 406, 0, 408, 383, + /* 1690 */ 383, 0, 325, 188, 0, 0, 42, 0, 35, 200, + /* 1700 */ 35, 35, 394, 35, 200, 0, 398, 356, 35, 401, + /* 1710 */ 402, 403, 404, 405, 406, 364, 408, 35, 200, 164, + /* 1720 */ 369, 0, 371, 356, 200, 0, 0, 35, 22, 0, + /* 1730 */ 183, 364, 181, 35, 0, 385, 369, 0, 371, 177, + /* 1740 */ 176, 0, 0, 325, 0, 394, 47, 0, 0, 398, + /* 1750 */ 42, 0, 401, 402, 403, 404, 405, 406, 0, 408, + /* 1760 */ 0, 394, 0, 0, 0, 398, 0, 0, 401, 402, + /* 1770 */ 403, 404, 405, 406, 356, 408, 152, 427, 35, 0, + /* 1780 */ 152, 431, 364, 0, 0, 0, 325, 369, 0, 371, + /* 1790 */ 0, 0, 0, 0, 0, 0, 446, 447, 0, 0, + /* 1800 */ 0, 451, 452, 325, 0, 0, 0, 42, 0, 0, + /* 1810 */ 0, 0, 394, 0, 0, 0, 398, 356, 22, 401, + /* 1820 */ 402, 403, 404, 405, 406, 364, 408, 0, 0, 136, + /* 1830 */ 369, 0, 371, 58, 356, 0, 35, 0, 58, 0, + /* 1840 */ 14, 44, 364, 14, 42, 0, 39, 369, 0, 371, + /* 1850 */ 47, 0, 40, 0, 0, 394, 325, 39, 39, 398, + /* 1860 */ 172, 0, 401, 402, 403, 404, 405, 406, 47, 408, + /* 1870 */ 47, 0, 394, 325, 0, 0, 398, 35, 48, 401, + /* 1880 */ 402, 403, 404, 405, 406, 39, 408, 356, 64, 0, + /* 1890 */ 35, 48, 0, 35, 0, 364, 39, 48, 39, 35, + /* 1900 */ 369, 39, 371, 0, 356, 0, 0, 0, 48, 22, + /* 1910 */ 0, 35, 364, 35, 35, 22, 35, 369, 35, 371, + /* 1920 */ 103, 105, 22, 35, 325, 394, 44, 0, 44, 398, + /* 1930 */ 35, 35, 401, 402, 403, 404, 405, 406, 22, 408, + /* 1940 */ 0, 325, 394, 22, 0, 22, 398, 50, 35, 401, + /* 1950 */ 402, 403, 404, 405, 406, 356, 408, 0, 0, 35, + /* 1960 */ 35, 0, 97, 364, 22, 20, 35, 325, 369, 35, + /* 1970 */ 371, 193, 356, 96, 0, 0, 35, 22, 0, 0, + /* 1980 */ 364, 44, 249, 3, 325, 369, 164, 371, 97, 249, + /* 1990 */ 44, 44, 44, 394, 96, 96, 164, 398, 356, 166, + /* 2000 */ 401, 402, 403, 404, 405, 406, 364, 408, 164, 184, + /* 2010 */ 394, 369, 97, 371, 398, 356, 97, 401, 402, 403, + /* 2020 */ 404, 405, 406, 364, 408, 96, 170, 97, 369, 47, + /* 2030 */ 371, 96, 96, 47, 96, 325, 394, 3, 44, 35, + /* 2040 */ 398, 35, 35, 401, 402, 403, 404, 405, 406, 97, + /* 2050 */ 408, 97, 35, 394, 35, 35, 97, 398, 47, 97, + /* 2060 */ 401, 402, 403, 404, 405, 406, 356, 408, 44, 47, + /* 2070 */ 0, 0, 0, 96, 364, 167, 0, 96, 325, 369, + /* 2080 */ 97, 371, 97, 249, 243, 96, 96, 39, 96, 47, + /* 2090 */ 106, 165, 2, 44, 325, 228, 230, 228, 96, 22, + /* 2100 */ 97, 96, 47, 47, 394, 97, 96, 206, 398, 356, + /* 2110 */ 97, 401, 402, 403, 404, 405, 406, 364, 408, 96, + /* 2120 */ 22, 96, 369, 97, 371, 356, 208, 96, 107, 97, + /* 2130 */ 35, 35, 96, 364, 97, 35, 96, 35, 369, 96, + /* 2140 */ 371, 97, 97, 35, 97, 325, 96, 394, 35, 96, + /* 2150 */ 120, 398, 22, 120, 401, 402, 403, 404, 405, 406, + /* 2160 */ 108, 408, 96, 394, 44, 96, 120, 398, 35, 96, + /* 2170 */ 401, 402, 403, 404, 405, 406, 356, 408, 120, 22, + /* 2180 */ 64, 63, 35, 35, 364, 35, 35, 35, 325, 369, + /* 2190 */ 35, 371, 70, 35, 35, 35, 35, 93, 44, 35, + /* 2200 */ 35, 22, 35, 22, 35, 325, 35, 35, 70, 35, + /* 2210 */ 35, 35, 35, 35, 394, 22, 0, 35, 398, 356, + /* 2220 */ 35, 401, 402, 403, 404, 405, 406, 364, 408, 39, + /* 2230 */ 0, 48, 369, 35, 371, 48, 356, 0, 39, 35, + /* 2240 */ 48, 39, 0, 35, 364, 48, 39, 0, 35, 369, + /* 2250 */ 35, 371, 0, 22, 21, 20, 22, 394, 325, 457, + /* 2260 */ 22, 398, 21, 457, 401, 402, 403, 404, 405, 406, + /* 2270 */ 457, 408, 457, 457, 394, 325, 457, 457, 398, 457, + /* 2280 */ 457, 401, 402, 403, 404, 405, 406, 457, 408, 356, + /* 2290 */ 457, 457, 457, 457, 457, 457, 457, 364, 457, 457, + /* 2300 */ 457, 457, 369, 457, 371, 457, 356, 457, 457, 457, + /* 2310 */ 457, 457, 457, 457, 364, 457, 457, 457, 457, 369, + /* 2320 */ 457, 371, 457, 457, 457, 457, 325, 394, 457, 457, + /* 2330 */ 457, 398, 457, 457, 401, 402, 403, 404, 405, 406, + /* 2340 */ 457, 408, 457, 457, 394, 457, 457, 457, 398, 457, + /* 2350 */ 457, 401, 402, 403, 404, 405, 406, 356, 408, 457, + /* 2360 */ 457, 457, 457, 457, 457, 364, 457, 457, 457, 457, + /* 2370 */ 369, 457, 371, 457, 457, 457, 457, 457, 457, 457, + /* 2380 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2390 */ 457, 457, 457, 457, 457, 394, 457, 457, 457, 398, + /* 2400 */ 457, 457, 401, 402, 403, 404, 405, 406, 457, 408, + /* 2410 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2420 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2430 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2440 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2450 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2460 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2470 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2480 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2490 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2500 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2510 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2520 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2530 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2540 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2550 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2560 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2570 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2580 */ 457, 457, 457, 457, 457, }; -#define YY_SHIFT_COUNT (706) +#define YY_SHIFT_COUNT (709) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2151) +#define YY_SHIFT_MAX (2252) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 925, 0, 71, 0, 288, 288, 288, 288, 288, 288, - /* 10 */ 288, 288, 288, 359, 574, 574, 645, 574, 574, 574, - /* 20 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 30 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 40 */ 574, 574, 574, 574, 574, 574, 61, 315, 211, 516, - /* 50 */ 62, 356, 399, 356, 211, 211, 1054, 1054, 356, 1054, - /* 60 */ 1054, 104, 356, 12, 12, 512, 512, 158, 31, 187, - /* 70 */ 187, 12, 12, 12, 12, 12, 12, 12, 12, 12, - /* 80 */ 12, 76, 12, 12, 168, 12, 442, 12, 12, 536, - /* 90 */ 12, 12, 536, 12, 536, 536, 536, 12, 498, 783, - /* 100 */ 34, 34, 162, 502, 1297, 1297, 1297, 1297, 1297, 1297, - /* 110 */ 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, - /* 120 */ 1297, 1297, 1297, 1298, 968, 158, 31, 661, 402, 217, - /* 130 */ 217, 217, 668, 312, 312, 402, 572, 572, 572, 508, - /* 140 */ 442, 3, 3, 393, 536, 536, 569, 569, 508, 576, - /* 150 */ 215, 215, 215, 215, 215, 215, 215, 571, 655, 522, - /* 160 */ 451, 867, 59, 327, 95, 591, 712, 573, 726, 479, - /* 170 */ 694, 733, 214, 964, 936, 214, 1059, 244, 864, 1036, - /* 180 */ 1262, 1145, 1283, 1307, 1283, 1187, 1330, 1330, 1283, 1187, - /* 190 */ 1187, 1266, 1330, 1330, 1330, 1361, 1361, 1365, 76, 442, - /* 200 */ 76, 1373, 1375, 76, 1373, 76, 76, 76, 1330, 76, - /* 210 */ 1357, 1357, 1361, 536, 536, 536, 536, 536, 536, 536, - /* 220 */ 536, 536, 536, 536, 1330, 1361, 569, 1245, 1365, 498, - /* 230 */ 1264, 442, 498, 1330, 1307, 1307, 569, 1202, 1205, 569, - /* 240 */ 1202, 1205, 569, 569, 536, 1199, 1317, 1202, 1240, 1242, - /* 250 */ 1258, 1036, 1241, 1243, 1247, 1270, 572, 1495, 1330, 1373, - /* 260 */ 498, 1205, 569, 569, 569, 569, 569, 1205, 569, 1367, - /* 270 */ 498, 508, 498, 572, 1445, 1448, 569, 576, 1330, 498, - /* 280 */ 1528, 1361, 2544, 2544, 2544, 2544, 2544, 2544, 2544, 826, - /* 290 */ 92, 742, 587, 418, 15, 735, 374, 832, 400, 941, - /* 300 */ 941, 544, 941, 941, 941, 941, 941, 941, 941, 987, - /* 310 */ 314, 51, 410, 73, 73, 167, 666, 180, 19, 292, - /* 320 */ 121, 99, 406, 121, 121, 121, 929, 829, 1071, 1066, - /* 330 */ 989, 1007, 933, 945, 1064, 1113, 1146, 1154, 1190, 986, - /* 340 */ 1134, 1181, 1078, 907, 323, 260, 1182, 1183, 1186, 1189, - /* 350 */ 1191, 981, 1193, 1040, 1084, 58, 1206, 1144, 1223, 1224, - /* 360 */ 1249, 1260, 1273, 1274, 1051, 1276, 1301, 1211, 1284, 1576, - /* 370 */ 1578, 1393, 1581, 1582, 1541, 1584, 1551, 1388, 1553, 1554, - /* 380 */ 1556, 1394, 1592, 1559, 1560, 1397, 1597, 1400, 1601, 1567, - /* 390 */ 1606, 1593, 1613, 1583, 1435, 1439, 1620, 1621, 1446, 1450, - /* 400 */ 1623, 1626, 1580, 1630, 1633, 1634, 1599, 1643, 1644, 1645, - /* 410 */ 1646, 1647, 1648, 1650, 1651, 1501, 1618, 1656, 1506, 1659, - /* 420 */ 1660, 1667, 1669, 1670, 1671, 1672, 1673, 1680, 1681, 1682, - /* 430 */ 1683, 1684, 1685, 1687, 1635, 1678, 1688, 1689, 1690, 1695, - /* 440 */ 1653, 1676, 1696, 1697, 1557, 1693, 1698, 1665, 1702, 1649, - /* 450 */ 1703, 1652, 1704, 1706, 1666, 1677, 1668, 1662, 1701, 1664, - /* 460 */ 1705, 1674, 1717, 1686, 1691, 1722, 1723, 1725, 1700, 1558, - /* 470 */ 1727, 1740, 1741, 1699, 1742, 1744, 1710, 1708, 1707, 1748, - /* 480 */ 1714, 1712, 1726, 1761, 1729, 1718, 1728, 1762, 1734, 1724, - /* 490 */ 1731, 1771, 1774, 1775, 1777, 1679, 1709, 1743, 1757, 1782, - /* 500 */ 1750, 1751, 1765, 1753, 1755, 1747, 1749, 1760, 1763, 1770, - /* 510 */ 1764, 1796, 1778, 1803, 1783, 1758, 1807, 1787, 1786, 1822, - /* 520 */ 1790, 1828, 1794, 1830, 1811, 1823, 1745, 1752, 1846, 1713, - /* 530 */ 1815, 1851, 1711, 1833, 1730, 1720, 1852, 1864, 1732, 1736, - /* 540 */ 1863, 1821, 1624, 1772, 1776, 1793, 1789, 1827, 1800, 1795, - /* 550 */ 1812, 1813, 1801, 1866, 1860, 1865, 1818, 1867, 1694, 1831, - /* 560 */ 1832, 1913, 1875, 1721, 1895, 1897, 1899, 1900, 1901, 1902, - /* 570 */ 1841, 1842, 1893, 1715, 1903, 1896, 1944, 1945, 1948, 1853, - /* 580 */ 1854, 1855, 1857, 1915, 1920, 1766, 1962, 1877, 1805, 1878, - /* 590 */ 1975, 1937, 1814, 1881, 1873, 1662, 1934, 1938, 1756, 1768, - /* 600 */ 1773, 1984, 1967, 1785, 1906, 1904, 1907, 1908, 1910, 1911, - /* 610 */ 1957, 1916, 1917, 1960, 1912, 1993, 1804, 1929, 1919, 1926, - /* 620 */ 1992, 1994, 1932, 1935, 1996, 1939, 1936, 1999, 1940, 1942, - /* 630 */ 2002, 1946, 1943, 2006, 1950, 1924, 1928, 1930, 1931, 2027, - /* 640 */ 1949, 1956, 1958, 2018, 1965, 2012, 2012, 2036, 2000, 2003, - /* 650 */ 2028, 2030, 2032, 2034, 2035, 2038, 2039, 2046, 2049, 2051, - /* 660 */ 2001, 1995, 2043, 2056, 2065, 2079, 2067, 2082, 2071, 2072, - /* 670 */ 2074, 2040, 1747, 2076, 1749, 2077, 2078, 2080, 2081, 2086, - /* 680 */ 2083, 2117, 2084, 2075, 2085, 2120, 2090, 2096, 2091, 2121, - /* 690 */ 2098, 2097, 2092, 2134, 2106, 2099, 2107, 2148, 2114, 2115, - /* 700 */ 2151, 2131, 2133, 2145, 2146, 2137, 2135, + /* 0 */ 933, 0, 134, 0, 268, 268, 268, 268, 268, 268, + /* 10 */ 268, 268, 268, 402, 536, 536, 670, 536, 536, 536, + /* 20 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + /* 30 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + /* 40 */ 536, 536, 536, 536, 536, 536, 55, 180, 65, 195, + /* 50 */ 26, 284, 330, 284, 65, 65, 947, 947, 284, 947, + /* 60 */ 947, 182, 284, 39, 39, 128, 128, 111, 272, 42, + /* 70 */ 42, 39, 39, 39, 39, 39, 39, 39, 39, 39, + /* 80 */ 39, 31, 39, 39, 105, 39, 137, 39, 39, 188, + /* 90 */ 39, 39, 188, 39, 188, 188, 188, 39, 140, 762, + /* 100 */ 949, 949, 438, 1131, 1056, 1056, 1056, 1056, 1056, 1056, + /* 110 */ 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + /* 120 */ 1056, 1056, 1056, 965, 228, 111, 272, 659, 532, 269, + /* 130 */ 269, 269, 800, 370, 370, 532, 224, 224, 224, 213, + /* 140 */ 137, 33, 188, 351, 188, 351, 351, 213, 389, 909, + /* 150 */ 909, 909, 909, 909, 909, 909, 1044, 36, 793, 851, + /* 160 */ 975, 572, 115, 83, 72, 84, 517, 850, 1034, 986, + /* 170 */ 959, 843, 634, 865, 843, 1099, 857, 486, 1066, 1285, + /* 180 */ 1160, 1302, 1327, 1302, 1190, 1353, 1353, 1302, 1190, 1190, + /* 190 */ 1290, 1353, 1353, 1353, 1371, 1371, 1387, 31, 137, 31, + /* 200 */ 1392, 1407, 31, 1392, 31, 31, 31, 1353, 31, 1382, + /* 210 */ 1382, 1371, 188, 188, 188, 188, 188, 188, 188, 188, + /* 220 */ 188, 188, 188, 1353, 1371, 351, 351, 1250, 1387, 140, + /* 230 */ 1315, 137, 140, 1353, 1327, 1327, 351, 1262, 1268, 351, + /* 240 */ 1262, 1268, 351, 351, 188, 1283, 1374, 1262, 1282, 1297, + /* 250 */ 1300, 1066, 1298, 1310, 1313, 1329, 224, 1575, 1353, 1392, + /* 260 */ 140, 1268, 351, 351, 351, 351, 351, 1268, 351, 1453, + /* 270 */ 140, 213, 140, 224, 1533, 1536, 351, 389, 1353, 140, + /* 280 */ 1627, 1371, 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410, + /* 290 */ 2410, 858, 1027, 23, 1389, 52, 663, 449, 155, 672, + /* 300 */ 1289, 1555, 423, 756, 756, 756, 756, 756, 756, 756, + /* 310 */ 756, 756, 339, 190, 243, 243, 390, 378, 315, 523, + /* 320 */ 470, 518, 518, 696, 999, 168, 696, 696, 696, 884, + /* 330 */ 1076, 385, 1102, 1007, 1089, 956, 1073, 1106, 1107, 16, + /* 340 */ 1196, 1197, 1166, 1105, 1128, 1093, 1071, 972, 1051, 1135, + /* 350 */ 1169, 1173, 1178, 1199, 1232, 1215, 1085, 1110, 573, 1217, + /* 360 */ 1181, 1264, 1265, 1267, 1272, 1288, 1292, 1134, 1234, 1305, + /* 370 */ 1210, 1323, 1687, 1691, 1505, 1694, 1695, 1654, 1697, 1663, + /* 380 */ 1499, 1665, 1666, 1668, 1504, 1705, 1673, 1682, 1518, 1721, + /* 390 */ 1524, 1725, 1692, 1726, 1706, 1729, 1698, 1547, 1551, 1734, + /* 400 */ 1737, 1562, 1564, 1741, 1742, 1699, 1744, 1747, 1748, 1708, + /* 410 */ 1751, 1758, 1760, 1762, 1763, 1764, 1766, 1767, 1624, 1743, + /* 420 */ 1779, 1628, 1783, 1784, 1785, 1788, 1790, 1791, 1792, 1793, + /* 430 */ 1794, 1795, 1798, 1799, 1800, 1804, 1805, 1765, 1806, 1808, + /* 440 */ 1809, 1810, 1811, 1796, 1813, 1814, 1815, 1693, 1827, 1828, + /* 450 */ 1801, 1831, 1775, 1835, 1780, 1837, 1839, 1802, 1807, 1797, + /* 460 */ 1803, 1826, 1821, 1829, 1823, 1845, 1812, 1818, 1848, 1851, + /* 470 */ 1853, 1819, 1688, 1854, 1861, 1871, 1824, 1874, 1875, 1842, + /* 480 */ 1830, 1846, 1889, 1855, 1843, 1857, 1892, 1858, 1849, 1859, + /* 490 */ 1894, 1864, 1860, 1862, 1903, 1905, 1906, 1907, 1816, 1817, + /* 500 */ 1876, 1887, 1910, 1878, 1879, 1893, 1881, 1883, 1882, 1884, + /* 510 */ 1888, 1895, 1900, 1896, 1927, 1916, 1940, 1921, 1897, 1944, + /* 520 */ 1923, 1913, 1957, 1924, 1958, 1925, 1961, 1942, 1945, 1931, + /* 530 */ 1934, 1778, 1865, 1877, 1974, 1822, 1941, 1975, 1825, 1955, + /* 540 */ 1832, 1833, 1978, 1979, 1844, 1856, 1980, 1937, 1733, 1898, + /* 550 */ 1891, 1899, 1915, 1946, 1919, 1929, 1935, 1936, 1930, 1947, + /* 560 */ 1982, 1986, 1938, 1948, 1740, 1952, 1954, 2034, 1994, 1834, + /* 570 */ 2004, 2006, 2007, 2017, 2019, 2020, 1959, 1962, 2011, 1841, + /* 580 */ 2024, 2022, 2070, 2071, 2072, 1977, 1983, 1985, 1981, 1989, + /* 590 */ 1908, 1990, 2076, 2048, 1926, 1992, 1984, 1803, 2042, 2049, + /* 600 */ 1867, 1866, 1869, 2090, 2077, 1901, 2002, 2003, 2005, 2008, + /* 610 */ 2010, 2013, 2055, 2023, 2025, 2056, 2026, 2098, 1918, 2031, + /* 620 */ 2021, 2032, 2095, 2096, 2036, 2037, 2100, 2040, 2044, 2102, + /* 630 */ 2043, 2045, 2108, 2050, 2047, 2113, 2053, 2030, 2033, 2046, + /* 640 */ 2058, 2130, 2052, 2066, 2120, 2069, 2133, 2073, 2120, 2120, + /* 650 */ 2157, 2116, 2118, 2147, 2148, 2150, 2151, 2152, 2155, 2158, + /* 660 */ 2159, 2160, 2161, 2122, 2104, 2154, 2164, 2165, 2179, 2167, + /* 670 */ 2181, 2169, 2171, 2172, 2138, 1882, 2174, 1884, 2175, 2176, + /* 680 */ 2177, 2178, 2193, 2182, 2216, 2185, 2183, 2190, 2230, 2198, + /* 690 */ 2187, 2199, 2237, 2204, 2192, 2202, 2242, 2208, 2197, 2207, + /* 700 */ 2247, 2213, 2215, 2252, 2231, 2233, 2234, 2238, 2241, 2235, }; -#define YY_REDUCE_COUNT (288) -#define YY_REDUCE_MIN (-425) -#define YY_REDUCE_MAX (2136) +#define YY_REDUCE_COUNT (290) +#define YY_REDUCE_MIN (-422) +#define YY_REDUCE_MAX (2001) static const short yy_reduce_ofst[] = { - /* 0 */ -76, -288, 286, 597, 650, 737, 780, 851, 894, 937, - /* 10 */ 961, 1019, 1062, 1090, -2, 83, 1149, 1207, 1235, 1261, - /* 20 */ 1331, 1350, 1413, 1434, 1456, 1477, 1499, 1520, 1563, 1591, - /* 30 */ 1617, 1675, 1692, 1735, 1759, 1802, 1819, 1845, 1862, 1905, - /* 40 */ 1927, 1989, 2011, 2073, 2093, 2136, -253, -196, 290, -385, - /* 50 */ -374, -323, 584, 778, 395, 659, -212, 764, 28, 408, - /* 60 */ 681, -425, -352, 72, 270, -324, -313, -339, -215, 23, - /* 70 */ 64, 267, 285, 331, 613, 615, 626, 649, 695, 700, - /* 80 */ 728, 298, 660, 748, 22, 790, -326, 833, 842, -345, - /* 90 */ 854, 857, -260, 869, 287, -190, 354, 710, 7, -189, - /* 100 */ -407, -407, -305, -233, -125, -66, 151, 193, 194, 221, - /* 110 */ 294, 340, 357, 407, 413, 484, 504, 506, 518, 519, - /* 120 */ 596, 651, 656, -56, -257, 283, -301, -185, -38, -257, - /* 130 */ 11, 412, 111, 401, 533, 18, -172, 234, 446, 411, - /* 140 */ 78, 586, 595, 425, -291, 468, 520, 628, 680, 727, - /* 150 */ 320, 328, 363, 493, 652, 684, 715, 321, 673, 765, - /* 160 */ 731, 698, 670, 825, 756, 840, 840, 868, 860, 908, - /* 170 */ 874, 865, 814, 814, 798, 814, 827, 871, 840, 914, - /* 180 */ 921, 935, 951, 950, 970, 975, 1020, 1021, 984, 996, - /* 190 */ 999, 1033, 1044, 1045, 1046, 1057, 1058, 997, 1052, 1022, - /* 200 */ 1053, 1061, 1010, 1060, 1068, 1065, 1067, 1069, 1072, 1070, - /* 210 */ 1075, 1076, 1087, 1063, 1074, 1079, 1080, 1081, 1085, 1086, - /* 220 */ 1088, 1089, 1091, 1092, 1095, 1105, 1082, 1050, 1077, 1112, - /* 230 */ 1094, 1100, 1115, 1120, 1083, 1093, 1104, 1038, 1097, 1107, - /* 240 */ 1049, 1101, 1118, 1121, 840, 1096, 1073, 1098, 1102, 1099, - /* 250 */ 1103, 1111, 1055, 1106, 1109, 814, 1151, 1117, 1188, 1185, - /* 260 */ 1192, 1140, 1155, 1156, 1157, 1158, 1159, 1141, 1161, 1160, - /* 270 */ 1194, 1196, 1204, 1175, 1126, 1201, 1177, 1203, 1226, 1225, - /* 280 */ 1238, 1246, 1178, 1195, 1218, 1220, 1222, 1236, 1252, + /* 0 */ -186, -325, -226, -166, -32, 236, 642, -92, 176, 852, + /* 10 */ 880, 923, 951, 994, 333, 1012, 1055, 1108, 1129, 1183, + /* 20 */ 1237, 40, 1254, 1308, 442, 1280, 1351, 1367, 1418, 1461, + /* 30 */ 1478, 1531, 1548, 1599, 1616, 1642, 1659, 1710, 1753, 1769, + /* 40 */ 1820, 1863, 1880, 1933, 1950, 2001, -34, 350, 240, -340, + /* 50 */ 666, 1098, 1109, 1350, 776, 1189, 1070, 1083, -422, -326, + /* 60 */ -269, -410, -287, -206, -163, -328, -321, -350, -352, -26, + /* 70 */ 122, -307, -28, 163, 166, 174, 229, 239, 361, 362, + /* 80 */ 452, 46, 508, 621, -251, 639, 48, 706, 741, 177, + /* 90 */ 757, 786, 146, 847, 178, 152, 287, 509, -108, -299, + /* 100 */ -221, -221, -338, -207, -27, 172, 194, 322, 332, 375, + /* 110 */ 405, 462, 465, 466, 469, 480, 483, 529, 550, 627, + /* 120 */ 628, 630, 641, -33, -303, 275, -101, 271, -48, -303, + /* 130 */ 383, 474, 356, 302, 306, 25, -222, 64, 409, 380, + /* 140 */ 624, 562, 368, 609, 686, 638, 683, 689, 493, 143, + /* 150 */ 157, 203, 233, 241, 366, 429, 14, 556, 481, 317, + /* 160 */ 522, 565, 702, 633, 775, 775, 812, 772, 903, 905, + /* 170 */ 873, 860, 860, 842, 860, 885, 878, 775, 934, 939, + /* 180 */ 954, 970, 969, 984, 993, 1041, 1042, 1001, 1004, 1005, + /* 190 */ 1045, 1049, 1054, 1057, 1067, 1078, 1018, 1082, 1052, 1086, + /* 200 */ 1095, 1046, 1091, 1097, 1096, 1101, 1104, 1103, 1111, 1112, + /* 210 */ 1115, 1117, 1090, 1118, 1120, 1130, 1132, 1133, 1136, 1139, + /* 220 */ 1140, 1141, 1143, 1122, 1144, 1069, 1121, 1080, 1113, 1125, + /* 230 */ 1127, 1147, 1168, 1170, 1142, 1145, 1138, 1146, 1137, 1157, + /* 240 */ 1153, 1156, 1159, 1172, 775, 1119, 1126, 1155, 1158, 1123, + /* 250 */ 1148, 1176, 1124, 1149, 1151, 860, 1214, 1202, 1263, 1269, + /* 260 */ 1260, 1222, 1238, 1240, 1242, 1251, 1252, 1244, 1253, 1247, + /* 270 */ 1287, 1276, 1293, 1270, 1228, 1294, 1278, 1304, 1320, 1324, + /* 280 */ 1337, 1339, 1279, 1281, 1306, 1307, 1318, 1321, 1325, 1332, + /* 290 */ 1357, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 10 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 20 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 30 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 40 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 50 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 60 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1843, 1587, 1587, - /* 70 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 80 */ 1587, 1665, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 90 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1663, 1836, - /* 100 */ 2032, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 110 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 120 */ 1587, 1587, 1587, 1587, 2044, 1587, 1587, 1665, 1587, 2044, - /* 130 */ 2044, 2044, 1663, 2004, 2004, 1587, 1587, 1587, 1587, 1774, - /* 140 */ 1587, 1885, 1885, 1587, 1587, 1587, 1587, 1587, 1774, 1587, - /* 150 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1879, 1587, 1587, - /* 160 */ 2069, 2122, 1587, 1587, 2072, 1587, 1587, 1587, 1848, 1587, - /* 170 */ 1727, 2059, 2036, 2050, 2106, 2037, 2034, 2053, 1587, 2063, - /* 180 */ 1587, 1872, 1841, 1587, 1841, 1838, 1587, 1587, 1841, 1838, - /* 190 */ 1838, 1718, 1587, 1587, 1587, 1587, 1587, 1587, 1665, 1587, - /* 200 */ 1665, 1587, 1587, 1665, 1587, 1665, 1665, 1665, 1587, 1665, - /* 210 */ 1644, 1644, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 220 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1892, 1587, 1663, - /* 230 */ 1881, 1587, 1663, 1587, 1587, 1587, 1587, 2079, 2077, 1587, - /* 240 */ 2079, 2077, 1587, 1587, 1587, 2091, 2087, 2079, 2095, 2093, - /* 250 */ 2065, 2063, 2125, 2112, 2108, 2050, 1587, 1587, 1587, 1587, - /* 260 */ 1663, 2077, 1587, 1587, 1587, 1587, 1587, 2077, 1587, 1587, - /* 270 */ 1663, 1587, 1663, 1587, 1587, 1743, 1587, 1587, 1587, 1663, - /* 280 */ 1619, 1587, 1874, 1885, 1777, 1777, 1777, 1666, 1592, 1587, - /* 290 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 2090, - /* 300 */ 2089, 1587, 1960, 1587, 2008, 2007, 2006, 1997, 1959, 1587, - /* 310 */ 1739, 1587, 1587, 1958, 1957, 1587, 1587, 1587, 1587, 1587, - /* 320 */ 1951, 1587, 1587, 1952, 1950, 1949, 1587, 1587, 1587, 1587, - /* 330 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 340 */ 1587, 1587, 1587, 2109, 2113, 1587, 1587, 1587, 1587, 1587, - /* 350 */ 1587, 2033, 1587, 1587, 1587, 1587, 1587, 1934, 1587, 1587, - /* 360 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 370 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 380 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 390 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 400 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 410 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 420 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 430 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 440 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 450 */ 1587, 1587, 1587, 1587, 1587, 1587, 1624, 1939, 1587, 1587, - /* 460 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 470 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 480 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 490 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 500 */ 1587, 1587, 1587, 1587, 1587, 1705, 1704, 1587, 1587, 1587, - /* 510 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 520 */ 1587, 1587, 1587, 1587, 1587, 1587, 1942, 1587, 1587, 1587, - /* 530 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 540 */ 2105, 2066, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 550 */ 1587, 1587, 1587, 1587, 1587, 1934, 1587, 2088, 1587, 1587, - /* 560 */ 2103, 1587, 2107, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 570 */ 2043, 2039, 1587, 1587, 2035, 1587, 1587, 1587, 1587, 1587, - /* 580 */ 1587, 1587, 1587, 1587, 1587, 1587, 1889, 1587, 1587, 1587, - /* 590 */ 1587, 1587, 1587, 1587, 1587, 1933, 1587, 1994, 1587, 1587, - /* 600 */ 1587, 2028, 1587, 1587, 1979, 1587, 1587, 1587, 1587, 1587, - /* 610 */ 1587, 1587, 1587, 1587, 1942, 1587, 1945, 1587, 1587, 1587, - /* 620 */ 1587, 1587, 1771, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 630 */ 1587, 1587, 1587, 1587, 1587, 1756, 1754, 1753, 1752, 1587, - /* 640 */ 1749, 1587, 1587, 1587, 1587, 1780, 1779, 1587, 1587, 1587, - /* 650 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 660 */ 1587, 1587, 1685, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 670 */ 1587, 1587, 1676, 1587, 1675, 1587, 1587, 1587, 1587, 1587, - /* 680 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 690 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 700 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, + /* 0 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 10 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 20 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 30 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 40 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 50 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 60 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1849, 1592, 1592, + /* 70 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 80 */ 1592, 1670, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 90 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1668, 1842, + /* 100 */ 2039, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 110 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 120 */ 1592, 1592, 1592, 1592, 2051, 1592, 1592, 1670, 1592, 2051, + /* 130 */ 2051, 2051, 1668, 2011, 2011, 1592, 1592, 1592, 1592, 1779, + /* 140 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1779, 1592, 1592, + /* 150 */ 1592, 1592, 1592, 1592, 1592, 1592, 1886, 1592, 1592, 2076, + /* 160 */ 2129, 1592, 1592, 2079, 1592, 1592, 1592, 1854, 1592, 1732, + /* 170 */ 2066, 2043, 2057, 2113, 2044, 2041, 2060, 1592, 2070, 1592, + /* 180 */ 1879, 1847, 1592, 1847, 1844, 1592, 1592, 1847, 1844, 1844, + /* 190 */ 1723, 1592, 1592, 1592, 1592, 1592, 1592, 1670, 1592, 1670, + /* 200 */ 1592, 1592, 1670, 1592, 1670, 1670, 1670, 1592, 1670, 1649, + /* 210 */ 1649, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 220 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1899, 1592, 1668, + /* 230 */ 1888, 1592, 1668, 1592, 1592, 1592, 1592, 2086, 2084, 1592, + /* 240 */ 2086, 2084, 1592, 1592, 1592, 2098, 2094, 2086, 2102, 2100, + /* 250 */ 2072, 2070, 2132, 2119, 2115, 2057, 1592, 1592, 1592, 1592, + /* 260 */ 1668, 2084, 1592, 1592, 1592, 1592, 1592, 2084, 1592, 1592, + /* 270 */ 1668, 1592, 1668, 1592, 1592, 1748, 1592, 1592, 1592, 1668, + /* 280 */ 1624, 1592, 1881, 1892, 1864, 1864, 1782, 1782, 1782, 1671, + /* 290 */ 1597, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 300 */ 1592, 1592, 1592, 2097, 2096, 1967, 1592, 2015, 2014, 2013, + /* 310 */ 2004, 1966, 1744, 1592, 1965, 1964, 1592, 1592, 1592, 1592, + /* 320 */ 1592, 1860, 1859, 1958, 1592, 1592, 1959, 1957, 1956, 1592, + /* 330 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 340 */ 1592, 1592, 1592, 1592, 1592, 1592, 2116, 2120, 1592, 1592, + /* 350 */ 1592, 1592, 1592, 1592, 2040, 1592, 1592, 1592, 1592, 1592, + /* 360 */ 1941, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 370 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 380 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 390 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 400 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 410 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 420 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 430 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 440 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 450 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1629, + /* 460 */ 1946, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 470 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 480 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 490 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 500 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1710, 1709, + /* 510 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 520 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 530 */ 1592, 1592, 1949, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 540 */ 1592, 1592, 1592, 1592, 1592, 1592, 2112, 2073, 1592, 1592, + /* 550 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 560 */ 1592, 1941, 1592, 2095, 1592, 1592, 2110, 1592, 2114, 1592, + /* 570 */ 1592, 1592, 1592, 1592, 1592, 1592, 2050, 2046, 1592, 1592, + /* 580 */ 2042, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 590 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1940, 1592, 2001, + /* 600 */ 1592, 1592, 1592, 2035, 1592, 1592, 1986, 1592, 1592, 1592, + /* 610 */ 1592, 1592, 1592, 1592, 1592, 1592, 1949, 1592, 1952, 1592, + /* 620 */ 1592, 1592, 1592, 1592, 1776, 1592, 1592, 1592, 1592, 1592, + /* 630 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1761, 1759, 1758, + /* 640 */ 1757, 1592, 1754, 1592, 1789, 1592, 1592, 1592, 1785, 1784, + /* 650 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 660 */ 1592, 1592, 1592, 1592, 1592, 1690, 1592, 1592, 1592, 1592, + /* 670 */ 1592, 1592, 1592, 1592, 1592, 1681, 1592, 1680, 1592, 1592, + /* 680 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 690 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 700 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1064,6 +1055,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* ROLLUP => nothing */ 0, /* TTL => nothing */ 0, /* SMA => nothing */ + 0, /* DELETE_MARK => nothing */ 0, /* FIRST => nothing */ 0, /* LAST => nothing */ 0, /* SHOW => nothing */ @@ -1159,7 +1151,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* COUNT => nothing */ 0, /* LAST_ROW => nothing */ 0, /* CASE => nothing */ - 268, /* END => ABORT */ + 269, /* END => ABORT */ 0, /* WHEN => nothing */ 0, /* THEN => nothing */ 0, /* ELSE => nothing */ @@ -1201,58 +1193,58 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 268, /* AFTER => ABORT */ - 268, /* ATTACH => ABORT */ - 268, /* BEFORE => ABORT */ - 268, /* BEGIN => ABORT */ - 268, /* BITAND => ABORT */ - 268, /* BITNOT => ABORT */ - 268, /* BITOR => ABORT */ - 268, /* BLOCKS => ABORT */ - 268, /* CHANGE => ABORT */ - 268, /* COMMA => ABORT */ - 268, /* COMPACT => ABORT */ - 268, /* CONCAT => ABORT */ - 268, /* CONFLICT => ABORT */ - 268, /* COPY => ABORT */ - 268, /* DEFERRED => ABORT */ - 268, /* DELIMITERS => ABORT */ - 268, /* DETACH => ABORT */ - 268, /* DIVIDE => ABORT */ - 268, /* DOT => ABORT */ - 268, /* EACH => ABORT */ - 268, /* FAIL => ABORT */ - 268, /* FILE => ABORT */ - 268, /* FOR => ABORT */ - 268, /* GLOB => ABORT */ - 268, /* ID => ABORT */ - 268, /* IMMEDIATE => ABORT */ - 268, /* IMPORT => ABORT */ - 268, /* INITIALLY => ABORT */ - 268, /* INSTEAD => ABORT */ - 268, /* ISNULL => ABORT */ - 268, /* KEY => ABORT */ - 268, /* MODULES => ABORT */ - 268, /* NK_BITNOT => ABORT */ - 268, /* NK_SEMI => ABORT */ - 268, /* NOTNULL => ABORT */ - 268, /* OF => ABORT */ - 268, /* PLUS => ABORT */ - 268, /* PRIVILEGE => ABORT */ - 268, /* RAISE => ABORT */ - 268, /* REPLACE => ABORT */ - 268, /* RESTRICT => ABORT */ - 268, /* ROW => ABORT */ - 268, /* SEMI => ABORT */ - 268, /* STAR => ABORT */ - 268, /* STATEMENT => ABORT */ - 268, /* STRING => ABORT */ - 268, /* TIMES => ABORT */ - 268, /* UPDATE => ABORT */ - 268, /* VALUES => ABORT */ - 268, /* VARIABLE => ABORT */ - 268, /* VIEW => ABORT */ - 268, /* WAL => ABORT */ + 269, /* AFTER => ABORT */ + 269, /* ATTACH => ABORT */ + 269, /* BEFORE => ABORT */ + 269, /* BEGIN => ABORT */ + 269, /* BITAND => ABORT */ + 269, /* BITNOT => ABORT */ + 269, /* BITOR => ABORT */ + 269, /* BLOCKS => ABORT */ + 269, /* CHANGE => ABORT */ + 269, /* COMMA => ABORT */ + 269, /* COMPACT => ABORT */ + 269, /* CONCAT => ABORT */ + 269, /* CONFLICT => ABORT */ + 269, /* COPY => ABORT */ + 269, /* DEFERRED => ABORT */ + 269, /* DELIMITERS => ABORT */ + 269, /* DETACH => ABORT */ + 269, /* DIVIDE => ABORT */ + 269, /* DOT => ABORT */ + 269, /* EACH => ABORT */ + 269, /* FAIL => ABORT */ + 269, /* FILE => ABORT */ + 269, /* FOR => ABORT */ + 269, /* GLOB => ABORT */ + 269, /* ID => ABORT */ + 269, /* IMMEDIATE => ABORT */ + 269, /* IMPORT => ABORT */ + 269, /* INITIALLY => ABORT */ + 269, /* INSTEAD => ABORT */ + 269, /* ISNULL => ABORT */ + 269, /* KEY => ABORT */ + 269, /* MODULES => ABORT */ + 269, /* NK_BITNOT => ABORT */ + 269, /* NK_SEMI => ABORT */ + 269, /* NOTNULL => ABORT */ + 269, /* OF => ABORT */ + 269, /* PLUS => ABORT */ + 269, /* PRIVILEGE => ABORT */ + 269, /* RAISE => ABORT */ + 269, /* REPLACE => ABORT */ + 269, /* RESTRICT => ABORT */ + 269, /* ROW => ABORT */ + 269, /* SEMI => ABORT */ + 269, /* STAR => ABORT */ + 269, /* STATEMENT => ABORT */ + 269, /* STRING => ABORT */ + 269, /* TIMES => ABORT */ + 269, /* UPDATE => ABORT */ + 269, /* VALUES => ABORT */ + 269, /* VARIABLE => ABORT */ + 269, /* VIEW => ABORT */ + 269, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1472,259 +1464,259 @@ static const char *const yyTokenName[] = { /* 129 */ "ROLLUP", /* 130 */ "TTL", /* 131 */ "SMA", - /* 132 */ "FIRST", - /* 133 */ "LAST", - /* 134 */ "SHOW", - /* 135 */ "PRIVILEGES", - /* 136 */ "DATABASES", - /* 137 */ "TABLES", - /* 138 */ "STABLES", - /* 139 */ "MNODES", - /* 140 */ "QNODES", - /* 141 */ "FUNCTIONS", - /* 142 */ "INDEXES", - /* 143 */ "ACCOUNTS", - /* 144 */ "APPS", - /* 145 */ "CONNECTIONS", - /* 146 */ "LICENCES", - /* 147 */ "GRANTS", - /* 148 */ "QUERIES", - /* 149 */ "SCORES", - /* 150 */ "TOPICS", - /* 151 */ "VARIABLES", - /* 152 */ "CLUSTER", - /* 153 */ "BNODES", - /* 154 */ "SNODES", - /* 155 */ "TRANSACTIONS", - /* 156 */ "DISTRIBUTED", - /* 157 */ "CONSUMERS", - /* 158 */ "SUBSCRIPTIONS", - /* 159 */ "VNODES", - /* 160 */ "LIKE", - /* 161 */ "TBNAME", - /* 162 */ "QTAGS", - /* 163 */ "AS", - /* 164 */ "INDEX", - /* 165 */ "FUNCTION", - /* 166 */ "INTERVAL", - /* 167 */ "TOPIC", - /* 168 */ "WITH", - /* 169 */ "META", - /* 170 */ "CONSUMER", - /* 171 */ "GROUP", - /* 172 */ "DESC", - /* 173 */ "DESCRIBE", - /* 174 */ "RESET", - /* 175 */ "QUERY", - /* 176 */ "CACHE", - /* 177 */ "EXPLAIN", - /* 178 */ "ANALYZE", - /* 179 */ "VERBOSE", - /* 180 */ "NK_BOOL", - /* 181 */ "RATIO", - /* 182 */ "NK_FLOAT", - /* 183 */ "OUTPUTTYPE", - /* 184 */ "AGGREGATE", - /* 185 */ "BUFSIZE", - /* 186 */ "STREAM", - /* 187 */ "INTO", - /* 188 */ "TRIGGER", - /* 189 */ "AT_ONCE", - /* 190 */ "WINDOW_CLOSE", - /* 191 */ "IGNORE", - /* 192 */ "EXPIRED", - /* 193 */ "FILL_HISTORY", - /* 194 */ "SUBTABLE", - /* 195 */ "KILL", - /* 196 */ "CONNECTION", - /* 197 */ "TRANSACTION", - /* 198 */ "BALANCE", - /* 199 */ "VGROUP", - /* 200 */ "MERGE", - /* 201 */ "REDISTRIBUTE", - /* 202 */ "SPLIT", - /* 203 */ "DELETE", - /* 204 */ "INSERT", - /* 205 */ "NULL", - /* 206 */ "NK_QUESTION", - /* 207 */ "NK_ARROW", - /* 208 */ "ROWTS", - /* 209 */ "QSTART", - /* 210 */ "QEND", - /* 211 */ "QDURATION", - /* 212 */ "WSTART", - /* 213 */ "WEND", - /* 214 */ "WDURATION", - /* 215 */ "IROWTS", - /* 216 */ "CAST", - /* 217 */ "NOW", - /* 218 */ "TODAY", - /* 219 */ "TIMEZONE", - /* 220 */ "CLIENT_VERSION", - /* 221 */ "SERVER_VERSION", - /* 222 */ "SERVER_STATUS", - /* 223 */ "CURRENT_USER", - /* 224 */ "COUNT", - /* 225 */ "LAST_ROW", - /* 226 */ "CASE", - /* 227 */ "END", - /* 228 */ "WHEN", - /* 229 */ "THEN", - /* 230 */ "ELSE", - /* 231 */ "BETWEEN", - /* 232 */ "IS", - /* 233 */ "NK_LT", - /* 234 */ "NK_GT", - /* 235 */ "NK_LE", - /* 236 */ "NK_GE", - /* 237 */ "NK_NE", - /* 238 */ "MATCH", - /* 239 */ "NMATCH", - /* 240 */ "CONTAINS", - /* 241 */ "IN", - /* 242 */ "JOIN", - /* 243 */ "INNER", - /* 244 */ "SELECT", - /* 245 */ "DISTINCT", - /* 246 */ "WHERE", - /* 247 */ "PARTITION", - /* 248 */ "BY", - /* 249 */ "SESSION", - /* 250 */ "STATE_WINDOW", - /* 251 */ "SLIDING", - /* 252 */ "FILL", - /* 253 */ "VALUE", - /* 254 */ "NONE", - /* 255 */ "PREV", - /* 256 */ "LINEAR", - /* 257 */ "NEXT", - /* 258 */ "HAVING", - /* 259 */ "RANGE", - /* 260 */ "EVERY", - /* 261 */ "ORDER", - /* 262 */ "SLIMIT", - /* 263 */ "SOFFSET", - /* 264 */ "LIMIT", - /* 265 */ "OFFSET", - /* 266 */ "ASC", - /* 267 */ "NULLS", - /* 268 */ "ABORT", - /* 269 */ "AFTER", - /* 270 */ "ATTACH", - /* 271 */ "BEFORE", - /* 272 */ "BEGIN", - /* 273 */ "BITAND", - /* 274 */ "BITNOT", - /* 275 */ "BITOR", - /* 276 */ "BLOCKS", - /* 277 */ "CHANGE", - /* 278 */ "COMMA", - /* 279 */ "COMPACT", - /* 280 */ "CONCAT", - /* 281 */ "CONFLICT", - /* 282 */ "COPY", - /* 283 */ "DEFERRED", - /* 284 */ "DELIMITERS", - /* 285 */ "DETACH", - /* 286 */ "DIVIDE", - /* 287 */ "DOT", - /* 288 */ "EACH", - /* 289 */ "FAIL", - /* 290 */ "FILE", - /* 291 */ "FOR", - /* 292 */ "GLOB", - /* 293 */ "ID", - /* 294 */ "IMMEDIATE", - /* 295 */ "IMPORT", - /* 296 */ "INITIALLY", - /* 297 */ "INSTEAD", - /* 298 */ "ISNULL", - /* 299 */ "KEY", - /* 300 */ "MODULES", - /* 301 */ "NK_BITNOT", - /* 302 */ "NK_SEMI", - /* 303 */ "NOTNULL", - /* 304 */ "OF", - /* 305 */ "PLUS", - /* 306 */ "PRIVILEGE", - /* 307 */ "RAISE", - /* 308 */ "REPLACE", - /* 309 */ "RESTRICT", - /* 310 */ "ROW", - /* 311 */ "SEMI", - /* 312 */ "STAR", - /* 313 */ "STATEMENT", - /* 314 */ "STRING", - /* 315 */ "TIMES", - /* 316 */ "UPDATE", - /* 317 */ "VALUES", - /* 318 */ "VARIABLE", - /* 319 */ "VIEW", - /* 320 */ "WAL", - /* 321 */ "cmd", - /* 322 */ "account_options", - /* 323 */ "alter_account_options", - /* 324 */ "literal", - /* 325 */ "alter_account_option", - /* 326 */ "user_name", - /* 327 */ "sysinfo_opt", - /* 328 */ "privileges", - /* 329 */ "priv_level", - /* 330 */ "priv_type_list", - /* 331 */ "priv_type", - /* 332 */ "db_name", - /* 333 */ "topic_name", - /* 334 */ "dnode_endpoint", - /* 335 */ "force_opt", - /* 336 */ "not_exists_opt", - /* 337 */ "db_options", - /* 338 */ "exists_opt", - /* 339 */ "alter_db_options", - /* 340 */ "speed_opt", - /* 341 */ "integer_list", - /* 342 */ "variable_list", - /* 343 */ "retention_list", - /* 344 */ "alter_db_option", - /* 345 */ "retention", - /* 346 */ "full_table_name", - /* 347 */ "column_def_list", - /* 348 */ "tags_def_opt", - /* 349 */ "table_options", - /* 350 */ "multi_create_clause", - /* 351 */ "tags_def", - /* 352 */ "multi_drop_clause", - /* 353 */ "alter_table_clause", - /* 354 */ "alter_table_options", - /* 355 */ "column_name", - /* 356 */ "type_name", - /* 357 */ "signed_literal", - /* 358 */ "create_subtable_clause", - /* 359 */ "specific_cols_opt", - /* 360 */ "expression_list", - /* 361 */ "drop_table_clause", - /* 362 */ "col_name_list", - /* 363 */ "table_name", - /* 364 */ "column_def", - /* 365 */ "duration_list", - /* 366 */ "rollup_func_list", - /* 367 */ "alter_table_option", - /* 368 */ "duration_literal", - /* 369 */ "rollup_func_name", - /* 370 */ "function_name", - /* 371 */ "col_name", - /* 372 */ "db_name_cond_opt", - /* 373 */ "like_pattern_opt", - /* 374 */ "table_name_cond", - /* 375 */ "from_db_opt", - /* 376 */ "tag_list_opt", - /* 377 */ "tag_item", - /* 378 */ "column_alias", - /* 379 */ "index_options", - /* 380 */ "func_list", - /* 381 */ "sliding_opt", - /* 382 */ "sma_stream_opt", - /* 383 */ "func", - /* 384 */ "stream_options", + /* 132 */ "DELETE_MARK", + /* 133 */ "FIRST", + /* 134 */ "LAST", + /* 135 */ "SHOW", + /* 136 */ "PRIVILEGES", + /* 137 */ "DATABASES", + /* 138 */ "TABLES", + /* 139 */ "STABLES", + /* 140 */ "MNODES", + /* 141 */ "QNODES", + /* 142 */ "FUNCTIONS", + /* 143 */ "INDEXES", + /* 144 */ "ACCOUNTS", + /* 145 */ "APPS", + /* 146 */ "CONNECTIONS", + /* 147 */ "LICENCES", + /* 148 */ "GRANTS", + /* 149 */ "QUERIES", + /* 150 */ "SCORES", + /* 151 */ "TOPICS", + /* 152 */ "VARIABLES", + /* 153 */ "CLUSTER", + /* 154 */ "BNODES", + /* 155 */ "SNODES", + /* 156 */ "TRANSACTIONS", + /* 157 */ "DISTRIBUTED", + /* 158 */ "CONSUMERS", + /* 159 */ "SUBSCRIPTIONS", + /* 160 */ "VNODES", + /* 161 */ "LIKE", + /* 162 */ "TBNAME", + /* 163 */ "QTAGS", + /* 164 */ "AS", + /* 165 */ "INDEX", + /* 166 */ "FUNCTION", + /* 167 */ "INTERVAL", + /* 168 */ "TOPIC", + /* 169 */ "WITH", + /* 170 */ "META", + /* 171 */ "CONSUMER", + /* 172 */ "GROUP", + /* 173 */ "DESC", + /* 174 */ "DESCRIBE", + /* 175 */ "RESET", + /* 176 */ "QUERY", + /* 177 */ "CACHE", + /* 178 */ "EXPLAIN", + /* 179 */ "ANALYZE", + /* 180 */ "VERBOSE", + /* 181 */ "NK_BOOL", + /* 182 */ "RATIO", + /* 183 */ "NK_FLOAT", + /* 184 */ "OUTPUTTYPE", + /* 185 */ "AGGREGATE", + /* 186 */ "BUFSIZE", + /* 187 */ "STREAM", + /* 188 */ "INTO", + /* 189 */ "TRIGGER", + /* 190 */ "AT_ONCE", + /* 191 */ "WINDOW_CLOSE", + /* 192 */ "IGNORE", + /* 193 */ "EXPIRED", + /* 194 */ "FILL_HISTORY", + /* 195 */ "SUBTABLE", + /* 196 */ "KILL", + /* 197 */ "CONNECTION", + /* 198 */ "TRANSACTION", + /* 199 */ "BALANCE", + /* 200 */ "VGROUP", + /* 201 */ "MERGE", + /* 202 */ "REDISTRIBUTE", + /* 203 */ "SPLIT", + /* 204 */ "DELETE", + /* 205 */ "INSERT", + /* 206 */ "NULL", + /* 207 */ "NK_QUESTION", + /* 208 */ "NK_ARROW", + /* 209 */ "ROWTS", + /* 210 */ "QSTART", + /* 211 */ "QEND", + /* 212 */ "QDURATION", + /* 213 */ "WSTART", + /* 214 */ "WEND", + /* 215 */ "WDURATION", + /* 216 */ "IROWTS", + /* 217 */ "CAST", + /* 218 */ "NOW", + /* 219 */ "TODAY", + /* 220 */ "TIMEZONE", + /* 221 */ "CLIENT_VERSION", + /* 222 */ "SERVER_VERSION", + /* 223 */ "SERVER_STATUS", + /* 224 */ "CURRENT_USER", + /* 225 */ "COUNT", + /* 226 */ "LAST_ROW", + /* 227 */ "CASE", + /* 228 */ "END", + /* 229 */ "WHEN", + /* 230 */ "THEN", + /* 231 */ "ELSE", + /* 232 */ "BETWEEN", + /* 233 */ "IS", + /* 234 */ "NK_LT", + /* 235 */ "NK_GT", + /* 236 */ "NK_LE", + /* 237 */ "NK_GE", + /* 238 */ "NK_NE", + /* 239 */ "MATCH", + /* 240 */ "NMATCH", + /* 241 */ "CONTAINS", + /* 242 */ "IN", + /* 243 */ "JOIN", + /* 244 */ "INNER", + /* 245 */ "SELECT", + /* 246 */ "DISTINCT", + /* 247 */ "WHERE", + /* 248 */ "PARTITION", + /* 249 */ "BY", + /* 250 */ "SESSION", + /* 251 */ "STATE_WINDOW", + /* 252 */ "SLIDING", + /* 253 */ "FILL", + /* 254 */ "VALUE", + /* 255 */ "NONE", + /* 256 */ "PREV", + /* 257 */ "LINEAR", + /* 258 */ "NEXT", + /* 259 */ "HAVING", + /* 260 */ "RANGE", + /* 261 */ "EVERY", + /* 262 */ "ORDER", + /* 263 */ "SLIMIT", + /* 264 */ "SOFFSET", + /* 265 */ "LIMIT", + /* 266 */ "OFFSET", + /* 267 */ "ASC", + /* 268 */ "NULLS", + /* 269 */ "ABORT", + /* 270 */ "AFTER", + /* 271 */ "ATTACH", + /* 272 */ "BEFORE", + /* 273 */ "BEGIN", + /* 274 */ "BITAND", + /* 275 */ "BITNOT", + /* 276 */ "BITOR", + /* 277 */ "BLOCKS", + /* 278 */ "CHANGE", + /* 279 */ "COMMA", + /* 280 */ "COMPACT", + /* 281 */ "CONCAT", + /* 282 */ "CONFLICT", + /* 283 */ "COPY", + /* 284 */ "DEFERRED", + /* 285 */ "DELIMITERS", + /* 286 */ "DETACH", + /* 287 */ "DIVIDE", + /* 288 */ "DOT", + /* 289 */ "EACH", + /* 290 */ "FAIL", + /* 291 */ "FILE", + /* 292 */ "FOR", + /* 293 */ "GLOB", + /* 294 */ "ID", + /* 295 */ "IMMEDIATE", + /* 296 */ "IMPORT", + /* 297 */ "INITIALLY", + /* 298 */ "INSTEAD", + /* 299 */ "ISNULL", + /* 300 */ "KEY", + /* 301 */ "MODULES", + /* 302 */ "NK_BITNOT", + /* 303 */ "NK_SEMI", + /* 304 */ "NOTNULL", + /* 305 */ "OF", + /* 306 */ "PLUS", + /* 307 */ "PRIVILEGE", + /* 308 */ "RAISE", + /* 309 */ "REPLACE", + /* 310 */ "RESTRICT", + /* 311 */ "ROW", + /* 312 */ "SEMI", + /* 313 */ "STAR", + /* 314 */ "STATEMENT", + /* 315 */ "STRING", + /* 316 */ "TIMES", + /* 317 */ "UPDATE", + /* 318 */ "VALUES", + /* 319 */ "VARIABLE", + /* 320 */ "VIEW", + /* 321 */ "WAL", + /* 322 */ "cmd", + /* 323 */ "account_options", + /* 324 */ "alter_account_options", + /* 325 */ "literal", + /* 326 */ "alter_account_option", + /* 327 */ "user_name", + /* 328 */ "sysinfo_opt", + /* 329 */ "privileges", + /* 330 */ "priv_level", + /* 331 */ "priv_type_list", + /* 332 */ "priv_type", + /* 333 */ "db_name", + /* 334 */ "topic_name", + /* 335 */ "dnode_endpoint", + /* 336 */ "force_opt", + /* 337 */ "not_exists_opt", + /* 338 */ "db_options", + /* 339 */ "exists_opt", + /* 340 */ "alter_db_options", + /* 341 */ "speed_opt", + /* 342 */ "integer_list", + /* 343 */ "variable_list", + /* 344 */ "retention_list", + /* 345 */ "alter_db_option", + /* 346 */ "retention", + /* 347 */ "full_table_name", + /* 348 */ "column_def_list", + /* 349 */ "tags_def_opt", + /* 350 */ "table_options", + /* 351 */ "multi_create_clause", + /* 352 */ "tags_def", + /* 353 */ "multi_drop_clause", + /* 354 */ "alter_table_clause", + /* 355 */ "alter_table_options", + /* 356 */ "column_name", + /* 357 */ "type_name", + /* 358 */ "signed_literal", + /* 359 */ "create_subtable_clause", + /* 360 */ "specific_cols_opt", + /* 361 */ "expression_list", + /* 362 */ "drop_table_clause", + /* 363 */ "col_name_list", + /* 364 */ "table_name", + /* 365 */ "column_def", + /* 366 */ "duration_list", + /* 367 */ "rollup_func_list", + /* 368 */ "alter_table_option", + /* 369 */ "duration_literal", + /* 370 */ "rollup_func_name", + /* 371 */ "function_name", + /* 372 */ "col_name", + /* 373 */ "db_name_cond_opt", + /* 374 */ "like_pattern_opt", + /* 375 */ "table_name_cond", + /* 376 */ "from_db_opt", + /* 377 */ "tag_list_opt", + /* 378 */ "tag_item", + /* 379 */ "column_alias", + /* 380 */ "index_options", + /* 381 */ "func_list", + /* 382 */ "sliding_opt", + /* 383 */ "sma_stream_opt", + /* 384 */ "func", /* 385 */ "query_or_subquery", /* 386 */ "cgroup_name", /* 387 */ "analyze_opt", @@ -1732,70 +1724,71 @@ static const char *const yyTokenName[] = { /* 389 */ "agg_func_opt", /* 390 */ "bufsize_opt", /* 391 */ "stream_name", - /* 392 */ "subtable_opt", - /* 393 */ "expression", - /* 394 */ "dnode_list", - /* 395 */ "where_clause_opt", - /* 396 */ "signed", - /* 397 */ "literal_func", - /* 398 */ "literal_list", - /* 399 */ "table_alias", - /* 400 */ "expr_or_subquery", - /* 401 */ "pseudo_column", - /* 402 */ "column_reference", - /* 403 */ "function_expression", - /* 404 */ "case_when_expression", - /* 405 */ "star_func", - /* 406 */ "star_func_para_list", - /* 407 */ "noarg_func", - /* 408 */ "other_para_list", - /* 409 */ "star_func_para", - /* 410 */ "when_then_list", - /* 411 */ "case_when_else_opt", - /* 412 */ "common_expression", - /* 413 */ "when_then_expr", - /* 414 */ "predicate", - /* 415 */ "compare_op", - /* 416 */ "in_op", - /* 417 */ "in_predicate_value", - /* 418 */ "boolean_value_expression", - /* 419 */ "boolean_primary", - /* 420 */ "from_clause_opt", - /* 421 */ "table_reference_list", - /* 422 */ "table_reference", - /* 423 */ "table_primary", - /* 424 */ "joined_table", - /* 425 */ "alias_opt", - /* 426 */ "subquery", - /* 427 */ "parenthesized_joined_table", - /* 428 */ "join_type", - /* 429 */ "search_condition", - /* 430 */ "query_specification", - /* 431 */ "set_quantifier_opt", - /* 432 */ "select_list", - /* 433 */ "partition_by_clause_opt", - /* 434 */ "range_opt", - /* 435 */ "every_opt", - /* 436 */ "fill_opt", - /* 437 */ "twindow_clause_opt", - /* 438 */ "group_by_clause_opt", - /* 439 */ "having_clause_opt", - /* 440 */ "select_item", - /* 441 */ "partition_list", - /* 442 */ "partition_item", - /* 443 */ "fill_mode", - /* 444 */ "group_by_list", - /* 445 */ "query_expression", - /* 446 */ "query_simple", - /* 447 */ "order_by_clause_opt", - /* 448 */ "slimit_clause_opt", - /* 449 */ "limit_clause_opt", - /* 450 */ "union_query_expression", - /* 451 */ "query_simple_or_subquery", - /* 452 */ "sort_specification_list", - /* 453 */ "sort_specification", - /* 454 */ "ordering_specification_opt", - /* 455 */ "null_ordering_opt", + /* 392 */ "stream_options", + /* 393 */ "subtable_opt", + /* 394 */ "expression", + /* 395 */ "dnode_list", + /* 396 */ "where_clause_opt", + /* 397 */ "signed", + /* 398 */ "literal_func", + /* 399 */ "literal_list", + /* 400 */ "table_alias", + /* 401 */ "expr_or_subquery", + /* 402 */ "pseudo_column", + /* 403 */ "column_reference", + /* 404 */ "function_expression", + /* 405 */ "case_when_expression", + /* 406 */ "star_func", + /* 407 */ "star_func_para_list", + /* 408 */ "noarg_func", + /* 409 */ "other_para_list", + /* 410 */ "star_func_para", + /* 411 */ "when_then_list", + /* 412 */ "case_when_else_opt", + /* 413 */ "common_expression", + /* 414 */ "when_then_expr", + /* 415 */ "predicate", + /* 416 */ "compare_op", + /* 417 */ "in_op", + /* 418 */ "in_predicate_value", + /* 419 */ "boolean_value_expression", + /* 420 */ "boolean_primary", + /* 421 */ "from_clause_opt", + /* 422 */ "table_reference_list", + /* 423 */ "table_reference", + /* 424 */ "table_primary", + /* 425 */ "joined_table", + /* 426 */ "alias_opt", + /* 427 */ "subquery", + /* 428 */ "parenthesized_joined_table", + /* 429 */ "join_type", + /* 430 */ "search_condition", + /* 431 */ "query_specification", + /* 432 */ "set_quantifier_opt", + /* 433 */ "select_list", + /* 434 */ "partition_by_clause_opt", + /* 435 */ "range_opt", + /* 436 */ "every_opt", + /* 437 */ "fill_opt", + /* 438 */ "twindow_clause_opt", + /* 439 */ "group_by_clause_opt", + /* 440 */ "having_clause_opt", + /* 441 */ "select_item", + /* 442 */ "partition_list", + /* 443 */ "partition_item", + /* 444 */ "fill_mode", + /* 445 */ "group_by_list", + /* 446 */ "query_expression", + /* 447 */ "query_simple", + /* 448 */ "order_by_clause_opt", + /* 449 */ "slimit_clause_opt", + /* 450 */ "limit_clause_opt", + /* 451 */ "union_query_expression", + /* 452 */ "query_simple_or_subquery", + /* 453 */ "sort_specification_list", + /* 454 */ "sort_specification", + /* 455 */ "ordering_specification_opt", + /* 456 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1997,350 +1990,352 @@ static const char *const yyRuleName[] = { /* 191 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", /* 192 */ "table_options ::= table_options TTL NK_INTEGER", /* 193 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 194 */ "alter_table_options ::= alter_table_option", - /* 195 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 196 */ "alter_table_option ::= COMMENT NK_STRING", - /* 197 */ "alter_table_option ::= TTL NK_INTEGER", - /* 198 */ "duration_list ::= duration_literal", - /* 199 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 200 */ "rollup_func_list ::= rollup_func_name", - /* 201 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 202 */ "rollup_func_name ::= function_name", - /* 203 */ "rollup_func_name ::= FIRST", - /* 204 */ "rollup_func_name ::= LAST", - /* 205 */ "col_name_list ::= col_name", - /* 206 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 207 */ "col_name ::= column_name", - /* 208 */ "cmd ::= SHOW DNODES", - /* 209 */ "cmd ::= SHOW USERS", - /* 210 */ "cmd ::= SHOW USER PRIVILEGES", - /* 211 */ "cmd ::= SHOW DATABASES", - /* 212 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 213 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 214 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 215 */ "cmd ::= SHOW MNODES", - /* 216 */ "cmd ::= SHOW QNODES", - /* 217 */ "cmd ::= SHOW FUNCTIONS", - /* 218 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 219 */ "cmd ::= SHOW STREAMS", - /* 220 */ "cmd ::= SHOW ACCOUNTS", - /* 221 */ "cmd ::= SHOW APPS", - /* 222 */ "cmd ::= SHOW CONNECTIONS", - /* 223 */ "cmd ::= SHOW LICENCES", - /* 224 */ "cmd ::= SHOW GRANTS", - /* 225 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 226 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 227 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 228 */ "cmd ::= SHOW QUERIES", - /* 229 */ "cmd ::= SHOW SCORES", - /* 230 */ "cmd ::= SHOW TOPICS", - /* 231 */ "cmd ::= SHOW VARIABLES", - /* 232 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 233 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 234 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 235 */ "cmd ::= SHOW BNODES", - /* 236 */ "cmd ::= SHOW SNODES", - /* 237 */ "cmd ::= SHOW CLUSTER", - /* 238 */ "cmd ::= SHOW TRANSACTIONS", - /* 239 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 240 */ "cmd ::= SHOW CONSUMERS", - /* 241 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 242 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 243 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 244 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 245 */ "cmd ::= SHOW VNODES NK_STRING", - /* 246 */ "db_name_cond_opt ::=", - /* 247 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 248 */ "like_pattern_opt ::=", - /* 249 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 250 */ "table_name_cond ::= table_name", - /* 251 */ "from_db_opt ::=", - /* 252 */ "from_db_opt ::= FROM db_name", - /* 253 */ "tag_list_opt ::=", - /* 254 */ "tag_list_opt ::= tag_item", - /* 255 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 256 */ "tag_item ::= TBNAME", - /* 257 */ "tag_item ::= QTAGS", - /* 258 */ "tag_item ::= column_name", - /* 259 */ "tag_item ::= column_name column_alias", - /* 260 */ "tag_item ::= column_name AS column_alias", - /* 261 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", - /* 262 */ "cmd ::= DROP INDEX exists_opt full_table_name", - /* 263 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 264 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", - /* 265 */ "func_list ::= func", - /* 266 */ "func_list ::= func_list NK_COMMA func", - /* 267 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 268 */ "sma_stream_opt ::=", - /* 269 */ "sma_stream_opt ::= stream_options WATERMARK duration_literal", - /* 270 */ "sma_stream_opt ::= stream_options MAX_DELAY duration_literal", - /* 271 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 272 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 276 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 277 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 278 */ "cmd ::= DESC full_table_name", - /* 279 */ "cmd ::= DESCRIBE full_table_name", - /* 280 */ "cmd ::= RESET QUERY CACHE", - /* 281 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 282 */ "analyze_opt ::=", - /* 283 */ "analyze_opt ::= ANALYZE", - /* 284 */ "explain_options ::=", - /* 285 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 286 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 287 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 288 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 289 */ "agg_func_opt ::=", - /* 290 */ "agg_func_opt ::= AGGREGATE", - /* 291 */ "bufsize_opt ::=", - /* 292 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 293 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", - /* 294 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 295 */ "stream_options ::=", - /* 296 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 297 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 298 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 299 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 300 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 301 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 302 */ "subtable_opt ::=", - /* 303 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 304 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 305 */ "cmd ::= KILL QUERY NK_STRING", - /* 306 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 307 */ "cmd ::= BALANCE VGROUP", - /* 308 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 309 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 310 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 311 */ "dnode_list ::= DNODE NK_INTEGER", - /* 312 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 313 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 314 */ "cmd ::= query_or_subquery", - /* 315 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 316 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 317 */ "literal ::= NK_INTEGER", - /* 318 */ "literal ::= NK_FLOAT", - /* 319 */ "literal ::= NK_STRING", - /* 320 */ "literal ::= NK_BOOL", - /* 321 */ "literal ::= TIMESTAMP NK_STRING", - /* 322 */ "literal ::= duration_literal", - /* 323 */ "literal ::= NULL", - /* 324 */ "literal ::= NK_QUESTION", - /* 325 */ "duration_literal ::= NK_VARIABLE", - /* 326 */ "signed ::= NK_INTEGER", - /* 327 */ "signed ::= NK_PLUS NK_INTEGER", - /* 328 */ "signed ::= NK_MINUS NK_INTEGER", - /* 329 */ "signed ::= NK_FLOAT", - /* 330 */ "signed ::= NK_PLUS NK_FLOAT", - /* 331 */ "signed ::= NK_MINUS NK_FLOAT", - /* 332 */ "signed_literal ::= signed", - /* 333 */ "signed_literal ::= NK_STRING", - /* 334 */ "signed_literal ::= NK_BOOL", - /* 335 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 336 */ "signed_literal ::= duration_literal", - /* 337 */ "signed_literal ::= NULL", - /* 338 */ "signed_literal ::= literal_func", - /* 339 */ "signed_literal ::= NK_QUESTION", - /* 340 */ "literal_list ::= signed_literal", - /* 341 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 342 */ "db_name ::= NK_ID", - /* 343 */ "table_name ::= NK_ID", - /* 344 */ "column_name ::= NK_ID", - /* 345 */ "function_name ::= NK_ID", - /* 346 */ "table_alias ::= NK_ID", - /* 347 */ "column_alias ::= NK_ID", - /* 348 */ "user_name ::= NK_ID", - /* 349 */ "topic_name ::= NK_ID", - /* 350 */ "stream_name ::= NK_ID", - /* 351 */ "cgroup_name ::= NK_ID", - /* 352 */ "expr_or_subquery ::= expression", - /* 353 */ "expression ::= literal", - /* 354 */ "expression ::= pseudo_column", - /* 355 */ "expression ::= column_reference", - /* 356 */ "expression ::= function_expression", - /* 357 */ "expression ::= case_when_expression", - /* 358 */ "expression ::= NK_LP expression NK_RP", - /* 359 */ "expression ::= NK_PLUS expr_or_subquery", - /* 360 */ "expression ::= NK_MINUS expr_or_subquery", - /* 361 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 362 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 363 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 364 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 365 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 366 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 367 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 368 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 369 */ "expression_list ::= expr_or_subquery", - /* 370 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 371 */ "column_reference ::= column_name", - /* 372 */ "column_reference ::= table_name NK_DOT column_name", - /* 373 */ "pseudo_column ::= ROWTS", - /* 374 */ "pseudo_column ::= TBNAME", - /* 375 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 376 */ "pseudo_column ::= QSTART", - /* 377 */ "pseudo_column ::= QEND", - /* 378 */ "pseudo_column ::= QDURATION", - /* 379 */ "pseudo_column ::= WSTART", - /* 380 */ "pseudo_column ::= WEND", - /* 381 */ "pseudo_column ::= WDURATION", - /* 382 */ "pseudo_column ::= IROWTS", - /* 383 */ "pseudo_column ::= QTAGS", - /* 384 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 385 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 386 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 387 */ "function_expression ::= literal_func", - /* 388 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 389 */ "literal_func ::= NOW", - /* 390 */ "noarg_func ::= NOW", - /* 391 */ "noarg_func ::= TODAY", - /* 392 */ "noarg_func ::= TIMEZONE", - /* 393 */ "noarg_func ::= DATABASE", - /* 394 */ "noarg_func ::= CLIENT_VERSION", - /* 395 */ "noarg_func ::= SERVER_VERSION", - /* 396 */ "noarg_func ::= SERVER_STATUS", - /* 397 */ "noarg_func ::= CURRENT_USER", - /* 398 */ "noarg_func ::= USER", - /* 399 */ "star_func ::= COUNT", - /* 400 */ "star_func ::= FIRST", - /* 401 */ "star_func ::= LAST", - /* 402 */ "star_func ::= LAST_ROW", - /* 403 */ "star_func_para_list ::= NK_STAR", - /* 404 */ "star_func_para_list ::= other_para_list", - /* 405 */ "other_para_list ::= star_func_para", - /* 406 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 407 */ "star_func_para ::= expr_or_subquery", - /* 408 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 409 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 410 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 411 */ "when_then_list ::= when_then_expr", - /* 412 */ "when_then_list ::= when_then_list when_then_expr", - /* 413 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 414 */ "case_when_else_opt ::=", - /* 415 */ "case_when_else_opt ::= ELSE common_expression", - /* 416 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 417 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 418 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 419 */ "predicate ::= expr_or_subquery IS NULL", - /* 420 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 421 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 422 */ "compare_op ::= NK_LT", - /* 423 */ "compare_op ::= NK_GT", - /* 424 */ "compare_op ::= NK_LE", - /* 425 */ "compare_op ::= NK_GE", - /* 426 */ "compare_op ::= NK_NE", - /* 427 */ "compare_op ::= NK_EQ", - /* 428 */ "compare_op ::= LIKE", - /* 429 */ "compare_op ::= NOT LIKE", - /* 430 */ "compare_op ::= MATCH", - /* 431 */ "compare_op ::= NMATCH", - /* 432 */ "compare_op ::= CONTAINS", - /* 433 */ "in_op ::= IN", - /* 434 */ "in_op ::= NOT IN", - /* 435 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 436 */ "boolean_value_expression ::= boolean_primary", - /* 437 */ "boolean_value_expression ::= NOT boolean_primary", - /* 438 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 439 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 440 */ "boolean_primary ::= predicate", - /* 441 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 442 */ "common_expression ::= expr_or_subquery", - /* 443 */ "common_expression ::= boolean_value_expression", - /* 444 */ "from_clause_opt ::=", - /* 445 */ "from_clause_opt ::= FROM table_reference_list", - /* 446 */ "table_reference_list ::= table_reference", - /* 447 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 448 */ "table_reference ::= table_primary", - /* 449 */ "table_reference ::= joined_table", - /* 450 */ "table_primary ::= table_name alias_opt", - /* 451 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 452 */ "table_primary ::= subquery alias_opt", - /* 453 */ "table_primary ::= parenthesized_joined_table", - /* 454 */ "alias_opt ::=", - /* 455 */ "alias_opt ::= table_alias", - /* 456 */ "alias_opt ::= AS table_alias", - /* 457 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 458 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 459 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 460 */ "join_type ::=", - /* 461 */ "join_type ::= INNER", - /* 462 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 463 */ "set_quantifier_opt ::=", - /* 464 */ "set_quantifier_opt ::= DISTINCT", - /* 465 */ "set_quantifier_opt ::= ALL", - /* 466 */ "select_list ::= select_item", - /* 467 */ "select_list ::= select_list NK_COMMA select_item", - /* 468 */ "select_item ::= NK_STAR", - /* 469 */ "select_item ::= common_expression", - /* 470 */ "select_item ::= common_expression column_alias", - /* 471 */ "select_item ::= common_expression AS column_alias", - /* 472 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 473 */ "where_clause_opt ::=", - /* 474 */ "where_clause_opt ::= WHERE search_condition", - /* 475 */ "partition_by_clause_opt ::=", - /* 476 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 477 */ "partition_list ::= partition_item", - /* 478 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 479 */ "partition_item ::= expr_or_subquery", - /* 480 */ "partition_item ::= expr_or_subquery column_alias", - /* 481 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 482 */ "twindow_clause_opt ::=", - /* 483 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 484 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 485 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 486 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 487 */ "sliding_opt ::=", - /* 488 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 489 */ "fill_opt ::=", - /* 490 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 491 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 492 */ "fill_mode ::= NONE", - /* 493 */ "fill_mode ::= PREV", - /* 494 */ "fill_mode ::= NULL", - /* 495 */ "fill_mode ::= LINEAR", - /* 496 */ "fill_mode ::= NEXT", - /* 497 */ "group_by_clause_opt ::=", - /* 498 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 499 */ "group_by_list ::= expr_or_subquery", - /* 500 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 501 */ "having_clause_opt ::=", - /* 502 */ "having_clause_opt ::= HAVING search_condition", - /* 503 */ "range_opt ::=", - /* 504 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 505 */ "every_opt ::=", - /* 506 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 507 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 508 */ "query_simple ::= query_specification", - /* 509 */ "query_simple ::= union_query_expression", - /* 510 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 511 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 512 */ "query_simple_or_subquery ::= query_simple", - /* 513 */ "query_simple_or_subquery ::= subquery", - /* 514 */ "query_or_subquery ::= query_expression", - /* 515 */ "query_or_subquery ::= subquery", - /* 516 */ "order_by_clause_opt ::=", - /* 517 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 518 */ "slimit_clause_opt ::=", - /* 519 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 520 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 522 */ "limit_clause_opt ::=", - /* 523 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 524 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 526 */ "subquery ::= NK_LP query_expression NK_RP", - /* 527 */ "subquery ::= NK_LP subquery NK_RP", - /* 528 */ "search_condition ::= common_expression", - /* 529 */ "sort_specification_list ::= sort_specification", - /* 530 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 531 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 532 */ "ordering_specification_opt ::=", - /* 533 */ "ordering_specification_opt ::= ASC", - /* 534 */ "ordering_specification_opt ::= DESC", - /* 535 */ "null_ordering_opt ::=", - /* 536 */ "null_ordering_opt ::= NULLS FIRST", - /* 537 */ "null_ordering_opt ::= NULLS LAST", + /* 194 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 195 */ "alter_table_options ::= alter_table_option", + /* 196 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 197 */ "alter_table_option ::= COMMENT NK_STRING", + /* 198 */ "alter_table_option ::= TTL NK_INTEGER", + /* 199 */ "duration_list ::= duration_literal", + /* 200 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 201 */ "rollup_func_list ::= rollup_func_name", + /* 202 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 203 */ "rollup_func_name ::= function_name", + /* 204 */ "rollup_func_name ::= FIRST", + /* 205 */ "rollup_func_name ::= LAST", + /* 206 */ "col_name_list ::= col_name", + /* 207 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 208 */ "col_name ::= column_name", + /* 209 */ "cmd ::= SHOW DNODES", + /* 210 */ "cmd ::= SHOW USERS", + /* 211 */ "cmd ::= SHOW USER PRIVILEGES", + /* 212 */ "cmd ::= SHOW DATABASES", + /* 213 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 214 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 215 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 216 */ "cmd ::= SHOW MNODES", + /* 217 */ "cmd ::= SHOW QNODES", + /* 218 */ "cmd ::= SHOW FUNCTIONS", + /* 219 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 220 */ "cmd ::= SHOW STREAMS", + /* 221 */ "cmd ::= SHOW ACCOUNTS", + /* 222 */ "cmd ::= SHOW APPS", + /* 223 */ "cmd ::= SHOW CONNECTIONS", + /* 224 */ "cmd ::= SHOW LICENCES", + /* 225 */ "cmd ::= SHOW GRANTS", + /* 226 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 227 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 228 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 229 */ "cmd ::= SHOW QUERIES", + /* 230 */ "cmd ::= SHOW SCORES", + /* 231 */ "cmd ::= SHOW TOPICS", + /* 232 */ "cmd ::= SHOW VARIABLES", + /* 233 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 234 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 235 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 236 */ "cmd ::= SHOW BNODES", + /* 237 */ "cmd ::= SHOW SNODES", + /* 238 */ "cmd ::= SHOW CLUSTER", + /* 239 */ "cmd ::= SHOW TRANSACTIONS", + /* 240 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 241 */ "cmd ::= SHOW CONSUMERS", + /* 242 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 243 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 244 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 245 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 246 */ "cmd ::= SHOW VNODES NK_STRING", + /* 247 */ "db_name_cond_opt ::=", + /* 248 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 249 */ "like_pattern_opt ::=", + /* 250 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 251 */ "table_name_cond ::= table_name", + /* 252 */ "from_db_opt ::=", + /* 253 */ "from_db_opt ::= FROM db_name", + /* 254 */ "tag_list_opt ::=", + /* 255 */ "tag_list_opt ::= tag_item", + /* 256 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 257 */ "tag_item ::= TBNAME", + /* 258 */ "tag_item ::= QTAGS", + /* 259 */ "tag_item ::= column_name", + /* 260 */ "tag_item ::= column_name column_alias", + /* 261 */ "tag_item ::= column_name AS column_alias", + /* 262 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", + /* 263 */ "cmd ::= DROP INDEX exists_opt full_table_name", + /* 264 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 265 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", + /* 266 */ "func_list ::= func", + /* 267 */ "func_list ::= func_list NK_COMMA func", + /* 268 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 269 */ "sma_stream_opt ::=", + /* 270 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 271 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 272 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 277 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 278 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 279 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 280 */ "cmd ::= DESC full_table_name", + /* 281 */ "cmd ::= DESCRIBE full_table_name", + /* 282 */ "cmd ::= RESET QUERY CACHE", + /* 283 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 284 */ "analyze_opt ::=", + /* 285 */ "analyze_opt ::= ANALYZE", + /* 286 */ "explain_options ::=", + /* 287 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 288 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 289 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 290 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 291 */ "agg_func_opt ::=", + /* 292 */ "agg_func_opt ::= AGGREGATE", + /* 293 */ "bufsize_opt ::=", + /* 294 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 295 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", + /* 296 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 297 */ "stream_options ::=", + /* 298 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 299 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 300 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 301 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 302 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 303 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 304 */ "subtable_opt ::=", + /* 305 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 306 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 307 */ "cmd ::= KILL QUERY NK_STRING", + /* 308 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 309 */ "cmd ::= BALANCE VGROUP", + /* 310 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 311 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 312 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 313 */ "dnode_list ::= DNODE NK_INTEGER", + /* 314 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 315 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 316 */ "cmd ::= query_or_subquery", + /* 317 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 318 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 319 */ "literal ::= NK_INTEGER", + /* 320 */ "literal ::= NK_FLOAT", + /* 321 */ "literal ::= NK_STRING", + /* 322 */ "literal ::= NK_BOOL", + /* 323 */ "literal ::= TIMESTAMP NK_STRING", + /* 324 */ "literal ::= duration_literal", + /* 325 */ "literal ::= NULL", + /* 326 */ "literal ::= NK_QUESTION", + /* 327 */ "duration_literal ::= NK_VARIABLE", + /* 328 */ "signed ::= NK_INTEGER", + /* 329 */ "signed ::= NK_PLUS NK_INTEGER", + /* 330 */ "signed ::= NK_MINUS NK_INTEGER", + /* 331 */ "signed ::= NK_FLOAT", + /* 332 */ "signed ::= NK_PLUS NK_FLOAT", + /* 333 */ "signed ::= NK_MINUS NK_FLOAT", + /* 334 */ "signed_literal ::= signed", + /* 335 */ "signed_literal ::= NK_STRING", + /* 336 */ "signed_literal ::= NK_BOOL", + /* 337 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 338 */ "signed_literal ::= duration_literal", + /* 339 */ "signed_literal ::= NULL", + /* 340 */ "signed_literal ::= literal_func", + /* 341 */ "signed_literal ::= NK_QUESTION", + /* 342 */ "literal_list ::= signed_literal", + /* 343 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 344 */ "db_name ::= NK_ID", + /* 345 */ "table_name ::= NK_ID", + /* 346 */ "column_name ::= NK_ID", + /* 347 */ "function_name ::= NK_ID", + /* 348 */ "table_alias ::= NK_ID", + /* 349 */ "column_alias ::= NK_ID", + /* 350 */ "user_name ::= NK_ID", + /* 351 */ "topic_name ::= NK_ID", + /* 352 */ "stream_name ::= NK_ID", + /* 353 */ "cgroup_name ::= NK_ID", + /* 354 */ "expr_or_subquery ::= expression", + /* 355 */ "expression ::= literal", + /* 356 */ "expression ::= pseudo_column", + /* 357 */ "expression ::= column_reference", + /* 358 */ "expression ::= function_expression", + /* 359 */ "expression ::= case_when_expression", + /* 360 */ "expression ::= NK_LP expression NK_RP", + /* 361 */ "expression ::= NK_PLUS expr_or_subquery", + /* 362 */ "expression ::= NK_MINUS expr_or_subquery", + /* 363 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 364 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 365 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 366 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 367 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 368 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 369 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 370 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 371 */ "expression_list ::= expr_or_subquery", + /* 372 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 373 */ "column_reference ::= column_name", + /* 374 */ "column_reference ::= table_name NK_DOT column_name", + /* 375 */ "pseudo_column ::= ROWTS", + /* 376 */ "pseudo_column ::= TBNAME", + /* 377 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 378 */ "pseudo_column ::= QSTART", + /* 379 */ "pseudo_column ::= QEND", + /* 380 */ "pseudo_column ::= QDURATION", + /* 381 */ "pseudo_column ::= WSTART", + /* 382 */ "pseudo_column ::= WEND", + /* 383 */ "pseudo_column ::= WDURATION", + /* 384 */ "pseudo_column ::= IROWTS", + /* 385 */ "pseudo_column ::= QTAGS", + /* 386 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 387 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 388 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 389 */ "function_expression ::= literal_func", + /* 390 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 391 */ "literal_func ::= NOW", + /* 392 */ "noarg_func ::= NOW", + /* 393 */ "noarg_func ::= TODAY", + /* 394 */ "noarg_func ::= TIMEZONE", + /* 395 */ "noarg_func ::= DATABASE", + /* 396 */ "noarg_func ::= CLIENT_VERSION", + /* 397 */ "noarg_func ::= SERVER_VERSION", + /* 398 */ "noarg_func ::= SERVER_STATUS", + /* 399 */ "noarg_func ::= CURRENT_USER", + /* 400 */ "noarg_func ::= USER", + /* 401 */ "star_func ::= COUNT", + /* 402 */ "star_func ::= FIRST", + /* 403 */ "star_func ::= LAST", + /* 404 */ "star_func ::= LAST_ROW", + /* 405 */ "star_func_para_list ::= NK_STAR", + /* 406 */ "star_func_para_list ::= other_para_list", + /* 407 */ "other_para_list ::= star_func_para", + /* 408 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 409 */ "star_func_para ::= expr_or_subquery", + /* 410 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 411 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 412 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 413 */ "when_then_list ::= when_then_expr", + /* 414 */ "when_then_list ::= when_then_list when_then_expr", + /* 415 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 416 */ "case_when_else_opt ::=", + /* 417 */ "case_when_else_opt ::= ELSE common_expression", + /* 418 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 419 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 420 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 421 */ "predicate ::= expr_or_subquery IS NULL", + /* 422 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 423 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 424 */ "compare_op ::= NK_LT", + /* 425 */ "compare_op ::= NK_GT", + /* 426 */ "compare_op ::= NK_LE", + /* 427 */ "compare_op ::= NK_GE", + /* 428 */ "compare_op ::= NK_NE", + /* 429 */ "compare_op ::= NK_EQ", + /* 430 */ "compare_op ::= LIKE", + /* 431 */ "compare_op ::= NOT LIKE", + /* 432 */ "compare_op ::= MATCH", + /* 433 */ "compare_op ::= NMATCH", + /* 434 */ "compare_op ::= CONTAINS", + /* 435 */ "in_op ::= IN", + /* 436 */ "in_op ::= NOT IN", + /* 437 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 438 */ "boolean_value_expression ::= boolean_primary", + /* 439 */ "boolean_value_expression ::= NOT boolean_primary", + /* 440 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 441 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 442 */ "boolean_primary ::= predicate", + /* 443 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 444 */ "common_expression ::= expr_or_subquery", + /* 445 */ "common_expression ::= boolean_value_expression", + /* 446 */ "from_clause_opt ::=", + /* 447 */ "from_clause_opt ::= FROM table_reference_list", + /* 448 */ "table_reference_list ::= table_reference", + /* 449 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 450 */ "table_reference ::= table_primary", + /* 451 */ "table_reference ::= joined_table", + /* 452 */ "table_primary ::= table_name alias_opt", + /* 453 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 454 */ "table_primary ::= subquery alias_opt", + /* 455 */ "table_primary ::= parenthesized_joined_table", + /* 456 */ "alias_opt ::=", + /* 457 */ "alias_opt ::= table_alias", + /* 458 */ "alias_opt ::= AS table_alias", + /* 459 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 460 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 461 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 462 */ "join_type ::=", + /* 463 */ "join_type ::= INNER", + /* 464 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 465 */ "set_quantifier_opt ::=", + /* 466 */ "set_quantifier_opt ::= DISTINCT", + /* 467 */ "set_quantifier_opt ::= ALL", + /* 468 */ "select_list ::= select_item", + /* 469 */ "select_list ::= select_list NK_COMMA select_item", + /* 470 */ "select_item ::= NK_STAR", + /* 471 */ "select_item ::= common_expression", + /* 472 */ "select_item ::= common_expression column_alias", + /* 473 */ "select_item ::= common_expression AS column_alias", + /* 474 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 475 */ "where_clause_opt ::=", + /* 476 */ "where_clause_opt ::= WHERE search_condition", + /* 477 */ "partition_by_clause_opt ::=", + /* 478 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 479 */ "partition_list ::= partition_item", + /* 480 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 481 */ "partition_item ::= expr_or_subquery", + /* 482 */ "partition_item ::= expr_or_subquery column_alias", + /* 483 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 484 */ "twindow_clause_opt ::=", + /* 485 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 486 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 487 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 488 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 489 */ "sliding_opt ::=", + /* 490 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 491 */ "fill_opt ::=", + /* 492 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 493 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 494 */ "fill_mode ::= NONE", + /* 495 */ "fill_mode ::= PREV", + /* 496 */ "fill_mode ::= NULL", + /* 497 */ "fill_mode ::= LINEAR", + /* 498 */ "fill_mode ::= NEXT", + /* 499 */ "group_by_clause_opt ::=", + /* 500 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 501 */ "group_by_list ::= expr_or_subquery", + /* 502 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 503 */ "having_clause_opt ::=", + /* 504 */ "having_clause_opt ::= HAVING search_condition", + /* 505 */ "range_opt ::=", + /* 506 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 507 */ "every_opt ::=", + /* 508 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 509 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 510 */ "query_simple ::= query_specification", + /* 511 */ "query_simple ::= union_query_expression", + /* 512 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 513 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 514 */ "query_simple_or_subquery ::= query_simple", + /* 515 */ "query_simple_or_subquery ::= subquery", + /* 516 */ "query_or_subquery ::= query_expression", + /* 517 */ "query_or_subquery ::= subquery", + /* 518 */ "order_by_clause_opt ::=", + /* 519 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 520 */ "slimit_clause_opt ::=", + /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 522 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 523 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 524 */ "limit_clause_opt ::=", + /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 526 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 527 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 528 */ "subquery ::= NK_LP query_expression NK_RP", + /* 529 */ "subquery ::= NK_LP subquery NK_RP", + /* 530 */ "search_condition ::= common_expression", + /* 531 */ "sort_specification_list ::= sort_specification", + /* 532 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 533 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 534 */ "ordering_specification_opt ::=", + /* 535 */ "ordering_specification_opt ::= ASC", + /* 536 */ "ordering_specification_opt ::= DESC", + /* 537 */ "null_ordering_opt ::=", + /* 538 */ "null_ordering_opt ::= NULLS FIRST", + /* 539 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2467,193 +2462,193 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 321: /* cmd */ - case 324: /* literal */ - case 337: /* db_options */ - case 339: /* alter_db_options */ - case 345: /* retention */ - case 346: /* full_table_name */ - case 349: /* table_options */ - case 353: /* alter_table_clause */ - case 354: /* alter_table_options */ - case 357: /* signed_literal */ - case 358: /* create_subtable_clause */ - case 361: /* drop_table_clause */ - case 364: /* column_def */ - case 368: /* duration_literal */ - case 369: /* rollup_func_name */ - case 371: /* col_name */ - case 372: /* db_name_cond_opt */ - case 373: /* like_pattern_opt */ - case 374: /* table_name_cond */ - case 375: /* from_db_opt */ - case 377: /* tag_item */ - case 379: /* index_options */ - case 381: /* sliding_opt */ - case 382: /* sma_stream_opt */ - case 383: /* func */ - case 384: /* stream_options */ + case 322: /* cmd */ + case 325: /* literal */ + case 338: /* db_options */ + case 340: /* alter_db_options */ + case 346: /* retention */ + case 347: /* full_table_name */ + case 350: /* table_options */ + case 354: /* alter_table_clause */ + case 355: /* alter_table_options */ + case 358: /* signed_literal */ + case 359: /* create_subtable_clause */ + case 362: /* drop_table_clause */ + case 365: /* column_def */ + case 369: /* duration_literal */ + case 370: /* rollup_func_name */ + case 372: /* col_name */ + case 373: /* db_name_cond_opt */ + case 374: /* like_pattern_opt */ + case 375: /* table_name_cond */ + case 376: /* from_db_opt */ + case 378: /* tag_item */ + case 380: /* index_options */ + case 382: /* sliding_opt */ + case 383: /* sma_stream_opt */ + case 384: /* func */ case 385: /* query_or_subquery */ case 388: /* explain_options */ - case 392: /* subtable_opt */ - case 393: /* expression */ - case 395: /* where_clause_opt */ - case 396: /* signed */ - case 397: /* literal_func */ - case 400: /* expr_or_subquery */ - case 401: /* pseudo_column */ - case 402: /* column_reference */ - case 403: /* function_expression */ - case 404: /* case_when_expression */ - case 409: /* star_func_para */ - case 411: /* case_when_else_opt */ - case 412: /* common_expression */ - case 413: /* when_then_expr */ - case 414: /* predicate */ - case 417: /* in_predicate_value */ - case 418: /* boolean_value_expression */ - case 419: /* boolean_primary */ - case 420: /* from_clause_opt */ - case 421: /* table_reference_list */ - case 422: /* table_reference */ - case 423: /* table_primary */ - case 424: /* joined_table */ - case 426: /* subquery */ - case 427: /* parenthesized_joined_table */ - case 429: /* search_condition */ - case 430: /* query_specification */ - case 434: /* range_opt */ - case 435: /* every_opt */ - case 436: /* fill_opt */ - case 437: /* twindow_clause_opt */ - case 439: /* having_clause_opt */ - case 440: /* select_item */ - case 442: /* partition_item */ - case 445: /* query_expression */ - case 446: /* query_simple */ - case 448: /* slimit_clause_opt */ - case 449: /* limit_clause_opt */ - case 450: /* union_query_expression */ - case 451: /* query_simple_or_subquery */ - case 453: /* sort_specification */ + case 392: /* stream_options */ + case 393: /* subtable_opt */ + case 394: /* expression */ + case 396: /* where_clause_opt */ + case 397: /* signed */ + case 398: /* literal_func */ + case 401: /* expr_or_subquery */ + case 402: /* pseudo_column */ + case 403: /* column_reference */ + case 404: /* function_expression */ + case 405: /* case_when_expression */ + case 410: /* star_func_para */ + case 412: /* case_when_else_opt */ + case 413: /* common_expression */ + case 414: /* when_then_expr */ + case 415: /* predicate */ + case 418: /* in_predicate_value */ + case 419: /* boolean_value_expression */ + case 420: /* boolean_primary */ + case 421: /* from_clause_opt */ + case 422: /* table_reference_list */ + case 423: /* table_reference */ + case 424: /* table_primary */ + case 425: /* joined_table */ + case 427: /* subquery */ + case 428: /* parenthesized_joined_table */ + case 430: /* search_condition */ + case 431: /* query_specification */ + case 435: /* range_opt */ + case 436: /* every_opt */ + case 437: /* fill_opt */ + case 438: /* twindow_clause_opt */ + case 440: /* having_clause_opt */ + case 441: /* select_item */ + case 443: /* partition_item */ + case 446: /* query_expression */ + case 447: /* query_simple */ + case 449: /* slimit_clause_opt */ + case 450: /* limit_clause_opt */ + case 451: /* union_query_expression */ + case 452: /* query_simple_or_subquery */ + case 454: /* sort_specification */ { - nodesDestroyNode((yypminor->yy104)); + nodesDestroyNode((yypminor->yy148)); } break; - case 322: /* account_options */ - case 323: /* alter_account_options */ - case 325: /* alter_account_option */ - case 340: /* speed_opt */ + case 323: /* account_options */ + case 324: /* alter_account_options */ + case 326: /* alter_account_option */ + case 341: /* speed_opt */ case 390: /* bufsize_opt */ { } break; - case 326: /* user_name */ - case 329: /* priv_level */ - case 332: /* db_name */ - case 333: /* topic_name */ - case 334: /* dnode_endpoint */ - case 355: /* column_name */ - case 363: /* table_name */ - case 370: /* function_name */ - case 378: /* column_alias */ + case 327: /* user_name */ + case 330: /* priv_level */ + case 333: /* db_name */ + case 334: /* topic_name */ + case 335: /* dnode_endpoint */ + case 356: /* column_name */ + case 364: /* table_name */ + case 371: /* function_name */ + case 379: /* column_alias */ case 386: /* cgroup_name */ case 391: /* stream_name */ - case 399: /* table_alias */ - case 405: /* star_func */ - case 407: /* noarg_func */ - case 425: /* alias_opt */ + case 400: /* table_alias */ + case 406: /* star_func */ + case 408: /* noarg_func */ + case 426: /* alias_opt */ { } break; - case 327: /* sysinfo_opt */ + case 328: /* sysinfo_opt */ { } break; - case 328: /* privileges */ - case 330: /* priv_type_list */ - case 331: /* priv_type */ + case 329: /* privileges */ + case 331: /* priv_type_list */ + case 332: /* priv_type */ { } break; - case 335: /* force_opt */ - case 336: /* not_exists_opt */ - case 338: /* exists_opt */ + case 336: /* force_opt */ + case 337: /* not_exists_opt */ + case 339: /* exists_opt */ case 387: /* analyze_opt */ case 389: /* agg_func_opt */ - case 431: /* set_quantifier_opt */ + case 432: /* set_quantifier_opt */ { } break; - case 341: /* integer_list */ - case 342: /* variable_list */ - case 343: /* retention_list */ - case 347: /* column_def_list */ - case 348: /* tags_def_opt */ - case 350: /* multi_create_clause */ - case 351: /* tags_def */ - case 352: /* multi_drop_clause */ - case 359: /* specific_cols_opt */ - case 360: /* expression_list */ - case 362: /* col_name_list */ - case 365: /* duration_list */ - case 366: /* rollup_func_list */ - case 376: /* tag_list_opt */ - case 380: /* func_list */ - case 394: /* dnode_list */ - case 398: /* literal_list */ - case 406: /* star_func_para_list */ - case 408: /* other_para_list */ - case 410: /* when_then_list */ - case 432: /* select_list */ - case 433: /* partition_by_clause_opt */ - case 438: /* group_by_clause_opt */ - case 441: /* partition_list */ - case 444: /* group_by_list */ - case 447: /* order_by_clause_opt */ - case 452: /* sort_specification_list */ + case 342: /* integer_list */ + case 343: /* variable_list */ + case 344: /* retention_list */ + case 348: /* column_def_list */ + case 349: /* tags_def_opt */ + case 351: /* multi_create_clause */ + case 352: /* tags_def */ + case 353: /* multi_drop_clause */ + case 360: /* specific_cols_opt */ + case 361: /* expression_list */ + case 363: /* col_name_list */ + case 366: /* duration_list */ + case 367: /* rollup_func_list */ + case 377: /* tag_list_opt */ + case 381: /* func_list */ + case 395: /* dnode_list */ + case 399: /* literal_list */ + case 407: /* star_func_para_list */ + case 409: /* other_para_list */ + case 411: /* when_then_list */ + case 433: /* select_list */ + case 434: /* partition_by_clause_opt */ + case 439: /* group_by_clause_opt */ + case 442: /* partition_list */ + case 445: /* group_by_list */ + case 448: /* order_by_clause_opt */ + case 453: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy616)); + nodesDestroyList((yypminor->yy404)); } break; - case 344: /* alter_db_option */ - case 367: /* alter_table_option */ + case 345: /* alter_db_option */ + case 368: /* alter_table_option */ { } break; - case 356: /* type_name */ + case 357: /* type_name */ { } break; - case 415: /* compare_op */ - case 416: /* in_op */ + case 416: /* compare_op */ + case 417: /* in_op */ { } break; - case 428: /* join_type */ + case 429: /* join_type */ { } break; - case 443: /* fill_mode */ + case 444: /* fill_mode */ { } break; - case 454: /* ordering_specification_opt */ + case 455: /* ordering_specification_opt */ { } break; - case 455: /* null_ordering_opt */ + case 456: /* null_ordering_opt */ { } @@ -2952,544 +2947,546 @@ 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[] = { - { 321, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - { 321, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - { 322, 0 }, /* (2) account_options ::= */ - { 322, -3 }, /* (3) account_options ::= account_options PPS literal */ - { 322, -3 }, /* (4) account_options ::= account_options TSERIES literal */ - { 322, -3 }, /* (5) account_options ::= account_options STORAGE literal */ - { 322, -3 }, /* (6) account_options ::= account_options STREAMS literal */ - { 322, -3 }, /* (7) account_options ::= account_options QTIME literal */ - { 322, -3 }, /* (8) account_options ::= account_options DBS literal */ - { 322, -3 }, /* (9) account_options ::= account_options USERS literal */ - { 322, -3 }, /* (10) account_options ::= account_options CONNS literal */ - { 322, -3 }, /* (11) account_options ::= account_options STATE literal */ - { 323, -1 }, /* (12) alter_account_options ::= alter_account_option */ - { 323, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - { 325, -2 }, /* (14) alter_account_option ::= PASS literal */ - { 325, -2 }, /* (15) alter_account_option ::= PPS literal */ - { 325, -2 }, /* (16) alter_account_option ::= TSERIES literal */ - { 325, -2 }, /* (17) alter_account_option ::= STORAGE literal */ - { 325, -2 }, /* (18) alter_account_option ::= STREAMS literal */ - { 325, -2 }, /* (19) alter_account_option ::= QTIME literal */ - { 325, -2 }, /* (20) alter_account_option ::= DBS literal */ - { 325, -2 }, /* (21) alter_account_option ::= USERS literal */ - { 325, -2 }, /* (22) alter_account_option ::= CONNS literal */ - { 325, -2 }, /* (23) alter_account_option ::= STATE literal */ - { 321, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ - { 321, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 321, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - { 321, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - { 321, -3 }, /* (28) cmd ::= DROP USER user_name */ - { 327, 0 }, /* (29) sysinfo_opt ::= */ - { 327, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ - { 321, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ - { 321, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ - { 328, -1 }, /* (33) privileges ::= ALL */ - { 328, -1 }, /* (34) privileges ::= priv_type_list */ - { 328, -1 }, /* (35) privileges ::= SUBSCRIBE */ - { 330, -1 }, /* (36) priv_type_list ::= priv_type */ - { 330, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - { 331, -1 }, /* (38) priv_type ::= READ */ - { 331, -1 }, /* (39) priv_type ::= WRITE */ - { 329, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ - { 329, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ - { 329, -1 }, /* (42) priv_level ::= topic_name */ - { 321, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */ - { 321, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - { 321, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */ - { 321, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */ - { 321, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - { 321, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - { 321, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */ - { 321, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - { 334, -1 }, /* (51) dnode_endpoint ::= NK_STRING */ - { 334, -1 }, /* (52) dnode_endpoint ::= NK_ID */ - { 334, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */ - { 335, 0 }, /* (54) force_opt ::= */ - { 335, -1 }, /* (55) force_opt ::= FORCE */ - { 321, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */ - { 321, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - { 321, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 321, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */ - { 321, -2 }, /* (68) cmd ::= USE db_name */ - { 321, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */ - { 321, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */ - { 321, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */ - { 336, -3 }, /* (72) not_exists_opt ::= IF NOT EXISTS */ - { 336, 0 }, /* (73) not_exists_opt ::= */ - { 338, -2 }, /* (74) exists_opt ::= IF EXISTS */ - { 338, 0 }, /* (75) exists_opt ::= */ - { 337, 0 }, /* (76) db_options ::= */ - { 337, -3 }, /* (77) db_options ::= db_options BUFFER NK_INTEGER */ - { 337, -3 }, /* (78) db_options ::= db_options CACHEMODEL NK_STRING */ - { 337, -3 }, /* (79) db_options ::= db_options CACHESIZE NK_INTEGER */ - { 337, -3 }, /* (80) db_options ::= db_options COMP NK_INTEGER */ - { 337, -3 }, /* (81) db_options ::= db_options DURATION NK_INTEGER */ - { 337, -3 }, /* (82) db_options ::= db_options DURATION NK_VARIABLE */ - { 337, -3 }, /* (83) db_options ::= db_options MAXROWS NK_INTEGER */ - { 337, -3 }, /* (84) db_options ::= db_options MINROWS NK_INTEGER */ - { 337, -3 }, /* (85) db_options ::= db_options KEEP integer_list */ - { 337, -3 }, /* (86) db_options ::= db_options KEEP variable_list */ - { 337, -3 }, /* (87) db_options ::= db_options PAGES NK_INTEGER */ - { 337, -3 }, /* (88) db_options ::= db_options PAGESIZE NK_INTEGER */ - { 337, -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - { 337, -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */ - { 337, -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */ - { 337, -3 }, /* (92) db_options ::= db_options STRICT NK_STRING */ - { 337, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */ - { 337, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 337, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */ - { 337, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 337, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - { 337, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - { 337, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - { 337, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - { 337, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - { 337, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - { 337, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - { 337, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - { 337, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - { 337, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ - { 337, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ - { 339, -1 }, /* (108) alter_db_options ::= alter_db_option */ - { 339, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */ - { 344, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */ - { 344, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */ - { 344, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */ - { 344, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - { 344, -2 }, /* (114) alter_db_option ::= KEEP integer_list */ - { 344, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ - { 344, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ - { 344, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ - { 344, -2 }, /* (118) alter_db_option ::= STRICT NK_STRING */ - { 344, -2 }, /* (119) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 344, -2 }, /* (120) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - { 341, -1 }, /* (121) integer_list ::= NK_INTEGER */ - { 341, -3 }, /* (122) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 342, -1 }, /* (123) variable_list ::= NK_VARIABLE */ - { 342, -3 }, /* (124) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 343, -1 }, /* (125) retention_list ::= retention */ - { 343, -3 }, /* (126) retention_list ::= retention_list NK_COMMA retention */ - { 345, -3 }, /* (127) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 340, 0 }, /* (128) speed_opt ::= */ - { 340, -2 }, /* (129) speed_opt ::= MAX_SPEED NK_INTEGER */ - { 321, -9 }, /* (130) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 321, -3 }, /* (131) cmd ::= CREATE TABLE multi_create_clause */ - { 321, -9 }, /* (132) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 321, -3 }, /* (133) cmd ::= DROP TABLE multi_drop_clause */ - { 321, -4 }, /* (134) cmd ::= DROP STABLE exists_opt full_table_name */ - { 321, -3 }, /* (135) cmd ::= ALTER TABLE alter_table_clause */ - { 321, -3 }, /* (136) cmd ::= ALTER STABLE alter_table_clause */ - { 353, -2 }, /* (137) alter_table_clause ::= full_table_name alter_table_options */ - { 353, -5 }, /* (138) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 353, -4 }, /* (139) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 353, -5 }, /* (140) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 353, -5 }, /* (141) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 353, -5 }, /* (142) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 353, -4 }, /* (143) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 353, -5 }, /* (144) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 353, -5 }, /* (145) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 353, -6 }, /* (146) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 350, -1 }, /* (147) multi_create_clause ::= create_subtable_clause */ - { 350, -2 }, /* (148) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 358, -10 }, /* (149) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - { 352, -1 }, /* (150) multi_drop_clause ::= drop_table_clause */ - { 352, -2 }, /* (151) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 361, -2 }, /* (152) drop_table_clause ::= exists_opt full_table_name */ - { 359, 0 }, /* (153) specific_cols_opt ::= */ - { 359, -3 }, /* (154) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 346, -1 }, /* (155) full_table_name ::= table_name */ - { 346, -3 }, /* (156) full_table_name ::= db_name NK_DOT table_name */ - { 347, -1 }, /* (157) column_def_list ::= column_def */ - { 347, -3 }, /* (158) column_def_list ::= column_def_list NK_COMMA column_def */ - { 364, -2 }, /* (159) column_def ::= column_name type_name */ - { 364, -4 }, /* (160) column_def ::= column_name type_name COMMENT NK_STRING */ - { 356, -1 }, /* (161) type_name ::= BOOL */ - { 356, -1 }, /* (162) type_name ::= TINYINT */ - { 356, -1 }, /* (163) type_name ::= SMALLINT */ - { 356, -1 }, /* (164) type_name ::= INT */ - { 356, -1 }, /* (165) type_name ::= INTEGER */ - { 356, -1 }, /* (166) type_name ::= BIGINT */ - { 356, -1 }, /* (167) type_name ::= FLOAT */ - { 356, -1 }, /* (168) type_name ::= DOUBLE */ - { 356, -4 }, /* (169) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 356, -1 }, /* (170) type_name ::= TIMESTAMP */ - { 356, -4 }, /* (171) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 356, -2 }, /* (172) type_name ::= TINYINT UNSIGNED */ - { 356, -2 }, /* (173) type_name ::= SMALLINT UNSIGNED */ - { 356, -2 }, /* (174) type_name ::= INT UNSIGNED */ - { 356, -2 }, /* (175) type_name ::= BIGINT UNSIGNED */ - { 356, -1 }, /* (176) type_name ::= JSON */ - { 356, -4 }, /* (177) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 356, -1 }, /* (178) type_name ::= MEDIUMBLOB */ - { 356, -1 }, /* (179) type_name ::= BLOB */ - { 356, -4 }, /* (180) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 356, -1 }, /* (181) type_name ::= DECIMAL */ - { 356, -4 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 356, -6 }, /* (183) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 348, 0 }, /* (184) tags_def_opt ::= */ - { 348, -1 }, /* (185) tags_def_opt ::= tags_def */ - { 351, -4 }, /* (186) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 349, 0 }, /* (187) table_options ::= */ - { 349, -3 }, /* (188) table_options ::= table_options COMMENT NK_STRING */ - { 349, -3 }, /* (189) table_options ::= table_options MAX_DELAY duration_list */ - { 349, -3 }, /* (190) table_options ::= table_options WATERMARK duration_list */ - { 349, -5 }, /* (191) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 349, -3 }, /* (192) table_options ::= table_options TTL NK_INTEGER */ - { 349, -5 }, /* (193) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 354, -1 }, /* (194) alter_table_options ::= alter_table_option */ - { 354, -2 }, /* (195) alter_table_options ::= alter_table_options alter_table_option */ - { 367, -2 }, /* (196) alter_table_option ::= COMMENT NK_STRING */ - { 367, -2 }, /* (197) alter_table_option ::= TTL NK_INTEGER */ - { 365, -1 }, /* (198) duration_list ::= duration_literal */ - { 365, -3 }, /* (199) duration_list ::= duration_list NK_COMMA duration_literal */ - { 366, -1 }, /* (200) rollup_func_list ::= rollup_func_name */ - { 366, -3 }, /* (201) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 369, -1 }, /* (202) rollup_func_name ::= function_name */ - { 369, -1 }, /* (203) rollup_func_name ::= FIRST */ - { 369, -1 }, /* (204) rollup_func_name ::= LAST */ - { 362, -1 }, /* (205) col_name_list ::= col_name */ - { 362, -3 }, /* (206) col_name_list ::= col_name_list NK_COMMA col_name */ - { 371, -1 }, /* (207) col_name ::= column_name */ - { 321, -2 }, /* (208) cmd ::= SHOW DNODES */ - { 321, -2 }, /* (209) cmd ::= SHOW USERS */ - { 321, -3 }, /* (210) cmd ::= SHOW USER PRIVILEGES */ - { 321, -2 }, /* (211) cmd ::= SHOW DATABASES */ - { 321, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 321, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 321, -3 }, /* (214) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 321, -2 }, /* (215) cmd ::= SHOW MNODES */ - { 321, -2 }, /* (216) cmd ::= SHOW QNODES */ - { 321, -2 }, /* (217) cmd ::= SHOW FUNCTIONS */ - { 321, -5 }, /* (218) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 321, -2 }, /* (219) cmd ::= SHOW STREAMS */ - { 321, -2 }, /* (220) cmd ::= SHOW ACCOUNTS */ - { 321, -2 }, /* (221) cmd ::= SHOW APPS */ - { 321, -2 }, /* (222) cmd ::= SHOW CONNECTIONS */ - { 321, -2 }, /* (223) cmd ::= SHOW LICENCES */ - { 321, -2 }, /* (224) cmd ::= SHOW GRANTS */ - { 321, -4 }, /* (225) cmd ::= SHOW CREATE DATABASE db_name */ - { 321, -4 }, /* (226) cmd ::= SHOW CREATE TABLE full_table_name */ - { 321, -4 }, /* (227) cmd ::= SHOW CREATE STABLE full_table_name */ - { 321, -2 }, /* (228) cmd ::= SHOW QUERIES */ - { 321, -2 }, /* (229) cmd ::= SHOW SCORES */ - { 321, -2 }, /* (230) cmd ::= SHOW TOPICS */ - { 321, -2 }, /* (231) cmd ::= SHOW VARIABLES */ - { 321, -3 }, /* (232) cmd ::= SHOW CLUSTER VARIABLES */ - { 321, -3 }, /* (233) cmd ::= SHOW LOCAL VARIABLES */ - { 321, -5 }, /* (234) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - { 321, -2 }, /* (235) cmd ::= SHOW BNODES */ - { 321, -2 }, /* (236) cmd ::= SHOW SNODES */ - { 321, -2 }, /* (237) cmd ::= SHOW CLUSTER */ - { 321, -2 }, /* (238) cmd ::= SHOW TRANSACTIONS */ - { 321, -4 }, /* (239) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 321, -2 }, /* (240) cmd ::= SHOW CONSUMERS */ - { 321, -2 }, /* (241) cmd ::= SHOW SUBSCRIPTIONS */ - { 321, -5 }, /* (242) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 321, -7 }, /* (243) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - { 321, -3 }, /* (244) cmd ::= SHOW VNODES NK_INTEGER */ - { 321, -3 }, /* (245) cmd ::= SHOW VNODES NK_STRING */ - { 372, 0 }, /* (246) db_name_cond_opt ::= */ - { 372, -2 }, /* (247) db_name_cond_opt ::= db_name NK_DOT */ - { 373, 0 }, /* (248) like_pattern_opt ::= */ - { 373, -2 }, /* (249) like_pattern_opt ::= LIKE NK_STRING */ - { 374, -1 }, /* (250) table_name_cond ::= table_name */ - { 375, 0 }, /* (251) from_db_opt ::= */ - { 375, -2 }, /* (252) from_db_opt ::= FROM db_name */ - { 376, 0 }, /* (253) tag_list_opt ::= */ - { 376, -1 }, /* (254) tag_list_opt ::= tag_item */ - { 376, -3 }, /* (255) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - { 377, -1 }, /* (256) tag_item ::= TBNAME */ - { 377, -1 }, /* (257) tag_item ::= QTAGS */ - { 377, -1 }, /* (258) tag_item ::= column_name */ - { 377, -2 }, /* (259) tag_item ::= column_name column_alias */ - { 377, -3 }, /* (260) tag_item ::= column_name AS column_alias */ - { 321, -8 }, /* (261) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 321, -4 }, /* (262) cmd ::= DROP INDEX exists_opt full_table_name */ - { 379, -10 }, /* (263) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 379, -12 }, /* (264) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - { 380, -1 }, /* (265) func_list ::= func */ - { 380, -3 }, /* (266) func_list ::= func_list NK_COMMA func */ - { 383, -4 }, /* (267) func ::= function_name NK_LP expression_list NK_RP */ - { 382, 0 }, /* (268) sma_stream_opt ::= */ - { 382, -3 }, /* (269) sma_stream_opt ::= stream_options WATERMARK duration_literal */ - { 382, -3 }, /* (270) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ - { 321, -6 }, /* (271) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - { 321, -7 }, /* (272) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 321, -9 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 321, -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 321, -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 321, -4 }, /* (276) cmd ::= DROP TOPIC exists_opt topic_name */ - { 321, -7 }, /* (277) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 321, -2 }, /* (278) cmd ::= DESC full_table_name */ - { 321, -2 }, /* (279) cmd ::= DESCRIBE full_table_name */ - { 321, -3 }, /* (280) cmd ::= RESET QUERY CACHE */ - { 321, -4 }, /* (281) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - { 387, 0 }, /* (282) analyze_opt ::= */ - { 387, -1 }, /* (283) analyze_opt ::= ANALYZE */ - { 388, 0 }, /* (284) explain_options ::= */ - { 388, -3 }, /* (285) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 388, -3 }, /* (286) explain_options ::= explain_options RATIO NK_FLOAT */ - { 321, -10 }, /* (287) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 321, -4 }, /* (288) cmd ::= DROP FUNCTION exists_opt function_name */ - { 389, 0 }, /* (289) agg_func_opt ::= */ - { 389, -1 }, /* (290) agg_func_opt ::= AGGREGATE */ - { 390, 0 }, /* (291) bufsize_opt ::= */ - { 390, -2 }, /* (292) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 321, -11 }, /* (293) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ - { 321, -4 }, /* (294) cmd ::= DROP STREAM exists_opt stream_name */ - { 384, 0 }, /* (295) stream_options ::= */ - { 384, -3 }, /* (296) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 384, -3 }, /* (297) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 384, -4 }, /* (298) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 384, -3 }, /* (299) stream_options ::= stream_options WATERMARK duration_literal */ - { 384, -4 }, /* (300) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 384, -3 }, /* (301) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - { 392, 0 }, /* (302) subtable_opt ::= */ - { 392, -4 }, /* (303) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 321, -3 }, /* (304) cmd ::= KILL CONNECTION NK_INTEGER */ - { 321, -3 }, /* (305) cmd ::= KILL QUERY NK_STRING */ - { 321, -3 }, /* (306) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 321, -2 }, /* (307) cmd ::= BALANCE VGROUP */ - { 321, -4 }, /* (308) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 321, -4 }, /* (309) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 321, -3 }, /* (310) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 394, -2 }, /* (311) dnode_list ::= DNODE NK_INTEGER */ - { 394, -3 }, /* (312) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 321, -4 }, /* (313) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 321, -1 }, /* (314) cmd ::= query_or_subquery */ - { 321, -7 }, /* (315) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 321, -4 }, /* (316) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 324, -1 }, /* (317) literal ::= NK_INTEGER */ - { 324, -1 }, /* (318) literal ::= NK_FLOAT */ - { 324, -1 }, /* (319) literal ::= NK_STRING */ - { 324, -1 }, /* (320) literal ::= NK_BOOL */ - { 324, -2 }, /* (321) literal ::= TIMESTAMP NK_STRING */ - { 324, -1 }, /* (322) literal ::= duration_literal */ - { 324, -1 }, /* (323) literal ::= NULL */ - { 324, -1 }, /* (324) literal ::= NK_QUESTION */ - { 368, -1 }, /* (325) duration_literal ::= NK_VARIABLE */ - { 396, -1 }, /* (326) signed ::= NK_INTEGER */ - { 396, -2 }, /* (327) signed ::= NK_PLUS NK_INTEGER */ - { 396, -2 }, /* (328) signed ::= NK_MINUS NK_INTEGER */ - { 396, -1 }, /* (329) signed ::= NK_FLOAT */ - { 396, -2 }, /* (330) signed ::= NK_PLUS NK_FLOAT */ - { 396, -2 }, /* (331) signed ::= NK_MINUS NK_FLOAT */ - { 357, -1 }, /* (332) signed_literal ::= signed */ - { 357, -1 }, /* (333) signed_literal ::= NK_STRING */ - { 357, -1 }, /* (334) signed_literal ::= NK_BOOL */ - { 357, -2 }, /* (335) signed_literal ::= TIMESTAMP NK_STRING */ - { 357, -1 }, /* (336) signed_literal ::= duration_literal */ - { 357, -1 }, /* (337) signed_literal ::= NULL */ - { 357, -1 }, /* (338) signed_literal ::= literal_func */ - { 357, -1 }, /* (339) signed_literal ::= NK_QUESTION */ - { 398, -1 }, /* (340) literal_list ::= signed_literal */ - { 398, -3 }, /* (341) literal_list ::= literal_list NK_COMMA signed_literal */ - { 332, -1 }, /* (342) db_name ::= NK_ID */ - { 363, -1 }, /* (343) table_name ::= NK_ID */ - { 355, -1 }, /* (344) column_name ::= NK_ID */ - { 370, -1 }, /* (345) function_name ::= NK_ID */ - { 399, -1 }, /* (346) table_alias ::= NK_ID */ - { 378, -1 }, /* (347) column_alias ::= NK_ID */ - { 326, -1 }, /* (348) user_name ::= NK_ID */ - { 333, -1 }, /* (349) topic_name ::= NK_ID */ - { 391, -1 }, /* (350) stream_name ::= NK_ID */ - { 386, -1 }, /* (351) cgroup_name ::= NK_ID */ - { 400, -1 }, /* (352) expr_or_subquery ::= expression */ - { 393, -1 }, /* (353) expression ::= literal */ - { 393, -1 }, /* (354) expression ::= pseudo_column */ - { 393, -1 }, /* (355) expression ::= column_reference */ - { 393, -1 }, /* (356) expression ::= function_expression */ - { 393, -1 }, /* (357) expression ::= case_when_expression */ - { 393, -3 }, /* (358) expression ::= NK_LP expression NK_RP */ - { 393, -2 }, /* (359) expression ::= NK_PLUS expr_or_subquery */ - { 393, -2 }, /* (360) expression ::= NK_MINUS expr_or_subquery */ - { 393, -3 }, /* (361) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 393, -3 }, /* (362) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 393, -3 }, /* (363) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 393, -3 }, /* (364) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 393, -3 }, /* (365) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 393, -3 }, /* (366) expression ::= column_reference NK_ARROW NK_STRING */ - { 393, -3 }, /* (367) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 393, -3 }, /* (368) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 360, -1 }, /* (369) expression_list ::= expr_or_subquery */ - { 360, -3 }, /* (370) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 402, -1 }, /* (371) column_reference ::= column_name */ - { 402, -3 }, /* (372) column_reference ::= table_name NK_DOT column_name */ - { 401, -1 }, /* (373) pseudo_column ::= ROWTS */ - { 401, -1 }, /* (374) pseudo_column ::= TBNAME */ - { 401, -3 }, /* (375) pseudo_column ::= table_name NK_DOT TBNAME */ - { 401, -1 }, /* (376) pseudo_column ::= QSTART */ - { 401, -1 }, /* (377) pseudo_column ::= QEND */ - { 401, -1 }, /* (378) pseudo_column ::= QDURATION */ - { 401, -1 }, /* (379) pseudo_column ::= WSTART */ - { 401, -1 }, /* (380) pseudo_column ::= WEND */ - { 401, -1 }, /* (381) pseudo_column ::= WDURATION */ - { 401, -1 }, /* (382) pseudo_column ::= IROWTS */ - { 401, -1 }, /* (383) pseudo_column ::= QTAGS */ - { 403, -4 }, /* (384) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 403, -4 }, /* (385) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 403, -6 }, /* (386) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 403, -1 }, /* (387) function_expression ::= literal_func */ - { 397, -3 }, /* (388) literal_func ::= noarg_func NK_LP NK_RP */ - { 397, -1 }, /* (389) literal_func ::= NOW */ - { 407, -1 }, /* (390) noarg_func ::= NOW */ - { 407, -1 }, /* (391) noarg_func ::= TODAY */ - { 407, -1 }, /* (392) noarg_func ::= TIMEZONE */ - { 407, -1 }, /* (393) noarg_func ::= DATABASE */ - { 407, -1 }, /* (394) noarg_func ::= CLIENT_VERSION */ - { 407, -1 }, /* (395) noarg_func ::= SERVER_VERSION */ - { 407, -1 }, /* (396) noarg_func ::= SERVER_STATUS */ - { 407, -1 }, /* (397) noarg_func ::= CURRENT_USER */ - { 407, -1 }, /* (398) noarg_func ::= USER */ - { 405, -1 }, /* (399) star_func ::= COUNT */ - { 405, -1 }, /* (400) star_func ::= FIRST */ - { 405, -1 }, /* (401) star_func ::= LAST */ - { 405, -1 }, /* (402) star_func ::= LAST_ROW */ - { 406, -1 }, /* (403) star_func_para_list ::= NK_STAR */ - { 406, -1 }, /* (404) star_func_para_list ::= other_para_list */ - { 408, -1 }, /* (405) other_para_list ::= star_func_para */ - { 408, -3 }, /* (406) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 409, -1 }, /* (407) star_func_para ::= expr_or_subquery */ - { 409, -3 }, /* (408) star_func_para ::= table_name NK_DOT NK_STAR */ - { 404, -4 }, /* (409) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 404, -5 }, /* (410) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 410, -1 }, /* (411) when_then_list ::= when_then_expr */ - { 410, -2 }, /* (412) when_then_list ::= when_then_list when_then_expr */ - { 413, -4 }, /* (413) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 411, 0 }, /* (414) case_when_else_opt ::= */ - { 411, -2 }, /* (415) case_when_else_opt ::= ELSE common_expression */ - { 414, -3 }, /* (416) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 414, -5 }, /* (417) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 414, -6 }, /* (418) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 414, -3 }, /* (419) predicate ::= expr_or_subquery IS NULL */ - { 414, -4 }, /* (420) predicate ::= expr_or_subquery IS NOT NULL */ - { 414, -3 }, /* (421) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 415, -1 }, /* (422) compare_op ::= NK_LT */ - { 415, -1 }, /* (423) compare_op ::= NK_GT */ - { 415, -1 }, /* (424) compare_op ::= NK_LE */ - { 415, -1 }, /* (425) compare_op ::= NK_GE */ - { 415, -1 }, /* (426) compare_op ::= NK_NE */ - { 415, -1 }, /* (427) compare_op ::= NK_EQ */ - { 415, -1 }, /* (428) compare_op ::= LIKE */ - { 415, -2 }, /* (429) compare_op ::= NOT LIKE */ - { 415, -1 }, /* (430) compare_op ::= MATCH */ - { 415, -1 }, /* (431) compare_op ::= NMATCH */ - { 415, -1 }, /* (432) compare_op ::= CONTAINS */ - { 416, -1 }, /* (433) in_op ::= IN */ - { 416, -2 }, /* (434) in_op ::= NOT IN */ - { 417, -3 }, /* (435) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 418, -1 }, /* (436) boolean_value_expression ::= boolean_primary */ - { 418, -2 }, /* (437) boolean_value_expression ::= NOT boolean_primary */ - { 418, -3 }, /* (438) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 418, -3 }, /* (439) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 419, -1 }, /* (440) boolean_primary ::= predicate */ - { 419, -3 }, /* (441) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 412, -1 }, /* (442) common_expression ::= expr_or_subquery */ - { 412, -1 }, /* (443) common_expression ::= boolean_value_expression */ - { 420, 0 }, /* (444) from_clause_opt ::= */ - { 420, -2 }, /* (445) from_clause_opt ::= FROM table_reference_list */ - { 421, -1 }, /* (446) table_reference_list ::= table_reference */ - { 421, -3 }, /* (447) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 422, -1 }, /* (448) table_reference ::= table_primary */ - { 422, -1 }, /* (449) table_reference ::= joined_table */ - { 423, -2 }, /* (450) table_primary ::= table_name alias_opt */ - { 423, -4 }, /* (451) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 423, -2 }, /* (452) table_primary ::= subquery alias_opt */ - { 423, -1 }, /* (453) table_primary ::= parenthesized_joined_table */ - { 425, 0 }, /* (454) alias_opt ::= */ - { 425, -1 }, /* (455) alias_opt ::= table_alias */ - { 425, -2 }, /* (456) alias_opt ::= AS table_alias */ - { 427, -3 }, /* (457) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 427, -3 }, /* (458) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 424, -6 }, /* (459) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 428, 0 }, /* (460) join_type ::= */ - { 428, -1 }, /* (461) join_type ::= INNER */ - { 430, -12 }, /* (462) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 431, 0 }, /* (463) set_quantifier_opt ::= */ - { 431, -1 }, /* (464) set_quantifier_opt ::= DISTINCT */ - { 431, -1 }, /* (465) set_quantifier_opt ::= ALL */ - { 432, -1 }, /* (466) select_list ::= select_item */ - { 432, -3 }, /* (467) select_list ::= select_list NK_COMMA select_item */ - { 440, -1 }, /* (468) select_item ::= NK_STAR */ - { 440, -1 }, /* (469) select_item ::= common_expression */ - { 440, -2 }, /* (470) select_item ::= common_expression column_alias */ - { 440, -3 }, /* (471) select_item ::= common_expression AS column_alias */ - { 440, -3 }, /* (472) select_item ::= table_name NK_DOT NK_STAR */ - { 395, 0 }, /* (473) where_clause_opt ::= */ - { 395, -2 }, /* (474) where_clause_opt ::= WHERE search_condition */ - { 433, 0 }, /* (475) partition_by_clause_opt ::= */ - { 433, -3 }, /* (476) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 441, -1 }, /* (477) partition_list ::= partition_item */ - { 441, -3 }, /* (478) partition_list ::= partition_list NK_COMMA partition_item */ - { 442, -1 }, /* (479) partition_item ::= expr_or_subquery */ - { 442, -2 }, /* (480) partition_item ::= expr_or_subquery column_alias */ - { 442, -3 }, /* (481) partition_item ::= expr_or_subquery AS column_alias */ - { 437, 0 }, /* (482) twindow_clause_opt ::= */ - { 437, -6 }, /* (483) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 437, -4 }, /* (484) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 437, -6 }, /* (485) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 437, -8 }, /* (486) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 381, 0 }, /* (487) sliding_opt ::= */ - { 381, -4 }, /* (488) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 436, 0 }, /* (489) fill_opt ::= */ - { 436, -4 }, /* (490) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 436, -6 }, /* (491) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 443, -1 }, /* (492) fill_mode ::= NONE */ - { 443, -1 }, /* (493) fill_mode ::= PREV */ - { 443, -1 }, /* (494) fill_mode ::= NULL */ - { 443, -1 }, /* (495) fill_mode ::= LINEAR */ - { 443, -1 }, /* (496) fill_mode ::= NEXT */ - { 438, 0 }, /* (497) group_by_clause_opt ::= */ - { 438, -3 }, /* (498) group_by_clause_opt ::= GROUP BY group_by_list */ - { 444, -1 }, /* (499) group_by_list ::= expr_or_subquery */ - { 444, -3 }, /* (500) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 439, 0 }, /* (501) having_clause_opt ::= */ - { 439, -2 }, /* (502) having_clause_opt ::= HAVING search_condition */ - { 434, 0 }, /* (503) range_opt ::= */ - { 434, -6 }, /* (504) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 435, 0 }, /* (505) every_opt ::= */ - { 435, -4 }, /* (506) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 445, -4 }, /* (507) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 446, -1 }, /* (508) query_simple ::= query_specification */ - { 446, -1 }, /* (509) query_simple ::= union_query_expression */ - { 450, -4 }, /* (510) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 450, -3 }, /* (511) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 451, -1 }, /* (512) query_simple_or_subquery ::= query_simple */ - { 451, -1 }, /* (513) query_simple_or_subquery ::= subquery */ - { 385, -1 }, /* (514) query_or_subquery ::= query_expression */ - { 385, -1 }, /* (515) query_or_subquery ::= subquery */ - { 447, 0 }, /* (516) order_by_clause_opt ::= */ - { 447, -3 }, /* (517) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 448, 0 }, /* (518) slimit_clause_opt ::= */ - { 448, -2 }, /* (519) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 448, -4 }, /* (520) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 448, -4 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 449, 0 }, /* (522) limit_clause_opt ::= */ - { 449, -2 }, /* (523) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 449, -4 }, /* (524) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 449, -4 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 426, -3 }, /* (526) subquery ::= NK_LP query_expression NK_RP */ - { 426, -3 }, /* (527) subquery ::= NK_LP subquery NK_RP */ - { 429, -1 }, /* (528) search_condition ::= common_expression */ - { 452, -1 }, /* (529) sort_specification_list ::= sort_specification */ - { 452, -3 }, /* (530) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 453, -3 }, /* (531) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 454, 0 }, /* (532) ordering_specification_opt ::= */ - { 454, -1 }, /* (533) ordering_specification_opt ::= ASC */ - { 454, -1 }, /* (534) ordering_specification_opt ::= DESC */ - { 455, 0 }, /* (535) null_ordering_opt ::= */ - { 455, -2 }, /* (536) null_ordering_opt ::= NULLS FIRST */ - { 455, -2 }, /* (537) null_ordering_opt ::= NULLS LAST */ + { 322, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + { 322, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + { 323, 0 }, /* (2) account_options ::= */ + { 323, -3 }, /* (3) account_options ::= account_options PPS literal */ + { 323, -3 }, /* (4) account_options ::= account_options TSERIES literal */ + { 323, -3 }, /* (5) account_options ::= account_options STORAGE literal */ + { 323, -3 }, /* (6) account_options ::= account_options STREAMS literal */ + { 323, -3 }, /* (7) account_options ::= account_options QTIME literal */ + { 323, -3 }, /* (8) account_options ::= account_options DBS literal */ + { 323, -3 }, /* (9) account_options ::= account_options USERS literal */ + { 323, -3 }, /* (10) account_options ::= account_options CONNS literal */ + { 323, -3 }, /* (11) account_options ::= account_options STATE literal */ + { 324, -1 }, /* (12) alter_account_options ::= alter_account_option */ + { 324, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + { 326, -2 }, /* (14) alter_account_option ::= PASS literal */ + { 326, -2 }, /* (15) alter_account_option ::= PPS literal */ + { 326, -2 }, /* (16) alter_account_option ::= TSERIES literal */ + { 326, -2 }, /* (17) alter_account_option ::= STORAGE literal */ + { 326, -2 }, /* (18) alter_account_option ::= STREAMS literal */ + { 326, -2 }, /* (19) alter_account_option ::= QTIME literal */ + { 326, -2 }, /* (20) alter_account_option ::= DBS literal */ + { 326, -2 }, /* (21) alter_account_option ::= USERS literal */ + { 326, -2 }, /* (22) alter_account_option ::= CONNS literal */ + { 326, -2 }, /* (23) alter_account_option ::= STATE literal */ + { 322, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ + { 322, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 322, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + { 322, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + { 322, -3 }, /* (28) cmd ::= DROP USER user_name */ + { 328, 0 }, /* (29) sysinfo_opt ::= */ + { 328, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ + { 322, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ + { 322, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ + { 329, -1 }, /* (33) privileges ::= ALL */ + { 329, -1 }, /* (34) privileges ::= priv_type_list */ + { 329, -1 }, /* (35) privileges ::= SUBSCRIBE */ + { 331, -1 }, /* (36) priv_type_list ::= priv_type */ + { 331, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { 332, -1 }, /* (38) priv_type ::= READ */ + { 332, -1 }, /* (39) priv_type ::= WRITE */ + { 330, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ + { 330, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ + { 330, -1 }, /* (42) priv_level ::= topic_name */ + { 322, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */ + { 322, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + { 322, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */ + { 322, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */ + { 322, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 322, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 322, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */ + { 322, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 335, -1 }, /* (51) dnode_endpoint ::= NK_STRING */ + { 335, -1 }, /* (52) dnode_endpoint ::= NK_ID */ + { 335, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */ + { 336, 0 }, /* (54) force_opt ::= */ + { 336, -1 }, /* (55) force_opt ::= FORCE */ + { 322, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */ + { 322, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 322, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 322, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */ + { 322, -2 }, /* (68) cmd ::= USE db_name */ + { 322, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 322, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */ + { 322, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */ + { 337, -3 }, /* (72) not_exists_opt ::= IF NOT EXISTS */ + { 337, 0 }, /* (73) not_exists_opt ::= */ + { 339, -2 }, /* (74) exists_opt ::= IF EXISTS */ + { 339, 0 }, /* (75) exists_opt ::= */ + { 338, 0 }, /* (76) db_options ::= */ + { 338, -3 }, /* (77) db_options ::= db_options BUFFER NK_INTEGER */ + { 338, -3 }, /* (78) db_options ::= db_options CACHEMODEL NK_STRING */ + { 338, -3 }, /* (79) db_options ::= db_options CACHESIZE NK_INTEGER */ + { 338, -3 }, /* (80) db_options ::= db_options COMP NK_INTEGER */ + { 338, -3 }, /* (81) db_options ::= db_options DURATION NK_INTEGER */ + { 338, -3 }, /* (82) db_options ::= db_options DURATION NK_VARIABLE */ + { 338, -3 }, /* (83) db_options ::= db_options MAXROWS NK_INTEGER */ + { 338, -3 }, /* (84) db_options ::= db_options MINROWS NK_INTEGER */ + { 338, -3 }, /* (85) db_options ::= db_options KEEP integer_list */ + { 338, -3 }, /* (86) db_options ::= db_options KEEP variable_list */ + { 338, -3 }, /* (87) db_options ::= db_options PAGES NK_INTEGER */ + { 338, -3 }, /* (88) db_options ::= db_options PAGESIZE NK_INTEGER */ + { 338, -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + { 338, -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */ + { 338, -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */ + { 338, -3 }, /* (92) db_options ::= db_options STRICT NK_STRING */ + { 338, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */ + { 338, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 338, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */ + { 338, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 338, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + { 338, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + { 338, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + { 338, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + { 338, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + { 338, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + { 338, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + { 338, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + { 338, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + { 338, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ + { 338, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ + { 340, -1 }, /* (108) alter_db_options ::= alter_db_option */ + { 340, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */ + { 345, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */ + { 345, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */ + { 345, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */ + { 345, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + { 345, -2 }, /* (114) alter_db_option ::= KEEP integer_list */ + { 345, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ + { 345, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ + { 345, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ + { 345, -2 }, /* (118) alter_db_option ::= STRICT NK_STRING */ + { 345, -2 }, /* (119) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { 345, -2 }, /* (120) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + { 342, -1 }, /* (121) integer_list ::= NK_INTEGER */ + { 342, -3 }, /* (122) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 343, -1 }, /* (123) variable_list ::= NK_VARIABLE */ + { 343, -3 }, /* (124) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 344, -1 }, /* (125) retention_list ::= retention */ + { 344, -3 }, /* (126) retention_list ::= retention_list NK_COMMA retention */ + { 346, -3 }, /* (127) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 341, 0 }, /* (128) speed_opt ::= */ + { 341, -2 }, /* (129) speed_opt ::= MAX_SPEED NK_INTEGER */ + { 322, -9 }, /* (130) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 322, -3 }, /* (131) cmd ::= CREATE TABLE multi_create_clause */ + { 322, -9 }, /* (132) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 322, -3 }, /* (133) cmd ::= DROP TABLE multi_drop_clause */ + { 322, -4 }, /* (134) cmd ::= DROP STABLE exists_opt full_table_name */ + { 322, -3 }, /* (135) cmd ::= ALTER TABLE alter_table_clause */ + { 322, -3 }, /* (136) cmd ::= ALTER STABLE alter_table_clause */ + { 354, -2 }, /* (137) alter_table_clause ::= full_table_name alter_table_options */ + { 354, -5 }, /* (138) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 354, -4 }, /* (139) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 354, -5 }, /* (140) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 354, -5 }, /* (141) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 354, -5 }, /* (142) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 354, -4 }, /* (143) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 354, -5 }, /* (144) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 354, -5 }, /* (145) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 354, -6 }, /* (146) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 351, -1 }, /* (147) multi_create_clause ::= create_subtable_clause */ + { 351, -2 }, /* (148) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 359, -10 }, /* (149) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + { 353, -1 }, /* (150) multi_drop_clause ::= drop_table_clause */ + { 353, -2 }, /* (151) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 362, -2 }, /* (152) drop_table_clause ::= exists_opt full_table_name */ + { 360, 0 }, /* (153) specific_cols_opt ::= */ + { 360, -3 }, /* (154) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + { 347, -1 }, /* (155) full_table_name ::= table_name */ + { 347, -3 }, /* (156) full_table_name ::= db_name NK_DOT table_name */ + { 348, -1 }, /* (157) column_def_list ::= column_def */ + { 348, -3 }, /* (158) column_def_list ::= column_def_list NK_COMMA column_def */ + { 365, -2 }, /* (159) column_def ::= column_name type_name */ + { 365, -4 }, /* (160) column_def ::= column_name type_name COMMENT NK_STRING */ + { 357, -1 }, /* (161) type_name ::= BOOL */ + { 357, -1 }, /* (162) type_name ::= TINYINT */ + { 357, -1 }, /* (163) type_name ::= SMALLINT */ + { 357, -1 }, /* (164) type_name ::= INT */ + { 357, -1 }, /* (165) type_name ::= INTEGER */ + { 357, -1 }, /* (166) type_name ::= BIGINT */ + { 357, -1 }, /* (167) type_name ::= FLOAT */ + { 357, -1 }, /* (168) type_name ::= DOUBLE */ + { 357, -4 }, /* (169) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (170) type_name ::= TIMESTAMP */ + { 357, -4 }, /* (171) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 357, -2 }, /* (172) type_name ::= TINYINT UNSIGNED */ + { 357, -2 }, /* (173) type_name ::= SMALLINT UNSIGNED */ + { 357, -2 }, /* (174) type_name ::= INT UNSIGNED */ + { 357, -2 }, /* (175) type_name ::= BIGINT UNSIGNED */ + { 357, -1 }, /* (176) type_name ::= JSON */ + { 357, -4 }, /* (177) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (178) type_name ::= MEDIUMBLOB */ + { 357, -1 }, /* (179) type_name ::= BLOB */ + { 357, -4 }, /* (180) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (181) type_name ::= DECIMAL */ + { 357, -4 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 357, -6 }, /* (183) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 349, 0 }, /* (184) tags_def_opt ::= */ + { 349, -1 }, /* (185) tags_def_opt ::= tags_def */ + { 352, -4 }, /* (186) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 350, 0 }, /* (187) table_options ::= */ + { 350, -3 }, /* (188) table_options ::= table_options COMMENT NK_STRING */ + { 350, -3 }, /* (189) table_options ::= table_options MAX_DELAY duration_list */ + { 350, -3 }, /* (190) table_options ::= table_options WATERMARK duration_list */ + { 350, -5 }, /* (191) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 350, -3 }, /* (192) table_options ::= table_options TTL NK_INTEGER */ + { 350, -5 }, /* (193) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 350, -3 }, /* (194) table_options ::= table_options DELETE_MARK duration_list */ + { 355, -1 }, /* (195) alter_table_options ::= alter_table_option */ + { 355, -2 }, /* (196) alter_table_options ::= alter_table_options alter_table_option */ + { 368, -2 }, /* (197) alter_table_option ::= COMMENT NK_STRING */ + { 368, -2 }, /* (198) alter_table_option ::= TTL NK_INTEGER */ + { 366, -1 }, /* (199) duration_list ::= duration_literal */ + { 366, -3 }, /* (200) duration_list ::= duration_list NK_COMMA duration_literal */ + { 367, -1 }, /* (201) rollup_func_list ::= rollup_func_name */ + { 367, -3 }, /* (202) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 370, -1 }, /* (203) rollup_func_name ::= function_name */ + { 370, -1 }, /* (204) rollup_func_name ::= FIRST */ + { 370, -1 }, /* (205) rollup_func_name ::= LAST */ + { 363, -1 }, /* (206) col_name_list ::= col_name */ + { 363, -3 }, /* (207) col_name_list ::= col_name_list NK_COMMA col_name */ + { 372, -1 }, /* (208) col_name ::= column_name */ + { 322, -2 }, /* (209) cmd ::= SHOW DNODES */ + { 322, -2 }, /* (210) cmd ::= SHOW USERS */ + { 322, -3 }, /* (211) cmd ::= SHOW USER PRIVILEGES */ + { 322, -2 }, /* (212) cmd ::= SHOW DATABASES */ + { 322, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 322, -4 }, /* (214) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 322, -3 }, /* (215) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 322, -2 }, /* (216) cmd ::= SHOW MNODES */ + { 322, -2 }, /* (217) cmd ::= SHOW QNODES */ + { 322, -2 }, /* (218) cmd ::= SHOW FUNCTIONS */ + { 322, -5 }, /* (219) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 322, -2 }, /* (220) cmd ::= SHOW STREAMS */ + { 322, -2 }, /* (221) cmd ::= SHOW ACCOUNTS */ + { 322, -2 }, /* (222) cmd ::= SHOW APPS */ + { 322, -2 }, /* (223) cmd ::= SHOW CONNECTIONS */ + { 322, -2 }, /* (224) cmd ::= SHOW LICENCES */ + { 322, -2 }, /* (225) cmd ::= SHOW GRANTS */ + { 322, -4 }, /* (226) cmd ::= SHOW CREATE DATABASE db_name */ + { 322, -4 }, /* (227) cmd ::= SHOW CREATE TABLE full_table_name */ + { 322, -4 }, /* (228) cmd ::= SHOW CREATE STABLE full_table_name */ + { 322, -2 }, /* (229) cmd ::= SHOW QUERIES */ + { 322, -2 }, /* (230) cmd ::= SHOW SCORES */ + { 322, -2 }, /* (231) cmd ::= SHOW TOPICS */ + { 322, -2 }, /* (232) cmd ::= SHOW VARIABLES */ + { 322, -3 }, /* (233) cmd ::= SHOW CLUSTER VARIABLES */ + { 322, -3 }, /* (234) cmd ::= SHOW LOCAL VARIABLES */ + { 322, -5 }, /* (235) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + { 322, -2 }, /* (236) cmd ::= SHOW BNODES */ + { 322, -2 }, /* (237) cmd ::= SHOW SNODES */ + { 322, -2 }, /* (238) cmd ::= SHOW CLUSTER */ + { 322, -2 }, /* (239) cmd ::= SHOW TRANSACTIONS */ + { 322, -4 }, /* (240) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 322, -2 }, /* (241) cmd ::= SHOW CONSUMERS */ + { 322, -2 }, /* (242) cmd ::= SHOW SUBSCRIPTIONS */ + { 322, -5 }, /* (243) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { 322, -7 }, /* (244) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + { 322, -3 }, /* (245) cmd ::= SHOW VNODES NK_INTEGER */ + { 322, -3 }, /* (246) cmd ::= SHOW VNODES NK_STRING */ + { 373, 0 }, /* (247) db_name_cond_opt ::= */ + { 373, -2 }, /* (248) db_name_cond_opt ::= db_name NK_DOT */ + { 374, 0 }, /* (249) like_pattern_opt ::= */ + { 374, -2 }, /* (250) like_pattern_opt ::= LIKE NK_STRING */ + { 375, -1 }, /* (251) table_name_cond ::= table_name */ + { 376, 0 }, /* (252) from_db_opt ::= */ + { 376, -2 }, /* (253) from_db_opt ::= FROM db_name */ + { 377, 0 }, /* (254) tag_list_opt ::= */ + { 377, -1 }, /* (255) tag_list_opt ::= tag_item */ + { 377, -3 }, /* (256) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + { 378, -1 }, /* (257) tag_item ::= TBNAME */ + { 378, -1 }, /* (258) tag_item ::= QTAGS */ + { 378, -1 }, /* (259) tag_item ::= column_name */ + { 378, -2 }, /* (260) tag_item ::= column_name column_alias */ + { 378, -3 }, /* (261) tag_item ::= column_name AS column_alias */ + { 322, -8 }, /* (262) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 322, -4 }, /* (263) cmd ::= DROP INDEX exists_opt full_table_name */ + { 380, -10 }, /* (264) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 380, -12 }, /* (265) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + { 381, -1 }, /* (266) func_list ::= func */ + { 381, -3 }, /* (267) func_list ::= func_list NK_COMMA func */ + { 384, -4 }, /* (268) func ::= function_name NK_LP expression_list NK_RP */ + { 383, 0 }, /* (269) sma_stream_opt ::= */ + { 383, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + { 383, -3 }, /* (271) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + { 383, -3 }, /* (272) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + { 322, -6 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + { 322, -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 322, -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 322, -7 }, /* (276) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 322, -9 }, /* (277) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 322, -4 }, /* (278) cmd ::= DROP TOPIC exists_opt topic_name */ + { 322, -7 }, /* (279) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 322, -2 }, /* (280) cmd ::= DESC full_table_name */ + { 322, -2 }, /* (281) cmd ::= DESCRIBE full_table_name */ + { 322, -3 }, /* (282) cmd ::= RESET QUERY CACHE */ + { 322, -4 }, /* (283) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + { 387, 0 }, /* (284) analyze_opt ::= */ + { 387, -1 }, /* (285) analyze_opt ::= ANALYZE */ + { 388, 0 }, /* (286) explain_options ::= */ + { 388, -3 }, /* (287) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 388, -3 }, /* (288) explain_options ::= explain_options RATIO NK_FLOAT */ + { 322, -10 }, /* (289) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 322, -4 }, /* (290) cmd ::= DROP FUNCTION exists_opt function_name */ + { 389, 0 }, /* (291) agg_func_opt ::= */ + { 389, -1 }, /* (292) agg_func_opt ::= AGGREGATE */ + { 390, 0 }, /* (293) bufsize_opt ::= */ + { 390, -2 }, /* (294) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 322, -11 }, /* (295) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + { 322, -4 }, /* (296) cmd ::= DROP STREAM exists_opt stream_name */ + { 392, 0 }, /* (297) stream_options ::= */ + { 392, -3 }, /* (298) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 392, -3 }, /* (299) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 392, -4 }, /* (300) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 392, -3 }, /* (301) stream_options ::= stream_options WATERMARK duration_literal */ + { 392, -4 }, /* (302) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 392, -3 }, /* (303) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + { 393, 0 }, /* (304) subtable_opt ::= */ + { 393, -4 }, /* (305) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + { 322, -3 }, /* (306) cmd ::= KILL CONNECTION NK_INTEGER */ + { 322, -3 }, /* (307) cmd ::= KILL QUERY NK_STRING */ + { 322, -3 }, /* (308) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 322, -2 }, /* (309) cmd ::= BALANCE VGROUP */ + { 322, -4 }, /* (310) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 322, -4 }, /* (311) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 322, -3 }, /* (312) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 395, -2 }, /* (313) dnode_list ::= DNODE NK_INTEGER */ + { 395, -3 }, /* (314) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 322, -4 }, /* (315) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 322, -1 }, /* (316) cmd ::= query_or_subquery */ + { 322, -7 }, /* (317) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { 322, -4 }, /* (318) cmd ::= INSERT INTO full_table_name query_or_subquery */ + { 325, -1 }, /* (319) literal ::= NK_INTEGER */ + { 325, -1 }, /* (320) literal ::= NK_FLOAT */ + { 325, -1 }, /* (321) literal ::= NK_STRING */ + { 325, -1 }, /* (322) literal ::= NK_BOOL */ + { 325, -2 }, /* (323) literal ::= TIMESTAMP NK_STRING */ + { 325, -1 }, /* (324) literal ::= duration_literal */ + { 325, -1 }, /* (325) literal ::= NULL */ + { 325, -1 }, /* (326) literal ::= NK_QUESTION */ + { 369, -1 }, /* (327) duration_literal ::= NK_VARIABLE */ + { 397, -1 }, /* (328) signed ::= NK_INTEGER */ + { 397, -2 }, /* (329) signed ::= NK_PLUS NK_INTEGER */ + { 397, -2 }, /* (330) signed ::= NK_MINUS NK_INTEGER */ + { 397, -1 }, /* (331) signed ::= NK_FLOAT */ + { 397, -2 }, /* (332) signed ::= NK_PLUS NK_FLOAT */ + { 397, -2 }, /* (333) signed ::= NK_MINUS NK_FLOAT */ + { 358, -1 }, /* (334) signed_literal ::= signed */ + { 358, -1 }, /* (335) signed_literal ::= NK_STRING */ + { 358, -1 }, /* (336) signed_literal ::= NK_BOOL */ + { 358, -2 }, /* (337) signed_literal ::= TIMESTAMP NK_STRING */ + { 358, -1 }, /* (338) signed_literal ::= duration_literal */ + { 358, -1 }, /* (339) signed_literal ::= NULL */ + { 358, -1 }, /* (340) signed_literal ::= literal_func */ + { 358, -1 }, /* (341) signed_literal ::= NK_QUESTION */ + { 399, -1 }, /* (342) literal_list ::= signed_literal */ + { 399, -3 }, /* (343) literal_list ::= literal_list NK_COMMA signed_literal */ + { 333, -1 }, /* (344) db_name ::= NK_ID */ + { 364, -1 }, /* (345) table_name ::= NK_ID */ + { 356, -1 }, /* (346) column_name ::= NK_ID */ + { 371, -1 }, /* (347) function_name ::= NK_ID */ + { 400, -1 }, /* (348) table_alias ::= NK_ID */ + { 379, -1 }, /* (349) column_alias ::= NK_ID */ + { 327, -1 }, /* (350) user_name ::= NK_ID */ + { 334, -1 }, /* (351) topic_name ::= NK_ID */ + { 391, -1 }, /* (352) stream_name ::= NK_ID */ + { 386, -1 }, /* (353) cgroup_name ::= NK_ID */ + { 401, -1 }, /* (354) expr_or_subquery ::= expression */ + { 394, -1 }, /* (355) expression ::= literal */ + { 394, -1 }, /* (356) expression ::= pseudo_column */ + { 394, -1 }, /* (357) expression ::= column_reference */ + { 394, -1 }, /* (358) expression ::= function_expression */ + { 394, -1 }, /* (359) expression ::= case_when_expression */ + { 394, -3 }, /* (360) expression ::= NK_LP expression NK_RP */ + { 394, -2 }, /* (361) expression ::= NK_PLUS expr_or_subquery */ + { 394, -2 }, /* (362) expression ::= NK_MINUS expr_or_subquery */ + { 394, -3 }, /* (363) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 394, -3 }, /* (364) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 394, -3 }, /* (365) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 394, -3 }, /* (366) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 394, -3 }, /* (367) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 394, -3 }, /* (368) expression ::= column_reference NK_ARROW NK_STRING */ + { 394, -3 }, /* (369) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 394, -3 }, /* (370) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 361, -1 }, /* (371) expression_list ::= expr_or_subquery */ + { 361, -3 }, /* (372) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 403, -1 }, /* (373) column_reference ::= column_name */ + { 403, -3 }, /* (374) column_reference ::= table_name NK_DOT column_name */ + { 402, -1 }, /* (375) pseudo_column ::= ROWTS */ + { 402, -1 }, /* (376) pseudo_column ::= TBNAME */ + { 402, -3 }, /* (377) pseudo_column ::= table_name NK_DOT TBNAME */ + { 402, -1 }, /* (378) pseudo_column ::= QSTART */ + { 402, -1 }, /* (379) pseudo_column ::= QEND */ + { 402, -1 }, /* (380) pseudo_column ::= QDURATION */ + { 402, -1 }, /* (381) pseudo_column ::= WSTART */ + { 402, -1 }, /* (382) pseudo_column ::= WEND */ + { 402, -1 }, /* (383) pseudo_column ::= WDURATION */ + { 402, -1 }, /* (384) pseudo_column ::= IROWTS */ + { 402, -1 }, /* (385) pseudo_column ::= QTAGS */ + { 404, -4 }, /* (386) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 404, -4 }, /* (387) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 404, -6 }, /* (388) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 404, -1 }, /* (389) function_expression ::= literal_func */ + { 398, -3 }, /* (390) literal_func ::= noarg_func NK_LP NK_RP */ + { 398, -1 }, /* (391) literal_func ::= NOW */ + { 408, -1 }, /* (392) noarg_func ::= NOW */ + { 408, -1 }, /* (393) noarg_func ::= TODAY */ + { 408, -1 }, /* (394) noarg_func ::= TIMEZONE */ + { 408, -1 }, /* (395) noarg_func ::= DATABASE */ + { 408, -1 }, /* (396) noarg_func ::= CLIENT_VERSION */ + { 408, -1 }, /* (397) noarg_func ::= SERVER_VERSION */ + { 408, -1 }, /* (398) noarg_func ::= SERVER_STATUS */ + { 408, -1 }, /* (399) noarg_func ::= CURRENT_USER */ + { 408, -1 }, /* (400) noarg_func ::= USER */ + { 406, -1 }, /* (401) star_func ::= COUNT */ + { 406, -1 }, /* (402) star_func ::= FIRST */ + { 406, -1 }, /* (403) star_func ::= LAST */ + { 406, -1 }, /* (404) star_func ::= LAST_ROW */ + { 407, -1 }, /* (405) star_func_para_list ::= NK_STAR */ + { 407, -1 }, /* (406) star_func_para_list ::= other_para_list */ + { 409, -1 }, /* (407) other_para_list ::= star_func_para */ + { 409, -3 }, /* (408) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 410, -1 }, /* (409) star_func_para ::= expr_or_subquery */ + { 410, -3 }, /* (410) star_func_para ::= table_name NK_DOT NK_STAR */ + { 405, -4 }, /* (411) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 405, -5 }, /* (412) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 411, -1 }, /* (413) when_then_list ::= when_then_expr */ + { 411, -2 }, /* (414) when_then_list ::= when_then_list when_then_expr */ + { 414, -4 }, /* (415) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 412, 0 }, /* (416) case_when_else_opt ::= */ + { 412, -2 }, /* (417) case_when_else_opt ::= ELSE common_expression */ + { 415, -3 }, /* (418) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 415, -5 }, /* (419) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 415, -6 }, /* (420) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 415, -3 }, /* (421) predicate ::= expr_or_subquery IS NULL */ + { 415, -4 }, /* (422) predicate ::= expr_or_subquery IS NOT NULL */ + { 415, -3 }, /* (423) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 416, -1 }, /* (424) compare_op ::= NK_LT */ + { 416, -1 }, /* (425) compare_op ::= NK_GT */ + { 416, -1 }, /* (426) compare_op ::= NK_LE */ + { 416, -1 }, /* (427) compare_op ::= NK_GE */ + { 416, -1 }, /* (428) compare_op ::= NK_NE */ + { 416, -1 }, /* (429) compare_op ::= NK_EQ */ + { 416, -1 }, /* (430) compare_op ::= LIKE */ + { 416, -2 }, /* (431) compare_op ::= NOT LIKE */ + { 416, -1 }, /* (432) compare_op ::= MATCH */ + { 416, -1 }, /* (433) compare_op ::= NMATCH */ + { 416, -1 }, /* (434) compare_op ::= CONTAINS */ + { 417, -1 }, /* (435) in_op ::= IN */ + { 417, -2 }, /* (436) in_op ::= NOT IN */ + { 418, -3 }, /* (437) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 419, -1 }, /* (438) boolean_value_expression ::= boolean_primary */ + { 419, -2 }, /* (439) boolean_value_expression ::= NOT boolean_primary */ + { 419, -3 }, /* (440) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 419, -3 }, /* (441) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 420, -1 }, /* (442) boolean_primary ::= predicate */ + { 420, -3 }, /* (443) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 413, -1 }, /* (444) common_expression ::= expr_or_subquery */ + { 413, -1 }, /* (445) common_expression ::= boolean_value_expression */ + { 421, 0 }, /* (446) from_clause_opt ::= */ + { 421, -2 }, /* (447) from_clause_opt ::= FROM table_reference_list */ + { 422, -1 }, /* (448) table_reference_list ::= table_reference */ + { 422, -3 }, /* (449) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 423, -1 }, /* (450) table_reference ::= table_primary */ + { 423, -1 }, /* (451) table_reference ::= joined_table */ + { 424, -2 }, /* (452) table_primary ::= table_name alias_opt */ + { 424, -4 }, /* (453) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 424, -2 }, /* (454) table_primary ::= subquery alias_opt */ + { 424, -1 }, /* (455) table_primary ::= parenthesized_joined_table */ + { 426, 0 }, /* (456) alias_opt ::= */ + { 426, -1 }, /* (457) alias_opt ::= table_alias */ + { 426, -2 }, /* (458) alias_opt ::= AS table_alias */ + { 428, -3 }, /* (459) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 428, -3 }, /* (460) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 425, -6 }, /* (461) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 429, 0 }, /* (462) join_type ::= */ + { 429, -1 }, /* (463) join_type ::= INNER */ + { 431, -12 }, /* (464) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 432, 0 }, /* (465) set_quantifier_opt ::= */ + { 432, -1 }, /* (466) set_quantifier_opt ::= DISTINCT */ + { 432, -1 }, /* (467) set_quantifier_opt ::= ALL */ + { 433, -1 }, /* (468) select_list ::= select_item */ + { 433, -3 }, /* (469) select_list ::= select_list NK_COMMA select_item */ + { 441, -1 }, /* (470) select_item ::= NK_STAR */ + { 441, -1 }, /* (471) select_item ::= common_expression */ + { 441, -2 }, /* (472) select_item ::= common_expression column_alias */ + { 441, -3 }, /* (473) select_item ::= common_expression AS column_alias */ + { 441, -3 }, /* (474) select_item ::= table_name NK_DOT NK_STAR */ + { 396, 0 }, /* (475) where_clause_opt ::= */ + { 396, -2 }, /* (476) where_clause_opt ::= WHERE search_condition */ + { 434, 0 }, /* (477) partition_by_clause_opt ::= */ + { 434, -3 }, /* (478) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 442, -1 }, /* (479) partition_list ::= partition_item */ + { 442, -3 }, /* (480) partition_list ::= partition_list NK_COMMA partition_item */ + { 443, -1 }, /* (481) partition_item ::= expr_or_subquery */ + { 443, -2 }, /* (482) partition_item ::= expr_or_subquery column_alias */ + { 443, -3 }, /* (483) partition_item ::= expr_or_subquery AS column_alias */ + { 438, 0 }, /* (484) twindow_clause_opt ::= */ + { 438, -6 }, /* (485) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 438, -4 }, /* (486) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 438, -6 }, /* (487) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 438, -8 }, /* (488) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 382, 0 }, /* (489) sliding_opt ::= */ + { 382, -4 }, /* (490) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 437, 0 }, /* (491) fill_opt ::= */ + { 437, -4 }, /* (492) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 437, -6 }, /* (493) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 444, -1 }, /* (494) fill_mode ::= NONE */ + { 444, -1 }, /* (495) fill_mode ::= PREV */ + { 444, -1 }, /* (496) fill_mode ::= NULL */ + { 444, -1 }, /* (497) fill_mode ::= LINEAR */ + { 444, -1 }, /* (498) fill_mode ::= NEXT */ + { 439, 0 }, /* (499) group_by_clause_opt ::= */ + { 439, -3 }, /* (500) group_by_clause_opt ::= GROUP BY group_by_list */ + { 445, -1 }, /* (501) group_by_list ::= expr_or_subquery */ + { 445, -3 }, /* (502) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 440, 0 }, /* (503) having_clause_opt ::= */ + { 440, -2 }, /* (504) having_clause_opt ::= HAVING search_condition */ + { 435, 0 }, /* (505) range_opt ::= */ + { 435, -6 }, /* (506) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 436, 0 }, /* (507) every_opt ::= */ + { 436, -4 }, /* (508) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 446, -4 }, /* (509) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 447, -1 }, /* (510) query_simple ::= query_specification */ + { 447, -1 }, /* (511) query_simple ::= union_query_expression */ + { 451, -4 }, /* (512) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 451, -3 }, /* (513) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 452, -1 }, /* (514) query_simple_or_subquery ::= query_simple */ + { 452, -1 }, /* (515) query_simple_or_subquery ::= subquery */ + { 385, -1 }, /* (516) query_or_subquery ::= query_expression */ + { 385, -1 }, /* (517) query_or_subquery ::= subquery */ + { 448, 0 }, /* (518) order_by_clause_opt ::= */ + { 448, -3 }, /* (519) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 449, 0 }, /* (520) slimit_clause_opt ::= */ + { 449, -2 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 449, -4 }, /* (522) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 449, -4 }, /* (523) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 450, 0 }, /* (524) limit_clause_opt ::= */ + { 450, -2 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 450, -4 }, /* (526) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 450, -4 }, /* (527) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 427, -3 }, /* (528) subquery ::= NK_LP query_expression NK_RP */ + { 427, -3 }, /* (529) subquery ::= NK_LP subquery NK_RP */ + { 430, -1 }, /* (530) search_condition ::= common_expression */ + { 453, -1 }, /* (531) sort_specification_list ::= sort_specification */ + { 453, -3 }, /* (532) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 454, -3 }, /* (533) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 455, 0 }, /* (534) ordering_specification_opt ::= */ + { 455, -1 }, /* (535) ordering_specification_opt ::= ASC */ + { 455, -1 }, /* (536) ordering_specification_opt ::= DESC */ + { 456, 0 }, /* (537) null_ordering_opt ::= */ + { 456, -2 }, /* (538) null_ordering_opt ::= NULLS FIRST */ + { 456, -2 }, /* (539) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3578,11 +3575,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,322,&yymsp[0].minor); + yy_destructor(yypParser,323,&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,323,&yymsp[0].minor); + yy_destructor(yypParser,324,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3596,20 +3593,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,322,&yymsp[-2].minor); +{ yy_destructor(yypParser,323,&yymsp[-2].minor); { } - yy_destructor(yypParser,324,&yymsp[0].minor); + yy_destructor(yypParser,325,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,325,&yymsp[0].minor); +{ yy_destructor(yypParser,326,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,323,&yymsp[-1].minor); +{ yy_destructor(yypParser,324,&yymsp[-1].minor); { } - yy_destructor(yypParser,325,&yymsp[0].minor); + yy_destructor(yypParser,326,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3623,80 +3620,80 @@ 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,324,&yymsp[0].minor); + yy_destructor(yypParser,325,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy737, &yymsp[-1].minor.yy0, yymsp[0].minor.yy695); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy199, &yymsp[-1].minor.yy0, yymsp[0].minor.yy33); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy737, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy199, 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.yy737, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy199, 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.yy737, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy199, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy199); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy695 = 1; } +{ yymsp[1].minor.yy33 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy695 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy33 = 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.yy93, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy525, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy93, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy525, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36); -{ yylhsminor.yy93 = yymsp[0].minor.yy93; } - yymsp[0].minor.yy93 = yylhsminor.yy93; +{ yylhsminor.yy525 = yymsp[0].minor.yy525; } + yymsp[0].minor.yy525 = yylhsminor.yy525; break; case 35: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy93 = yymsp[-2].minor.yy93 | yymsp[0].minor.yy93; } - yymsp[-2].minor.yy93 = yylhsminor.yy93; +{ yylhsminor.yy525 = yymsp[-2].minor.yy525 | yymsp[0].minor.yy525; } + yymsp[-2].minor.yy525 = yylhsminor.yy525; break; case 38: /* priv_type ::= READ */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_READ; } break; case 39: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_WRITE; } break; case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy737 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy737 = yylhsminor.yy737; +{ yylhsminor.yy199 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy199 = yylhsminor.yy199; break; case 41: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy737 = yymsp[-2].minor.yy737; } - yymsp[-2].minor.yy737 = yylhsminor.yy737; +{ yylhsminor.yy199 = yymsp[-2].minor.yy199; } + yymsp[-2].minor.yy199 = yylhsminor.yy199; break; case 42: /* priv_level ::= topic_name */ - case 455: /* alias_opt ::= table_alias */ yytestcase(yyruleno==455); -{ yylhsminor.yy737 = yymsp[0].minor.yy737; } - yymsp[0].minor.yy737 = yylhsminor.yy737; + case 457: /* alias_opt ::= table_alias */ yytestcase(yyruleno==457); +{ yylhsminor.yy199 = yymsp[0].minor.yy199; } + yymsp[0].minor.yy199 = yylhsminor.yy199; break; case 43: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy737, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy199, NULL); } break; case 44: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0); } break; case 45: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy185); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy397); } break; case 46: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy185); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy397); } break; case 47: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3713,45 +3710,45 @@ static YYACTIONTYPE yy_reduce( case 51: /* dnode_endpoint ::= NK_STRING */ case 52: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==52); case 53: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==53); - case 342: /* db_name ::= NK_ID */ yytestcase(yyruleno==342); - case 343: /* table_name ::= NK_ID */ yytestcase(yyruleno==343); - case 344: /* column_name ::= NK_ID */ yytestcase(yyruleno==344); - case 345: /* function_name ::= NK_ID */ yytestcase(yyruleno==345); - case 346: /* table_alias ::= NK_ID */ yytestcase(yyruleno==346); - case 347: /* column_alias ::= NK_ID */ yytestcase(yyruleno==347); - case 348: /* user_name ::= NK_ID */ yytestcase(yyruleno==348); - case 349: /* topic_name ::= NK_ID */ yytestcase(yyruleno==349); - case 350: /* stream_name ::= NK_ID */ yytestcase(yyruleno==350); - case 351: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==351); - case 390: /* noarg_func ::= NOW */ yytestcase(yyruleno==390); - case 391: /* noarg_func ::= TODAY */ yytestcase(yyruleno==391); - case 392: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==392); - case 393: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==393); - case 394: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==394); - case 395: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==395); - case 396: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==396); - case 397: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==397); - case 398: /* noarg_func ::= USER */ yytestcase(yyruleno==398); - case 399: /* star_func ::= COUNT */ yytestcase(yyruleno==399); - case 400: /* star_func ::= FIRST */ yytestcase(yyruleno==400); - case 401: /* star_func ::= LAST */ yytestcase(yyruleno==401); - case 402: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==402); -{ yylhsminor.yy737 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy737 = yylhsminor.yy737; + case 344: /* db_name ::= NK_ID */ yytestcase(yyruleno==344); + case 345: /* table_name ::= NK_ID */ yytestcase(yyruleno==345); + case 346: /* column_name ::= NK_ID */ yytestcase(yyruleno==346); + case 347: /* function_name ::= NK_ID */ yytestcase(yyruleno==347); + case 348: /* table_alias ::= NK_ID */ yytestcase(yyruleno==348); + case 349: /* column_alias ::= NK_ID */ yytestcase(yyruleno==349); + case 350: /* user_name ::= NK_ID */ yytestcase(yyruleno==350); + case 351: /* topic_name ::= NK_ID */ yytestcase(yyruleno==351); + case 352: /* stream_name ::= NK_ID */ yytestcase(yyruleno==352); + case 353: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==353); + case 392: /* noarg_func ::= NOW */ yytestcase(yyruleno==392); + case 393: /* noarg_func ::= TODAY */ yytestcase(yyruleno==393); + case 394: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==394); + case 395: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==395); + case 396: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==396); + case 397: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==397); + case 398: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==398); + case 399: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==399); + case 400: /* noarg_func ::= USER */ yytestcase(yyruleno==400); + case 401: /* star_func ::= COUNT */ yytestcase(yyruleno==401); + case 402: /* star_func ::= FIRST */ yytestcase(yyruleno==402); + case 403: /* star_func ::= LAST */ yytestcase(yyruleno==403); + case 404: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==404); +{ yylhsminor.yy199 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy199 = yylhsminor.yy199; break; case 54: /* force_opt ::= */ case 73: /* not_exists_opt ::= */ yytestcase(yyruleno==73); case 75: /* exists_opt ::= */ yytestcase(yyruleno==75); - case 282: /* analyze_opt ::= */ yytestcase(yyruleno==282); - case 289: /* agg_func_opt ::= */ yytestcase(yyruleno==289); - case 463: /* set_quantifier_opt ::= */ yytestcase(yyruleno==463); -{ yymsp[1].minor.yy185 = false; } + case 284: /* analyze_opt ::= */ yytestcase(yyruleno==284); + case 291: /* agg_func_opt ::= */ yytestcase(yyruleno==291); + case 465: /* set_quantifier_opt ::= */ yytestcase(yyruleno==465); +{ yymsp[1].minor.yy397 = false; } break; case 55: /* force_opt ::= FORCE */ - case 283: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==283); - case 290: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==290); - case 464: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==464); -{ yymsp[0].minor.yy185 = true; } + case 285: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==285); + case 292: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==292); + case 466: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==466); +{ yymsp[0].minor.yy397 = true; } break; case 56: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3784,1334 +3781,1342 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 66: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy185, &yymsp[-1].minor.yy737, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy397, &yymsp[-1].minor.yy199, yymsp[0].minor.yy148); } break; case 67: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; case 68: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } break; case 69: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy148); } break; case 70: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } break; case 71: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy196); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy706); } break; case 72: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy185 = true; } +{ yymsp[-2].minor.yy397 = true; } break; case 74: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy185 = true; } +{ yymsp[-1].minor.yy397 = true; } break; case 76: /* db_options ::= */ -{ yymsp[1].minor.yy104 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy148 = createDefaultDatabaseOptions(pCxt); } break; case 77: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 78: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 79: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 80: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 81: /* db_options ::= db_options DURATION NK_INTEGER */ case 82: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==82); -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 83: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 84: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 85: /* db_options ::= db_options KEEP integer_list */ case 86: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==86); -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_KEEP, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_KEEP, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 87: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 88: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 89: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 90: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 91: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 92: /* db_options ::= db_options STRICT NK_STRING */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 93: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 94: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 95: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_RETENTIONS, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_RETENTIONS, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 96: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 97: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 98: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 100: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-3].minor.yy104, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-3].minor.yy148, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 102: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-3].minor.yy104, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-3].minor.yy148, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 103: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 104: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 105: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 106: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 107: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 108: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy104 = createAlterDatabaseOptions(pCxt); yylhsminor.yy104 = setAlterDatabaseOption(pCxt, yylhsminor.yy104, &yymsp[0].minor.yy557); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterDatabaseOptions(pCxt); yylhsminor.yy148 = setAlterDatabaseOption(pCxt, yylhsminor.yy148, &yymsp[0].minor.yy123); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; case 109: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy104 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy104, &yymsp[0].minor.yy557); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy148, &yymsp[0].minor.yy123); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; case 110: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 111: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 112: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 113: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 114: /* alter_db_option ::= KEEP integer_list */ case 115: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==115); -{ yymsp[-1].minor.yy557.type = DB_OPTION_KEEP; yymsp[-1].minor.yy557.pList = yymsp[0].minor.yy616; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_KEEP; yymsp[-1].minor.yy123.pList = yymsp[0].minor.yy404; } break; case 116: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_PAGES; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_PAGES; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 117: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 118: /* alter_db_option ::= STRICT NK_STRING */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_STRICT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_STRICT; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 119: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_WAL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_WAL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 120: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 121: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy616 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; +{ yylhsminor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 122: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 312: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==312); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 314: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==314); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 123: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy616 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; +{ yylhsminor.yy404 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 124: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 125: /* retention_list ::= retention */ case 147: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==147); case 150: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==150); case 157: /* column_def_list ::= column_def */ yytestcase(yyruleno==157); - case 200: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==200); - case 205: /* col_name_list ::= col_name */ yytestcase(yyruleno==205); - case 254: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==254); - case 265: /* func_list ::= func */ yytestcase(yyruleno==265); - case 340: /* literal_list ::= signed_literal */ yytestcase(yyruleno==340); - case 405: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==405); - case 411: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==411); - case 466: /* select_list ::= select_item */ yytestcase(yyruleno==466); - case 477: /* partition_list ::= partition_item */ yytestcase(yyruleno==477); - case 529: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==529); -{ yylhsminor.yy616 = createNodeList(pCxt, yymsp[0].minor.yy104); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 201: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==201); + case 206: /* col_name_list ::= col_name */ yytestcase(yyruleno==206); + case 255: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==255); + case 266: /* func_list ::= func */ yytestcase(yyruleno==266); + case 342: /* literal_list ::= signed_literal */ yytestcase(yyruleno==342); + case 407: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==407); + case 413: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==413); + case 468: /* select_list ::= select_item */ yytestcase(yyruleno==468); + case 479: /* partition_list ::= partition_item */ yytestcase(yyruleno==479); + case 531: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==531); +{ yylhsminor.yy404 = createNodeList(pCxt, yymsp[0].minor.yy148); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 126: /* retention_list ::= retention_list NK_COMMA retention */ case 158: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==158); - case 201: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==201); - case 206: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==206); - case 255: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==255); - case 266: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==266); - case 341: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==341); - case 406: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==406); - case 467: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==467); - case 478: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==478); - case 530: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==530); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, yymsp[0].minor.yy104); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 202: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==202); + case 207: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==207); + case 256: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==256); + case 267: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==267); + case 343: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==343); + case 408: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==408); + case 469: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==469); + case 480: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==480); + case 532: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==532); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 127: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy104 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 128: /* speed_opt ::= */ - case 291: /* bufsize_opt ::= */ yytestcase(yyruleno==291); -{ yymsp[1].minor.yy196 = 0; } + case 293: /* bufsize_opt ::= */ yytestcase(yyruleno==293); +{ yymsp[1].minor.yy706 = 0; } break; case 129: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 292: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==292); -{ yymsp[-1].minor.yy196 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 294: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==294); +{ yymsp[-1].minor.yy706 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 130: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 132: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==132); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy185, yymsp[-5].minor.yy104, yymsp[-3].minor.yy616, yymsp[-1].minor.yy616, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-5].minor.yy148, yymsp[-3].minor.yy404, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } break; case 131: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy616); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy404); } break; case 133: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy616); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy404); } break; case 134: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } break; case 135: /* cmd ::= ALTER TABLE alter_table_clause */ - case 314: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==314); -{ pCxt->pRootNode = yymsp[0].minor.yy104; } + case 316: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==316); +{ pCxt->pRootNode = yymsp[0].minor.yy148; } break; case 136: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy104); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy148); } break; case 137: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy104 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; case 138: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 139: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy104 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy104, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy737); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy199); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 140: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 141: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy104 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 142: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 143: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy104 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy104, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy737); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy199); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 144: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 145: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy104 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 146: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy104 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy104, &yymsp[-2].minor.yy737, yymsp[0].minor.yy104); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy148, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } + yymsp[-5].minor.yy148 = yylhsminor.yy148; break; case 148: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 151: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==151); - case 412: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==412); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-1].minor.yy616, yymsp[0].minor.yy104); } - yymsp[-1].minor.yy616 = yylhsminor.yy616; + case 414: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==414); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } + yymsp[-1].minor.yy404 = yylhsminor.yy404; break; case 149: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy104 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy185, yymsp[-8].minor.yy104, yymsp[-6].minor.yy104, yymsp[-5].minor.yy616, yymsp[-2].minor.yy616, yymsp[0].minor.yy104); } - yymsp[-9].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy397, yymsp[-8].minor.yy148, yymsp[-6].minor.yy148, yymsp[-5].minor.yy404, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } + yymsp[-9].minor.yy148 = yylhsminor.yy148; break; case 152: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy104 = createDropTableClause(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy104); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createDropTableClause(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; case 153: /* specific_cols_opt ::= */ case 184: /* tags_def_opt ::= */ yytestcase(yyruleno==184); - case 253: /* tag_list_opt ::= */ yytestcase(yyruleno==253); - case 475: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==475); - case 497: /* group_by_clause_opt ::= */ yytestcase(yyruleno==497); - case 516: /* order_by_clause_opt ::= */ yytestcase(yyruleno==516); -{ yymsp[1].minor.yy616 = NULL; } + case 254: /* tag_list_opt ::= */ yytestcase(yyruleno==254); + case 477: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==477); + case 499: /* group_by_clause_opt ::= */ yytestcase(yyruleno==499); + case 518: /* order_by_clause_opt ::= */ yytestcase(yyruleno==518); +{ yymsp[1].minor.yy404 = NULL; } break; case 154: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy616 = yymsp[-1].minor.yy616; } +{ yymsp[-2].minor.yy404 = yymsp[-1].minor.yy404; } break; case 155: /* full_table_name ::= table_name */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy737, NULL); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy199, NULL); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; case 156: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737, NULL); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, NULL); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 159: /* column_def ::= column_name type_name */ -{ yylhsminor.yy104 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640, NULL); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530, NULL); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; case 160: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy104 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy737, yymsp[-2].minor.yy640, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-2].minor.yy530, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 161: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 162: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 163: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 164: /* type_name ::= INT */ case 165: /* type_name ::= INTEGER */ yytestcase(yyruleno==165); -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_INT); } break; case 166: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 167: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 168: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 169: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 170: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 171: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 172: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 173: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 174: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 175: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 176: /* type_name ::= JSON */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 177: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 178: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 179: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 180: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 181: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 183: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy640 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 185: /* tags_def_opt ::= tags_def */ - case 404: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==404); -{ yylhsminor.yy616 = yymsp[0].minor.yy616; } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 406: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==406); +{ yylhsminor.yy404 = yymsp[0].minor.yy404; } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 186: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy616 = yymsp[-1].minor.yy616; } +{ yymsp[-3].minor.yy404 = yymsp[-1].minor.yy404; } break; case 187: /* table_options ::= */ -{ yymsp[1].minor.yy104 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy148 = createDefaultTableOptions(pCxt); } break; case 188: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 189: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 190: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 191: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-4].minor.yy104, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy616); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy404); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 192: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 193: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-4].minor.yy104, TABLE_OPTION_SMA, yymsp[-1].minor.yy616); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_SMA, yymsp[-1].minor.yy404); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 194: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy104 = createAlterTableOptions(pCxt); yylhsminor.yy104 = setTableOption(pCxt, yylhsminor.yy104, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 194: /* table_options ::= table_options DELETE_MARK duration_list */ +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 195: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 195: /* alter_table_options ::= alter_table_option */ +{ yylhsminor.yy148 = createAlterTableOptions(pCxt); yylhsminor.yy148 = setTableOption(pCxt, yylhsminor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 196: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } + case 196: /* alter_table_options ::= alter_table_options alter_table_option */ +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 197: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } + case 197: /* alter_table_option ::= COMMENT NK_STRING */ +{ yymsp[-1].minor.yy123.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 198: /* duration_list ::= duration_literal */ - case 369: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==369); -{ yylhsminor.yy616 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 198: /* alter_table_option ::= TTL NK_INTEGER */ +{ yymsp[-1].minor.yy123.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 199: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 370: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==370); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 199: /* duration_list ::= duration_literal */ + case 371: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==371); +{ yylhsminor.yy404 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 202: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy104 = createFunctionNode(pCxt, &yymsp[0].minor.yy737, NULL); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 200: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 372: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==372); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 203: /* rollup_func_name ::= FIRST */ - case 204: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==204); - case 257: /* tag_item ::= QTAGS */ yytestcase(yyruleno==257); -{ yylhsminor.yy104 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 203: /* rollup_func_name ::= function_name */ +{ yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy199, NULL); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 207: /* col_name ::= column_name */ - case 258: /* tag_item ::= column_name */ yytestcase(yyruleno==258); -{ yylhsminor.yy104 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy737); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 204: /* rollup_func_name ::= FIRST */ + case 205: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==205); + case 258: /* tag_item ::= QTAGS */ yytestcase(yyruleno==258); +{ yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 208: /* cmd ::= SHOW DNODES */ + case 208: /* col_name ::= column_name */ + case 259: /* tag_item ::= column_name */ yytestcase(yyruleno==259); +{ yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199); } + yymsp[0].minor.yy148 = yylhsminor.yy148; + break; + case 209: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 209: /* cmd ::= SHOW USERS */ + case 210: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 210: /* cmd ::= SHOW USER PRIVILEGES */ + case 211: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 211: /* cmd ::= SHOW DATABASES */ + case 212: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 212: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy104, yymsp[0].minor.yy104, OP_TYPE_LIKE); } + case 213: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } break; - case 213: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy104, yymsp[0].minor.yy104, OP_TYPE_LIKE); } + case 214: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } break; - case 214: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy104, NULL, OP_TYPE_LIKE); } + case 215: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy148, NULL, OP_TYPE_LIKE); } break; - case 215: /* cmd ::= SHOW MNODES */ + case 216: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 216: /* cmd ::= SHOW QNODES */ + case 217: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 217: /* cmd ::= SHOW FUNCTIONS */ + case 218: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 218: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy104, yymsp[-1].minor.yy104, OP_TYPE_EQUAL); } + case 219: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } break; - case 219: /* cmd ::= SHOW STREAMS */ + case 220: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 220: /* cmd ::= SHOW ACCOUNTS */ + case 221: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 221: /* cmd ::= SHOW APPS */ + case 222: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 222: /* cmd ::= SHOW CONNECTIONS */ + case 223: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 223: /* cmd ::= SHOW LICENCES */ - case 224: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==224); + case 224: /* cmd ::= SHOW LICENCES */ + case 225: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==225); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 225: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy737); } + case 226: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } break; - case 226: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy104); } + case 227: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy148); } break; - case 227: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy104); } + case 228: /* cmd ::= SHOW CREATE STABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy148); } break; - case 228: /* cmd ::= SHOW QUERIES */ + case 229: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 229: /* cmd ::= SHOW SCORES */ + case 230: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 230: /* cmd ::= SHOW TOPICS */ + case 231: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 231: /* cmd ::= SHOW VARIABLES */ - case 232: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==232); + case 232: /* cmd ::= SHOW VARIABLES */ + case 233: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==233); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 233: /* cmd ::= SHOW LOCAL VARIABLES */ + case 234: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 234: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy104); } + case 235: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy148); } break; - case 235: /* cmd ::= SHOW BNODES */ + case 236: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 236: /* cmd ::= SHOW SNODES */ + case 237: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 237: /* cmd ::= SHOW CLUSTER */ + case 238: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 238: /* cmd ::= SHOW TRANSACTIONS */ + case 239: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 239: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy104); } + case 240: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy148); } break; - case 240: /* cmd ::= SHOW CONSUMERS */ + case 241: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 241: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 242: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 242: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy104, yymsp[-1].minor.yy104, OP_TYPE_EQUAL); } + case 243: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } break; - case 243: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy104, yymsp[-3].minor.yy616); } + case 244: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148, yymsp[-3].minor.yy404); } break; - case 244: /* cmd ::= SHOW VNODES NK_INTEGER */ + case 245: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 245: /* cmd ::= SHOW VNODES NK_STRING */ + case 246: /* cmd ::= SHOW VNODES NK_STRING */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 246: /* db_name_cond_opt ::= */ - case 251: /* from_db_opt ::= */ yytestcase(yyruleno==251); -{ yymsp[1].minor.yy104 = createDefaultDatabaseCondValue(pCxt); } + case 247: /* db_name_cond_opt ::= */ + case 252: /* from_db_opt ::= */ yytestcase(yyruleno==252); +{ yymsp[1].minor.yy148 = createDefaultDatabaseCondValue(pCxt); } break; - case 247: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy104 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 248: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 248: /* like_pattern_opt ::= */ - case 302: /* subtable_opt ::= */ yytestcase(yyruleno==302); - case 414: /* case_when_else_opt ::= */ yytestcase(yyruleno==414); - case 444: /* from_clause_opt ::= */ yytestcase(yyruleno==444); - case 473: /* where_clause_opt ::= */ yytestcase(yyruleno==473); - case 482: /* twindow_clause_opt ::= */ yytestcase(yyruleno==482); - case 487: /* sliding_opt ::= */ yytestcase(yyruleno==487); - case 489: /* fill_opt ::= */ yytestcase(yyruleno==489); - case 501: /* having_clause_opt ::= */ yytestcase(yyruleno==501); - case 503: /* range_opt ::= */ yytestcase(yyruleno==503); - case 505: /* every_opt ::= */ yytestcase(yyruleno==505); - case 518: /* slimit_clause_opt ::= */ yytestcase(yyruleno==518); - case 522: /* limit_clause_opt ::= */ yytestcase(yyruleno==522); -{ yymsp[1].minor.yy104 = NULL; } + case 249: /* like_pattern_opt ::= */ + case 304: /* subtable_opt ::= */ yytestcase(yyruleno==304); + case 416: /* case_when_else_opt ::= */ yytestcase(yyruleno==416); + case 446: /* from_clause_opt ::= */ yytestcase(yyruleno==446); + case 475: /* where_clause_opt ::= */ yytestcase(yyruleno==475); + case 484: /* twindow_clause_opt ::= */ yytestcase(yyruleno==484); + case 489: /* sliding_opt ::= */ yytestcase(yyruleno==489); + case 491: /* fill_opt ::= */ yytestcase(yyruleno==491); + case 503: /* having_clause_opt ::= */ yytestcase(yyruleno==503); + case 505: /* range_opt ::= */ yytestcase(yyruleno==505); + case 507: /* every_opt ::= */ yytestcase(yyruleno==507); + case 520: /* slimit_clause_opt ::= */ yytestcase(yyruleno==520); + case 524: /* limit_clause_opt ::= */ yytestcase(yyruleno==524); +{ yymsp[1].minor.yy148 = NULL; } break; - case 249: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 250: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 250: /* table_name_cond ::= table_name */ -{ yylhsminor.yy104 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy737); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 251: /* table_name_cond ::= table_name */ +{ yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 252: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy104 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy737); } + case 253: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } break; - case 256: /* tag_item ::= TBNAME */ -{ yylhsminor.yy104 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 257: /* tag_item ::= TBNAME */ +{ yylhsminor.yy148 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 259: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy104 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy737), &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 260: /* tag_item ::= column_name column_alias */ +{ yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy199), &yymsp[0].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 260: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy104 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy737), &yymsp[0].minor.yy737); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 261: /* tag_item ::= column_name AS column_alias */ +{ yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy199), &yymsp[0].minor.yy199); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 261: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy185, yymsp[-3].minor.yy104, yymsp[-1].minor.yy104, NULL, yymsp[0].minor.yy104); } + case 262: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy397, yymsp[-3].minor.yy148, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } break; - case 262: /* cmd ::= DROP INDEX exists_opt full_table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy104); } + case 263: /* cmd ::= DROP INDEX exists_opt full_table_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } break; - case 263: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy104 = createIndexOption(pCxt, yymsp[-7].minor.yy616, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), NULL, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy148 = createIndexOption(pCxt, yymsp[-7].minor.yy404, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-11].minor.yy104 = createIndexOption(pCxt, yymsp[-9].minor.yy616, releaseRawExprNode(pCxt, yymsp[-5].minor.yy104), releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 265: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-11].minor.yy148 = createIndexOption(pCxt, yymsp[-9].minor.yy404, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 267: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy104 = createFunctionNode(pCxt, &yymsp[-3].minor.yy737, yymsp[-1].minor.yy616); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 268: /* func ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 268: /* sma_stream_opt ::= */ - case 295: /* stream_options ::= */ yytestcase(yyruleno==295); -{ yymsp[1].minor.yy104 = createStreamOptions(pCxt); } + case 269: /* sma_stream_opt ::= */ + case 297: /* stream_options ::= */ yytestcase(yyruleno==297); +{ yymsp[1].minor.yy148 = createStreamOptions(pCxt); } break; - case 269: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ - case 299: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==299); -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 270: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + case 301: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==301); +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 270: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 271: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 271: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy185, &yymsp[-2].minor.yy737, yymsp[0].minor.yy104); } + case 272: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 272: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy185, &yymsp[-3].minor.yy737, &yymsp[0].minor.yy737, false); } + case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } break; - case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy185, &yymsp[-5].minor.yy737, &yymsp[0].minor.yy737, true); } + case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy199, false); } break; - case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy185, &yymsp[-3].minor.yy737, yymsp[0].minor.yy104, false); } + case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[0].minor.yy199, true); } break; - case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy185, &yymsp[-5].minor.yy737, yymsp[0].minor.yy104, true); } + case 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, yymsp[0].minor.yy148, false); } break; - case 276: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } + case 277: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, yymsp[0].minor.yy148, true); } break; - case 277: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy185, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737); } + case 278: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 278: /* cmd ::= DESC full_table_name */ - case 279: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==279); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy104); } + case 279: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } break; - case 280: /* cmd ::= RESET QUERY CACHE */ + case 280: /* cmd ::= DESC full_table_name */ + case 281: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==281); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy148); } + break; + case 282: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 281: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy185, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 283: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy397, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 284: /* explain_options ::= */ -{ yymsp[1].minor.yy104 = createDefaultExplainOptions(pCxt); } + case 286: /* explain_options ::= */ +{ yymsp[1].minor.yy148 = createDefaultExplainOptions(pCxt); } break; - case 285: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy104 = setExplainVerbose(pCxt, yymsp[-2].minor.yy104, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 287: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy148 = setExplainVerbose(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 286: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy104 = setExplainRatio(pCxt, yymsp[-2].minor.yy104, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 288: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy148 = setExplainRatio(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 287: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy185, yymsp[-8].minor.yy185, &yymsp[-5].minor.yy737, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy640, yymsp[0].minor.yy196); } + case 289: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-8].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy530, yymsp[0].minor.yy706); } break; - case 288: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } + case 290: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 293: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy185, &yymsp[-7].minor.yy737, yymsp[-4].minor.yy104, yymsp[-6].minor.yy104, yymsp[-3].minor.yy616, yymsp[-2].minor.yy104, yymsp[0].minor.yy104); } + case 295: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy397, &yymsp[-7].minor.yy199, yymsp[-4].minor.yy148, yymsp[-6].minor.yy148, yymsp[-3].minor.yy404, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } break; - case 294: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } + case 296: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 296: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 298: /* stream_options ::= stream_options TRIGGER AT_ONCE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 297: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 299: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 298: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy104)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy104)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); yylhsminor.yy104 = yymsp[-3].minor.yy104; } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 300: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy148)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-3].minor.yy148; } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 300: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-3].minor.yy104)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy104 = yymsp[-3].minor.yy104; } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 302: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-3].minor.yy148)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-3].minor.yy148; } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 301: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 303: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 303: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 488: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==488); - case 506: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==506); -{ yymsp[-3].minor.yy104 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy104); } + case 305: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 490: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==490); + case 508: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==508); +{ yymsp[-3].minor.yy148 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy148); } break; - case 304: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 306: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 305: /* cmd ::= KILL QUERY NK_STRING */ + case 307: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 306: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 308: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 307: /* cmd ::= BALANCE VGROUP */ + case 309: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 308: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 310: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 309: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy616); } + case 311: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy404); } break; - case 310: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 312: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 311: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy616 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 313: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 313: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 315: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 315: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy104, yymsp[-2].minor.yy616, yymsp[0].minor.yy104); } + case 317: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy148, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } break; - case 316: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy104, NULL, yymsp[0].minor.yy104); } + case 318: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } break; - case 317: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 319: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 318: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 320: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 319: /* literal ::= NK_STRING */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 321: /* literal ::= NK_STRING */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 320: /* literal ::= NK_BOOL */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 322: /* literal ::= NK_BOOL */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 321: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 323: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 322: /* literal ::= duration_literal */ - case 332: /* signed_literal ::= signed */ yytestcase(yyruleno==332); - case 352: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==352); - case 353: /* expression ::= literal */ yytestcase(yyruleno==353); - case 354: /* expression ::= pseudo_column */ yytestcase(yyruleno==354); - case 355: /* expression ::= column_reference */ yytestcase(yyruleno==355); - case 356: /* expression ::= function_expression */ yytestcase(yyruleno==356); - case 357: /* expression ::= case_when_expression */ yytestcase(yyruleno==357); - case 387: /* function_expression ::= literal_func */ yytestcase(yyruleno==387); - case 436: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==436); - case 440: /* boolean_primary ::= predicate */ yytestcase(yyruleno==440); - case 442: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==442); - case 443: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==443); - case 446: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==446); - case 448: /* table_reference ::= table_primary */ yytestcase(yyruleno==448); - case 449: /* table_reference ::= joined_table */ yytestcase(yyruleno==449); - case 453: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==453); - case 508: /* query_simple ::= query_specification */ yytestcase(yyruleno==508); - case 509: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==509); - case 512: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==512); - case 514: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==514); -{ yylhsminor.yy104 = yymsp[0].minor.yy104; } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 324: /* literal ::= duration_literal */ + case 334: /* signed_literal ::= signed */ yytestcase(yyruleno==334); + case 354: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==354); + case 355: /* expression ::= literal */ yytestcase(yyruleno==355); + case 356: /* expression ::= pseudo_column */ yytestcase(yyruleno==356); + case 357: /* expression ::= column_reference */ yytestcase(yyruleno==357); + case 358: /* expression ::= function_expression */ yytestcase(yyruleno==358); + case 359: /* expression ::= case_when_expression */ yytestcase(yyruleno==359); + case 389: /* function_expression ::= literal_func */ yytestcase(yyruleno==389); + case 438: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==438); + case 442: /* boolean_primary ::= predicate */ yytestcase(yyruleno==442); + case 444: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==444); + case 445: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==445); + case 448: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==448); + case 450: /* table_reference ::= table_primary */ yytestcase(yyruleno==450); + case 451: /* table_reference ::= joined_table */ yytestcase(yyruleno==451); + case 455: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==455); + case 510: /* query_simple ::= query_specification */ yytestcase(yyruleno==510); + case 511: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==511); + case 514: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==514); + case 516: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==516); +{ yylhsminor.yy148 = yymsp[0].minor.yy148; } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 323: /* literal ::= NULL */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 325: /* literal ::= NULL */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 324: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 326: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 325: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 327: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 326: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 328: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 327: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 329: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 328: /* signed ::= NK_MINUS NK_INTEGER */ + case 330: /* 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.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 329: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 331: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 330: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 332: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 331: /* signed ::= NK_MINUS NK_FLOAT */ + case 333: /* 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.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 333: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 335: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 334: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 336: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 335: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 337: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 336: /* signed_literal ::= duration_literal */ - case 338: /* signed_literal ::= literal_func */ yytestcase(yyruleno==338); - case 407: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==407); - case 469: /* select_item ::= common_expression */ yytestcase(yyruleno==469); - case 479: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==479); - case 513: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==513); - case 515: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==515); - case 528: /* search_condition ::= common_expression */ yytestcase(yyruleno==528); -{ yylhsminor.yy104 = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 338: /* signed_literal ::= duration_literal */ + case 340: /* signed_literal ::= literal_func */ yytestcase(yyruleno==340); + case 409: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==409); + case 471: /* select_item ::= common_expression */ yytestcase(yyruleno==471); + case 481: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==481); + case 515: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==515); + case 517: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==517); + case 530: /* search_condition ::= common_expression */ yytestcase(yyruleno==530); +{ yylhsminor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 337: /* signed_literal ::= NULL */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 339: /* signed_literal ::= NULL */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 339: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy104 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 341: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy148 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 358: /* expression ::= NK_LP expression NK_RP */ - case 441: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==441); - case 527: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==527); -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 360: /* expression ::= NK_LP expression NK_RP */ + case 443: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==443); + case 529: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==529); +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 359: /* expression ::= NK_PLUS expr_or_subquery */ + case 361: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 360: /* expression ::= NK_MINUS expr_or_subquery */ + case 362: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy104), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 361: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 363: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 362: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 364: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 363: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 365: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 364: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 366: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 365: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 367: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 366: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 368: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 367: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 369: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 368: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 370: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 371: /* column_reference ::= column_name */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy737, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy737)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 373: /* column_reference ::= column_name */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy199, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 372: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737, createColumnNode(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 374: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 373: /* pseudo_column ::= ROWTS */ - case 374: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==374); - case 376: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==376); - case 377: /* pseudo_column ::= QEND */ yytestcase(yyruleno==377); - case 378: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==378); - case 379: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==379); - case 380: /* pseudo_column ::= WEND */ yytestcase(yyruleno==380); - case 381: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==381); - case 382: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==382); - case 383: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==383); - case 389: /* literal_func ::= NOW */ yytestcase(yyruleno==389); -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 375: /* pseudo_column ::= ROWTS */ + case 376: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==376); + case 378: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==378); + case 379: /* pseudo_column ::= QEND */ yytestcase(yyruleno==379); + case 380: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==380); + case 381: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==381); + case 382: /* pseudo_column ::= WEND */ yytestcase(yyruleno==382); + case 383: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==383); + case 384: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==384); + case 385: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==385); + case 391: /* literal_func ::= NOW */ yytestcase(yyruleno==391); +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 375: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy737)))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 377: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy199)))); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 384: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 385: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==385); -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy737, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy737, yymsp[-1].minor.yy616)); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 386: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 387: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==387); +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404)); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 386: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-1].minor.yy640)); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + case 388: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy530)); } + yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 388: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy737, NULL)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 390: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy199, NULL)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 403: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy616 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 405: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy404 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 408: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 472: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==472); -{ yylhsminor.yy104 = createColumnNode(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 410: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 474: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==474); +{ yylhsminor.yy148 = createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 409: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy616, yymsp[-1].minor.yy104)); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 411: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 410: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-2].minor.yy616, yymsp[-1].minor.yy104)); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 412: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 413: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy104 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); } + case 415: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy148 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } break; - case 415: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy104 = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); } + case 417: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } break; - case 416: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 421: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==421); + case 418: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 423: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==423); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy668, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy20, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 417: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 419: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy104), releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy148), releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 418: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 420: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy104), releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 419: /* predicate ::= expr_or_subquery IS NULL */ + case 421: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), NULL)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 420: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 422: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL)); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 422: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy668 = OP_TYPE_LOWER_THAN; } + case 424: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; } break; - case 423: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy668 = OP_TYPE_GREATER_THAN; } + case 425: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; } break; - case 424: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy668 = OP_TYPE_LOWER_EQUAL; } + case 426: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; } break; - case 425: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy668 = OP_TYPE_GREATER_EQUAL; } + case 427: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; } break; - case 426: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy668 = OP_TYPE_NOT_EQUAL; } + case 428: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; } break; - case 427: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy668 = OP_TYPE_EQUAL; } + case 429: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy20 = OP_TYPE_EQUAL; } break; - case 428: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy668 = OP_TYPE_LIKE; } + case 430: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy20 = OP_TYPE_LIKE; } break; - case 429: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy668 = OP_TYPE_NOT_LIKE; } + case 431: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; } break; - case 430: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy668 = OP_TYPE_MATCH; } + case 432: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy20 = OP_TYPE_MATCH; } break; - case 431: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy668 = OP_TYPE_NMATCH; } + case 433: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy20 = OP_TYPE_NMATCH; } break; - case 432: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy668 = OP_TYPE_JSON_CONTAINS; } + case 434: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy20 = OP_TYPE_JSON_CONTAINS; } break; - case 433: /* in_op ::= IN */ -{ yymsp[0].minor.yy668 = OP_TYPE_IN; } + case 435: /* in_op ::= IN */ +{ yymsp[0].minor.yy20 = OP_TYPE_IN; } break; - case 434: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy668 = OP_TYPE_NOT_IN; } + case 436: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; } break; - case 435: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy616)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 437: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 437: /* boolean_value_expression ::= NOT boolean_primary */ + case 439: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy104), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 438: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 440: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 439: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 441: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 445: /* from_clause_opt ::= FROM table_reference_list */ - case 474: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==474); - case 502: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==502); -{ yymsp[-1].minor.yy104 = yymsp[0].minor.yy104; } + case 447: /* from_clause_opt ::= FROM table_reference_list */ + case 476: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==476); + case 504: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==504); +{ yymsp[-1].minor.yy148 = yymsp[0].minor.yy148; } break; - case 447: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy104 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy104, yymsp[0].minor.yy104, NULL); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 449: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy148 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, NULL); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 450: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 452: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 451: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, &yymsp[-3].minor.yy737, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 453: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-3].minor.yy199, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 452: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy104 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104), &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 454: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy148 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 454: /* alias_opt ::= */ -{ yymsp[1].minor.yy737 = nil_token; } + case 456: /* alias_opt ::= */ +{ yymsp[1].minor.yy199 = nil_token; } break; - case 456: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy737 = yymsp[0].minor.yy737; } + case 458: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy199 = yymsp[0].minor.yy199; } break; - case 457: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 458: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==458); -{ yymsp[-2].minor.yy104 = yymsp[-1].minor.yy104; } + case 459: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 460: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==460); +{ yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148; } break; - case 459: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy104 = createJoinTableNode(pCxt, yymsp[-4].minor.yy228, yymsp[-5].minor.yy104, yymsp[-2].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + case 461: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy148 = createJoinTableNode(pCxt, yymsp[-4].minor.yy470, yymsp[-5].minor.yy148, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } + yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 460: /* join_type ::= */ -{ yymsp[1].minor.yy228 = JOIN_TYPE_INNER; } + case 462: /* join_type ::= */ +{ yymsp[1].minor.yy470 = JOIN_TYPE_INNER; } break; - case 461: /* join_type ::= INNER */ -{ yymsp[0].minor.yy228 = JOIN_TYPE_INNER; } + case 463: /* join_type ::= INNER */ +{ yymsp[0].minor.yy470 = JOIN_TYPE_INNER; } break; - case 462: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 464: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-11].minor.yy104 = createSelectStmt(pCxt, yymsp[-10].minor.yy185, yymsp[-9].minor.yy616, yymsp[-8].minor.yy104); - yymsp[-11].minor.yy104 = addWhereClause(pCxt, yymsp[-11].minor.yy104, yymsp[-7].minor.yy104); - yymsp[-11].minor.yy104 = addPartitionByClause(pCxt, yymsp[-11].minor.yy104, yymsp[-6].minor.yy616); - yymsp[-11].minor.yy104 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy104, yymsp[-2].minor.yy104); - yymsp[-11].minor.yy104 = addGroupByClause(pCxt, yymsp[-11].minor.yy104, yymsp[-1].minor.yy616); - yymsp[-11].minor.yy104 = addHavingClause(pCxt, yymsp[-11].minor.yy104, yymsp[0].minor.yy104); - yymsp[-11].minor.yy104 = addRangeClause(pCxt, yymsp[-11].minor.yy104, yymsp[-5].minor.yy104); - yymsp[-11].minor.yy104 = addEveryClause(pCxt, yymsp[-11].minor.yy104, yymsp[-4].minor.yy104); - yymsp[-11].minor.yy104 = addFillClause(pCxt, yymsp[-11].minor.yy104, yymsp[-3].minor.yy104); + yymsp[-11].minor.yy148 = createSelectStmt(pCxt, yymsp[-10].minor.yy397, yymsp[-9].minor.yy404, yymsp[-8].minor.yy148); + yymsp[-11].minor.yy148 = addWhereClause(pCxt, yymsp[-11].minor.yy148, yymsp[-7].minor.yy148); + yymsp[-11].minor.yy148 = addPartitionByClause(pCxt, yymsp[-11].minor.yy148, yymsp[-6].minor.yy404); + yymsp[-11].minor.yy148 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy148, yymsp[-2].minor.yy148); + yymsp[-11].minor.yy148 = addGroupByClause(pCxt, yymsp[-11].minor.yy148, yymsp[-1].minor.yy404); + yymsp[-11].minor.yy148 = addHavingClause(pCxt, yymsp[-11].minor.yy148, yymsp[0].minor.yy148); + yymsp[-11].minor.yy148 = addRangeClause(pCxt, yymsp[-11].minor.yy148, yymsp[-5].minor.yy148); + yymsp[-11].minor.yy148 = addEveryClause(pCxt, yymsp[-11].minor.yy148, yymsp[-4].minor.yy148); + yymsp[-11].minor.yy148 = addFillClause(pCxt, yymsp[-11].minor.yy148, yymsp[-3].minor.yy148); } break; - case 465: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy185 = false; } + case 467: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy397 = false; } break; - case 468: /* select_item ::= NK_STAR */ -{ yylhsminor.yy104 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 470: /* select_item ::= NK_STAR */ +{ yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 470: /* select_item ::= common_expression column_alias */ - case 480: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==480); -{ yylhsminor.yy104 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104), &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 472: /* select_item ::= common_expression column_alias */ + case 482: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==482); +{ yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 471: /* select_item ::= common_expression AS column_alias */ - case 481: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==481); -{ yylhsminor.yy104 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), &yymsp[0].minor.yy737); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 473: /* select_item ::= common_expression AS column_alias */ + case 483: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==483); +{ yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), &yymsp[0].minor.yy199); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 476: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 498: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==498); - case 517: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==517); -{ yymsp[-2].minor.yy616 = yymsp[0].minor.yy616; } + case 478: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 500: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==500); + case 519: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==519); +{ yymsp[-2].minor.yy404 = yymsp[0].minor.yy404; } break; - case 483: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy104 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } + case 485: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy148 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 484: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy104 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } + case 486: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy148 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 485: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy104 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), NULL, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 487: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 486: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy104 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy104), releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 488: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 490: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy104 = createFillNode(pCxt, yymsp[-1].minor.yy246, NULL); } + case 492: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy148 = createFillNode(pCxt, yymsp[-1].minor.yy334, NULL); } break; - case 491: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy104 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy616)); } + case 493: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy148 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } break; - case 492: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy246 = FILL_MODE_NONE; } + case 494: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy334 = FILL_MODE_NONE; } break; - case 493: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy246 = FILL_MODE_PREV; } + case 495: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy334 = FILL_MODE_PREV; } break; - case 494: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy246 = FILL_MODE_NULL; } + case 496: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy334 = FILL_MODE_NULL; } break; - case 495: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy246 = FILL_MODE_LINEAR; } + case 497: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy334 = FILL_MODE_LINEAR; } break; - case 496: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy246 = FILL_MODE_NEXT; } + case 498: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy334 = FILL_MODE_NEXT; } break; - case 499: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy616 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 501: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy404 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 500: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 502: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 504: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy104 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } + case 506: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy148 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 507: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 509: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy104 = addOrderByClause(pCxt, yymsp[-3].minor.yy104, yymsp[-2].minor.yy616); - yylhsminor.yy104 = addSlimitClause(pCxt, yylhsminor.yy104, yymsp[-1].minor.yy104); - yylhsminor.yy104 = addLimitClause(pCxt, yylhsminor.yy104, yymsp[0].minor.yy104); + yylhsminor.yy148 = addOrderByClause(pCxt, yymsp[-3].minor.yy148, yymsp[-2].minor.yy404); + yylhsminor.yy148 = addSlimitClause(pCxt, yylhsminor.yy148, yymsp[-1].minor.yy148); + yylhsminor.yy148 = addLimitClause(pCxt, yylhsminor.yy148, yymsp[0].minor.yy148); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 510: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy104 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 512: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy148, yymsp[0].minor.yy148); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 511: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy104 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 513: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 519: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 523: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==523); -{ yymsp[-1].minor.yy104 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==525); +{ yymsp[-1].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 520: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 524: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==524); -{ yymsp[-3].minor.yy104 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 522: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 526: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==526); +{ yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==525); -{ yymsp[-3].minor.yy104 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 523: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 527: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==527); +{ yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 526: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy104); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 528: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy148); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 531: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy104 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), yymsp[-1].minor.yy50, yymsp[0].minor.yy793); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 533: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy148 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), yymsp[-1].minor.yy898, yymsp[0].minor.yy499); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 532: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy50 = ORDER_ASC; } + case 534: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy898 = ORDER_ASC; } break; - case 533: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy50 = ORDER_ASC; } + case 535: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy898 = ORDER_ASC; } break; - case 534: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy50 = ORDER_DESC; } + case 536: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy898 = ORDER_DESC; } break; - case 535: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy793 = NULL_ORDER_DEFAULT; } + case 537: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy499 = NULL_ORDER_DEFAULT; } break; - case 536: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy793 = NULL_ORDER_FIRST; } + case 538: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy499 = NULL_ORDER_FIRST; } break; - case 537: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy793 = NULL_ORDER_LAST; } + case 539: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy499 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 634fd3e127..334d12b95f 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -375,9 +375,68 @@ TEST_F(ParserInitialCTest, createFunction) { TEST_F(ParserInitialCTest, createSmaIndex) { useDb("root", "test"); + SMCreateSmaReq expect = {0}; + + auto setCreateSmacReq = [&](const char* pIndexName, const char* pStbName, int64_t interval, int8_t intervalUnit, + int64_t offset = 0, int64_t sliding = -1, int8_t slidingUnit = -1, int8_t igExists = 0) { + memset(&expect, 0, sizeof(SMCreateSmaReq)); + strcpy(expect.name, pIndexName); + strcpy(expect.stb, pStbName); + expect.igExists = igExists; + expect.intervalUnit = intervalUnit; + expect.slidingUnit = slidingUnit < 0 ? intervalUnit : slidingUnit; + expect.timezone = 0; + expect.dstVgId = 1; + expect.interval = interval; + expect.offset = offset; + expect.sliding = sliding < 0 ? interval : sliding; + expect.maxDelay = -1; + expect.watermark = TSDB_DEFAULT_ROLLUP_WATERMARK; + expect.deleteMark = TSDB_DEFAULT_ROLLUP_DELETE_MARK; + }; + + auto setOptionsForCreateSmacReq = [&](int64_t maxDelay, int64_t watermark, int64_t deleteMark) { + expect.maxDelay = maxDelay; + expect.watermark = watermark; + expect.deleteMark = deleteMark; + }; + + setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) { + ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_CREATE_INDEX_STMT); + SMCreateSmaReq req = {0}; + ASSERT_TRUE(TSDB_CODE_SUCCESS == tDeserializeSMCreateSmaReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req)); + + ASSERT_EQ(std::string(req.name), std::string(expect.name)); + ASSERT_EQ(std::string(req.stb), std::string(expect.stb)); + ASSERT_EQ(req.igExists, expect.igExists); + ASSERT_EQ(req.intervalUnit, expect.intervalUnit); + ASSERT_EQ(req.slidingUnit, expect.slidingUnit); + ASSERT_EQ(req.timezone, expect.timezone); + ASSERT_EQ(req.dstVgId, expect.dstVgId); + ASSERT_EQ(req.interval, expect.interval); + ASSERT_EQ(req.offset, expect.offset); + ASSERT_EQ(req.sliding, expect.sliding); + ASSERT_EQ(req.maxDelay, expect.maxDelay); + ASSERT_EQ(req.watermark, expect.watermark); + ASSERT_EQ(req.deleteMark, expect.deleteMark); + ASSERT_GT(req.exprLen, 0); + ASSERT_EQ(req.tagsFilterLen, 0); + ASSERT_GT(req.sqlLen, 0); + ASSERT_GT(req.astLen, 0); + ASSERT_NE(req.expr, nullptr); + ASSERT_EQ(req.tagsFilter, nullptr); + ASSERT_NE(req.sql, nullptr); + ASSERT_NE(req.ast, nullptr); + tFreeSMCreateSmaReq(&req); + }); + + setCreateSmacReq("0.test.index1", "0.test.t1", 10 * MILLISECOND_PER_SECOND, 's'); run("CREATE SMA INDEX index1 ON t1 FUNCTION(MAX(c1), MIN(c3 + 10), SUM(c4)) INTERVAL(10s)"); - run("CREATE SMA INDEX index2 ON st1 FUNCTION(MAX(c1), MIN(tag1)) INTERVAL(10s)"); + setCreateSmacReq("0.test.index2", "0.test.st1", 5 * MILLISECOND_PER_SECOND, 's'); + setOptionsForCreateSmacReq(10 * MILLISECOND_PER_SECOND, 20 * MILLISECOND_PER_SECOND, 1000 * MILLISECOND_PER_SECOND); + run("CREATE SMA INDEX index2 ON st1 FUNCTION(MAX(c1), MIN(tag1)) INTERVAL(5s) WATERMARK 20s MAX_DELAY 10s " + "DELETE_MARK 1000s"); } TEST_F(ParserInitialCTest, createMnode) { @@ -408,23 +467,26 @@ TEST_F(ParserInitialCTest, createStable) { memset(&expect, 0, sizeof(SMCreateStbReq)); }; - auto setCreateStbReqFunc = [&](const char* pDbName, const char* pTbName, int8_t igExists = 0, int64_t delay1 = -1, - int64_t delay2 = -1, int64_t watermark1 = TSDB_DEFAULT_ROLLUP_WATERMARK, - int64_t watermark2 = TSDB_DEFAULT_ROLLUP_WATERMARK, - int32_t ttl = TSDB_DEFAULT_TABLE_TTL, const char* pComment = nullptr) { - int32_t len = snprintf(expect.name, sizeof(expect.name), "0.%s.%s", pDbName, pTbName); - expect.name[len] = '\0'; - expect.igExists = igExists; - expect.delay1 = delay1; - expect.delay2 = delay2; - expect.watermark1 = watermark1; - expect.watermark2 = watermark2; - // expect.ttl = ttl; - if (nullptr != pComment) { - expect.pComment = strdup(pComment); - expect.commentLen = strlen(pComment); - } - }; + auto setCreateStbReqFunc = + [&](const char* pDbName, const char* pTbName, int8_t igExists = 0, int64_t delay1 = -1, int64_t delay2 = -1, + int64_t watermark1 = TSDB_DEFAULT_ROLLUP_WATERMARK, int64_t watermark2 = TSDB_DEFAULT_ROLLUP_WATERMARK, + int64_t deleteMark1 = TSDB_DEFAULT_ROLLUP_DELETE_MARK, int64_t deleteMark2 = TSDB_DEFAULT_ROLLUP_DELETE_MARK, + int32_t ttl = TSDB_DEFAULT_TABLE_TTL, const char* pComment = nullptr) { + int32_t len = snprintf(expect.name, sizeof(expect.name), "0.%s.%s", pDbName, pTbName); + expect.name[len] = '\0'; + expect.igExists = igExists; + expect.delay1 = delay1; + expect.delay2 = delay2; + expect.watermark1 = watermark1; + expect.watermark2 = watermark2; + expect.deleteMark1 = deleteMark1; + expect.deleteMark2 = deleteMark2; + // expect.ttl = ttl; + if (nullptr != pComment) { + expect.pComment = strdup(pComment); + expect.commentLen = strlen(pComment); + } + }; auto addFieldToCreateStbReqFunc = [&](bool col, const char* pFieldName, uint8_t type, int32_t bytes = 0, int8_t flags = COL_SMA_ON) { @@ -511,7 +573,8 @@ TEST_F(ParserInitialCTest, createStable) { clearCreateStbReq(); setCreateStbReqFunc("rollup_db", "t1", 1, 100 * MILLISECOND_PER_SECOND, 10 * MILLISECOND_PER_MINUTE, 10, - 1 * MILLISECOND_PER_MINUTE, 100, "test create table"); + 1 * MILLISECOND_PER_MINUTE, 1000 * MILLISECOND_PER_SECOND, 200 * MILLISECOND_PER_MINUTE, 100, + "test create table"); addFieldToCreateStbReqFunc(true, "ts", TSDB_DATA_TYPE_TIMESTAMP, 0, 0); addFieldToCreateStbReqFunc(true, "c1", TSDB_DATA_TYPE_INT); addFieldToCreateStbReqFunc(true, "c2", TSDB_DATA_TYPE_UINT); @@ -549,7 +612,8 @@ TEST_F(ParserInitialCTest, createStable) { "TAGS (a1 TIMESTAMP, a2 INT, a3 INT UNSIGNED, a4 BIGINT, a5 BIGINT UNSIGNED, a6 FLOAT, a7 DOUBLE, " "a8 BINARY(20), a9 SMALLINT, a10 SMALLINT UNSIGNED COMMENT 'test column comment', a11 TINYINT, " "a12 TINYINT UNSIGNED, a13 BOOL, a14 NCHAR(30), a15 VARCHAR(50)) " - "TTL 100 COMMENT 'test create table' SMA(c1, c2, c3) ROLLUP (MIN) MAX_DELAY 100s,10m WATERMARK 10a,1m"); + "TTL 100 COMMENT 'test create table' SMA(c1, c2, c3) ROLLUP (MIN) MAX_DELAY 100s,10m WATERMARK 10a,1m " + "DELETE_MARK 1000s,200m"); clearCreateStbReq(); } diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index dd5e283a55..b05c35452b 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -702,6 +702,7 @@ static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStm if (pCxt->pPlanCxt->streamQuery) { pWindow->triggerType = pCxt->pPlanCxt->triggerType; pWindow->watermark = pCxt->pPlanCxt->watermark; + pWindow->deleteMark = pCxt->pPlanCxt->deleteMark; pWindow->igExpired = pCxt->pPlanCxt->igExpired; } pWindow->inputTsOrder = ORDER_ASC; diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index c370e2c84b..e1687fc3a5 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -330,6 +330,7 @@ static void scanPathOptSetScanWin(SScanLogicNode* pScan) { pScan->slidingUnit = ((SWindowLogicNode*)pParent)->slidingUnit; pScan->triggerType = ((SWindowLogicNode*)pParent)->triggerType; pScan->watermark = ((SWindowLogicNode*)pParent)->watermark; + pScan->deleteMark = ((SWindowLogicNode*)pParent)->deleteMark; pScan->igExpired = ((SWindowLogicNode*)pParent)->igExpired; } } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 53c1d24df9..e5675310b5 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1139,6 +1139,7 @@ static int32_t createWindowPhysiNodeFinalize(SPhysiPlanContext* pCxt, SNodeList* SWindowLogicNode* pWindowLogicNode) { pWindow->triggerType = pWindowLogicNode->triggerType; pWindow->watermark = pWindowLogicNode->watermark; + pWindow->deleteMark = pWindowLogicNode->deleteMark; pWindow->igExpired = pWindowLogicNode->igExpired; pWindow->inputTsOrder = pWindowLogicNode->inputTsOrder; pWindow->outputTsOrder = pWindowLogicNode->outputTsOrder; diff --git a/source/libs/planner/test/planOtherTest.cpp b/source/libs/planner/test/planOtherTest.cpp index 3ed23d6cb2..4741d241b5 100644 --- a/source/libs/planner/test/planOtherTest.cpp +++ b/source/libs/planner/test/planOtherTest.cpp @@ -51,7 +51,7 @@ TEST_F(PlanOtherTest, createStreamUseSTable) { TEST_F(PlanOtherTest, createSmaIndex) { useDb("root", "test"); - run("CREATE SMA INDEX idx1 ON t1 FUNCTION(MAX(c1), MIN(c3 + 10), SUM(c4)) INTERVAL(10s)"); + run("CREATE SMA INDEX idx1 ON t1 FUNCTION(MAX(c1), MIN(c3 + 10), SUM(c4)) INTERVAL(10s) DELETE_MARK 1000s"); run("SELECT SUM(c4) FROM t1 INTERVAL(10s)"); diff --git a/source/libs/planner/test/planTestUtil.cpp b/source/libs/planner/test/planTestUtil.cpp index b3620cedfb..d89e669a90 100644 --- a/source/libs/planner/test/planTestUtil.cpp +++ b/source/libs/planner/test/planTestUtil.cpp @@ -444,6 +444,7 @@ class PlannerTestBaseImpl { tDeserializeSMCreateSmaReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req); g_mockCatalogService->createSmaIndex(&req); nodesStringToNode(req.ast, &pCxt->pAstRoot); + pCxt->deleteMark = req.deleteMark; tFreeSMCreateSmaReq(&req); nodesDestroyNode(pQuery->pRoot); pQuery->pRoot = pCxt->pAstRoot; From 99975ae52486f0a493e9b4d08b2202cf51905648 Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao@163.com> Date: Tue, 6 Dec 2022 16:26:33 +0800 Subject: [PATCH 53/63] fix:read data and compute group id --- source/libs/executor/src/scanoperator.c | 56 +++++++++++++++++-------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 04f5f4ecfe..57773b300d 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1218,27 +1218,56 @@ static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pS if (rows == 0) { return TSDB_CODE_SUCCESS; } + + SColumnInfoData* pSrcStartTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); + SColumnInfoData* pSrcEndTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, END_TS_COLUMN_INDEX); + SColumnInfoData* pSrcUidCol = taosArrayGet(pSrcBlock->pDataBlock, UID_COLUMN_INDEX); + SColumnInfoData* pSrcGpCol = taosArrayGet(pSrcBlock->pDataBlock, GROUPID_COLUMN_INDEX); + + uint64_t* srcUidData = (uint64_t*)pSrcUidCol->pData; + ASSERT(pSrcStartTsCol->info.type == TSDB_DATA_TYPE_TIMESTAMP); + TSKEY* srcStartTsCol = (TSKEY*)pSrcStartTsCol->pData; + TSKEY* srcEndTsCol = (TSKEY*)pSrcEndTsCol->pData; + int64_t version = pSrcBlock->info.version - 1; + + if (pInfo->partitionSup.needCalc && srcStartTsCol[0] != srcEndTsCol[0]) { + uint64_t srcUid = srcUidData[0]; + TSKEY startTs = srcStartTsCol[0]; + TSKEY endTs = srcEndTsCol[0]; + SSDataBlock* pPreRes = readPreVersionData(pInfo->pTableScanOp, srcUid, startTs, endTs, version); + printDataBlock(pPreRes, "pre res"); + blockDataCleanup(pSrcBlock); + int32_t code = blockDataEnsureCapacity(pSrcBlock, pPreRes->info.rows); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + SColumnInfoData* pTsCol = (SColumnInfoData*)taosArrayGet(pPreRes->pDataBlock, pInfo->primaryTsIndex); + rows = pPreRes->info.rows; + + for (int32_t i = 0; i < rows; i++) { + uint64_t groupId = calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, i); + appendOneRowToStreamSpecialBlock(pSrcBlock, ((TSKEY*)pTsCol->pData) + i, ((TSKEY*)pTsCol->pData) + i, &srcUid, + &groupId, NULL); + } + printDataBlock(pSrcBlock, "new delete"); + } + uint64_t* srcGp = (uint64_t*)pSrcGpCol->pData; + srcStartTsCol = (TSKEY*)pSrcStartTsCol->pData; + srcEndTsCol = (TSKEY*)pSrcEndTsCol->pData; + srcUidData = (uint64_t*)pSrcUidCol->pData; + int32_t code = blockDataEnsureCapacity(pDestBlock, rows); if (code != TSDB_CODE_SUCCESS) { return code; } - SColumnInfoData* pSrcStartTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); - SColumnInfoData* pSrcEndTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, END_TS_COLUMN_INDEX); - SColumnInfoData* pSrcUidCol = taosArrayGet(pSrcBlock->pDataBlock, UID_COLUMN_INDEX); - uint64_t* srcUidData = (uint64_t*)pSrcUidCol->pData; - SColumnInfoData* pSrcGpCol = taosArrayGet(pSrcBlock->pDataBlock, GROUPID_COLUMN_INDEX); - uint64_t* srcGp = (uint64_t*)pSrcGpCol->pData; - ASSERT(pSrcStartTsCol->info.type == TSDB_DATA_TYPE_TIMESTAMP); - TSKEY* srcStartTsCol = (TSKEY*)pSrcStartTsCol->pData; - TSKEY* srcEndTsCol = (TSKEY*)pSrcEndTsCol->pData; SColumnInfoData* pStartTsCol = taosArrayGet(pDestBlock->pDataBlock, START_TS_COLUMN_INDEX); SColumnInfoData* pEndTsCol = taosArrayGet(pDestBlock->pDataBlock, END_TS_COLUMN_INDEX); SColumnInfoData* pDeUidCol = taosArrayGet(pDestBlock->pDataBlock, UID_COLUMN_INDEX); SColumnInfoData* pGpCol = taosArrayGet(pDestBlock->pDataBlock, GROUPID_COLUMN_INDEX); SColumnInfoData* pCalStartTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); SColumnInfoData* pCalEndTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); - int64_t version = pSrcBlock->info.version - 1; for (int32_t i = 0; i < rows;) { uint64_t srcUid = srcUidData[i]; uint64_t groupId = srcGp[i]; @@ -1653,13 +1682,6 @@ static void setBlockGroupIdByUid(SStreamScanInfo* pInfo, SSDataBlock* pBlock) { uint64_t groupId = getGroupIdByUid(pInfo, uidCol[i]); colDataAppend(pGpCol, i, (const char*)&groupId, false); } - } else { - // SSDataBlock* pPreRes = readPreVersionData(pInfo->pTableScanOp, uidCol[i], startTsCol, ts, maxVersion); - // if (!pPreRes || pPreRes->info.rows == 0) { - // return 0; - // } - // ASSERT(pPreRes->info.rows == 1); - // return calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, 0); } } From 2cc58eebd3657b31de1567416dd2253b185af02f Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 6 Dec 2022 00:29:38 -0800 Subject: [PATCH 54/63] fix: fix count VAR type column error cause of reading incoorect sma results --- 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 20de7f73bf..7dc9538fcf 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -501,7 +501,7 @@ static int32_t getNumOfElems(SqlFunctionCtx* pCtx) { */ SInputColumnInfoData* pInput = &pCtx->input; SColumnInfoData* pInputCol = pInput->pData[0]; - if (pInput->colDataSMAIsSet && pInput->totalRows == pInput->numOfRows) { + if (pInput->colDataSMAIsSet && pInput->totalRows == pInput->numOfRows && !IS_VAR_DATA_TYPE(pInputCol->info.type)) { numOfElem = pInput->numOfRows - pInput->pColumnDataAgg[0]->numOfNull; ASSERT(numOfElem >= 0); } else { From 529d8cc800f53e50131a943e6b79f36bf52b6150 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Tue, 6 Dec 2022 16:42:37 +0800 Subject: [PATCH 55/63] enh: enable timeout checking of sync Resp with ttl as 30s --- include/libs/sync/sync.h | 2 +- source/libs/sync/src/syncTimeout.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index 7f9b240f63..900bc88c41 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -25,7 +25,7 @@ extern "C" { #include "tlrucache.h" #include "tmsgcb.h" -#define SYNC_RESP_TTL_MS 10000000 +#define SYNC_RESP_TTL_MS 30000 #define SYNC_SPEED_UP_HB_TIMER 400 #define SYNC_SPEED_UP_AFTER_MS (1000 * 20) #define SYNC_SLOW_DOWN_RANGE 100 diff --git a/source/libs/sync/src/syncTimeout.c b/source/libs/sync/src/syncTimeout.c index cf933d98b2..9c39fc1e8e 100644 --- a/source/libs/sync/src/syncTimeout.c +++ b/source/libs/sync/src/syncTimeout.c @@ -19,6 +19,7 @@ #include "syncRaftCfg.h" #include "syncRaftLog.h" #include "syncReplication.h" +#include "syncRespMgr.h" #include "syncUtil.h" static void syncNodeCleanConfigIndex(SSyncNode* ths) { @@ -85,11 +86,9 @@ static int32_t syncNodeTimerRoutine(SSyncNode* ths) { } } -#if 0 if (!syncNodeIsMnode(ths)) { syncRespClean(ths->pSyncRespMgr); } -#endif return 0; } From 20e2acbacfd8105da3498eb0d0250eb4037a7722 Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Tue, 6 Dec 2022 16:59:19 +0800 Subject: [PATCH 56/63] refactor(sync): add reserved field in message --- source/libs/sync/inc/syncMessage.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/libs/sync/inc/syncMessage.h b/source/libs/sync/inc/syncMessage.h index cf63df371d..3bd94dbab5 100644 --- a/source/libs/sync/inc/syncMessage.h +++ b/source/libs/sync/inc/syncMessage.h @@ -46,6 +46,7 @@ typedef struct SyncClientRequest { uint32_t originalRpcType; // origin RpcMsg msgType uint64_t seqNum; bool isWeak; + int16_t reserved; uint32_t dataLen; // origin RpcMsg.contLen char data[]; // origin RpcMsg.pCont } SyncClientRequest; @@ -56,6 +57,7 @@ typedef struct SyncClientRequestReply { uint32_t msgType; int32_t errCode; SRaftId leaderHint; + int16_t reserved; } SyncClientRequestReply; typedef struct SyncRequestVote { @@ -68,6 +70,7 @@ typedef struct SyncRequestVote { SyncTerm term; SyncIndex lastLogIndex; SyncTerm lastLogTerm; + int16_t reserved; } SyncRequestVote; typedef struct SyncRequestVoteReply { @@ -79,6 +82,7 @@ typedef struct SyncRequestVoteReply { // private data SyncTerm term; bool voteGranted; + int16_t reserved; } SyncRequestVoteReply; typedef struct SyncAppendEntries { @@ -94,6 +98,7 @@ typedef struct SyncAppendEntries { SyncTerm prevLogTerm; SyncIndex commitIndex; SyncTerm privateTerm; + int16_t reserved; uint32_t dataLen; char data[]; } SyncAppendEntries; @@ -111,6 +116,7 @@ typedef struct SyncAppendEntriesReply { SyncIndex matchIndex; SyncIndex lastSendIndex; int64_t startTime; + int16_t reserved; } SyncAppendEntriesReply; typedef struct SyncHeartbeat { @@ -126,6 +132,7 @@ typedef struct SyncHeartbeat { SyncTerm privateTerm; SyncTerm minMatchIndex; int64_t timeStamp; + int16_t reserved; } SyncHeartbeat; typedef struct SyncHeartbeatReply { @@ -140,6 +147,7 @@ typedef struct SyncHeartbeatReply { SyncTerm privateTerm; int64_t startTime; int64_t timeStamp; + int16_t reserved; } SyncHeartbeatReply; typedef struct SyncPreSnapshot { @@ -151,6 +159,7 @@ typedef struct SyncPreSnapshot { // private data SyncTerm term; + int16_t reserved; } SyncPreSnapshot; typedef struct SyncPreSnapshotReply { @@ -163,6 +172,7 @@ typedef struct SyncPreSnapshotReply { // private data SyncTerm term; SyncIndex snapStart; + int16_t reserved; } SyncPreSnapshotReply; typedef struct SyncApplyMsg { @@ -190,6 +200,7 @@ typedef struct SyncSnapshotSend { SSyncCfg lastConfig; int64_t startTime; int32_t seq; + int16_t reserved; uint32_t dataLen; char data[]; } SyncSnapshotSend; @@ -208,6 +219,7 @@ typedef struct SyncSnapshotRsp { int32_t ack; int32_t code; SyncIndex snapBeginIndex; // when ack = SYNC_SNAPSHOT_SEQ_BEGIN, it's valid + int16_t reserved; } SyncSnapshotRsp; typedef struct SyncLeaderTransfer { From 2af319ac0a66bbb3939ebcddc5eb8483d8fa43f8 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 6 Dec 2022 17:16:34 +0800 Subject: [PATCH 57/63] fix tbnameIn bug on normal table --- source/libs/executor/src/executil.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 2032cb9fce..fc3cfbd0f6 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -439,7 +439,9 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* goto end; } } - removeInvalidTable(uidList, tags); + if (suid != 0) { + removeInvalidTable(uidList, tags); + } int32_t rows = taosArrayGetSize(uidList); if (rows == 0) { @@ -1604,7 +1606,7 @@ int32_t initQueryTableDataCond(SQueryTableDataCond* pCond, const STableScanPhysi pCond->numOfCols = LIST_LENGTH(pTableScanNode->scan.pScanCols); pCond->colList = taosMemoryCalloc(pCond->numOfCols, sizeof(SColumnInfo)); - pCond->pSlotList = taosMemoryMalloc(sizeof(int32_t)*pCond->numOfCols); + pCond->pSlotList = taosMemoryMalloc(sizeof(int32_t) * pCond->numOfCols); if (pCond->colList == NULL || pCond->pSlotList == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; taosMemoryFreeClear(pCond->colList); From bb382ec2a3ae0bc1882e5da663927e995e23e8db Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 6 Dec 2022 19:23:50 +0800 Subject: [PATCH 58/63] fix: fix case dead loop issue --- tests/script/tsim/vnode/replica3_repeat.sim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/script/tsim/vnode/replica3_repeat.sim b/tests/script/tsim/vnode/replica3_repeat.sim index 8efba515ae..10e18d01d0 100644 --- a/tests/script/tsim/vnode/replica3_repeat.sim +++ b/tests/script/tsim/vnode/replica3_repeat.sim @@ -85,6 +85,7 @@ print ======== step3 system sh/exec.sh -n dnode2 -s stop sleep 3000 +$t = 0 $x = 0 loop: @@ -126,8 +127,8 @@ print ======== step8 $lastRows = $data00 print ======== loop Times $x -if $x < 2 then - $x = $x + 1 +if $t < 2 then + $t = $t + 1 goto loop endi @@ -138,4 +139,4 @@ system sh/exec.sh -n dnode4 -s stop -x SIGINT system sh/exec.sh -n dnode5 -s stop -x SIGINT system sh/exec.sh -n dnode6 -s stop -x SIGINT system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode8 -s stop -x SIGINT From 130ef694c71d8978d6ea62f78c418ab8a5cb7b75 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 6 Dec 2022 19:37:43 +0800 Subject: [PATCH 59/63] fix: one less alter vnode request was sent --- source/dnode/mnode/impl/src/mndDnode.c | 4 ++-- source/dnode/mnode/impl/src/mndVgroup.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index df25e44bee..0538d70101 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -383,9 +383,9 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { pGid->syncCanRead != pVload->syncCanRead) { mInfo( "vgId:%d, state changed by status msg, old state:%s restored:%d canRead:%d new state:%s restored:%d " - "canRead:%d", + "canRead:%d, dnode:%d", pVgroup->vgId, syncStr(pGid->syncState), pGid->syncRestore, pGid->syncCanRead, - syncStr(pVload->syncState), pVload->syncRestore, pVload->syncCanRead); + syncStr(pVload->syncState), pVload->syncRestore, pVload->syncCanRead, pDnode->id); pGid->syncState = pVload->syncState; pGid->syncRestore = pVload->syncRestore; pGid->syncCanRead = pVload->syncCanRead; diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index ea8bb581e0..a6e52caf1f 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1174,7 +1174,7 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, } if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; - for (int32_t i = 0; i < newVg.replica - 1; ++i) { + for (int32_t i = 0; i < newVg.replica; ++i) { if (i == vnIndex) continue; if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; } From 34072c23074449a32b5007b079ef089c63e9fee0 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 6 Dec 2022 20:40:29 +0800 Subject: [PATCH 60/63] fix: add stmt sort merge case --- tests/script/api/batchprepare.c | 148 +++++++++++++++++++++++++------- 1 file changed, 115 insertions(+), 33 deletions(-) diff --git a/tests/script/api/batchprepare.c b/tests/script/api/batchprepare.c index 74aa7baf0b..60df188d7b 100644 --- a/tests/script/api/batchprepare.c +++ b/tests/script/api/batchprepare.c @@ -79,6 +79,9 @@ int64_t bpTs; #define IS_NUMERIC_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t)) || (IS_FLOAT_TYPE(_t))) typedef struct { + bool singleTbInsert; + int32_t singleTbIdx; + int64_t* tsData; bool* boolData; int8_t* tinyData; @@ -116,6 +119,7 @@ int insertMBMETest4(TAOS_STMT *stmt, TAOS *taos); int insertMPMETest1(TAOS_STMT *stmt, TAOS *taos); int insertAUTOTest1(TAOS_STMT *stmt, TAOS *taos); int insertAUTOTest2(TAOS_STMT *stmt, TAOS *taos); +int insertAUTOTest3(TAOS_STMT *stmt, TAOS *taos); int queryColumnTest(TAOS_STMT *stmt, TAOS *taos); int queryMiscTest(TAOS_STMT *stmt, TAOS *taos); @@ -130,6 +134,7 @@ typedef struct { int32_t *colList; // full table column list int32_t testType; int32_t autoCreateTbl; + bool duplicateValue; bool fullCol; int32_t (*runFn)(TAOS_STMT*, TAOS*); int32_t tblNum; @@ -143,46 +148,47 @@ typedef struct { } CaseCfg; CaseCfg gCase[] = { - {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, true, insertMBSETest1, 1, 10, 10, 0, 0, 0, 1, -1}, - {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, true, insertMBSETest1, 10, 100, 10, 0, 0, 0, 1, -1}, + {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 1, 10, 10, 0, 0, 0, 1, -1}, + {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 10, 100, 10, 0, 0, 0, 1, -1}, - {"insert:MBSE1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBSETest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBSE1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest1, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBSE1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest1, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBSE1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBSE1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest1, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBSE1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest1, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MBSE2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBSETest2, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBSE2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest2, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBSE2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest2, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBSE2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBSETest2, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBSE2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest2, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBSE2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest2, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MBME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest1, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBME1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest1, 10, 10, 2, 2, 0, 0, 1, -1}, // 11 - {"insert:MBME2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest2, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest2, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest2, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBME2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest2, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBME2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest2, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBME2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest2, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MBME3-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest3, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME3-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest3, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME3-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest3, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBME3-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest3, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBME3-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest3, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBME3-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest3, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MBME4-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest4, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME4-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest4, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME4-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest4, 10, 10, 2, 2, 0, 0, 1, -1}, + {"insert:MBME4-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest4, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MBME4-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest4, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MBME4-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest4, 10, 10, 2, 2, 0, 0, 1, -1}, - {"insert:MPME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMPMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MPME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMPMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, + {"insert:MPME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMPMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:MPME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMPMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, // 22 - {"insert:AUTO1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 1, true, insertAUTOTest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:AUTO1-TBEXISTS", tListLen(fullColList), fullColList, TTYPE_INSERT, 3, true, insertAUTOTest2, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:AUTO1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 1, false, true, insertAUTOTest1, 10, 10, 2, 0, 0, 0, 1, -1}, + {"insert:AUTO2-TBEXISTS", tListLen(fullColList), fullColList, TTYPE_INSERT, 3, false, true, insertAUTOTest2, 10, 10, 2, 0, 0, 0, 1, -1}, +// {"insert:AUTO3-NTB", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, true, insertAUTOTest3, 10, 10, 2, 0, 0, 0, 1, -1}, - {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryColumnTest, 10, 10, 1, 3, 0, 0, 1, 2}, - {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryMiscTest, 10, 10, 1, 3, 0, 0, 1, 2}, + {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryColumnTest, 10, 10, 1, 3, 0, 0, 1, 2}, + {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryMiscTest, 10, 10, 1, 3, 0, 0, 1, 2}, -// {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryColumnTest, 1, 10, 1, 1, 0, 0, 1, 2}, -// {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryMiscTest, 2, 10, 1, 1, 0, 0, 1, 2}, +// {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryColumnTest, 1, 10, 1, 1, 0, 0, 1, 2}, +// {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryMiscTest, 2, 10, 1, 1, 0, 0, 1, 2}, }; @@ -232,7 +238,7 @@ CaseCtrl gCaseCtrl = { .numericParam = false, .rowNum = 0, .bindColNum = 0, - .bindTagNum = 14, + .bindTagNum = 0, .bindRowNum = 0, .bindColTypeNum = 0, .bindColTypeList = NULL, @@ -244,7 +250,7 @@ CaseCtrl gCaseCtrl = { .funcIdxList = NULL, .checkParamNum = false, .runTimes = 0, - .caseIdx = 23, + .caseIdx = 24, .caseNum = 1, .caseRunIdx = -1, .caseRunNum = -1, @@ -382,7 +388,11 @@ bool colExists(TAOS_MULTI_BIND* pBind, int32_t dataType) { void generateInsertSQL(BindData *data) { int32_t len = 0; if (gCurCase->tblNum > 1) { - len = sprintf(data->sql, "insert into ? "); + if (data->singleTbInsert) { + len = sprintf(data->sql, "insert into %s%d ", bpTbPrefix, data->singleTbIdx); + } else { + len = sprintf(data->sql, "insert into ? "); + } } else { len = sprintf(data->sql, "insert into %s0 ", bpTbPrefix); } @@ -938,7 +948,14 @@ int32_t prepareInsertData(BindData *data) { } for (int32_t i = 0; i < allRowNum; ++i) { - data->tsData[i] = bpTs++; + if (gCurCase->duplicateValue) { + data->tsData[i] = bpTs; + if (i % 2 == 1) { + bpTs++; + } + } else { + data->tsData[i] = bpTs++; + } data->boolData[i] = (bool)(i % 2); data->tinyData[i] = (int8_t)i; data->utinyData[i] = (uint8_t)(i+1); @@ -1251,6 +1268,9 @@ void bpCheckParamNum(TAOS_STMT *stmt) { void bpCheckAffectedRows(TAOS_STMT *stmt, int32_t times) { int32_t rows = taos_stmt_affected_rows(stmt); int32_t insertNum = gCurCase->rowNum * gCurCase->tblNum * times; + if (gCurCase->duplicateValue) { + insertNum /= 2; + } if (insertNum != rows) { printf("!!!affected rows %d mis-match with insert num %d\n", rows, insertNum); exit(1); @@ -2014,6 +2034,65 @@ int insertAUTOTest2(TAOS_STMT *stmt, TAOS *taos) { return 0; } +/* normal table [prepare [bind add exec]] */ +int insertAUTOTest3(TAOS_STMT *stmt, TAOS *taos) { + int32_t loop = 0; + + while (gCurCase->bindColNum > 0) { + BindData data = {0}; + data.singleTbInsert = true; + prepareInsertData(&data); + + int32_t bindTimes = gCurCase->rowNum/gCurCase->bindRowNum; + for (int32_t t = 0; t< gCurCase->tblNum; ++t) { + data.singleTbIdx = t; + generateInsertSQL(&data); + + int code = taos_stmt_prepare(stmt, data.sql, 0); + if (code != 0){ + printf("!!!failed to execute taos_stmt_prepare. error:%s\n", taos_stmt_errstr(stmt)); + exit(1); + } + + for (int32_t b = 0; b bindColNum + b*gCurCase->bindColNum)) { + exit(1); + } + + if (taos_stmt_add_batch(stmt)) { + printf("!!!taos_stmt_add_batch error:%s\n", taos_stmt_errstr(stmt)); + exit(1); + } + + if (taos_stmt_execute(stmt) != 0) { + printf("!!!taos_stmt_execute error:%s\n", taos_stmt_errstr(stmt)); + exit(1); + } + } + } + + bpCheckIsInsert(stmt, 1); + + destroyData(&data); + + gCurCase->bindColNum -= 2; + gCurCase->fullCol = false; + loop++; + } + + bpCheckAffectedRows(stmt, loop); + + gExecLoopTimes = loop; + + return 0; +} + /* select * from table */ int queryColumnTest(TAOS_STMT *stmt, TAOS *taos) { @@ -2160,7 +2239,7 @@ void prepareCheckResult(TAOS *taos, bool silent) { sprintf(buf, "%s%d", bpTbPrefix, 0); } - prepareCheckResultImpl(taos, buf, gCaseCtrl.printRes, gCurCase->rowNum * gExecLoopTimes, silent); + prepareCheckResultImpl(taos, buf, gCaseCtrl.printRes, gCurCase->duplicateValue ? (gCurCase->rowNum * gExecLoopTimes / 2) : (gCurCase->rowNum * gExecLoopTimes), silent); } gExecLoopTimes = 1; @@ -2749,6 +2828,7 @@ void runAll(TAOS *taos) { printf("%s Begin\n", gCaseCtrl.caseCatalog); runCaseList(taos); +#if 0 strcpy(gCaseCtrl.caseCatalog, "Micro DB precision Test"); printf("%s Begin\n", gCaseCtrl.caseCatalog); gCaseCtrl.precision = TIME_PRECISION_MICRO; @@ -2805,6 +2885,8 @@ void runAll(TAOS *taos) { runCaseList(taos); gCaseCtrl.bindColNum = 0; +#endif + /* strcpy(gCaseCtrl.caseCatalog, "Bind Col Type Test"); printf("%s Begin\n", gCaseCtrl.caseCatalog); From 6635691f520e6c8c9d79f1fc4c7499568cb691ac Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 6 Dec 2022 22:21:47 +0800 Subject: [PATCH 61/63] add msg type --- source/libs/transport/src/transCli.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 187e17fc30..50594f1a5a 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -883,10 +883,11 @@ void cliConnCb(uv_connect_t* req, int status) { } if (status != 0) { - tError("%s conn %p failed to connect to %s:%d, reason:%s", CONN_GET_INST_LABEL(pConn), pConn, pConn->ip, - pConn->port, uv_strerror(status)); SCliMsg* pMsg = transQueueGet(&pConn->cliMsgs, 0); STrans* pTransInst = pThrd->pTransInst; + + tError("%s msg %s failed to send, conn %p failed to connect to %s:%d, reason: %s", CONN_GET_INST_LABEL(pConn), + pMsg ? TMSG_INFO(pMsg->msg.msgType) : 0, pConn, pConn->ip, pConn->port, uv_strerror(status)); if (pMsg != NULL && REQUEST_NO_RESP(&pMsg->msg) && (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) { char* ip = pConn->ip; @@ -1071,8 +1072,8 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) { int32_t elapse = (int32_t)(taosGetTimestampMs() - item->timestamp); if (item->count >= pTransInst->failFastThreshold && (elapse >= 0 && elapse <= pTransInst->failFastInterval)) { STraceId* trace = &(pMsg->msg.info.traceId); - tGTrace("%s, msg %p cancel to send, reason: failed to connect %s:%d: count: %d, at %d", pTransInst->label, pMsg, - ip, port, item->count, elapse); + tGTrace("%s, msg %s cancel to send, reason: failed to connect %s:%d: count: %d, at %d", pTransInst->label, + TMSG_INFO(pMsg->msg.msgType), ip, port, item->count, elapse); destroyCmsg(pMsg); return; } From f8fff96b7a06e1f288deb6de13f8e7a210086ec5 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 7 Dec 2022 09:30:17 +0800 Subject: [PATCH 62/63] support more fail-fast msgtype --- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 04c12abcf9..2383a09343 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -50,7 +50,7 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) { static bool dmFailFastFp(tmsg_t msgType) { // add more msg type later - return msgType == TDMT_SYNC_HEARTBEAT; + return msgType == TDMT_SYNC_HEARTBEAT || msgType == TDMT_SYNC_APPEND_ENTRIES; } static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { From 89855677fa6981a56594850896a5b737a777e890 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 7 Dec 2022 11:22:36 +0800 Subject: [PATCH 63/63] fix: change qnode query min thread number --- source/common/src/tglobal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 3bcfddb8b2..d1a3f38143 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -407,7 +407,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { tsNumOfQnodeQueryThreads = tsNumOfCores * 2; tsNumOfQnodeQueryThreads = TMAX(tsNumOfQnodeQueryThreads, 4); - if (cfgAddInt32(pCfg, "numOfQnodeQueryThreads", tsNumOfQnodeQueryThreads, 1, 1024, 0) != 0) return -1; + if (cfgAddInt32(pCfg, "numOfQnodeQueryThreads", tsNumOfQnodeQueryThreads, 4, 1024, 0) != 0) return -1; // tsNumOfQnodeFetchThreads = tsNumOfCores / 2; // tsNumOfQnodeFetchThreads = TMAX(tsNumOfQnodeFetchThreads, 4);