diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in index 68af4e7fcb..6cdff79629 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 df8678f + GIT_TAG 88d26c3 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index 60f1f0448d..f90a163cb4 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG 2a2def1 + GIT_TAG 58f58ee SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/docs/zh/12-taos-sql/22-meta.md b/docs/zh/12-taos-sql/22-meta.md index 14a4d3c2bb..1e17870685 100644 --- a/docs/zh/12-taos-sql/22-meta.md +++ b/docs/zh/12-taos-sql/22-meta.md @@ -176,18 +176,6 @@ Note: 由于 SHOW 语句已经被开发者熟悉和广泛使用,所以它们 | 5 | tag_type | BINARY(64) | tag 的类型 | | 6 | tag_value | BINARY(16384) | tag 的值 | -## USER_STREAMS - -提供用户创建的流计算的相关信息。 - -| # | **列名** | **数据类型** | **说明** | -| --- | :---------: | ------------ | --------------------------- | -| 1 | stream_name | BINARY(192) | 流计算名称 | -| 2 | user_name | BINARY(23) | 创建流计算的用户 | -| 3 | dest_table | BINARY(192) | 流计算写入的目标表 | -| 4 | create_time | TIMESTAMP | 创建时间 | -| 5 | sql | BLOB | 创建流计算时提供的 SQL 语句 | - ## INS_USERS 提供系统中创建的用户的相关信息。 @@ -200,27 +188,44 @@ Note: 由于 SHOW 语句已经被开发者熟悉和广泛使用,所以它们 ## INS_GRANTS -TODO +提供企业版授权的相关信息。 + +| # | **列名** | **数据类型** | **说明** | +| --- | :---------: | ------------ | -------------------------------------------------- | +| 1 | version | BINARY(9) | 企业版授权说明:official(官方授权的)/trial(试用的) | +| 2 | cpu_cores | BINARY(9) | 授权使用的 CPU 核心数量 | +| 3 | dnodes | BINARY(10) | 授权使用的 dnode 节点数量 | +| 4 | streams | BINARY(10) | 授权创建的流数量 | +| 5 | users | BINARY(10) | 授权创建的用户数量 | +| 6 | accounts | BINARY(10) | 授权创建的帐户数量 | +| 7 | storage | BINARY(21) | 授权使用的存储空间大小 | +| 8 | connections | BINARY(21) | 授权使用的客户端连接数量 | +| 9 | databases | BINARY(11) | 授权使用的数据库数量 | +| 10 | speed | BINARY(9) | 授权使用的数据点每秒写入数量 | +| 11 | querytime | BINARY(9) | 授权使用的查询总时长 | +| 12 | timeseries | BINARY(21) | 授权使用的测点数量 | +| 13 | expired | BINARY(5) | 是否到期,true:到期,false:未到期 | +| 14 | expire_time | BINARY(19) | 试用期到期时间 | ## INS_VGROUPS 系统中所有 vgroups 的信息。 -| # | **列名** | **数据类型** | **说明** | -| --- | :-------: | ------------ | ---------------------------- | -| 1 | vgroup_id | INT | vgroup id | -| 2 | db_name | BINARY(32) | 数据库名 | -| 3 | tables | INT | 此 vgroup 内有多少表 | -| 4 | status | BINARY(10) | 此 vgroup 的状态 | -| 5 | v1_dnode | INT | 第一个成员所在的 dnode 的 id | -| 6 | v1_status | BINARY(10) | 第一个成员的状态 | -| 7 | v2_dnode | INT | 第二个成员所在的 dnode 的 id | -| 8 | v2_status | BINARY(10) | 第二个成员的状态 | -| 9 | v3_dnode | INT | 第三个成员所在的 dnode 的 id | -| 10 | v3_status | BINARY(10) | 第三个成员的状态 | -| 11 | nfiles | INT | TODO | -| 12 | file_size | INT | TODO | -| 13 | tsma | TINYINT | TODO | +| # | **列名** | **数据类型** | **说明** | +| --- | :-------: | ------------ | ------------------------------------------------------ | +| 1 | vgroup_id | INT | vgroup id | +| 2 | db_name | BINARY(32) | 数据库名 | +| 3 | tables | INT | 此 vgroup 内有多少表 | +| 4 | status | BINARY(10) | 此 vgroup 的状态 | +| 5 | v1_dnode | INT | 第一个成员所在的 dnode 的 id | +| 6 | v1_status | BINARY(10) | 第一个成员的状态 | +| 7 | v2_dnode | INT | 第二个成员所在的 dnode 的 id | +| 8 | v2_status | BINARY(10) | 第二个成员的状态 | +| 9 | v3_dnode | INT | 第三个成员所在的 dnode 的 id | +| 10 | v3_status | BINARY(10) | 第三个成员的状态 | +| 11 | nfiles | INT | 此 vgroup 中数据/元数据文件的数量 | +| 12 | file_size | INT | 此 vgroup 中数据/元数据文件的大小 | +| 13 | tsma | TINYINT | 此 vgroup 是否专用于 Time-range-wise SMA,1: 是, 0: 否 | ## INS_CONFIGS diff --git a/include/common/tgrant.h b/include/common/tgrant.h index 6392fcf517..97fb773044 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -49,9 +49,9 @@ int32_t grantCheck(EGrantType grant); #ifndef GRANTS_CFG #define GRANTS_SCHEMA static const SSysDbTableSchema grantsSchema[] = { \ {.name = "version", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "expire time", .bytes = 19 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "expire_time", .bytes = 19 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ {.name = "expired", .bytes = 5 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "storage(GB)", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "storage", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ {.name = "timeseries", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ {.name = "databases", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ {.name = "users", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ @@ -59,8 +59,8 @@ int32_t grantCheck(EGrantType grant); {.name = "dnodes", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ {.name = "connections", .bytes = 11 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ {.name = "streams", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "cpu cores", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ - {.name = "speed(PPS)", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "cpu_cores", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ + {.name = "speed", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ {.name = "querytime", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, \ } #define GRANT_CFG_ADD diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 9bc2ae4268..dcd35f10f7 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -337,8 +337,10 @@ static FORCE_INLINE SSchemaWrapper* tCloneSSchemaWrapper(const SSchemaWrapper* p } static FORCE_INLINE void tDeleteSSchemaWrapper(SSchemaWrapper* pSchemaWrapper) { - taosMemoryFree(pSchemaWrapper->pSchema); - taosMemoryFree(pSchemaWrapper); + if (pSchemaWrapper) { + taosMemoryFree(pSchemaWrapper->pSchema); + taosMemoryFree(pSchemaWrapper); + } } static FORCE_INLINE int32_t taosEncodeSSchema(void** buf, const SSchema* pSchema) { diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 32a53c9f4e..21d3fa92a8 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -253,7 +253,8 @@ typedef struct SShowCreateTableStmt { ENodeType type; char dbName[TSDB_DB_NAME_LEN]; char tableName[TSDB_TABLE_NAME_LEN]; - void* pCfg; // STableCfg + void* pDbCfg; // SDbCfgInfo + void* pTableCfg; // STableCfg } SShowCreateTableStmt; typedef struct SShowTableDistributedStmt { @@ -282,6 +283,7 @@ typedef struct SCreateIndexStmt { ENodeType type; EIndexType indexType; bool ignoreExists; + char indexDbName[TSDB_DB_NAME_LEN]; char indexName[TSDB_INDEX_NAME_LEN]; char dbName[TSDB_DB_NAME_LEN]; char tableName[TSDB_TABLE_NAME_LEN]; @@ -292,6 +294,7 @@ typedef struct SCreateIndexStmt { typedef struct SDropIndexStmt { ENodeType type; bool ignoreNotExists; + char indexDbName[TSDB_DB_NAME_LEN]; char indexName[TSDB_INDEX_NAME_LEN]; } SDropIndexStmt; diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 2f6bb603c1..40879de3bc 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -114,6 +114,7 @@ typedef struct SAggLogicNode { SNodeList* pAggFuncs; bool hasLastRow; bool hasTimeLineFunc; + bool onlyHasKeepOrderFunc; } SAggLogicNode; typedef struct SProjectLogicNode { @@ -552,6 +553,8 @@ typedef struct SQueryPlan { void nodesWalkPhysiPlan(SNode* pNode, FNodeWalker walker, void* pContext); +const char* dataOrderStr(EDataOrderLevel order); + #ifdef __cplusplus } #endif diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index cd2a7d3f9f..db87bde521 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -269,6 +269,7 @@ typedef struct SSelectStmt { bool hasInterpFunc; bool hasLastRowFunc; bool hasTimeLineFunc; + bool onlyHasKeepOrderFunc; bool groupSort; } SSelectStmt; diff --git a/include/util/taoserror.h b/include/util/taoserror.h index b15be12490..97a664d776 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -608,6 +608,7 @@ int32_t* taosGetErrno(); #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_REMOVE_EXISTS TAOS_DEF_ERROR_CODE(0, 0x3154) //index #define TSDB_CODE_INDEX_REBUILDING TAOS_DEF_ERROR_CODE(0, 0x3200) diff --git a/packaging/docker/bin/entrypoint.sh b/packaging/docker/bin/entrypoint.sh old mode 100644 new mode 100755 diff --git a/packaging/docker/bin/env-to-cfg b/packaging/docker/bin/env-to-cfg old mode 100644 new mode 100755 diff --git a/packaging/docker/bin/taos-check b/packaging/docker/bin/taos-check old mode 100644 new mode 100755 diff --git a/packaging/docker/dockerManifest.sh b/packaging/docker/dockerManifest.sh old mode 100644 new mode 100755 diff --git a/packaging/docker/dockerbuild.sh b/packaging/docker/dockerbuild.sh old mode 100644 new mode 100755 diff --git a/packaging/docker/dockerbuildi.sh b/packaging/docker/dockerbuildi.sh old mode 100644 new mode 100755 diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 1b0a2c2a13..0fea400725 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -1011,6 +1011,11 @@ static int32_t mndProcessCreateStbReq(SRpcMsg *pReq) { goto _OVER; } + if ((terrno = grantCheck(TSDB_GRANT_STABLE)) < 0) { + code = -1; + goto _OVER; + } + if (isAlter) { bool needRsp = false; SStbObj pDst = {0}; diff --git a/source/dnode/vnode/src/inc/sma.h b/source/dnode/vnode/src/inc/sma.h index 8cd70537de..1aee08027c 100644 --- a/source/dnode/vnode/src/inc/sma.h +++ b/source/dnode/vnode/src/inc/sma.h @@ -151,6 +151,11 @@ enum { RSMA_ROLE_ITERATE = 4, }; +enum { + RSMA_RESTORE_REBOOT = 1, + RSMA_RESTORE_SYNC = 2, +}; + void tdDestroySmaEnv(SSmaEnv *pSmaEnv); void *tdFreeSmaEnv(SSmaEnv *pSmaEnv); @@ -227,7 +232,8 @@ void tdRemoveRSmaInfoBySuid(SSma *pSma, int64_t suid); int32_t tdRSmaPersistExecImpl(SRSmaStat *pRSmaStat, SHashObj *pInfoHash); int32_t tdProcessRSmaCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, const char *tbName); -int32_t tdProcessRSmaRestoreImpl(SSma *pSma); +int32_t tdProcessRSmaRestoreImpl(SSma *pSma, int8_t type, int64_t qtaskFileVer); +int32_t tdRsmaRestore(SSma *pSma, int8_t type, int64_t committedVer); int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char *pMsg); int32_t tdProcessTSmaInsertImpl(SSma *pSma, int64_t indexUid, const char *msg); diff --git a/source/dnode/vnode/src/sma/smaOpen.c b/source/dnode/vnode/src/sma/smaOpen.c index d260b11a55..235fb1f941 100644 --- a/source/dnode/vnode/src/sma/smaOpen.c +++ b/source/dnode/vnode/src/sma/smaOpen.c @@ -123,7 +123,7 @@ int32_t smaOpen(SVnode *pVnode) { } // restore the rsma - if (rsmaRestore(pSma) < 0) { + if (tdRsmaRestore(pSma, RSMA_RESTORE_REBOOT, pVnode->state.committed) < 0) { goto _err; } } @@ -148,12 +148,14 @@ int32_t smaClose(SSma *pSma) { /** * @brief rsma env restore - * - * @param pSma - * @return int32_t + * + * @param pSma + * @param type + * @param committedVer + * @return int32_t */ -static int32_t rsmaRestore(SSma *pSma) { +int32_t tdRsmaRestore(SSma *pSma, int8_t type, int64_t committedVer) { ASSERT(VND_IS_RSMA(pSma->pVnode)); - return tdProcessRSmaRestoreImpl(pSma); + return tdProcessRSmaRestoreImpl(pSma, type, committedVer); } \ No newline at end of file diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 8d94ca491c..beebf2b0e2 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -41,12 +41,12 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId); static int32_t tdRSmaQTaskInfoIterInit(SRSmaQTaskInfoIter *pIter, STFile *pTFile); static int32_t tdRSmaQTaskInfoIterNextBlock(SRSmaQTaskInfoIter *pIter, bool *isFinish); -static int32_t tdRSmaQTaskInfoRestore(SSma *pSma, SRSmaQTaskInfoIter *pIter); +static int32_t tdRSmaQTaskInfoRestore(SSma *pSma, int8_t type, SRSmaQTaskInfoIter *pIter); static int32_t tdRSmaQTaskInfoItemRestore(SSma *pSma, const SRSmaQTaskInfoItem *infoItem); static int32_t tdRSmaRestoreQTaskInfoInit(SSma *pSma, int64_t *nTables); -static int32_t tdRSmaRestoreQTaskInfoReload(SSma *pSma, int64_t *committed); -static int32_t tdRSmaRestoreTSDataReload(SSma *pSma, int64_t committed); +static int32_t tdRSmaRestoreQTaskInfoReload(SSma *pSma, int8_t type, int64_t qTaskFileVer); +static int32_t tdRSmaRestoreTSDataReload(SSma *pSma); static SRSmaInfo *tdGetRSmaInfoByItem(SRSmaInfoItem *pItem) { // adapt accordingly if definition of SRSmaInfo update @@ -80,7 +80,7 @@ void tdRSmaQTaskInfoGetFileName(int32_t vgId, int64_t version, char *outputName) tdGetVndFileName(vgId, NULL, VNODE_RSMA_DIR, TD_QTASKINFO_FNAME_PREFIX, version, outputName); } -void tdRSmaQTaskInfoGetFullName(int32_t vgId, int64_t version, const char* path, char *outputName) { +void tdRSmaQTaskInfoGetFullName(int32_t vgId, int64_t version, const char *path, char *outputName) { tdGetVndFileName(vgId, path, VNODE_RSMA_DIR, TD_QTASKINFO_FNAME_PREFIX, version, outputName); } @@ -319,9 +319,13 @@ int32_t tdProcessRSmaCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, con pRSmaInfo = taosHashGet(RSMA_INFO_HASH(pStat), &suid, sizeof(tb_uid_t)); if (pRSmaInfo) { - ASSERT(0); // TODO: free original pRSmaInfo if exists abnormally - smaDebug("vgId:%d, rsma info already exists for table %s, %" PRIi64, SMA_VID(pSma), tbName, suid); - return TSDB_CODE_SUCCESS; + // TODO: free original pRSmaInfo if exists abnormally + tdFreeRSmaInfo(pSma, *(SRSmaInfo **)pRSmaInfo, true); + if (taosHashRemove(RSMA_INFO_HASH(pStat), &suid, sizeof(tb_uid_t)) < 0) { + terrno = TSDB_CODE_RSMA_REMOVE_EXISTS; + goto _err; + } + smaWarn("vgId:%d, remove the rsma info already exists for table %s, %" PRIi64, SMA_VID(pSma), tbName, suid); } // from write queue: single thead @@ -648,7 +652,7 @@ static int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int32_t inputType pItem->taskInfo, suid); if (qSetMultiStreamInput(pItem->taskInfo, pMsg, 1, inputType) < 0) { // INPUT__DATA_SUBMIT - smaError("vgId:%d, rsma % " PRIi8 " qSetStreamInput failed since %s", SMA_VID(pSma), level, tstrerror(terrno)); + smaError("vgId:%d, rsma %" PRIi8 " qSetStreamInput failed since %s", SMA_VID(pSma), level, tstrerror(terrno)); return TSDB_CODE_FAILED; } @@ -872,24 +876,23 @@ _err: return TSDB_CODE_FAILED; } -static int32_t tdRSmaRestoreQTaskInfoReload(SSma *pSma, int64_t *committed) { +static int32_t tdRSmaRestoreQTaskInfoReload(SSma *pSma, int8_t type, int64_t qTaskFileVer) { SVnode *pVnode = pSma->pVnode; STFile tFile = {0}; char qTaskInfoFName[TSDB_FILENAME_LEN] = {0}; - tdRSmaQTaskInfoGetFileName(TD_VID(pVnode), pVnode->state.committed, qTaskInfoFName); + tdRSmaQTaskInfoGetFileName(TD_VID(pVnode), qTaskFileVer, qTaskInfoFName); if (tdInitTFile(&tFile, tfsGetPrimaryPath(pVnode->pTfs), qTaskInfoFName) < 0) { goto _err; } if (!taosCheckExistFile(TD_TFILE_FULL_NAME(&tFile))) { - *committed = 0; - if (pVnode->state.committed > 0) { - smaWarn("vgId:%d, rsma restore for version %" PRIi64 ", not start as %s not exist", TD_VID(pVnode), - pVnode->state.committed, TD_TFILE_FULL_NAME(&tFile)); + if (qTaskFileVer > 0) { + smaWarn("vgId:%d, restore rsma task %" PRIi8 " for version %" PRIi64 ", not start as %s not exist", + TD_VID(pVnode), type, qTaskFileVer, TD_TFILE_FULL_NAME(&tFile)); } else { - smaDebug("vgId:%d, rsma restore for version %" PRIi64 ", no need as %s not exist", TD_VID(pVnode), - pVnode->state.committed, TD_TFILE_FULL_NAME(&tFile)); + smaDebug("vgId:%d, restore rsma task %" PRIi8 " for version %" PRIi64 ", no need as %s not exist", TD_VID(pVnode), + type, qTaskFileVer, TD_TFILE_FULL_NAME(&tFile)); } return TSDB_CODE_SUCCESS; } @@ -914,7 +917,7 @@ static int32_t tdRSmaRestoreQTaskInfoReload(SSma *pSma, int64_t *committed) { goto _err; } - if (tdRSmaQTaskInfoRestore(pSma, &fIter) < 0) { + if (tdRSmaQTaskInfoRestore(pSma, type, &fIter) < 0) { tdRSmaQTaskInfoIterDestroy(&fIter); tdCloseTFile(&tFile); tdDestroyTFile(&tFile); @@ -925,13 +928,13 @@ static int32_t tdRSmaRestoreQTaskInfoReload(SSma *pSma, int64_t *committed) { tdCloseTFile(&tFile); tdDestroyTFile(&tFile); - // restored successfully from committed - *committed = pVnode->state.committed; - + // restored successfully from committed or sync + smaInfo("vgId:%d, restore rsma task %" PRIi8 " for version %" PRIi64 ", qtaskinfo reload succeed", TD_VID(pVnode), + type, qTaskFileVer); return TSDB_CODE_SUCCESS; _err: - smaError("vgId:%d, rsma restore for version %" PRIi64 ", qtaskinfo reload failed since %s", TD_VID(pVnode), - pVnode->state.committed, terrstr()); + smaError("vgId:%d, restore rsma task %" PRIi8 " for version %" PRIi64 ", qtaskinfo reload failed since %s", + TD_VID(pVnode), type, qTaskFileVer, terrstr()); return TSDB_CODE_FAILED; } @@ -939,15 +942,14 @@ _err: * @brief reload ts data from checkpoint * * @param pSma - * @param committed restore from committed version * @return int32_t */ -static int32_t tdRSmaRestoreTSDataReload(SSma *pSma, int64_t committed) { +static int32_t tdRSmaRestoreTSDataReload(SSma *pSma) { // NOTHING TODO: the data would be restored from the unified WAL replay procedure return TSDB_CODE_SUCCESS; } -int32_t tdProcessRSmaRestoreImpl(SSma *pSma) { +int32_t tdProcessRSmaRestoreImpl(SSma *pSma, int8_t type, int64_t qtaskFileVer) { // step 1: iterate all stables to restore the rsma env int64_t nTables = 0; if (tdRSmaRestoreQTaskInfoInit(pSma, &nTables) < 0) { @@ -955,24 +957,24 @@ int32_t tdProcessRSmaRestoreImpl(SSma *pSma) { } if (nTables <= 0) { - smaDebug("vgId:%d, no need to restore rsma task since no tables", SMA_VID(pSma)); + smaDebug("vgId:%d, no need to restore rsma task %" PRIi8 " since no tables", SMA_VID(pSma), type); return TSDB_CODE_SUCCESS; } // step 2: retrieve qtaskinfo items from the persistence file(rsma/qtaskinfo) and restore - int64_t committed = -1; - if (tdRSmaRestoreQTaskInfoReload(pSma, &committed) < 0) { + if (tdRSmaRestoreQTaskInfoReload(pSma, type, qtaskFileVer) < 0) { goto _err; } // step 3: reload ts data from checkpoint - if (tdRSmaRestoreTSDataReload(pSma, committed) < 0) { + if (tdRSmaRestoreTSDataReload(pSma) < 0) { goto _err; } - + smaInfo("vgId:%d, restore rsma task %" PRIi8 " from qtaskf %" PRIi64 " succeed", SMA_VID(pSma), type, qtaskFileVer); return TSDB_CODE_SUCCESS; _err: - smaError("vgId:%d, failed to restore rsma task since %s", SMA_VID(pSma), terrstr()); + smaError("vgId:%d, restore rsma task %" PRIi8 "from qtaskf %" PRIi64 " failed since %s", SMA_VID(pSma), type, + qtaskFileVer, terrstr()); return TSDB_CODE_FAILED; } @@ -1101,7 +1103,7 @@ static int32_t tdRSmaQTaskInfoIterNextBlock(SRSmaQTaskInfoIter *pIter, bool *isF return TSDB_CODE_SUCCESS; } -static int32_t tdRSmaQTaskInfoRestore(SSma *pSma, SRSmaQTaskInfoIter *pIter) { +static int32_t tdRSmaQTaskInfoRestore(SSma *pSma, int8_t type, SRSmaQTaskInfoIter *pIter) { while (1) { // block iter bool isFinish = false; @@ -1117,7 +1119,7 @@ static int32_t tdRSmaQTaskInfoRestore(SSma *pSma, SRSmaQTaskInfoIter *pIter) { pIter->qBuf = taosDecodeFixedI32(pIter->qBuf, &qTaskInfoLenWithHead); if (qTaskInfoLenWithHead < RSMA_QTASKINFO_HEAD_LEN) { terrno = TSDB_CODE_TDB_FILE_CORRUPTED; - smaError("vgId:%d, restore rsma qtaskinfo file %s failed since %s", SMA_VID(pSma), + smaError("vgId:%d, restore rsma task %" PRIi8 " from qtaskinfo file %s failed since %s", SMA_VID(pSma), type, TD_TFILE_FULL_NAME(pIter->pTFile), terrstr()); return TSDB_CODE_FAILED; } @@ -1130,8 +1132,8 @@ static int32_t tdRSmaQTaskInfoRestore(SSma *pSma, SRSmaQTaskInfoIter *pIter) { infoItem.qTaskInfo = pIter->qBuf; infoItem.len = tdRSmaQTaskInfoContLen(qTaskInfoLenWithHead); // do the restore job - smaDebug("vgId:%d, restore the qtask info %s offset:%" PRIi64 "\n", SMA_VID(pSma), - TD_TFILE_FULL_NAME(pIter->pTFile), pIter->offset - pIter->nBytes + pIter->nBufPos); + smaDebug("vgId:%d, restore rsma task %" PRIi8 " from qtaskinfo file %s offset:%" PRIi64 "\n", SMA_VID(pSma), + type, TD_TFILE_FULL_NAME(pIter->pTFile), pIter->offset - pIter->nBytes + pIter->nBufPos); tdRSmaQTaskInfoItemRestore(pSma, &infoItem); pIter->qBuf = POINTER_SHIFT(pIter->qBuf, infoItem.len); diff --git a/source/dnode/vnode/src/sma/smaSnapshot.c b/source/dnode/vnode/src/sma/smaSnapshot.c index 4dda122bd7..fbcd2af751 100644 --- a/source/dnode/vnode/src/sma/smaSnapshot.c +++ b/source/dnode/vnode/src/sma/smaSnapshot.c @@ -275,7 +275,7 @@ int32_t rsmaSnapWriterOpen(SSma* pSma, int64_t sver, int64_t ever, SRsmaSnapWrit qWriter->pSma = pSma; char qTaskInfoFullName[TSDB_FILENAME_LEN]; - tdRSmaQTaskInfoGetFullName(TD_VID(pVnode), 1, tfsGetPrimaryPath(pVnode->pTfs), qTaskInfoFullName); + tdRSmaQTaskInfoGetFullName(TD_VID(pVnode), 0, tfsGetPrimaryPath(pVnode->pTfs), qTaskInfoFullName); TdFilePtr qTaskF = taosCreateFile(qTaskInfoFullName, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); if (!qTaskF) { code = TAOS_SYSTEM_ERROR(errno); @@ -323,10 +323,19 @@ int32_t rsmaSnapWriterClose(SRsmaSnapWriter** ppWriter, int8_t rollback) { // qtaskinfo if (pWriter->pQTaskFWriter) { char qTaskInfoFullName[TSDB_FILENAME_LEN]; - tdRSmaQTaskInfoGetFullName(TD_VID(pVnode), 0, tfsGetPrimaryPath(pVnode->pTfs), qTaskInfoFullName); - taosRenameFile(pWriter->pQTaskFWriter->fname, qTaskInfoFullName); + tdRSmaQTaskInfoGetFullName(TD_VID(pVnode), pWriter->ever, tfsGetPrimaryPath(pVnode->pTfs), qTaskInfoFullName); + if (taosRenameFile(pWriter->pQTaskFWriter->fname, qTaskInfoFullName) < 0) { + code = TAOS_SYSTEM_ERROR(errno); + goto _err; + } smaInfo("vgId:%d, vnode snapshot rsma writer rename %s to %s", SMA_VID(pWriter->pSma), pWriter->pQTaskFWriter->fname, qTaskInfoFullName); + + // rsma restore + if ((code = tdRsmaRestore(pWriter->pSma, RSMA_RESTORE_SYNC, pWriter->ever)) < 0) { + goto _err; + } + smaInfo("vgId:%d, vnode snapshot rsma writer restore from %s succeed", SMA_VID(pWriter->pSma), qTaskInfoFullName); } } diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 265e20e55e..cadb6fefd2 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -408,6 +408,10 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd goto _end; } + if (VND_IS_TSMA(pVnode)) { + tsdbDebug("vgId:%d, tsma is selected to query", TD_VID(pVnode)); + } + initReaderStatus(&pReader->status); pReader->pTsdb = getTsdbByRetentions(pVnode, pCond->twindows.skey, pVnode->config.tsdbCfg.retentions, idstr, &level); @@ -1906,20 +1910,19 @@ static STsdb* getTsdbByRetentions(SVnode* pVnode, TSKEY winSKey, SRetention* ret ++level; } - int32_t vgId = TD_VID(pVnode); const char* str = (idStr != NULL) ? idStr : ""; if (level == TSDB_RETENTION_L0) { *pLevel = TSDB_RETENTION_L0; - tsdbDebug("vgId:%d, rsma level %d is selected to query %s", vgId, TSDB_RETENTION_L0, str); + tsdbDebug("vgId:%d, rsma level %d is selected to query %s", TD_VID(pVnode), TSDB_RETENTION_L0, str); return VND_RSMA0(pVnode); } else if (level == TSDB_RETENTION_L1) { *pLevel = TSDB_RETENTION_L1; - tsdbDebug("vgId:%d, rsma level %d is selected to query %s", vgId, TSDB_RETENTION_L1, str); + tsdbDebug("vgId:%d, rsma level %d is selected to query %s", TD_VID(pVnode), TSDB_RETENTION_L1, str); return VND_RSMA1(pVnode); } else { *pLevel = TSDB_RETENTION_L2; - tsdbDebug("vgId:%d, rsma level %d is selected to query %s", vgId, TSDB_RETENTION_L2, str); + tsdbDebug("vgId:%d, rsma level %d is selected to query %s", TD_VID(pVnode), TSDB_RETENTION_L2, str); return VND_RSMA2(pVnode); } } diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 0738dfa057..60f430f058 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -491,6 +491,11 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t version, void *pR goto _exit; } + if ((terrno = grantCheck(TSDB_GRANT_TABLE)) < 0) { + rcode = -1; + goto _exit; + } + // validate hash sprintf(tbName, "%s.%s", pVnode->config.dbname, pCreateReq->name); if (vnodeValidateTableHash(pVnode, tbName) < 0) { @@ -841,6 +846,13 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq goto _exit; } + if ((terrno = grantCheck(TSDB_GRANT_TABLE)) < 0) { + pRsp->code = terrno; + tDecoderClear(&decoder); + taosArrayDestroy(createTbReq.ctb.tagName); + goto _exit; + } + if (metaCreateTable(pVnode->pMeta, version, &createTbReq) < 0) { if (terrno != TSDB_CODE_TDB_TABLE_ALREADY_EXIST) { submitBlkRsp.code = terrno; diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 5c5163eb41..f3550bf2ee 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -19,9 +19,8 @@ #define BATCH_DISABLE 1 static inline bool vnodeIsMsgBlock(tmsg_t type) { - return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_CREATE_TABLE) || - (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) || (type == TDMT_VND_UPDATE_TAG_VAL) || - (type == TDMT_VND_ALTER_REPLICA); + return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) || + (type == TDMT_VND_UPDATE_TAG_VAL) || (type == TDMT_VND_ALTER_REPLICA); } static inline bool vnodeIsMsgWeak(tmsg_t type) { return false; } @@ -325,16 +324,7 @@ int32_t vnodeProcessSyncMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) { return -1; } -#if 1 - do { - char *syncNodeStr = sync2SimpleStr(pVnode->sync); - static int64_t vndTick = 0; - if (++vndTick % 10 == 1) { - vGTrace("vgId:%d, sync trace msg:%s, %s", syncGetVgId(pVnode->sync), TMSG_INFO(pMsg->msgType), syncNodeStr); - } - taosMemoryFree(syncNodeStr); - } while (0); -#endif + vGTrace("vgId:%d, sync msg:%p will be processed, type:%s", pVnode->config.vgId, pMsg, TMSG_INFO(pMsg->msgType)); if (syncNodeStrategy(pSyncNode) == SYNC_STRATEGY_NO_SNAPSHOT) { if (pMsg->msgType == TDMT_SYNC_TIMEOUT) { @@ -458,6 +448,7 @@ int32_t vnodeProcessSyncMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) { } } + vTrace("vgId:%d, sync msg:%p is processed, type:%s code:0x%x", pVnode->config.vgId, pMsg, TMSG_INFO(pMsg->msgType), code); syncNodeRelease(pSyncNode); if (code != 0 && terrno == 0) { terrno = TSDB_CODE_SYN_INTERNAL_ERROR; @@ -619,10 +610,10 @@ static int32_t vnodeSnapshotStartWrite(struct SSyncFSM *pFsm, void *pParam, void do { int32_t itemSize = tmsgGetQueueSize(&pVnode->msgCb, pVnode->config.vgId, APPLY_QUEUE); if (itemSize == 0) { - vDebug("vgId:%d, apply queue is empty, start write snapshot", pVnode->config.vgId); + vInfo("vgId:%d, start write vnode snapshot since apply queue is empty", pVnode->config.vgId); break; } else { - vDebug("vgId:%d, %d items in apply queue, write snapshot later", pVnode->config.vgId); + vInfo("vgId:%d, write vnode snapshot later since %d items in apply queue", pVnode->config.vgId); taosMsleep(10); } } while (true); @@ -638,10 +629,11 @@ static int32_t vnodeSnapshotStartWrite(struct SSyncFSM *pFsm, void *pParam, void static int32_t vnodeSnapshotStopWrite(struct SSyncFSM *pFsm, void *pWriter, bool isApply, SSnapshot *pSnapshot) { #ifdef USE_TSDB_SNAPSHOT SVnode *pVnode = pFsm->data; - vDebug("vgId:%d, stop write snapshot, isApply:%d", pVnode->config.vgId, isApply); + vInfo("vgId:%d, stop write vnode snapshot, apply:%d, index:%" PRId64 " term:%" PRIu64 " config:%" PRId64, pVnode->config.vgId, isApply, + pSnapshot->lastApplyIndex, pSnapshot->lastApplyTerm, pSnapshot->lastApplyIndex); int32_t code = vnodeSnapWriterClose(pWriter, !isApply, pSnapshot); - vDebug("vgId:%d, apply snapshot to vnode, code:0x%x", pVnode->config.vgId, code); + vInfo("vgId:%d, apply vnode snapshot finished, code:0x%x", pVnode->config.vgId, code); return code; #else taosMemoryFree(pWriter); @@ -652,8 +644,9 @@ static int32_t vnodeSnapshotStopWrite(struct SSyncFSM *pFsm, void *pWriter, bool static int32_t vnodeSnapshotDoWrite(struct SSyncFSM *pFsm, void *pWriter, void *pBuf, int32_t len) { #ifdef USE_TSDB_SNAPSHOT SVnode *pVnode = pFsm->data; + vDebug("vgId:%d, continue write vnode snapshot, len:%d", pVnode->config.vgId, len); int32_t code = vnodeSnapWrite(pWriter, pBuf, len); - vTrace("vgId:%d, write snapshot, len:%d", pVnode->config.vgId, len); + vDebug("vgId:%d, continue write vnode snapshot finished, len:%d", pVnode->config.vgId, len); return code; #else return 0; diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 2ff76f937d..1b2489acd6 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -192,6 +192,26 @@ char* buildRetension(SArray* pRetension) { return p1; } +static const char* cacheModelStr(int8_t cacheModel) { + switch (cacheModel) { + case TSDB_CACHE_MODEL_NONE: + return TSDB_CACHE_MODEL_NONE_STR; + case TSDB_CACHE_MODEL_LAST_ROW: + return TSDB_CACHE_MODEL_LAST_ROW_STR; + case TSDB_CACHE_MODEL_LAST_VALUE: + return TSDB_CACHE_MODEL_LAST_VALUE_STR; + case TSDB_CACHE_MODEL_BOTH: + return TSDB_CACHE_MODEL_BOTH_STR; + default: + break; + } + return TSDB_CACHE_MODEL_NONE_STR; +} + +static const char* strictStr(int8_t strict) { + return TSDB_DB_STRICT_ON == strict ? TSDB_DB_STRICT_ON_STR : TSDB_DB_STRICT_OFF_STR; +} + static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, SDbCfgInfo* pCfg) { blockDataEnsureCapacity(pBlock, 1); pBlock->info.rows = 1; @@ -222,14 +242,15 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S char* retentions = buildRetension(pCfg->pRetensions); - len += sprintf(buf2 + VARSTR_HEADER_SIZE, - "CREATE DATABASE `%s` BUFFER %d CACHEMODEL %d COMP %d DURATION %dm " - "FSYNC %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d " - "STRICT %d WAL %d VGROUPS %d SINGLE_STABLE %d", - dbFName, pCfg->buffer, pCfg->cacheLast, pCfg->compression, pCfg->daysPerFile, pCfg->walFsyncPeriod, - pCfg->maxRows, pCfg->minRows, pCfg->daysToKeep0, pCfg->daysToKeep1, pCfg->daysToKeep2, pCfg->pages, - pCfg->pageSize, prec, pCfg->replications, pCfg->strict, pCfg->walLevel, pCfg->numOfVgroups, - 1 == pCfg->numOfStables); + len += sprintf( + buf2 + VARSTR_HEADER_SIZE, + "CREATE DATABASE `%s` BUFFER %d CACHEMODEL '%s' COMP %d DURATION %dm " + "WAL_FSYNC_PERIOD %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d " + "STRICT '%s' WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d", + dbFName, pCfg->buffer, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile, pCfg->walFsyncPeriod, + pCfg->maxRows, pCfg->minRows, pCfg->daysToKeep0, pCfg->daysToKeep1, pCfg->daysToKeep2, pCfg->pages, + pCfg->pageSize, prec, pCfg->replications, strictStr(pCfg->strict), pCfg->walLevel, pCfg->numOfVgroups, + 1 == pCfg->numOfStables); if (retentions) { len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, " RETENTIONS %s", retentions); @@ -383,21 +404,21 @@ int32_t appendTagValues(char* buf, int32_t* len, STableCfg* pCfg) { return TSDB_CODE_SUCCESS; } -void appendTableOptions(char* buf, int32_t* len, STableCfg* pCfg) { +void appendTableOptions(char* buf, int32_t* len, SDbCfgInfo* pDbCfg, STableCfg* pCfg) { if (pCfg->commentLen > 0) { *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, " COMMENT '%s'", pCfg->pComment); } else if (0 == pCfg->commentLen) { *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, " COMMENT ''"); } - if (pCfg->watermark1 > 0) { + if (NULL != pDbCfg->pRetensions && pCfg->watermark1 > 0) { *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, " WATERMARK %" PRId64 "a", pCfg->watermark1); if (pCfg->watermark2 > 0) { *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, ", %" PRId64 "a", pCfg->watermark2); } } - if (pCfg->delay1 > 0) { + if (NULL != pDbCfg->pRetensions && pCfg->delay1 > 0) { *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, " MAX_DELAY %" PRId64 "a", pCfg->delay1); if (pCfg->delay2 > 0) { *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, ", %" PRId64 "a", pCfg->delay2); @@ -405,7 +426,7 @@ void appendTableOptions(char* buf, int32_t* len, STableCfg* pCfg) { } int32_t funcNum = taosArrayGetSize(pCfg->pFuncs); - if (funcNum > 0) { + if (NULL != pDbCfg->pRetensions && funcNum > 0) { *len += sprintf(buf + VARSTR_HEADER_SIZE + *len, " ROLLUP("); for (int32_t i = 0; i < funcNum; ++i) { char* pFunc = taosArrayGet(pCfg->pFuncs, i); @@ -419,7 +440,7 @@ void appendTableOptions(char* buf, int32_t* len, STableCfg* pCfg) { } } -static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, char* tbName, STableCfg* pCfg) { +static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* pDbCfg, char* tbName, STableCfg* pCfg) { int32_t code = 0; blockDataEnsureCapacity(pBlock, 1); pBlock->info.rows = 1; @@ -439,7 +460,7 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, char* tbName, len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, ") TAGS ("); appendTagFields(buf2, &len, pCfg); len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, ")"); - appendTableOptions(buf2, &len, pCfg); + appendTableOptions(buf2, &len, pDbCfg, pCfg); } else if (TSDB_CHILD_TABLE == pCfg->tableType) { len += sprintf(buf2 + VARSTR_HEADER_SIZE, "CREATE TABLE `%s` USING `%s` (", tbName, pCfg->stbName); appendTagNameFields(buf2, &len, pCfg); @@ -449,7 +470,7 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, char* tbName, return code; } len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, ")"); - appendTableOptions(buf2, &len, pCfg); + appendTableOptions(buf2, &len, pDbCfg, pCfg); } else { len += sprintf(buf2 + VARSTR_HEADER_SIZE, "CREATE TABLE `%s` (", tbName); appendColumnFields(buf2, &len, pCfg); @@ -465,7 +486,7 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, char* tbName, static int32_t execShowCreateTable(SShowCreateTableStmt* pStmt, SRetrieveTableRsp** pRsp) { SSDataBlock* pBlock = buildCreateTbResultDataBlock(); - int32_t code = setCreateTBResultIntoDataBlock(pBlock, pStmt->tableName, pStmt->pCfg); + int32_t code = setCreateTBResultIntoDataBlock(pBlock, pStmt->pDbCfg, pStmt->tableName, pStmt->pTableCfg); if (code) { return code; } @@ -473,7 +494,7 @@ static int32_t execShowCreateTable(SShowCreateTableStmt* pStmt, SRetrieveTableRs } static int32_t execShowCreateSTable(SShowCreateTableStmt* pStmt, SRetrieveTableRsp** pRsp) { - STableCfg* pCfg = (STableCfg*)pStmt->pCfg; + STableCfg* pCfg = (STableCfg*)pStmt->pTableCfg; if (TSDB_SUPER_TABLE != pCfg->tableType) { terrno = TSDB_CODE_TSC_NOT_STABLE_ERROR; return terrno; diff --git a/source/libs/executor/inc/executil.h b/source/libs/executor/inc/executil.h index c3dad1ed7c..ee96bc693d 100644 --- a/source/libs/executor/inc/executil.h +++ b/source/libs/executor/inc/executil.h @@ -90,6 +90,7 @@ struct SResultRowEntryInfo* getResultEntryInfo(const SResultRow* pRow, int32_t i static FORCE_INLINE SResultRow* getResultRowByPos(SDiskbasedBuf* pBuf, SResultRowPosition* pos) { SFilePage* bufPage = (SFilePage*)getBufPage(pBuf, pos->pageId); + setBufPageDirty(bufPage, true); SResultRow* pRow = (SResultRow*)((char*)bufPage + pos->offset); return pRow; } diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 16075ec1f1..b62ff2bef1 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -844,6 +844,7 @@ void initBasicInfo(SOptrBasicInfo* pInfo, SSDataBlock* pBlock); void cleanupBasicInfo(SOptrBasicInfo* pInfo); int32_t initExprSupp(SExprSupp* pSup, SExprInfo* pExprInfo, int32_t numOfExpr); void cleanupExprSupp(SExprSupp* pSup); +void destroyExprInfo(SExprInfo* pExpr, int32_t numOfExprs); int32_t initAggInfo(SExprSupp *pSup, SAggSupporter* pAggSup, SExprInfo* pExprInfo, int32_t numOfCols, size_t keyBufSize, const char* pkey); void initResultSizeInfo(SResultInfo * pResultInfo, int32_t numOfRows); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 531fae2ab2..c0afd7adac 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -3329,17 +3329,19 @@ static SSDataBlock* doFill(SOperatorInfo* pOperator) { return fillResult; } -static void destroyExprInfo(SExprInfo* pExpr, int32_t numOfExprs) { - for (int32_t i = 0; i < numOfExprs; ++i) { - SExprInfo* pExprInfo = &pExpr[i]; - for (int32_t j = 0; j < pExprInfo->base.numOfParams; ++j) { - if (pExprInfo->base.pParam[j].type == FUNC_PARAM_TYPE_COLUMN) { - taosMemoryFreeClear(pExprInfo->base.pParam[j].pCol); +void destroyExprInfo(SExprInfo* pExpr, int32_t numOfExprs) { + if (pExpr) { + for (int32_t i = 0; i < numOfExprs; ++i) { + SExprInfo* pExprInfo = &pExpr[i]; + for (int32_t j = 0; j < pExprInfo->base.numOfParams; ++j) { + if (pExprInfo->base.pParam[j].type == FUNC_PARAM_TYPE_COLUMN) { + taosMemoryFreeClear(pExprInfo->base.pParam[j].pCol); + } } - } - taosMemoryFree(pExprInfo->base.pParam); - taosMemoryFree(pExprInfo->pExpr); + taosMemoryFree(pExprInfo->base.pParam); + taosMemoryFree(pExprInfo->pExpr); + } } } @@ -3770,11 +3772,7 @@ SSchemaWrapper* extractQueriedColumnSchema(SScanPhysiNode* pScanNode) { static void cleanupTableSchemaInfo(SSchemaInfo* pSchemaInfo) { taosMemoryFreeClear(pSchemaInfo->dbname); - if (pSchemaInfo->sw == NULL) { - return; - } - - taosMemoryFree(pSchemaInfo->tablename); + taosMemoryFreeClear(pSchemaInfo->tablename); tDeleteSSchemaWrapper(pSchemaInfo->sw); tDeleteSSchemaWrapper(pSchemaInfo->qsw); } diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index 53e25c7e97..9a7c3cf7fb 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -56,6 +56,8 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys goto _error; } + pOperator->pTaskInfo = pTaskInfo; + int32_t numOfCols = 0; SExprInfo* pExprInfo = createExprInfo(pProjPhyNode->pProjections, NULL, &numOfCols); @@ -63,7 +65,7 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys initLimitInfo(pProjPhyNode->node.pLimit, pProjPhyNode->node.pSlimit, &pInfo->limitInfo); pInfo->binfo.pRes = pResBlock; - pInfo->pFinalRes = createOneDataBlock(pResBlock, false); + pInfo->pFinalRes = createOneDataBlock(pResBlock, false); pInfo->pFilterNode = pProjPhyNode->node.pConditions; pInfo->mergeDataBlocks = pProjPhyNode->mergeDataBlock; @@ -73,7 +75,6 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys pInfo->mergeDataBlocks = false; } - int32_t numOfRows = 4096; size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; @@ -89,12 +90,11 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys setFunctionResultOutput(pOperator, &pInfo->binfo, &pInfo->aggSup, MAIN_SCAN, numOfCols); pInfo->pPseudoColInfo = setRowTsColumnOutputInfo(pOperator->exprSupp.pCtx, numOfCols); - pOperator->name = "ProjectOperator"; + pOperator->name = "ProjectOperator"; pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_PROJECT; - pOperator->blocking = false; - pOperator->status = OP_NOT_OPENED; - pOperator->info = pInfo; - pOperator->pTaskInfo = pTaskInfo; + pOperator->blocking = false; + pOperator->status = OP_NOT_OPENED; + pOperator->info = pInfo; pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doProjectOperation, NULL, NULL, destroyProjectOperatorInfo, NULL, NULL, NULL); @@ -106,7 +106,7 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys return pOperator; - _error: +_error: pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY; return NULL; } @@ -156,7 +156,8 @@ static int32_t setInfoForNewGroup(SSDataBlock* pBlock, SLimitInfo* pLimitInfo, S return PROJECT_RETRIEVE_DONE; } -static int32_t doIngroupLimitOffset(SLimitInfo* pLimitInfo, uint64_t groupId, SSDataBlock* pBlock, SOperatorInfo* pOperator) { +static int32_t doIngroupLimitOffset(SLimitInfo* pLimitInfo, uint64_t groupId, SSDataBlock* pBlock, + SOperatorInfo* pOperator) { // set current group id pLimitInfo->currentGroupId = groupId; @@ -170,8 +171,7 @@ static int32_t doIngroupLimitOffset(SLimitInfo* pLimitInfo, uint64_t groupId, SS } // check for the limitation in each group - if (pLimitInfo->limit.limit >= 0 && - pLimitInfo->numOfOutputRows + pBlock->info.rows >= pLimitInfo->limit.limit) { + if (pLimitInfo->limit.limit >= 0 && pLimitInfo->numOfOutputRows + pBlock->info.rows >= pLimitInfo->limit.limit) { int32_t keepRows = (int32_t)(pLimitInfo->limit.limit - pLimitInfo->numOfOutputRows); blockDataKeepFirstNRows(pBlock, keepRows); if (pLimitInfo->slimit.limit > 0 && pLimitInfo->slimit.limit <= pLimitInfo->numOfOutputGroups) { @@ -222,7 +222,7 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { } SOperatorInfo* downstream = pOperator->pDownstream[0]; - SLimitInfo* pLimitInfo = &pProjectInfo->limitInfo; + SLimitInfo* pLimitInfo = &pProjectInfo->limitInfo; if (downstream == NULL) { return doGenerateSourceData(pOperator); @@ -317,7 +317,7 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { if (pOperator->cost.openCost == 0) { pOperator->cost.openCost = (taosGetTimestampUs() - st) / 1000.0; } - + // printDataBlock1(p, "project"); return (p->info.rows > 0) ? p : NULL; } @@ -330,6 +330,8 @@ SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhy goto _error; } + pOperator->pTaskInfo = pTaskInfo; + SExprSupp* pSup = &pOperator->exprSupp; SIndefRowsFuncPhysiNode* pPhyNode = (SIndefRowsFuncPhysiNode*)pNode; @@ -373,7 +375,6 @@ SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhy pOperator->blocking = false; pOperator->status = OP_NOT_OPENED; pOperator->info = pInfo; - pOperator->pTaskInfo = pTaskInfo; pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doApplyIndefinitFunction, NULL, NULL, destroyIndefinitOperatorInfo, NULL, NULL, NULL); @@ -385,7 +386,7 @@ SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhy return pOperator; - _error: +_error: taosMemoryFree(pInfo); taosMemoryFree(pOperator); pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY; @@ -593,7 +594,7 @@ SSDataBlock* doGenerateSourceData(SOperatorInfo* pOperator) { pRes->info.rows = 1; doFilter(pProjectInfo->pFilterNode, pRes, NULL); - /*int32_t status = */doIngroupLimitOffset(&pProjectInfo->limitInfo, 0, pRes, pOperator); + /*int32_t status = */ doIngroupLimitOffset(&pProjectInfo->limitInfo, 0, pRes, pOperator); pOperator->resultInfo.totalRows += pRes->info.rows; diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c index e371e6d9cf..16f35b1b0d 100644 --- a/source/libs/executor/src/sortoperator.c +++ b/source/libs/executor/src/sortoperator.c @@ -30,6 +30,7 @@ SOperatorInfo* createSortOperatorInfo(SOperatorInfo* downstream, SSortPhysiNode* goto _error; } + pOperator->pTaskInfo = pTaskInfo; SDataBlockDescNode* pDescNode = pSortNode->node.pOutputDataBlockDesc; int32_t numOfCols = 0; @@ -45,7 +46,7 @@ SOperatorInfo* createSortOperatorInfo(SOperatorInfo* downstream, SSortPhysiNode* initResultSizeInfo(&pOperator->resultInfo, 1024); pInfo->binfo.pRes = pResBlock; - pInfo->pSortInfo = createSortInfo(pSortNode->pSortKeys); + pInfo->pSortInfo = createSortInfo(pSortNode->pSortKeys); pInfo->pCondition = pSortNode->node.pConditions; pInfo->pColMatchInfo = pColMatchColInfo; initLimitInfo(pSortNode->node.pLimit, pSortNode->node.pSlimit, &pInfo->limitInfo); @@ -57,7 +58,6 @@ SOperatorInfo* createSortOperatorInfo(SOperatorInfo* downstream, SSortPhysiNode* pOperator->info = pInfo; pOperator->exprSupp.pExprInfo = pExprInfo; pOperator->exprSupp.numOfExprs = numOfCols; - pOperator->pTaskInfo = pTaskInfo; // lazy evaluation for the following parameter since the input datablock is not known till now. // pInfo->bufPageSize = rowSize < 1024 ? 1024 * 2 : rowSize * 2; @@ -222,7 +222,7 @@ SSDataBlock* doSort(SOperatorInfo* pOperator) { } // todo add the limit/offset info - if (pInfo->limitInfo.remainOffset > 0) { + if (pInfo->limitInfo.remainOffset > 0) { if (pInfo->limitInfo.remainOffset >= blockDataGetNumOfRows(pBlock)) { pInfo->limitInfo.remainOffset -= pBlock->info.rows; continue; @@ -247,7 +247,7 @@ SSDataBlock* doSort(SOperatorInfo* pOperator) { } } - return blockDataGetNumOfRows(pBlock) > 0? pBlock:NULL; + return blockDataGetNumOfRows(pBlock) > 0 ? pBlock : NULL; } void destroyOrderOperatorInfo(void* param, int32_t numOfOutput) { @@ -474,7 +474,7 @@ void destroyGroupSortOperatorInfo(void* param, int32_t numOfOutput) { taosArrayDestroy(pInfo->pSortInfo); taosArrayDestroy(pInfo->pColMatchInfo); - + taosMemoryFreeClear(param); } @@ -609,8 +609,7 @@ SSDataBlock* getMultiwaySortedBlockData(SSortHandle* pHandle, SSDataBlock* pData pInfo->groupId = tsortGetGroupId(pTupleHandle); pInfo->prefetchedTuple = NULL; } - } - else { + } else { pTupleHandle = tsortNextTuple(pHandle); pInfo->groupId = 0; } @@ -694,7 +693,7 @@ void destroyMultiwayMergeOperatorInfo(void* param, int32_t numOfOutput) { tsortDestroySortHandle(pInfo->pSortHandle); taosArrayDestroy(pInfo->pSortInfo); taosArrayDestroy(pInfo->pColMatchInfo); - + taosMemoryFreeClear(param); } @@ -711,7 +710,7 @@ int32_t getMultiwayMergeExplainExecInfo(SOperatorInfo* pOptr, void** pOptrExplai } SOperatorInfo* createMultiwayMergeOperatorInfo(SOperatorInfo** downStreams, size_t numStreams, - SMergePhysiNode* pMergePhyNode, SExecTaskInfo* pTaskInfo) { + SMergePhysiNode* pMergePhyNode, SExecTaskInfo* pTaskInfo) { SPhysiNode* pPhyNode = (SPhysiNode*)pMergePhyNode; SMultiwayMergeOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SMultiwayMergeOperatorInfo)); diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index d1bc6dea29..c8951c30b6 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1791,6 +1791,7 @@ SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SExprInfo* goto _error; } + pOperator->pTaskInfo = pTaskInfo; pInfo->win = pTaskInfo->window; pInfo->inputOrder = (pPhyNode->window.inputTsOrder == ORDER_ASC) ? TSDB_ORDER_ASC : TSDB_ORDER_DESC; pInfo->resultTsOrder = (pPhyNode->window.outputTsOrder == ORDER_ASC) ? TSDB_ORDER_ASC : TSDB_ORDER_DESC; @@ -1846,7 +1847,6 @@ SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SExprInfo* pOperator->blocking = true; pOperator->status = OP_NOT_OPENED; pOperator->exprSupp.pExprInfo = pExprInfo; - pOperator->pTaskInfo = pTaskInfo; pOperator->exprSupp.numOfExprs = numOfCols; pOperator->info = pInfo; @@ -1881,6 +1881,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SExpr goto _error; } + pOperator->pTaskInfo = pTaskInfo; pInfo->inputOrder = TSDB_ORDER_ASC; pInfo->interval = *pInterval; pInfo->execModel = OPTR_EXEC_MODEL_STREAM; @@ -1907,7 +1908,6 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SExpr pOperator->blocking = true; pOperator->status = OP_NOT_OPENED; pOperator->exprSupp.pExprInfo = pExprInfo; - pOperator->pTaskInfo = pTaskInfo; pOperator->exprSupp.numOfExprs = numOfCols; pOperator->info = pInfo; @@ -3028,6 +3028,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, goto _error; } + pOperator->pTaskInfo = pTaskInfo; pInfo->order = TSDB_ORDER_ASC; pInfo->interval = (SInterval){.interval = pIntervalPhyNode->interval, .sliding = pIntervalPhyNode->sliding, @@ -3114,7 +3115,6 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, pOperator->blocking = true; pOperator->status = OP_NOT_OPENED; pOperator->exprSupp.pExprInfo = pExprInfo; - pOperator->pTaskInfo = pTaskInfo; pOperator->exprSupp.numOfExprs = numOfCols; pOperator->info = pInfo; @@ -3246,6 +3246,8 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh goto _error; } + pOperator->pTaskInfo = pTaskInfo; + initResultSizeInfo(&pOperator->resultInfo, 4096); if (pSessionNode->window.pExprs != NULL) { int32_t numOfScalar = 0; @@ -3308,7 +3310,6 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doStreamSessionAgg, NULL, NULL, destroyStreamSessionAggOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL); - pOperator->pTaskInfo = pTaskInfo; if (downstream) { initDownStream(downstream, &pInfo->streamAggSup, pInfo->gap, pInfo->twAggSup.waterMark, pOperator->operatorType); code = appendDownstream(pOperator, &downstream, 1); diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 6383179fee..ae07651402 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -19,6 +19,7 @@ #include "querynodes.h" #include "scalar.h" #include "taoserror.h" +#include "ttime.h" static int32_t buildFuncErrMsg(char* pErrBuf, int32_t len, int32_t errCode, const char* pFormat, ...) { va_list vArgList; @@ -1442,6 +1443,58 @@ static int32_t translateIrate(SFunctionNode* pFunc, char* pErrBuf, int32_t len) return TSDB_CODE_SUCCESS; } +static int32_t translateInterp(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + int32_t numOfParams = LIST_LENGTH(pFunc->pParameterList); + uint8_t dbPrec = pFunc->node.resType.precision; + + if (1 != numOfParams && 3 != numOfParams && 4 != numOfParams) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + if (3 <= numOfParams) { + int64_t timeVal[2] = {0}; + for (int32_t i = 1; i < 3; ++i) { + uint8_t nodeType = nodeType(nodesListGetNode(pFunc->pParameterList, i)); + uint8_t paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, i))->resType.type; + if (!IS_VAR_DATA_TYPE(paraType) || QUERY_NODE_VALUE != nodeType) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + SValueNode* pValue = (SValueNode*)nodesListGetNode(pFunc->pParameterList, i); + int32_t ret = convertStringToTimestamp(paraType, pValue->datum.p, dbPrec, &timeVal[i - 1]); + if (ret != TSDB_CODE_SUCCESS) { + return invaildFuncParaValueErrMsg(pErrBuf, len, pFunc->functionName); + } + } + + if (timeVal[0] > timeVal[1]) { + return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, + "INTERP function invalid time range"); + } + } + + if (4 == numOfParams) { + uint8_t nodeType = nodeType(nodesListGetNode(pFunc->pParameterList, 3)); + uint8_t paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 3))->resType.type; + if (!IS_INTEGER_TYPE(paraType) || QUERY_NODE_VALUE != nodeType) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + int32_t ret = validateTimeUnitParam(dbPrec, (SValueNode*)nodesListGetNode(pFunc->pParameterList, 3)); + if (ret == TIME_UNIT_TOO_SMALL) { + return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, + "INTERP function time interval parameter should be greater than db precision"); + } else if (ret == TIME_UNIT_INVALID) { + return buildFuncErrMsg( + pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, + "INTERP function time interval parameter should be one of the following: [1b, 1u, 1a, 1s, 1m, 1h, 1d, 1w]"); + } + } + + pFunc->node.resType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType; + return TSDB_CODE_SUCCESS; +} + static int32_t translateFirstLast(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { // forbid null as first/last input, since first(c0, null, 1) may have different number of input int32_t numOfParams = LIST_LENGTH(pFunc->pParameterList); @@ -2237,7 +2290,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .name = "interp", .type = FUNCTION_TYPE_INTERP, .classification = FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_INTERVAL_INTERPO_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | FUNC_MGT_FORBID_STREAM_FUNC, - .translateFunc = translateFirstLast, + .translateFunc = translateInterp, .getEnvFunc = getSelectivityFuncEnv, .initFunc = functionSetup, .processFunc = NULL, @@ -2246,7 +2299,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "derivative", .type = FUNCTION_TYPE_DERIVATIVE, - .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | FUNC_MGT_CUMULATIVE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC, + .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | + FUNC_MGT_KEEP_ORDER_FUNC | FUNC_MGT_CUMULATIVE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC, .translateFunc = translateDerivative, .getEnvFunc = getDerivativeFuncEnv, .initFunc = derivativeFuncSetup, @@ -2453,7 +2507,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "diff", .type = FUNCTION_TYPE_DIFF, - .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_CUMULATIVE_FUNC, + .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_KEEP_ORDER_FUNC | + FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_CUMULATIVE_FUNC, .translateFunc = translateDiff, .getEnvFunc = getDiffFuncEnv, .initFunc = diffFunctionSetup, @@ -2487,7 +2542,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "csum", .type = FUNCTION_TYPE_CSUM, - .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_CUMULATIVE_FUNC, + .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | + FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_CUMULATIVE_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, .translateFunc = translateCsum, .getEnvFunc = getCsumFuncEnv, .initFunc = functionSetup, @@ -2856,7 +2912,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "tbname", .type = FUNCTION_TYPE_TBNAME, - .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_SCAN_PC_FUNC, + .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_SCAN_PC_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, .translateFunc = translateTbnameColumn, .getEnvFunc = NULL, .initFunc = NULL, @@ -2896,7 +2952,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "_wstart", .type = FUNCTION_TYPE_WSTART, - .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC, + .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, .translateFunc = translateTimePseudoColumn, .getEnvFunc = getTimePseudoFuncEnv, .initFunc = NULL, @@ -2906,7 +2962,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "_wend", .type = FUNCTION_TYPE_WEND, - .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC, + .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, .translateFunc = translateTimePseudoColumn, .getEnvFunc = getTimePseudoFuncEnv, .initFunc = NULL, @@ -2916,7 +2972,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "_wduration", .type = FUNCTION_TYPE_WDURATION, - .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC, + .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_WINDOW_PC_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, .translateFunc = translateWduration, .getEnvFunc = getTimePseudoFuncEnv, .initFunc = NULL, @@ -2964,7 +3020,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "_group_key", .type = FUNCTION_TYPE_GROUP_KEY, - .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SELECT_FUNC, + .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, .translateFunc = translateGroupKey, .getEnvFunc = getGroupKeyFuncEnv, .initFunc = functionSetup, diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 38c35e382a..e78a78e7d8 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -28,7 +28,6 @@ #define HISTOGRAM_MAX_BINS_NUM 1000 #define MAVG_MAX_POINTS_NUM 1000 -#define SAMPLE_MAX_POINTS_NUM 1000 #define TAIL_MAX_POINTS_NUM 100 #define TAIL_MAX_OFFSET 100 @@ -4898,9 +4897,7 @@ bool sampleFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) pInfo->numSampled = 0; pInfo->colType = pCtx->resDataInfo.type; pInfo->colBytes = pCtx->resDataInfo.bytes; - if (pInfo->samples < 1 || pInfo->samples > SAMPLE_MAX_POINTS_NUM) { - return false; - } + pInfo->data = (char*)pInfo + sizeof(SSampleInfo); pInfo->tuplePos = (STuplePos*)((char*)pInfo + sizeof(SSampleInfo) + pInfo->samples * pInfo->colBytes); diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index afacb50d35..d5a3e91eea 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -976,8 +976,12 @@ int32_t cleanUpUdfs() { } uv_mutex_lock(&gUdfdProxy.udfStubsMutex); - int32_t i = 0; + if (gUdfdProxy.udfStubs == NULL || taosArrayGetSize(gUdfdProxy.udfStubs) == 0) { + uv_mutex_unlock(&gUdfdProxy.udfStubsMutex); + return TSDB_CODE_SUCCESS; + } SArray* udfStubs = taosArrayInit(16, sizeof(SUdfcFuncStub)); + int32_t i = 0; while (i < taosArrayGetSize(gUdfdProxy.udfStubs)) { SUdfcFuncStub *stub = taosArrayGet(gUdfdProxy.udfStubs, i); if (stub->refCount == 0) { diff --git a/source/libs/nodes/src/nodesEqualFuncs.c b/source/libs/nodes/src/nodesEqualFuncs.c index 2442bd8c16..9cb7e8b66d 100644 --- a/source/libs/nodes/src/nodesEqualFuncs.c +++ b/source/libs/nodes/src/nodesEqualFuncs.c @@ -82,7 +82,9 @@ static bool columnNodeEqual(const SColumnNode* a, const SColumnNode* b) { COMPARE_STRING_FIELD(dbName); COMPARE_STRING_FIELD(tableName); COMPARE_STRING_FIELD(colName); - COMPARE_STRING_FIELD(tableAlias); + if (0 == a->tableId) { + COMPARE_STRING_FIELD(tableAlias); + } return true; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index abab2126c0..6f71b58aef 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -713,7 +713,8 @@ void nodesDestroyNode(SNode* pNode) { break; case QUERY_NODE_SHOW_CREATE_TABLE_STMT: case QUERY_NODE_SHOW_CREATE_STABLE_STMT: - destroyTableCfg((STableCfg*)(((SShowCreateTableStmt*)pNode)->pCfg)); + taosMemoryFreeClear(((SShowCreateTableStmt*)pNode)->pDbCfg); + destroyTableCfg((STableCfg*)(((SShowCreateTableStmt*)pNode)->pTableCfg)); break; case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT: // no pointer field case QUERY_NODE_KILL_CONNECTION_STMT: // no pointer field @@ -1817,3 +1818,19 @@ int32_t nodesMergeConds(SNode** pDst, SNodeList** pSrc) { return TSDB_CODE_SUCCESS; } + +const char* dataOrderStr(EDataOrderLevel order) { + switch (order) { + case DATA_ORDER_LEVEL_NONE: + return "no order required"; + case DATA_ORDER_LEVEL_IN_BLOCK: + return "in-datablock order"; + case DATA_ORDER_LEVEL_IN_GROUP: + return "in-group order"; + case DATA_ORDER_LEVEL_GLOBAL: + return "global order"; + default: + break; + } + return "unknown"; +} diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index d0c994e210..2a4f4c194d 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -176,11 +176,11 @@ SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName); SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort); SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode); SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue); -SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SToken* pIndexName, +SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName, SNode* pRealTable, SNodeList* pCols, SNode* pOptions); SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pStreamOptions); -SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pIndexName); +SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pIndexName); SNode* createCreateComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId); SNode* createDropComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId); SNode* createCreateTopicStmtUseQuery(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName, diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 21cb310f10..45bbea1707 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -424,8 +424,8 @@ from_db_opt(A) ::= FROM db_name(B). /************************************************ create index ********************************************************/ cmd ::= CREATE SMA INDEX not_exists_opt(D) - index_name(A) ON full_table_name(B) index_options(C). { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, D, &A, B, NULL, C); } -cmd ::= DROP INDEX exists_opt(B) index_name(A). { pCxt->pRootNode = createDropIndexStmt(pCxt, B, &A); } + full_table_name(A) ON full_table_name(B) index_options(C). { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, D, A, B, NULL, C); } +cmd ::= DROP INDEX exists_opt(B) full_table_name(A). { pCxt->pRootNode = createDropIndexStmt(pCxt, B, A); } index_options(A) ::= FUNCTION NK_LP func_list(B) NK_RP INTERVAL NK_LP duration_literal(C) NK_RP sliding_opt(D) sma_stream_opt(E). { A = createIndexOption(pCxt, B, releaseRawExprNode(pCxt, C), NULL, D, E); } @@ -608,10 +608,6 @@ column_alias(A) ::= NK_ID(B). %destructor user_name { } user_name(A) ::= NK_ID(B). { A = B; } -%type index_name { SToken } -%destructor index_name { } -index_name(A) ::= NK_ID(B). { A = B; } - %type topic_name { SToken } %destructor topic_name { } topic_name(A) ::= NK_ID(B). { A = B; } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 41c614eba8..b2006f8fc9 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -767,6 +767,7 @@ SNode* createSelectStmt(SAstCreateContext* pCxt, bool isDistinct, SNodeList* pPr select->pFromTable = pTable; sprintf(select->stmtName, "%p", select); select->isTimeLineResult = true; + select->onlyHasKeepOrderFunc = true; select->timeRange = TSWINDOW_INITIALIZER; return (SNode*)select; } @@ -1402,19 +1403,18 @@ SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const return (SNode*)pStmt; } -SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SToken* pIndexName, +SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName, SNode* pRealTable, SNodeList* pCols, SNode* pOptions) { CHECK_PARSER_STATUS(pCxt); - if (!checkIndexName(pCxt, pIndexName)) { - return NULL; - } SCreateIndexStmt* pStmt = (SCreateIndexStmt*)nodesMakeNode(QUERY_NODE_CREATE_INDEX_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->indexType = type; pStmt->ignoreExists = ignoreExists; - COPY_STRING_FORM_ID_TOKEN(pStmt->indexName, pIndexName); + strcpy(pStmt->indexDbName, ((SRealTableNode*)pIndexName)->table.dbName); + strcpy(pStmt->indexName, ((SRealTableNode*)pIndexName)->table.tableName); strcpy(pStmt->dbName, ((SRealTableNode*)pRealTable)->table.dbName); strcpy(pStmt->tableName, ((SRealTableNode*)pRealTable)->table.tableName); + nodesDestroyNode(pIndexName); nodesDestroyNode(pRealTable); pStmt->pCols = pCols; pStmt->pOptions = (SIndexOptions*)pOptions; @@ -1434,15 +1434,14 @@ SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInt return (SNode*)pOptions; } -SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pIndexName) { +SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pIndexName) { CHECK_PARSER_STATUS(pCxt); - if (!checkDbName(pCxt, NULL, true) || !checkIndexName(pCxt, pIndexName)) { - return NULL; - } SDropIndexStmt* pStmt = (SDropIndexStmt*)nodesMakeNode(QUERY_NODE_DROP_INDEX_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->ignoreNotExists = ignoreNotExists; - COPY_STRING_FORM_ID_TOKEN(pStmt->indexName, pIndexName); + strcpy(pStmt->indexDbName, ((SRealTableNode*)pIndexName)->table.dbName); + strcpy(pStmt->indexName, ((SRealTableNode*)pIndexName)->table.tableName); + nodesDestroyNode(pIndexName); return (SNode*)pStmt; } diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 3e4144f057..f5f44da9db 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -269,16 +269,15 @@ static int32_t collectMetaKeyFromUseDatabase(SCollectMetaKeyCxt* pCxt, SUseDatab static int32_t collectMetaKeyFromCreateIndex(SCollectMetaKeyCxt* pCxt, SCreateIndexStmt* pStmt) { int32_t code = TSDB_CODE_SUCCESS; if (INDEX_TYPE_SMA == pStmt->indexType) { - code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->db, pStmt->tableName, pCxt->pMetaCache); + code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache); if (TSDB_CODE_SUCCESS == code) { - code = - reserveTableVgroupInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->db, pStmt->tableName, pCxt->pMetaCache); + code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache); } if (TSDB_CODE_SUCCESS == code) { - code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->db, pCxt->pMetaCache); + code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache); } if (TSDB_CODE_SUCCESS == code) { - code = reserveDbCfgInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->db, pCxt->pMetaCache); + code = reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache); } } return code; @@ -366,8 +365,8 @@ static int32_t collectMetaKeyFromShowStreams(SCollectMetaKeyCxt* pCxt, SShowStmt } static int32_t collectMetaKeyFromShowTables(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, - TSDB_INS_TABLE_TABLES, pCxt->pMetaCache); + int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TABLES, + pCxt->pMetaCache); if (TSDB_CODE_SUCCESS == code) { if (NULL != pStmt->pDbName) { code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); @@ -457,6 +456,9 @@ static int32_t collectMetaKeyFromShowCreateTable(SCollectMetaKeyCxt* pCxt, SShow if (TSDB_CODE_SUCCESS == code) { code = reserveTableCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache); } + if (TSDB_CODE_SUCCESS == code) { + code = reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache); + } return code; } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 9f4f046605..f53f1f27b7 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1171,6 +1171,44 @@ static int32_t translateMultiRowsFunc(STranslateContext* pCxt, SFunctionNode* pF return TSDB_CODE_SUCCESS; } +static int32_t translateInterpFunc(STranslateContext* pCxt, SFunctionNode* pFunc) { + if (!fmIsInterpFunc(pFunc->funcId)) { + return TSDB_CODE_SUCCESS; + } + if (!isSelectStmt(pCxt->pCurrStmt) || SQL_CLAUSE_SELECT != pCxt->currClause) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC); + } + SSelectStmt* pSelect = (SSelectStmt*)pCxt->pCurrStmt; + if (pSelect->hasAggFuncs || pSelect->hasMultiRowsFunc || pSelect->hasIndefiniteRowsFunc) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC); + } + if (NULL != pSelect->pWindow || NULL != pSelect->pGroupByList) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC, + "%s function is not supported in window query or group query", pFunc->functionName); + } + if (hasInvalidFuncNesting(pFunc->pParameterList)) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_AGG_FUNC_NESTING); + } + return TSDB_CODE_SUCCESS; +} + +static int32_t translateTimelineFunc(STranslateContext* pCxt, SFunctionNode* pFunc) { + if (!fmIsTimelineFunc(pFunc->funcId)) { + return TSDB_CODE_SUCCESS; + } + if (!isSelectStmt(pCxt->pCurrStmt)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC, + "%s function must be used in select statements", pFunc->functionName); + } + SSelectStmt* pSelect = (SSelectStmt*)pCxt->pCurrStmt; + if (QUERY_NODE_TEMP_TABLE == nodeType(pSelect->pFromTable) && + !isTimeLineQuery(((STempTableNode*)pSelect->pFromTable)->pSubquery)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC, + "%s function requires valid time series input", pFunc->functionName); + } + return TSDB_CODE_SUCCESS; +} + static bool hasFillClause(SNode* pCurrStmt) { if (!isSelectStmt(pCurrStmt)) { return false; @@ -1291,6 +1329,7 @@ static void setFuncClassification(SNode* pCurrStmt, SFunctionNode* pFunc) { pSelect->hasInterpFunc = pSelect->hasInterpFunc ? true : (FUNCTION_TYPE_INTERP == pFunc->funcType); pSelect->hasLastRowFunc = pSelect->hasLastRowFunc ? true : (FUNCTION_TYPE_LAST_ROW == pFunc->funcType); pSelect->hasTimeLineFunc = pSelect->hasTimeLineFunc ? true : fmIsTimelineFunc(pFunc->funcId); + pSelect->onlyHasKeepOrderFunc = pSelect->onlyHasKeepOrderFunc ? fmIsKeepOrderFunc(pFunc->funcId) : false; } } @@ -1409,6 +1448,12 @@ static int32_t translateNoramlFunction(STranslateContext* pCxt, SFunctionNode* p if (TSDB_CODE_SUCCESS == code) { code = translateMultiRowsFunc(pCxt, pFunc); } + if (TSDB_CODE_SUCCESS == code) { + code = translateInterpFunc(pCxt, pFunc); + } + if (TSDB_CODE_SUCCESS == code) { + code = translateTimelineFunc(pCxt, pFunc); + } if (TSDB_CODE_SUCCESS == code) { setFuncClassification(pCxt->pCurrStmt, pFunc); } @@ -1685,6 +1730,9 @@ static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect) (!pSelect->hasAggFuncs && !pSelect->hasIndefiniteRowsFunc && !pSelect->hasInterpFunc)) { return TSDB_CODE_SUCCESS; } + if (!pSelect->onlyHasKeepOrderFunc) { + pSelect->isTimeLineResult = false; + } CheckAggColCoexistCxt cxt = {.pTranslateCxt = pCxt, .existCol = false}; nodesRewriteExprs(pSelect->pProjectionList, doCheckAggColCoexist, &cxt); if (!pSelect->isDistinct) { @@ -1751,8 +1799,7 @@ static int32_t dnodeToVgroupsInfo(SArray* pDnodes, SVgroupsInfo** pVgsInfo) { static bool sysTableFromVnode(const char* pTable) { return (0 == strcmp(pTable, TSDB_INS_TABLE_TABLES)) || - (0 == strcmp(pTable, TSDB_INS_TABLE_TABLE_DISTRIBUTED) || - (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS))); + (0 == strcmp(pTable, TSDB_INS_TABLE_TABLE_DISTRIBUTED) || (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS))); } static bool sysTableFromDnode(const char* pTable) { return 0 == strcmp(pTable, TSDB_INS_TABLE_DNODE_VARIABLES); } @@ -2182,9 +2229,9 @@ static int32_t translateOrderBy(STranslateContext* pCxt, SSelectStmt* pSelect) { } pCxt->currClause = SQL_CLAUSE_ORDER_BY; code = translateExprList(pCxt, pSelect->pOrderByList); - if (TSDB_CODE_SUCCESS == code) { - code = checkExprListForGroupBy(pCxt, pSelect, pSelect->pOrderByList); - } + } + if (TSDB_CODE_SUCCESS == code) { + code = checkExprListForGroupBy(pCxt, pSelect, pSelect->pOrderByList); } return code; } @@ -2265,15 +2312,15 @@ static int32_t translateHaving(STranslateContext* pCxt, SSelectStmt* pSelect) { } static int32_t translateGroupBy(STranslateContext* pCxt, SSelectStmt* pSelect) { - if (NULL != pSelect->pGroupByList && NULL != pSelect->pWindow) { + if (NULL == pSelect->pGroupByList) { + return TSDB_CODE_SUCCESS; + } + if (NULL != pSelect->pWindow) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_GROUPBY_WINDOW_COEXIST); } - if (NULL != pSelect->pGroupByList) { - pCxt->currClause = SQL_CLAUSE_GROUP_BY; - pSelect->isTimeLineResult = false; - return translateExprList(pCxt, pSelect->pGroupByList); - } - return TSDB_CODE_SUCCESS; + pCxt->currClause = SQL_CLAUSE_GROUP_BY; + pSelect->isTimeLineResult = false; + return translateExprList(pCxt, pSelect->pGroupByList); } static int32_t getTimeRange(SNode** pPrimaryKeyCond, STimeWindow* pTimeRange, bool* pIsStrict) { @@ -2496,6 +2543,7 @@ static int32_t translateWindow(STranslateContext* pCxt, SSelectStmt* pSelect) { if (NULL == pSelect->pWindow) { return TSDB_CODE_SUCCESS; } + pSelect->isTimeLineResult = true; pCxt->currClause = SQL_CLAUSE_WINDOW; int32_t code = translateExpr(pCxt, &pSelect->pWindow); if (TSDB_CODE_SUCCESS == code) { @@ -2562,12 +2610,13 @@ static int32_t translateInterp(STranslateContext* pCxt, SSelectStmt* pSelect) { return code; } -static int32_t translatePartitionBy(STranslateContext* pCxt, SNodeList* pPartitionByList) { - if (NULL == pPartitionByList) { +static int32_t translatePartitionBy(STranslateContext* pCxt, SSelectStmt* pSelect) { + if (NULL == pSelect->pPartitionByList) { return TSDB_CODE_SUCCESS; } + pSelect->isTimeLineResult = false; pCxt->currClause = SQL_CLAUSE_PARTITION_BY; - return translateExprList(pCxt, pPartitionByList); + return translateExprList(pCxt, pSelect->pPartitionByList); } static int32_t translateWhere(STranslateContext* pCxt, SSelectStmt* pSelect) { @@ -2670,11 +2719,36 @@ static EDealRes replaceOrderByAliasImpl(SNode** pNode, void* pContext) { } static int32_t replaceOrderByAlias(STranslateContext* pCxt, SNodeList* pProjectionList, SNodeList* pOrderByList) { + if (NULL == pOrderByList) { + return TSDB_CODE_SUCCESS; + } SReplaceOrderByAliasCxt cxt = {.pTranslateCxt = pCxt, .pProjectionList = pProjectionList}; nodesRewriteExprsPostOrder(pOrderByList, replaceOrderByAliasImpl, &cxt); return pCxt->errCode; } +static void resetResultTimeline(SSelectStmt* pSelect) { + if (NULL == pSelect->pOrderByList) { + return; + } + SNode* pOrder = ((SOrderByExprNode*)nodesListGetNode(pSelect->pOrderByList, 0))->pExpr; + if ((QUERY_NODE_TEMP_TABLE == nodeType(pSelect->pFromTable) && + isPrimaryKey((STempTableNode*)pSelect->pFromTable, pOrder)) || + (QUERY_NODE_TEMP_TABLE != nodeType(pSelect->pFromTable) && isPrimaryKeyImpl(pOrder))) { + pSelect->isTimeLineResult = true; + } else { + pSelect->isTimeLineResult = false; + } +} + +static int32_t replaceOrderByAliasForSelect(STranslateContext* pCxt, SSelectStmt* pSelect) { + int32_t code = replaceOrderByAlias(pCxt, pSelect->pProjectionList, pSelect->pOrderByList); + if (TSDB_CODE_SUCCESS == pCxt->errCode) { + resetResultTimeline(pSelect); + } + return code; +} + static int32_t translateSelectWithoutFrom(STranslateContext* pCxt, SSelectStmt* pSelect) { pCxt->pCurrStmt = (SNode*)pSelect; pCxt->currClause = SQL_CLAUSE_SELECT; @@ -2689,7 +2763,7 @@ static int32_t translateSelectFrom(STranslateContext* pCxt, SSelectStmt* pSelect code = translateWhere(pCxt, pSelect); } if (TSDB_CODE_SUCCESS == code) { - code = translatePartitionBy(pCxt, pSelect->pPartitionByList); + code = translatePartitionBy(pCxt, pSelect); } if (TSDB_CODE_SUCCESS == code) { code = translateWindow(pCxt, pSelect); @@ -2722,7 +2796,7 @@ static int32_t translateSelectFrom(STranslateContext* pCxt, SSelectStmt* pSelect code = appendTsForImplicitTsFunc(pCxt, pSelect); } if (TSDB_CODE_SUCCESS == code) { - code = replaceOrderByAlias(pCxt, pSelect->pProjectionList, pSelect->pOrderByList); + code = replaceOrderByAliasForSelect(pCxt, pSelect); } return code; } @@ -3705,6 +3779,11 @@ static int32_t checkTableWatermarkOption(STranslateContext* pCxt, STableOptions* } 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, + "The table name cannot contain '.'"); + } + SDbCfgInfo dbCfg = {0}; int32_t code = getDBCfg(pCxt, pStmt->dbName, &dbCfg); if (TSDB_CODE_SUCCESS == code && !createStable && NULL != dbCfg.pRetensions) { @@ -4282,9 +4361,10 @@ static int32_t translateAlterDnode(STranslateContext* pCxt, SAlterDnodeStmt* pSt return buildCmdMsg(pCxt, TDMT_MND_CONFIG_DNODE, (FSerializeFunc)tSerializeSMCfgDnodeReq, &cfgReq); } -static int32_t getSmaIndexDstVgId(STranslateContext* pCxt, char* pTableName, int32_t* pVgId) { +static int32_t getSmaIndexDstVgId(STranslateContext* pCxt, const char* pDbName, const char* pTableName, + int32_t* pVgId) { SVgroupInfo vg = {0}; - int32_t code = getTableHashVgroup(pCxt, pCxt->pParseCxt->db, pTableName, &vg); + int32_t code = getTableHashVgroup(pCxt, pDbName, pTableName, &vg); if (TSDB_CODE_SUCCESS == code) { *pVgId = vg.vgId; } @@ -4301,7 +4381,7 @@ static int32_t getSmaIndexSql(STranslateContext* pCxt, char** pSql, int32_t* pLe } static int32_t buildSampleAstInfoByIndex(STranslateContext* pCxt, SCreateIndexStmt* pStmt, SSampleAstInfo* pInfo) { - pInfo->pDbName = pCxt->pParseCxt->db; + pInfo->pDbName = pStmt->dbName; pInfo->pTableName = pStmt->tableName; pInfo->pFuncs = nodesCloneList(pStmt->pOptions->pFuncs); pInfo->pInterval = nodesCloneNode(pStmt->pOptions->pInterval); @@ -4328,7 +4408,7 @@ static int32_t getSmaIndexAst(STranslateContext* pCxt, SCreateIndexStmt* pStmt, static int32_t buildCreateSmaReq(STranslateContext* pCxt, SCreateIndexStmt* pStmt, SMCreateSmaReq* pReq) { SName name; - tNameExtractFullName(toName(pCxt->pParseCxt->acctId, pCxt->pParseCxt->db, pStmt->indexName, &name), pReq->name); + tNameExtractFullName(toName(pCxt->pParseCxt->acctId, pStmt->indexDbName, pStmt->indexName, &name), pReq->name); memset(&name, 0, sizeof(SName)); tNameExtractFullName(toName(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, &name), pReq->stb); pReq->igExists = pStmt->ignoreExists; @@ -4352,7 +4432,7 @@ static int32_t buildCreateSmaReq(STranslateContext* pCxt, SCreateIndexStmt* pStm } } - int32_t code = getSmaIndexDstVgId(pCxt, pStmt->tableName, &pReq->dstVgId); + int32_t code = getSmaIndexDstVgId(pCxt, pStmt->dbName, pStmt->tableName, &pReq->dstVgId); if (TSDB_CODE_SUCCESS == code) { code = getSmaIndexSql(pCxt, &pReq->sql, &pReq->sqlLen); } @@ -4365,7 +4445,7 @@ static int32_t buildCreateSmaReq(STranslateContext* pCxt, SCreateIndexStmt* pStm static int32_t checkCreateSmaIndex(STranslateContext* pCxt, SCreateIndexStmt* pStmt) { SDbCfgInfo dbCfg = {0}; - int32_t code = getDBCfg(pCxt, pCxt->pParseCxt->db, &dbCfg); + int32_t code = getDBCfg(pCxt, pStmt->dbName, &dbCfg); if (TSDB_CODE_SUCCESS == code && NULL != dbCfg.pRetensions) { code = generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_SMA_INDEX, "Tables configured with the 'ROLLUP' option do not support creating sma index"); @@ -4883,10 +4963,17 @@ static int32_t translateShowCreateDatabase(STranslateContext* pCxt, SShowCreateD } static int32_t translateShowCreateTable(STranslateContext* pCxt, SShowCreateTableStmt* pStmt) { - SName name; - toName(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, &name); - - return getTableCfg(pCxt, &name, (STableCfg**)&pStmt->pCfg); + pStmt->pDbCfg = taosMemoryCalloc(1, sizeof(SDbCfgInfo)); + if (NULL == pStmt->pDbCfg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + int32_t code = getDBCfg(pCxt, pStmt->dbName, (SDbCfgInfo*)pStmt->pDbCfg); + if (TSDB_CODE_SUCCESS == code) { + SName name; + toName(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, &name); + code = getTableCfg(pCxt, &name, (STableCfg**)&pStmt->pTableCfg); + } + return code; } static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { @@ -5917,6 +6004,10 @@ static int32_t checkCreateSubTable(STranslateContext* pCxt, SCreateSubTableClaus if (0 != strcmp(pStmt->dbName, pStmt->useDbName)) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_CORRESPONDING_STABLE_ERR); } + if (NULL != strchr(pStmt->tableName, '.')) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME, + "The table name cannot contain '.'"); + } return TSDB_CODE_SUCCESS; } static int32_t rewriteCreateSubTable(STranslateContext* pCxt, SCreateSubTableClause* pStmt, SHashObj* pVgroupHashmap) { diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 549e8d68ff..e3ebb85f68 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 380 +#define YYNOCODE 379 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EOperatorType yy60; - EFillMode yy94; - SToken yy129; - SDataType yy184; - bool yy337; - ENullOrder yy338; - SAlterOption yy405; - SNodeList* yy464; - int32_t yy500; - EJoinType yy532; - int8_t yy543; - int64_t yy549; - EOrder yy658; - SNode* yy712; + EOrder yy58; + bool yy151; + int8_t yy285; + SNodeList* yy356; + SToken yy361; + SAlterOption yy409; + int64_t yy457; + EFillMode yy494; + EJoinType yy504; + EOperatorType yy526; + SDataType yy600; + ENullOrder yy613; + SNode* yy616; + int32_t yy734; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -140,16 +140,16 @@ typedef union { #define ParseCTX_STORE #define YYFALLBACK 1 #define YYNSTATE 666 -#define YYNRULE 492 +#define YYNRULE 491 #define YYNTOKEN 257 #define YY_MAX_SHIFT 665 -#define YY_MIN_SHIFTREDUCE 973 -#define YY_MAX_SHIFTREDUCE 1464 -#define YY_ERROR_ACTION 1465 -#define YY_ACCEPT_ACTION 1466 -#define YY_NO_ACTION 1467 -#define YY_MIN_REDUCE 1468 -#define YY_MAX_REDUCE 1959 +#define YY_MIN_SHIFTREDUCE 972 +#define YY_MAX_SHIFTREDUCE 1462 +#define YY_ERROR_ACTION 1463 +#define YY_ACCEPT_ACTION 1464 +#define YY_NO_ACTION 1465 +#define YY_MIN_REDUCE 1466 +#define YY_MAX_REDUCE 1956 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,664 +216,676 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2395) +#define YY_ACTTAB_COUNT (2458) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 433, 1937, 434, 1503, 1654, 1655, 1599, 326, 441, 548, - /* 10 */ 434, 1503, 39, 37, 1936, 144, 1709, 1776, 1934, 1937, - /* 20 */ 339, 1469, 1264, 513, 1610, 40, 38, 36, 35, 34, - /* 30 */ 1793, 325, 164, 1341, 1706, 1262, 1934, 125, 1290, 1023, - /* 40 */ 1006, 1022, 105, 1772, 1778, 104, 103, 102, 101, 100, - /* 50 */ 99, 98, 97, 96, 157, 570, 1336, 73, 1811, 344, - /* 60 */ 148, 14, 1653, 1655, 1568, 89, 577, 1647, 1270, 1024, - /* 70 */ 1023, 1762, 1022, 576, 39, 37, 1404, 123, 122, 1604, - /* 80 */ 1010, 1011, 339, 1530, 1264, 469, 1600, 553, 146, 1, - /* 90 */ 1480, 550, 159, 1879, 1880, 1341, 1884, 1262, 1825, 551, - /* 100 */ 1024, 64, 92, 1794, 579, 1796, 1797, 575, 1660, 570, - /* 110 */ 1291, 662, 1871, 1408, 1937, 312, 306, 1867, 1336, 1289, - /* 120 */ 36, 35, 34, 14, 1658, 1343, 1344, 1935, 1937, 105, - /* 130 */ 1270, 1934, 104, 103, 102, 101, 100, 99, 98, 97, - /* 140 */ 96, 165, 450, 1161, 1162, 1934, 639, 638, 637, 636, - /* 150 */ 349, 2, 635, 634, 126, 629, 628, 627, 626, 625, - /* 160 */ 624, 623, 137, 619, 618, 617, 348, 347, 614, 613, - /* 170 */ 1265, 316, 1263, 662, 1491, 33, 32, 1466, 1937, 40, - /* 180 */ 38, 36, 35, 34, 30, 261, 63, 1343, 1344, 432, - /* 190 */ 1290, 164, 436, 1268, 1269, 1934, 1318, 1319, 1321, 1322, - /* 200 */ 1323, 1324, 1325, 1326, 572, 568, 1334, 1335, 1337, 1338, - /* 210 */ 1339, 1340, 1342, 1345, 1468, 1762, 33, 32, 612, 551, - /* 220 */ 40, 38, 36, 35, 34, 1289, 317, 166, 315, 314, - /* 230 */ 610, 473, 1265, 210, 1263, 475, 1425, 354, 114, 113, - /* 240 */ 112, 111, 110, 109, 108, 107, 106, 253, 384, 135, - /* 250 */ 134, 607, 606, 605, 63, 1268, 1269, 474, 1318, 1319, - /* 260 */ 1321, 1322, 1323, 1324, 1325, 1326, 572, 568, 1334, 1335, - /* 270 */ 1337, 1338, 1339, 1340, 1342, 1345, 39, 37, 1937, 534, - /* 280 */ 1423, 1424, 1426, 1427, 339, 303, 1264, 378, 43, 75, - /* 290 */ 305, 163, 222, 515, 1793, 1934, 1320, 1341, 1435, 1262, - /* 300 */ 1119, 601, 600, 599, 1123, 598, 1125, 1126, 597, 1128, - /* 310 */ 594, 487, 1134, 591, 1136, 1137, 588, 585, 440, 1811, - /* 320 */ 1336, 436, 1811, 537, 166, 14, 497, 541, 1937, 1461, - /* 330 */ 577, 1699, 1270, 551, 377, 1762, 376, 576, 39, 37, - /* 340 */ 209, 163, 171, 63, 548, 1934, 339, 49, 1264, 525, - /* 350 */ 665, 1244, 1245, 2, 490, 1490, 223, 224, 484, 1341, - /* 360 */ 55, 1262, 1825, 208, 268, 540, 94, 1794, 579, 1796, - /* 370 */ 1797, 575, 125, 570, 1289, 662, 1871, 1608, 155, 144, - /* 380 */ 1870, 1867, 1336, 655, 651, 647, 643, 266, 1611, 1343, - /* 390 */ 1344, 1270, 166, 1264, 1270, 58, 1762, 217, 57, 1489, - /* 400 */ 543, 538, 42, 39, 37, 1346, 1262, 1780, 496, 1488, - /* 410 */ 548, 339, 123, 1264, 305, 8, 1460, 515, 1776, 90, - /* 420 */ 73, 494, 231, 492, 1341, 542, 1262, 160, 1879, 1880, - /* 430 */ 63, 1884, 77, 120, 1265, 1351, 1263, 662, 125, 1270, - /* 440 */ 1762, 1289, 1603, 63, 1772, 1778, 328, 1336, 479, 478, - /* 450 */ 1762, 1343, 1344, 11, 10, 522, 570, 1268, 1269, 1270, - /* 460 */ 1318, 1319, 1321, 1322, 1323, 1324, 1325, 1326, 572, 568, - /* 470 */ 1334, 1335, 1337, 1338, 1339, 1340, 1342, 1345, 123, 216, - /* 480 */ 9, 166, 662, 482, 481, 166, 172, 219, 1586, 196, - /* 490 */ 121, 633, 631, 161, 1879, 1880, 1265, 1884, 1263, 1660, - /* 500 */ 477, 480, 662, 150, 61, 1236, 327, 212, 467, 463, - /* 510 */ 459, 455, 195, 1585, 76, 1658, 1343, 1344, 71, 1268, - /* 520 */ 1269, 70, 1318, 1319, 1321, 1322, 1323, 1324, 1325, 1326, - /* 530 */ 572, 568, 1334, 1335, 1337, 1338, 1339, 1340, 1342, 1345, - /* 540 */ 166, 1265, 1377, 1263, 74, 1583, 1288, 193, 450, 82, - /* 550 */ 33, 32, 342, 166, 40, 38, 36, 35, 34, 1533, - /* 560 */ 144, 1265, 1584, 1263, 1268, 1269, 621, 512, 166, 1610, - /* 570 */ 1601, 1699, 33, 32, 1010, 1011, 40, 38, 36, 35, - /* 580 */ 34, 166, 174, 604, 1268, 1269, 1081, 1318, 1319, 1321, - /* 590 */ 1322, 1323, 1324, 1325, 1326, 572, 568, 1334, 1335, 1337, - /* 600 */ 1338, 1339, 1340, 1342, 1345, 39, 37, 22, 1937, 192, - /* 610 */ 185, 1793, 190, 339, 610, 1264, 446, 1597, 1320, 1083, - /* 620 */ 513, 163, 612, 482, 481, 1934, 1341, 525, 1262, 1593, - /* 630 */ 121, 1707, 183, 135, 134, 607, 606, 605, 115, 1811, - /* 640 */ 477, 480, 7, 345, 548, 471, 610, 577, 1487, 1336, - /* 650 */ 438, 144, 1762, 525, 576, 1608, 1287, 1595, 419, 352, - /* 660 */ 1610, 1270, 351, 1365, 168, 135, 134, 607, 606, 605, - /* 670 */ 33, 32, 125, 1486, 40, 38, 36, 35, 34, 1825, - /* 680 */ 1485, 1608, 9, 280, 1794, 579, 1796, 1797, 575, 1762, - /* 690 */ 570, 33, 32, 553, 505, 40, 38, 36, 35, 34, - /* 700 */ 1937, 33, 32, 1937, 662, 40, 38, 36, 35, 34, - /* 710 */ 176, 175, 123, 163, 1762, 498, 163, 1934, 1343, 1344, - /* 720 */ 1934, 1762, 1705, 307, 300, 27, 1484, 251, 1879, 547, - /* 730 */ 525, 546, 39, 37, 1937, 1370, 1483, 302, 1886, 1287, - /* 740 */ 339, 115, 1264, 525, 307, 555, 412, 165, 476, 424, - /* 750 */ 1591, 1934, 1303, 1341, 382, 1262, 1937, 213, 1608, 373, - /* 760 */ 1363, 1886, 1883, 1265, 1509, 1263, 397, 1762, 425, 163, - /* 770 */ 399, 1608, 1482, 1934, 1479, 1292, 1336, 1762, 375, 371, - /* 780 */ 1704, 1363, 300, 1415, 1478, 1882, 1268, 1269, 1270, 1318, - /* 790 */ 1319, 1321, 1322, 1323, 1324, 1325, 1326, 572, 568, 1334, - /* 800 */ 1335, 1337, 1338, 1339, 1340, 1342, 1345, 390, 1477, 2, - /* 810 */ 26, 1660, 657, 1762, 1364, 1762, 33, 32, 343, 386, - /* 820 */ 40, 38, 36, 35, 34, 1762, 28, 1658, 1660, 1397, - /* 830 */ 1476, 662, 33, 32, 1475, 1364, 40, 38, 36, 35, - /* 840 */ 34, 622, 1289, 1580, 1659, 1343, 1344, 423, 1474, 1762, + /* 0 */ 525, 30, 261, 525, 548, 433, 525, 434, 1501, 11, + /* 10 */ 10, 117, 39, 37, 55, 1652, 1653, 117, 471, 378, + /* 20 */ 339, 1467, 1263, 1005, 476, 1022, 551, 1021, 1606, 1790, + /* 30 */ 1597, 1606, 127, 1339, 1606, 1261, 441, 74, 434, 1501, + /* 40 */ 469, 1774, 107, 1778, 1289, 106, 105, 104, 103, 102, + /* 50 */ 101, 100, 99, 98, 1774, 1023, 1334, 1808, 150, 1602, + /* 60 */ 1934, 14, 1566, 1009, 1010, 552, 1770, 1776, 1269, 450, + /* 70 */ 1760, 125, 576, 165, 39, 37, 1402, 1931, 570, 1770, + /* 80 */ 1776, 328, 339, 1528, 1263, 550, 161, 1876, 1877, 1, + /* 90 */ 1881, 570, 1658, 63, 1288, 1339, 1822, 1261, 1375, 327, + /* 100 */ 95, 1791, 579, 1793, 1794, 575, 496, 570, 1656, 344, + /* 110 */ 1868, 662, 1651, 1653, 330, 1864, 160, 513, 1334, 494, + /* 120 */ 146, 492, 551, 14, 325, 1341, 1342, 1704, 164, 1609, + /* 130 */ 1269, 40, 38, 36, 35, 34, 1894, 33, 32, 479, + /* 140 */ 478, 40, 38, 36, 35, 34, 639, 638, 637, 636, + /* 150 */ 349, 2, 635, 634, 128, 629, 628, 627, 626, 625, + /* 160 */ 624, 623, 139, 619, 618, 617, 348, 347, 614, 613, + /* 170 */ 1264, 107, 1262, 662, 106, 105, 104, 103, 102, 101, + /* 180 */ 100, 99, 98, 174, 1808, 49, 1080, 1341, 1342, 224, + /* 190 */ 225, 42, 541, 1267, 1268, 218, 1316, 1317, 1319, 1320, + /* 200 */ 1321, 1322, 1323, 1324, 572, 568, 1332, 1333, 1335, 1336, + /* 210 */ 1337, 1338, 1340, 1343, 1466, 71, 33, 32, 70, 1082, + /* 220 */ 40, 38, 36, 35, 34, 1289, 525, 168, 63, 540, + /* 230 */ 78, 168, 1264, 373, 1262, 1263, 84, 170, 116, 115, + /* 240 */ 114, 113, 112, 111, 110, 109, 108, 305, 1261, 1583, + /* 250 */ 515, 548, 375, 371, 1606, 1267, 1268, 1599, 1316, 1317, + /* 260 */ 1319, 1320, 1321, 1322, 1323, 1324, 572, 568, 1332, 1333, + /* 270 */ 1335, 1336, 1337, 1338, 1340, 1343, 39, 37, 542, 127, + /* 280 */ 64, 1269, 551, 1290, 339, 1363, 1263, 1288, 33, 32, + /* 290 */ 384, 1459, 40, 38, 36, 35, 34, 1339, 1433, 1261, + /* 300 */ 1118, 601, 600, 599, 1122, 598, 1124, 1125, 597, 1127, + /* 310 */ 594, 487, 1133, 591, 1135, 1136, 588, 585, 125, 1022, + /* 320 */ 1334, 1021, 610, 168, 662, 14, 497, 303, 1287, 168, + /* 330 */ 1160, 1161, 1269, 162, 1876, 1877, 211, 1881, 39, 37, + /* 340 */ 210, 137, 136, 607, 606, 605, 339, 27, 1263, 1023, + /* 350 */ 610, 43, 432, 2, 490, 436, 63, 1368, 484, 1339, + /* 360 */ 1658, 1261, 1707, 209, 1934, 63, 168, 312, 1531, 137, + /* 370 */ 136, 607, 606, 605, 612, 662, 1656, 1933, 1458, 61, + /* 380 */ 1778, 1931, 1334, 1264, 148, 1262, 1478, 74, 159, 1341, + /* 390 */ 1342, 1774, 76, 305, 1269, 58, 515, 1934, 57, 1269, + /* 400 */ 122, 1645, 1489, 39, 37, 1344, 1267, 1268, 1934, 1601, + /* 410 */ 166, 339, 1790, 1263, 1931, 8, 1770, 1776, 334, 604, + /* 420 */ 253, 1932, 223, 537, 1339, 1931, 1261, 326, 570, 1934, + /* 430 */ 633, 631, 482, 481, 1264, 146, 1262, 662, 440, 123, + /* 440 */ 1808, 436, 166, 1760, 1608, 1291, 1931, 1334, 574, 477, + /* 450 */ 480, 1341, 1342, 1760, 1488, 576, 1487, 1267, 1268, 1269, + /* 460 */ 1316, 1317, 1319, 1320, 1321, 1322, 1323, 1324, 572, 568, + /* 470 */ 1332, 1333, 1335, 1336, 1337, 1338, 1340, 1343, 621, 1822, + /* 480 */ 9, 1243, 1244, 294, 1791, 579, 1793, 1794, 575, 573, + /* 490 */ 570, 567, 1840, 548, 168, 1760, 1264, 1760, 1262, 1658, + /* 500 */ 543, 538, 662, 168, 1584, 33, 32, 1582, 438, 40, + /* 510 */ 38, 36, 35, 34, 1286, 1657, 1341, 1342, 1595, 1267, + /* 520 */ 1268, 127, 1316, 1317, 1319, 1320, 1321, 1322, 1323, 1324, + /* 530 */ 572, 568, 1332, 1333, 1335, 1336, 1337, 1338, 1340, 1343, + /* 540 */ 22, 33, 32, 1591, 26, 40, 38, 36, 35, 34, + /* 550 */ 33, 32, 475, 168, 40, 38, 36, 35, 34, 28, + /* 560 */ 125, 1264, 1406, 1262, 450, 33, 32, 612, 1288, 40, + /* 570 */ 38, 36, 35, 34, 474, 163, 1876, 1877, 1703, 1881, + /* 580 */ 300, 1790, 233, 1593, 1267, 1268, 316, 1316, 1317, 1319, + /* 590 */ 1320, 1321, 1322, 1323, 1324, 572, 568, 1332, 1333, 1335, + /* 600 */ 1336, 1337, 1338, 1340, 1343, 39, 37, 1581, 505, 1808, + /* 610 */ 342, 419, 1507, 339, 525, 1263, 1589, 552, 146, 525, + /* 620 */ 555, 1464, 1760, 1413, 576, 382, 1339, 1608, 1261, 63, + /* 630 */ 383, 33, 32, 214, 1883, 40, 38, 36, 35, 34, + /* 640 */ 1423, 317, 1606, 315, 314, 1349, 473, 1606, 1822, 1334, + /* 650 */ 475, 1288, 95, 1791, 579, 1793, 1794, 575, 1880, 570, + /* 660 */ 657, 1269, 1868, 178, 177, 1486, 330, 1864, 160, 571, + /* 670 */ 33, 32, 474, 345, 40, 38, 36, 35, 34, 665, + /* 680 */ 354, 146, 9, 534, 1421, 1422, 1424, 1425, 1895, 603, + /* 690 */ 1608, 33, 32, 268, 525, 40, 38, 36, 35, 34, + /* 700 */ 36, 35, 34, 1479, 662, 389, 1760, 157, 610, 377, + /* 710 */ 1658, 376, 655, 651, 647, 643, 266, 343, 1341, 1342, + /* 720 */ 256, 1934, 1606, 307, 535, 1779, 1656, 137, 136, 607, + /* 730 */ 606, 605, 39, 37, 165, 1883, 1774, 302, 1931, 1286, + /* 740 */ 339, 1485, 1263, 525, 307, 1318, 412, 608, 92, 424, + /* 750 */ 1649, 231, 1301, 1339, 404, 1261, 7, 482, 481, 1879, + /* 760 */ 1361, 1770, 1776, 1264, 123, 1262, 397, 168, 425, 512, + /* 770 */ 399, 1606, 352, 570, 477, 480, 1334, 1484, 1399, 351, + /* 780 */ 145, 1361, 1760, 1483, 522, 1288, 1267, 1268, 1269, 1316, + /* 790 */ 1317, 1319, 1320, 1321, 1322, 1323, 1324, 572, 568, 1332, + /* 800 */ 1333, 1335, 1336, 1337, 1338, 1340, 1343, 390, 91, 2, + /* 810 */ 1934, 525, 1567, 1934, 1362, 513, 220, 1883, 1760, 386, + /* 820 */ 1934, 124, 405, 165, 1760, 1705, 165, 1931, 1318, 1598, + /* 830 */ 1931, 662, 1482, 165, 1235, 1362, 213, 1931, 1702, 1606, + /* 840 */ 300, 1878, 622, 499, 1578, 1341, 1342, 423, 1481, 468, /* 850 */ 418, 417, 416, 415, 414, 411, 410, 409, 408, 407, - /* 860 */ 403, 402, 401, 400, 394, 393, 392, 391, 1473, 388, - /* 870 */ 387, 1762, 475, 1401, 1472, 1762, 29, 337, 1358, 1359, - /* 880 */ 1360, 1361, 1362, 1366, 1367, 1368, 1369, 1886, 608, 1762, - /* 890 */ 1265, 1651, 1263, 609, 474, 571, 1651, 29, 337, 1358, - /* 900 */ 1359, 1360, 1361, 1362, 1366, 1367, 1368, 1369, 1471, 1762, - /* 910 */ 1793, 1881, 233, 1268, 1269, 1762, 1318, 1319, 1321, 1322, - /* 920 */ 1323, 1324, 1325, 1326, 572, 568, 1334, 1335, 1337, 1338, - /* 930 */ 1339, 1340, 1342, 1345, 525, 145, 525, 525, 1811, 1273, - /* 940 */ 279, 525, 1891, 1397, 548, 383, 577, 389, 404, 1762, - /* 950 */ 603, 1762, 405, 576, 277, 60, 273, 133, 59, 1638, - /* 960 */ 44, 4, 1608, 1749, 1608, 1608, 1481, 553, 201, 1608, - /* 970 */ 525, 199, 125, 1520, 179, 429, 427, 1780, 1825, 1515, - /* 980 */ 560, 449, 92, 1794, 579, 1796, 1797, 575, 1776, 570, - /* 990 */ 566, 203, 1871, 553, 202, 483, 306, 1867, 1608, 336, - /* 1000 */ 335, 485, 525, 41, 54, 557, 63, 221, 1937, 1278, - /* 1010 */ 361, 1513, 123, 1605, 1772, 1778, 334, 53, 509, 1320, - /* 1020 */ 1341, 163, 1271, 11, 10, 1934, 570, 251, 1879, 547, - /* 1030 */ 1608, 546, 256, 488, 1937, 525, 205, 1781, 207, 204, - /* 1040 */ 129, 206, 1793, 1336, 91, 132, 1737, 163, 1776, 51, - /* 1050 */ 1213, 1934, 33, 32, 225, 1270, 40, 38, 36, 35, - /* 1060 */ 34, 33, 32, 1608, 133, 40, 38, 36, 35, 34, - /* 1070 */ 1811, 525, 1463, 1464, 1772, 1778, 1276, 1569, 552, 68, - /* 1080 */ 67, 381, 506, 1762, 170, 576, 570, 518, 468, 1783, - /* 1090 */ 615, 535, 230, 1272, 88, 245, 1371, 1400, 565, 1608, - /* 1100 */ 301, 499, 51, 369, 85, 367, 363, 359, 356, 353, - /* 1110 */ 1825, 1112, 1069, 237, 93, 1794, 579, 1796, 1797, 575, - /* 1120 */ 525, 570, 1355, 525, 1871, 525, 525, 525, 330, 1867, - /* 1130 */ 158, 510, 1785, 1050, 227, 525, 523, 524, 262, 616, - /* 1140 */ 41, 1793, 162, 1303, 166, 350, 346, 1504, 1608, 1422, - /* 1150 */ 1897, 1608, 41, 1608, 1608, 1608, 1812, 1279, 583, 1274, - /* 1160 */ 240, 1067, 1648, 1608, 1901, 132, 1051, 549, 255, 1811, - /* 1170 */ 250, 258, 3, 260, 133, 117, 355, 552, 132, 5, - /* 1180 */ 1282, 1284, 1762, 1793, 576, 561, 360, 1327, 313, 269, - /* 1190 */ 173, 1229, 568, 1334, 1335, 1337, 1338, 1339, 1340, 272, - /* 1200 */ 385, 143, 1287, 406, 1701, 1140, 421, 413, 558, 1825, - /* 1210 */ 426, 1811, 1144, 93, 1794, 579, 1796, 1797, 575, 577, - /* 1220 */ 570, 1151, 1149, 1871, 1762, 136, 576, 330, 1867, 158, - /* 1230 */ 1275, 420, 422, 428, 430, 1293, 1793, 431, 1296, 439, - /* 1240 */ 182, 443, 442, 184, 444, 1295, 1297, 447, 445, 1898, - /* 1250 */ 187, 1825, 189, 1793, 1294, 93, 1794, 579, 1796, 1797, - /* 1260 */ 575, 448, 570, 191, 1811, 1871, 72, 451, 194, 330, - /* 1270 */ 1867, 1950, 577, 472, 470, 304, 1598, 1762, 198, 576, - /* 1280 */ 1905, 1811, 116, 1594, 1742, 211, 200, 500, 138, 577, - /* 1290 */ 270, 139, 1596, 507, 1762, 1592, 576, 140, 141, 214, - /* 1300 */ 511, 218, 322, 501, 1825, 533, 519, 1292, 93, 1794, - /* 1310 */ 579, 1796, 1797, 575, 1609, 570, 1793, 228, 1871, 504, - /* 1320 */ 130, 1825, 330, 1867, 1950, 93, 1794, 579, 1796, 1797, - /* 1330 */ 575, 514, 570, 1928, 1741, 1871, 1711, 516, 131, 330, - /* 1340 */ 1867, 1950, 324, 521, 1811, 271, 81, 520, 1902, 529, - /* 1350 */ 1890, 235, 577, 536, 239, 6, 1912, 1762, 531, 576, - /* 1360 */ 545, 532, 530, 329, 539, 1911, 1793, 528, 527, 1397, - /* 1370 */ 124, 249, 1291, 553, 562, 559, 1793, 48, 331, 1887, - /* 1380 */ 83, 581, 1652, 246, 1825, 248, 1893, 265, 286, 1794, - /* 1390 */ 579, 1796, 1797, 575, 1811, 570, 658, 274, 1581, 659, - /* 1400 */ 247, 1933, 577, 661, 1811, 52, 244, 1762, 151, 576, - /* 1410 */ 152, 1852, 577, 276, 1937, 287, 297, 1762, 1793, 576, - /* 1420 */ 278, 1756, 296, 553, 254, 1755, 556, 165, 257, 1953, - /* 1430 */ 65, 1934, 1754, 1753, 1825, 66, 1750, 259, 286, 1794, - /* 1440 */ 579, 1796, 1797, 575, 1825, 570, 1811, 563, 94, 1794, - /* 1450 */ 579, 1796, 1797, 575, 574, 570, 358, 357, 1871, 1762, - /* 1460 */ 362, 576, 564, 1867, 1937, 1256, 1257, 1748, 1747, 169, - /* 1470 */ 364, 366, 1793, 365, 1746, 370, 368, 163, 1745, 372, - /* 1480 */ 1744, 1934, 374, 1232, 1793, 1231, 1825, 1722, 1721, 380, - /* 1490 */ 294, 1794, 579, 1796, 1797, 575, 573, 570, 567, 1843, - /* 1500 */ 1811, 379, 1720, 1719, 1201, 1694, 127, 1693, 577, 1692, - /* 1510 */ 1691, 69, 1811, 1762, 1690, 576, 1689, 1688, 1687, 1686, - /* 1520 */ 577, 395, 1685, 398, 396, 1762, 1684, 576, 1683, 1682, - /* 1530 */ 1681, 1680, 1679, 1678, 1677, 1676, 1675, 1674, 1673, 1672, - /* 1540 */ 1825, 1793, 1671, 128, 147, 1794, 579, 1796, 1797, 575, - /* 1550 */ 1670, 570, 1825, 180, 177, 1534, 94, 1794, 579, 1796, - /* 1560 */ 1797, 575, 1669, 570, 1668, 1793, 1871, 1203, 1664, 1811, - /* 1570 */ 1667, 1868, 1666, 1665, 323, 1663, 1662, 577, 1661, 1535, - /* 1580 */ 178, 1532, 1762, 1793, 576, 1500, 118, 156, 554, 1951, - /* 1590 */ 1499, 1013, 435, 1811, 1012, 437, 181, 119, 526, 1735, - /* 1600 */ 1729, 577, 1718, 188, 186, 1717, 1762, 1703, 576, 1825, - /* 1610 */ 1587, 1811, 1531, 295, 1794, 579, 1796, 1797, 575, 577, - /* 1620 */ 570, 1043, 1529, 452, 1762, 454, 576, 1527, 456, 453, - /* 1630 */ 457, 458, 1525, 1825, 461, 462, 460, 295, 1794, 579, - /* 1640 */ 1796, 1797, 575, 1523, 570, 1793, 464, 466, 1512, 1511, - /* 1650 */ 465, 1825, 1496, 1589, 1588, 290, 1794, 579, 1796, 1797, - /* 1660 */ 575, 50, 570, 1793, 1155, 197, 1154, 630, 1080, 632, - /* 1670 */ 1077, 1076, 1075, 1811, 1521, 1516, 1514, 318, 319, 486, - /* 1680 */ 320, 577, 489, 1495, 1494, 1493, 1762, 495, 576, 95, - /* 1690 */ 1734, 1811, 491, 544, 493, 1238, 1728, 56, 142, 574, - /* 1700 */ 502, 1716, 1714, 1715, 1762, 503, 576, 1713, 215, 321, - /* 1710 */ 508, 1712, 15, 1825, 226, 1793, 1710, 147, 1794, 579, - /* 1720 */ 1796, 1797, 575, 1248, 570, 1702, 517, 220, 78, 80, - /* 1730 */ 79, 1825, 232, 1793, 23, 294, 1794, 579, 1796, 1797, - /* 1740 */ 575, 85, 570, 1811, 1844, 243, 16, 229, 338, 41, - /* 1750 */ 1783, 577, 1437, 234, 17, 238, 1762, 1793, 576, 252, - /* 1760 */ 236, 1811, 1952, 1419, 47, 242, 340, 1421, 149, 577, - /* 1770 */ 241, 24, 25, 46, 1762, 1449, 576, 1414, 84, 1782, - /* 1780 */ 153, 18, 1394, 1825, 1393, 1811, 45, 295, 1794, 579, - /* 1790 */ 1796, 1797, 575, 577, 570, 1454, 1448, 13, 1762, 1443, - /* 1800 */ 576, 1825, 332, 1453, 1452, 295, 1794, 579, 1796, 1797, - /* 1810 */ 575, 333, 570, 1793, 10, 1280, 19, 1828, 154, 1311, - /* 1820 */ 569, 1356, 582, 167, 31, 1825, 1331, 1793, 12, 281, - /* 1830 */ 1794, 579, 1796, 1797, 575, 1329, 570, 1328, 20, 21, - /* 1840 */ 341, 1811, 580, 1141, 584, 587, 578, 1138, 586, 577, - /* 1850 */ 1135, 589, 590, 592, 1762, 1811, 576, 595, 1118, 1133, - /* 1860 */ 1129, 1127, 1150, 577, 593, 1132, 602, 596, 1762, 1793, - /* 1870 */ 576, 1131, 1130, 263, 86, 87, 1146, 62, 611, 1793, - /* 1880 */ 1072, 1825, 1041, 1071, 1070, 282, 1794, 579, 1796, 1797, - /* 1890 */ 575, 1068, 570, 1066, 1065, 1825, 1064, 1811, 620, 289, - /* 1900 */ 1794, 579, 1796, 1797, 575, 577, 570, 1811, 1087, 264, - /* 1910 */ 1762, 1062, 576, 1061, 1060, 577, 1059, 1058, 1057, 1056, - /* 1920 */ 1762, 1793, 576, 1084, 1082, 1047, 1053, 1528, 1052, 1049, - /* 1930 */ 1526, 1048, 1046, 640, 641, 644, 1524, 1825, 642, 648, - /* 1940 */ 646, 291, 1794, 579, 1796, 1797, 575, 1825, 570, 1811, - /* 1950 */ 650, 283, 1794, 579, 1796, 1797, 575, 577, 570, 645, - /* 1960 */ 649, 1522, 1762, 652, 576, 653, 1510, 656, 654, 1003, - /* 1970 */ 1492, 267, 660, 663, 1793, 1266, 275, 664, 1467, 1467, - /* 1980 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1825, - /* 1990 */ 1467, 1467, 1793, 292, 1794, 579, 1796, 1797, 575, 1467, - /* 2000 */ 570, 1467, 1811, 1467, 1467, 1467, 1467, 1467, 1467, 1467, - /* 2010 */ 577, 1467, 1467, 1467, 1467, 1762, 1467, 576, 1467, 1467, - /* 2020 */ 1811, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 577, 1467, - /* 2030 */ 1467, 1467, 1467, 1762, 1467, 576, 1467, 1467, 1467, 1467, - /* 2040 */ 1467, 1467, 1825, 1467, 1793, 1467, 284, 1794, 579, 1796, - /* 2050 */ 1797, 575, 1467, 570, 1793, 1467, 1467, 1467, 1467, 1467, - /* 2060 */ 1825, 1467, 1467, 1467, 293, 1794, 579, 1796, 1797, 575, - /* 2070 */ 1793, 570, 1811, 1467, 1467, 1467, 1467, 1467, 1467, 1467, - /* 2080 */ 577, 1467, 1811, 1467, 1467, 1762, 1467, 576, 1467, 1467, - /* 2090 */ 577, 1467, 1467, 1467, 1467, 1762, 1467, 576, 1811, 1467, - /* 2100 */ 1467, 1467, 1467, 1467, 1467, 1467, 577, 1467, 1467, 1467, - /* 2110 */ 1467, 1762, 1825, 576, 1467, 1467, 285, 1794, 579, 1796, - /* 2120 */ 1797, 575, 1825, 570, 1793, 1467, 298, 1794, 579, 1796, - /* 2130 */ 1797, 575, 1467, 570, 1467, 1467, 1467, 1467, 1825, 1467, - /* 2140 */ 1793, 1467, 299, 1794, 579, 1796, 1797, 575, 1467, 570, - /* 2150 */ 1793, 1467, 1811, 1467, 1467, 1467, 1467, 1467, 1467, 1467, - /* 2160 */ 577, 1467, 1467, 1467, 1467, 1762, 1793, 576, 1811, 1467, - /* 2170 */ 1467, 1467, 1467, 1467, 1467, 1467, 577, 1467, 1811, 1467, - /* 2180 */ 1467, 1762, 1467, 576, 1467, 1467, 577, 1467, 1467, 1467, - /* 2190 */ 1467, 1762, 1825, 576, 1811, 1467, 1805, 1794, 579, 1796, - /* 2200 */ 1797, 575, 577, 570, 1467, 1467, 1467, 1762, 1825, 576, - /* 2210 */ 1467, 1467, 1804, 1794, 579, 1796, 1797, 575, 1825, 570, - /* 2220 */ 1467, 1467, 1803, 1794, 579, 1796, 1797, 575, 1467, 570, - /* 2230 */ 1467, 1467, 1467, 1467, 1825, 1793, 1467, 1467, 310, 1794, - /* 2240 */ 579, 1796, 1797, 575, 1467, 570, 1467, 1467, 1467, 1467, - /* 2250 */ 1467, 1467, 1467, 1793, 1467, 1467, 1467, 1467, 1467, 1467, - /* 2260 */ 1467, 1467, 1467, 1811, 1467, 1467, 1467, 1467, 1467, 1467, - /* 2270 */ 1467, 577, 1467, 1467, 1467, 1467, 1762, 1467, 576, 1467, - /* 2280 */ 1467, 1811, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 577, - /* 2290 */ 1467, 1467, 1467, 1467, 1762, 1467, 576, 1467, 1467, 1467, - /* 2300 */ 1467, 1467, 1467, 1825, 1467, 1793, 1467, 309, 1794, 579, - /* 2310 */ 1796, 1797, 575, 1467, 570, 1793, 1467, 1467, 1467, 1467, - /* 2320 */ 1467, 1825, 1467, 1467, 1467, 311, 1794, 579, 1796, 1797, - /* 2330 */ 575, 1467, 570, 1811, 1467, 1467, 1467, 1467, 1467, 1467, - /* 2340 */ 1467, 577, 1467, 1811, 1467, 1467, 1762, 1467, 576, 1467, - /* 2350 */ 1467, 577, 1467, 1467, 1467, 1467, 1762, 1467, 576, 1467, - /* 2360 */ 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, - /* 2370 */ 1467, 1467, 1467, 1825, 1467, 1467, 1467, 308, 1794, 579, - /* 2380 */ 1796, 1797, 575, 1825, 570, 1467, 1467, 288, 1794, 579, - /* 2390 */ 1796, 1797, 575, 1467, 570, + /* 860 */ 403, 402, 401, 400, 394, 393, 392, 391, 1480, 388, + /* 870 */ 387, 1477, 609, 1760, 1476, 1649, 29, 337, 1356, 1357, + /* 880 */ 1358, 1359, 1360, 1364, 1365, 1366, 1367, 1009, 1010, 1760, + /* 890 */ 1264, 273, 1262, 1475, 1636, 44, 4, 29, 337, 1356, + /* 900 */ 1357, 1358, 1359, 1360, 1364, 1365, 1366, 1367, 1474, 1760, + /* 910 */ 1790, 1473, 1760, 1267, 1268, 1760, 1316, 1317, 1319, 1320, + /* 920 */ 1321, 1322, 1323, 1324, 572, 568, 1332, 1333, 1335, 1336, + /* 930 */ 1337, 1338, 1340, 1343, 1760, 147, 1697, 1790, 1808, 1697, + /* 940 */ 279, 1888, 1395, 1395, 217, 135, 577, 173, 1472, 1760, + /* 950 */ 176, 1760, 1760, 576, 277, 60, 1471, 1470, 59, 1469, + /* 960 */ 53, 509, 1318, 33, 32, 1808, 553, 40, 38, 36, + /* 970 */ 35, 34, 1747, 577, 181, 429, 427, 1822, 1760, 77, + /* 980 */ 576, 94, 1791, 579, 1793, 1794, 575, 202, 570, 1760, + /* 990 */ 200, 1868, 54, 553, 245, 306, 1864, 1760, 1760, 1518, + /* 1000 */ 1760, 498, 1398, 557, 1822, 525, 63, 1934, 94, 1791, + /* 1010 */ 579, 1793, 1794, 575, 204, 570, 448, 203, 1868, 361, + /* 1020 */ 167, 483, 306, 1864, 1931, 206, 1272, 208, 205, 525, + /* 1030 */ 207, 336, 335, 1606, 1934, 525, 1513, 525, 525, 1271, + /* 1040 */ 449, 1277, 1934, 560, 93, 1301, 1603, 165, 1735, 506, + /* 1050 */ 1790, 1931, 1339, 350, 1270, 165, 1809, 1606, 485, 1931, + /* 1060 */ 525, 525, 525, 1606, 566, 1606, 1606, 41, 1049, 222, + /* 1070 */ 1898, 510, 228, 521, 525, 1334, 1511, 1502, 1808, 68, + /* 1080 */ 67, 381, 131, 525, 172, 523, 577, 1269, 1606, 1606, + /* 1090 */ 1606, 1760, 134, 576, 524, 135, 51, 1646, 488, 525, + /* 1100 */ 301, 1050, 1606, 369, 525, 367, 363, 359, 356, 353, + /* 1110 */ 262, 1606, 1790, 237, 1212, 346, 226, 1822, 11, 10, + /* 1120 */ 51, 95, 1791, 579, 1793, 1794, 575, 1606, 570, 518, + /* 1130 */ 565, 1868, 1606, 1461, 1462, 330, 1864, 1947, 1781, 230, + /* 1140 */ 1808, 549, 1111, 1420, 168, 5, 1902, 41, 577, 90, + /* 1150 */ 615, 616, 250, 1760, 41, 576, 583, 134, 255, 87, + /* 1160 */ 240, 313, 135, 1275, 1790, 3, 258, 1369, 119, 260, + /* 1170 */ 134, 355, 1068, 1066, 1228, 360, 1274, 269, 175, 1822, + /* 1180 */ 385, 1783, 1286, 95, 1791, 579, 1793, 1794, 575, 1278, + /* 1190 */ 570, 1273, 1808, 1868, 1325, 406, 1353, 330, 1864, 1947, + /* 1200 */ 577, 272, 421, 1139, 1143, 1760, 558, 576, 1925, 1150, + /* 1210 */ 1699, 413, 1281, 1283, 420, 1148, 1790, 138, 422, 426, + /* 1220 */ 428, 430, 1292, 431, 568, 1332, 1333, 1335, 1336, 1337, + /* 1230 */ 1338, 1822, 439, 1294, 184, 95, 1791, 579, 1793, 1794, + /* 1240 */ 575, 442, 570, 1790, 1808, 1868, 443, 186, 561, 330, + /* 1250 */ 1864, 1947, 577, 1293, 444, 1295, 189, 1760, 445, 576, + /* 1260 */ 1887, 447, 191, 451, 72, 73, 195, 470, 472, 1596, + /* 1270 */ 199, 1808, 553, 1592, 201, 140, 141, 1594, 304, 577, + /* 1280 */ 118, 270, 500, 1822, 1760, 1590, 576, 286, 1791, 579, + /* 1290 */ 1793, 1794, 575, 212, 570, 1790, 507, 142, 143, 553, + /* 1300 */ 501, 504, 1740, 533, 215, 511, 519, 132, 219, 271, + /* 1310 */ 1822, 1790, 514, 1934, 286, 1791, 579, 1793, 1794, 575, + /* 1320 */ 536, 570, 322, 1808, 133, 81, 167, 520, 1739, 83, + /* 1330 */ 1931, 577, 1709, 516, 1291, 6, 1760, 1607, 576, 1808, + /* 1340 */ 1934, 324, 1890, 529, 1899, 545, 531, 577, 532, 530, + /* 1350 */ 528, 527, 1760, 165, 576, 235, 1395, 1931, 329, 239, + /* 1360 */ 126, 1290, 1822, 539, 48, 1909, 96, 1791, 579, 1793, + /* 1370 */ 1794, 575, 331, 570, 559, 85, 1868, 246, 1822, 562, + /* 1380 */ 1867, 1864, 96, 1791, 579, 1793, 1794, 575, 249, 570, + /* 1390 */ 1884, 1790, 1868, 1908, 244, 1930, 564, 1864, 1950, 1650, + /* 1400 */ 658, 1790, 581, 274, 1579, 659, 154, 247, 661, 1849, + /* 1410 */ 265, 153, 52, 278, 248, 287, 297, 1754, 276, 1808, + /* 1420 */ 1753, 296, 65, 1752, 1751, 66, 1748, 577, 254, 1808, + /* 1430 */ 357, 556, 1760, 358, 576, 1255, 1256, 577, 257, 171, + /* 1440 */ 563, 362, 1760, 259, 576, 1746, 364, 365, 366, 1745, + /* 1450 */ 1790, 368, 1744, 370, 1743, 372, 1742, 374, 1822, 1231, + /* 1460 */ 1230, 1720, 149, 1791, 579, 1793, 1794, 575, 1822, 570, + /* 1470 */ 1719, 379, 96, 1791, 579, 1793, 1794, 575, 1808, 570, + /* 1480 */ 380, 1718, 1868, 323, 1717, 1200, 577, 1865, 1692, 129, + /* 1490 */ 1691, 1760, 1690, 576, 1689, 69, 1688, 1687, 1686, 1790, + /* 1500 */ 395, 396, 1683, 398, 1682, 1681, 554, 1948, 1685, 1684, + /* 1510 */ 1680, 1790, 1679, 1678, 1677, 1676, 1675, 1822, 1674, 1673, + /* 1520 */ 1672, 295, 1791, 579, 1793, 1794, 575, 1808, 570, 1671, + /* 1530 */ 1670, 1669, 526, 130, 1668, 577, 1667, 1666, 1665, 1808, + /* 1540 */ 1760, 1664, 576, 1663, 1202, 1662, 1661, 577, 1660, 1659, + /* 1550 */ 1533, 179, 1760, 1532, 576, 180, 1530, 1498, 1012, 182, + /* 1560 */ 1790, 1011, 120, 1497, 158, 183, 1822, 121, 1733, 1727, + /* 1570 */ 295, 1791, 579, 1793, 1794, 575, 1790, 570, 1822, 435, + /* 1580 */ 1716, 437, 290, 1791, 579, 1793, 1794, 575, 1808, 570, + /* 1590 */ 188, 1715, 190, 1701, 1585, 1529, 577, 1527, 454, 452, + /* 1600 */ 1525, 1760, 1042, 576, 1808, 453, 456, 457, 1523, 458, + /* 1610 */ 460, 462, 574, 461, 1521, 466, 464, 1760, 1510, 576, + /* 1620 */ 544, 465, 1509, 1494, 1587, 50, 1153, 1822, 198, 1790, + /* 1630 */ 630, 149, 1791, 579, 1793, 1794, 575, 1154, 570, 1586, + /* 1640 */ 1079, 1790, 632, 1822, 1076, 1075, 1519, 294, 1791, 579, + /* 1650 */ 1793, 1794, 575, 1074, 570, 1514, 1841, 1808, 318, 319, + /* 1660 */ 486, 1512, 338, 320, 489, 577, 197, 1493, 1492, 1808, + /* 1670 */ 1760, 1491, 576, 491, 340, 493, 1949, 577, 495, 97, + /* 1680 */ 152, 1732, 1760, 56, 576, 467, 463, 459, 455, 196, + /* 1690 */ 1790, 502, 1237, 1726, 1714, 1712, 1822, 144, 508, 503, + /* 1700 */ 295, 1791, 579, 1793, 1794, 575, 216, 570, 1822, 1713, + /* 1710 */ 1711, 321, 295, 1791, 579, 1793, 1794, 575, 1808, 570, + /* 1720 */ 1710, 75, 1708, 15, 194, 221, 577, 1700, 517, 80, + /* 1730 */ 232, 1760, 227, 576, 79, 229, 82, 1247, 16, 1790, + /* 1740 */ 41, 23, 234, 87, 1435, 47, 242, 243, 236, 1447, + /* 1750 */ 1417, 238, 1781, 1419, 151, 241, 25, 1822, 252, 24, + /* 1760 */ 1790, 280, 1791, 579, 1793, 1794, 575, 1808, 570, 1412, + /* 1770 */ 1392, 86, 46, 1391, 1780, 577, 155, 1452, 18, 1441, + /* 1780 */ 1760, 1446, 576, 332, 1451, 1450, 193, 187, 1808, 192, + /* 1790 */ 45, 333, 10, 446, 1279, 19, 577, 1825, 17, 1354, + /* 1800 */ 569, 1760, 1309, 576, 156, 1329, 1822, 1327, 31, 185, + /* 1810 */ 281, 1791, 579, 1793, 1794, 575, 1326, 570, 580, 13, + /* 1820 */ 12, 1790, 20, 169, 1140, 21, 582, 1822, 341, 1137, + /* 1830 */ 584, 282, 1791, 579, 1793, 1794, 575, 1790, 570, 586, + /* 1840 */ 587, 589, 590, 578, 1134, 1128, 592, 1126, 593, 1808, + /* 1850 */ 595, 596, 1117, 548, 88, 1132, 1131, 577, 1130, 89, + /* 1860 */ 1129, 602, 1760, 1149, 576, 1808, 263, 62, 1145, 1040, + /* 1870 */ 611, 1071, 1070, 577, 1069, 1067, 1065, 1064, 1760, 1063, + /* 1880 */ 576, 127, 1086, 620, 1061, 1060, 264, 1059, 1822, 1058, + /* 1890 */ 1790, 1057, 289, 1791, 579, 1793, 1794, 575, 1056, 570, + /* 1900 */ 548, 553, 1790, 1055, 1822, 1081, 1083, 1052, 291, 1791, + /* 1910 */ 579, 1793, 1794, 575, 1051, 570, 1048, 1047, 1808, 1046, + /* 1920 */ 125, 1045, 1526, 640, 641, 1524, 577, 644, 127, 642, + /* 1930 */ 1808, 1760, 645, 576, 646, 251, 1876, 547, 577, 546, + /* 1940 */ 1522, 648, 1934, 1760, 650, 576, 649, 1520, 553, 652, + /* 1950 */ 653, 1790, 654, 1508, 656, 167, 1002, 1822, 1490, 1931, + /* 1960 */ 267, 283, 1791, 579, 1793, 1794, 575, 125, 570, 1822, + /* 1970 */ 660, 664, 1265, 292, 1791, 579, 1793, 1794, 575, 1808, + /* 1980 */ 570, 275, 251, 1876, 547, 663, 546, 577, 1465, 1934, + /* 1990 */ 1465, 1465, 1760, 1465, 576, 1465, 1465, 1465, 1465, 1465, + /* 2000 */ 1790, 1465, 165, 1465, 1465, 1465, 1931, 1465, 1465, 1465, + /* 2010 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1822, 1465, + /* 2020 */ 1465, 1790, 284, 1791, 579, 1793, 1794, 575, 1808, 570, + /* 2030 */ 1465, 1465, 1465, 1465, 1465, 1465, 577, 1465, 1465, 1465, + /* 2040 */ 1465, 1760, 1465, 576, 1465, 1465, 1465, 1465, 1465, 1808, + /* 2050 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 577, 1465, 1465, + /* 2060 */ 1465, 1465, 1760, 1465, 576, 1465, 1465, 1822, 1465, 1465, + /* 2070 */ 1790, 293, 1791, 579, 1793, 1794, 575, 1465, 570, 1465, + /* 2080 */ 1465, 1465, 1790, 1465, 1465, 1465, 1465, 1465, 1822, 1465, + /* 2090 */ 1465, 1465, 285, 1791, 579, 1793, 1794, 575, 1808, 570, + /* 2100 */ 1465, 1465, 1465, 1465, 1465, 1465, 577, 1465, 1465, 1465, + /* 2110 */ 1808, 1760, 1465, 576, 1465, 1465, 1465, 1465, 577, 1465, + /* 2120 */ 1465, 1465, 1465, 1760, 1465, 576, 1465, 1465, 1465, 1465, + /* 2130 */ 1465, 1465, 1465, 1465, 1790, 1465, 1465, 1822, 1465, 1465, + /* 2140 */ 1465, 298, 1791, 579, 1793, 1794, 575, 1465, 570, 1822, + /* 2150 */ 1465, 1790, 1465, 299, 1791, 579, 1793, 1794, 575, 1465, + /* 2160 */ 570, 1465, 1808, 1465, 1465, 1465, 1465, 1465, 1465, 1465, + /* 2170 */ 577, 1465, 1465, 1465, 1465, 1760, 1465, 576, 1465, 1808, + /* 2180 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 577, 1465, 1465, + /* 2190 */ 1465, 1465, 1760, 1465, 576, 1465, 1465, 1465, 1465, 1465, + /* 2200 */ 1465, 1822, 1465, 1465, 1790, 1802, 1791, 579, 1793, 1794, + /* 2210 */ 575, 1465, 570, 1465, 1465, 1465, 1465, 1465, 1822, 1465, + /* 2220 */ 1465, 1465, 1801, 1791, 579, 1793, 1794, 575, 1465, 570, + /* 2230 */ 1465, 1465, 1808, 1465, 1465, 1465, 1465, 1465, 1465, 1465, + /* 2240 */ 577, 1465, 1465, 1465, 1465, 1760, 1465, 576, 1465, 1465, + /* 2250 */ 1465, 1465, 1465, 1790, 1465, 1465, 1465, 1465, 1465, 1465, + /* 2260 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, + /* 2270 */ 1465, 1822, 1465, 1465, 1465, 1800, 1791, 579, 1793, 1794, + /* 2280 */ 575, 1808, 570, 1465, 1465, 1465, 1465, 1465, 1465, 577, + /* 2290 */ 1465, 1465, 1465, 1465, 1760, 1465, 576, 1465, 1465, 1465, + /* 2300 */ 1465, 1465, 1790, 1465, 1465, 1465, 1465, 1465, 1465, 1465, + /* 2310 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1790, 1465, + /* 2320 */ 1822, 1465, 1465, 1465, 310, 1791, 579, 1793, 1794, 575, + /* 2330 */ 1808, 570, 1465, 1465, 1465, 1465, 1465, 1465, 577, 1465, + /* 2340 */ 1465, 1465, 1465, 1760, 1465, 576, 1808, 1465, 1465, 1465, + /* 2350 */ 1465, 1465, 1465, 1465, 577, 1465, 1465, 1465, 1465, 1760, + /* 2360 */ 1465, 576, 1465, 1465, 1465, 1465, 1465, 1790, 1465, 1822, + /* 2370 */ 1465, 1465, 1465, 309, 1791, 579, 1793, 1794, 575, 1790, + /* 2380 */ 570, 1465, 1465, 1465, 1465, 1822, 1465, 1465, 1465, 311, + /* 2390 */ 1791, 579, 1793, 1794, 575, 1808, 570, 1465, 1465, 1465, + /* 2400 */ 1465, 1465, 1465, 577, 1465, 1465, 1465, 1808, 1760, 1465, + /* 2410 */ 576, 1465, 1465, 1465, 1465, 577, 1465, 1465, 1465, 1465, + /* 2420 */ 1760, 1465, 576, 1465, 1465, 1465, 1465, 1465, 1465, 1465, + /* 2430 */ 1465, 1465, 1465, 1465, 1822, 1465, 1465, 1465, 308, 1791, + /* 2440 */ 579, 1793, 1794, 575, 1465, 570, 1822, 1465, 1465, 1465, + /* 2450 */ 288, 1791, 579, 1793, 1794, 575, 1465, 570, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 264, 358, 266, 267, 302, 303, 290, 280, 264, 268, - /* 10 */ 266, 267, 12, 13, 371, 288, 0, 301, 375, 358, - /* 20 */ 20, 0, 22, 303, 297, 12, 13, 14, 15, 16, - /* 30 */ 260, 311, 371, 33, 314, 35, 375, 296, 20, 20, - /* 40 */ 4, 22, 21, 327, 328, 24, 25, 26, 27, 28, - /* 50 */ 29, 30, 31, 32, 287, 339, 56, 272, 288, 299, - /* 60 */ 273, 61, 302, 303, 277, 270, 296, 300, 68, 50, - /* 70 */ 20, 301, 22, 303, 12, 13, 14, 336, 283, 294, - /* 80 */ 44, 45, 20, 0, 22, 35, 291, 317, 259, 89, - /* 90 */ 261, 350, 351, 352, 353, 33, 355, 35, 328, 20, - /* 100 */ 50, 4, 332, 333, 334, 335, 336, 337, 288, 339, - /* 110 */ 20, 111, 342, 14, 358, 295, 346, 347, 56, 20, - /* 120 */ 14, 15, 16, 61, 304, 125, 126, 371, 358, 21, - /* 130 */ 68, 375, 24, 25, 26, 27, 28, 29, 30, 31, - /* 140 */ 32, 371, 60, 125, 126, 375, 63, 64, 65, 66, + /* 0 */ 268, 342, 343, 268, 268, 264, 268, 266, 267, 1, + /* 10 */ 2, 279, 12, 13, 279, 302, 303, 279, 286, 316, + /* 20 */ 20, 0, 22, 4, 286, 20, 20, 22, 296, 260, + /* 30 */ 290, 296, 296, 33, 296, 35, 264, 272, 266, 267, + /* 40 */ 35, 301, 21, 290, 20, 24, 25, 26, 27, 28, + /* 50 */ 29, 30, 31, 32, 301, 50, 56, 288, 273, 294, + /* 60 */ 357, 61, 277, 44, 45, 296, 326, 327, 68, 60, + /* 70 */ 301, 335, 303, 370, 12, 13, 14, 374, 338, 326, + /* 80 */ 327, 328, 20, 0, 22, 349, 350, 351, 352, 89, + /* 90 */ 354, 338, 288, 89, 20, 33, 327, 35, 90, 295, + /* 100 */ 331, 332, 333, 334, 335, 336, 21, 338, 304, 299, + /* 110 */ 341, 111, 302, 303, 345, 346, 347, 303, 56, 34, + /* 120 */ 288, 36, 20, 61, 310, 125, 126, 313, 359, 297, + /* 130 */ 68, 12, 13, 14, 15, 16, 367, 8, 9, 274, + /* 140 */ 275, 12, 13, 14, 15, 16, 63, 64, 65, 66, /* 150 */ 67, 89, 69, 70, 71, 72, 73, 74, 75, 76, /* 160 */ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - /* 170 */ 170, 37, 172, 111, 260, 8, 9, 257, 358, 12, - /* 180 */ 13, 14, 15, 16, 343, 344, 89, 125, 126, 265, - /* 190 */ 20, 371, 268, 193, 194, 375, 196, 197, 198, 199, + /* 170 */ 170, 21, 172, 111, 24, 25, 26, 27, 28, 29, + /* 180 */ 30, 31, 32, 56, 288, 89, 35, 125, 126, 120, + /* 190 */ 121, 89, 296, 193, 194, 56, 196, 197, 198, 199, /* 200 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - /* 210 */ 210, 211, 212, 213, 0, 301, 8, 9, 60, 20, - /* 220 */ 12, 13, 14, 15, 16, 20, 92, 227, 94, 95, - /* 230 */ 101, 97, 170, 121, 172, 101, 193, 317, 24, 25, - /* 240 */ 26, 27, 28, 29, 30, 31, 32, 157, 268, 120, - /* 250 */ 121, 122, 123, 124, 89, 193, 194, 123, 196, 197, + /* 210 */ 210, 211, 212, 213, 0, 88, 8, 9, 91, 68, + /* 220 */ 12, 13, 14, 15, 16, 20, 268, 227, 89, 333, + /* 230 */ 91, 227, 170, 165, 172, 22, 270, 279, 24, 25, + /* 240 */ 26, 27, 28, 29, 30, 31, 32, 178, 35, 0, + /* 250 */ 181, 268, 184, 185, 296, 193, 194, 291, 196, 197, /* 260 */ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - /* 270 */ 208, 209, 210, 211, 212, 213, 12, 13, 358, 236, - /* 280 */ 237, 238, 239, 240, 20, 305, 22, 317, 89, 177, - /* 290 */ 178, 371, 120, 181, 260, 375, 197, 33, 90, 35, + /* 270 */ 208, 209, 210, 211, 212, 213, 12, 13, 20, 296, + /* 280 */ 4, 68, 20, 20, 20, 152, 22, 20, 8, 9, + /* 290 */ 268, 162, 12, 13, 14, 15, 16, 33, 90, 35, /* 300 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - /* 310 */ 112, 4, 114, 115, 116, 117, 118, 119, 265, 288, - /* 320 */ 56, 268, 288, 155, 227, 61, 19, 296, 358, 162, - /* 330 */ 296, 296, 68, 20, 169, 301, 171, 303, 12, 13, - /* 340 */ 33, 371, 307, 89, 268, 375, 20, 89, 22, 268, - /* 350 */ 19, 179, 180, 89, 47, 260, 120, 121, 51, 33, - /* 360 */ 279, 35, 328, 56, 33, 334, 332, 333, 334, 335, - /* 370 */ 336, 337, 296, 339, 20, 111, 342, 296, 47, 288, - /* 380 */ 346, 347, 56, 52, 53, 54, 55, 56, 297, 125, - /* 390 */ 126, 68, 227, 22, 68, 88, 301, 56, 91, 260, - /* 400 */ 232, 233, 89, 12, 13, 14, 35, 290, 21, 260, - /* 410 */ 268, 20, 336, 22, 178, 89, 249, 181, 301, 88, - /* 420 */ 272, 34, 91, 36, 33, 20, 35, 351, 352, 353, - /* 430 */ 89, 355, 91, 285, 170, 14, 172, 111, 296, 68, - /* 440 */ 301, 20, 294, 89, 327, 328, 329, 56, 274, 275, - /* 450 */ 301, 125, 126, 1, 2, 124, 339, 193, 194, 68, + /* 310 */ 112, 4, 114, 115, 116, 117, 118, 119, 335, 20, + /* 320 */ 56, 22, 101, 227, 111, 61, 19, 305, 20, 227, + /* 330 */ 125, 126, 68, 350, 351, 352, 121, 354, 12, 13, + /* 340 */ 33, 120, 121, 122, 123, 124, 20, 214, 22, 50, + /* 350 */ 101, 89, 265, 89, 47, 268, 89, 224, 51, 33, + /* 360 */ 288, 35, 0, 56, 357, 89, 227, 295, 0, 120, + /* 370 */ 121, 122, 123, 124, 60, 111, 304, 370, 249, 3, + /* 380 */ 290, 374, 56, 170, 259, 172, 261, 272, 287, 125, + /* 390 */ 126, 301, 177, 178, 68, 88, 181, 357, 91, 68, + /* 400 */ 285, 300, 260, 12, 13, 14, 193, 194, 357, 294, + /* 410 */ 370, 20, 260, 22, 374, 89, 326, 327, 328, 100, + /* 420 */ 157, 370, 120, 155, 33, 374, 35, 280, 338, 357, + /* 430 */ 274, 275, 64, 65, 170, 288, 172, 111, 265, 71, + /* 440 */ 288, 268, 370, 301, 297, 20, 374, 56, 296, 81, + /* 450 */ 82, 125, 126, 301, 260, 303, 260, 193, 194, 68, /* 460 */ 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - /* 470 */ 206, 207, 208, 209, 210, 211, 212, 213, 336, 56, - /* 480 */ 89, 227, 111, 64, 65, 227, 56, 156, 0, 33, - /* 490 */ 71, 274, 275, 351, 352, 353, 170, 355, 172, 288, - /* 500 */ 81, 82, 111, 47, 3, 174, 295, 176, 52, 53, - /* 510 */ 54, 55, 56, 0, 91, 304, 125, 126, 88, 193, - /* 520 */ 194, 91, 196, 197, 198, 199, 200, 201, 202, 203, + /* 470 */ 206, 207, 208, 209, 210, 211, 212, 213, 68, 327, + /* 480 */ 89, 179, 180, 331, 332, 333, 334, 335, 336, 337, + /* 490 */ 338, 339, 340, 268, 227, 301, 170, 301, 172, 288, + /* 500 */ 232, 233, 111, 227, 0, 8, 9, 0, 14, 12, + /* 510 */ 13, 14, 15, 16, 20, 304, 125, 126, 289, 193, + /* 520 */ 194, 296, 196, 197, 198, 199, 200, 201, 202, 203, /* 530 */ 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - /* 540 */ 227, 170, 90, 172, 88, 0, 20, 91, 60, 270, - /* 550 */ 8, 9, 280, 227, 12, 13, 14, 15, 16, 0, - /* 560 */ 288, 170, 0, 172, 193, 194, 68, 317, 227, 297, - /* 570 */ 291, 296, 8, 9, 44, 45, 12, 13, 14, 15, - /* 580 */ 16, 227, 307, 100, 193, 194, 35, 196, 197, 198, + /* 540 */ 43, 8, 9, 289, 2, 12, 13, 14, 15, 16, + /* 550 */ 8, 9, 101, 227, 12, 13, 14, 15, 16, 2, + /* 560 */ 335, 170, 14, 172, 60, 8, 9, 60, 20, 12, + /* 570 */ 13, 14, 15, 16, 123, 350, 351, 352, 312, 354, + /* 580 */ 314, 260, 157, 289, 193, 194, 37, 196, 197, 198, /* 590 */ 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - /* 600 */ 209, 210, 211, 212, 213, 12, 13, 43, 358, 153, - /* 610 */ 154, 260, 156, 20, 101, 22, 160, 289, 197, 68, - /* 620 */ 303, 371, 60, 64, 65, 375, 33, 268, 35, 289, - /* 630 */ 71, 314, 176, 120, 121, 122, 123, 124, 279, 288, - /* 640 */ 81, 82, 39, 280, 268, 286, 101, 296, 260, 56, - /* 650 */ 14, 288, 301, 268, 303, 296, 20, 289, 77, 317, - /* 660 */ 297, 68, 317, 152, 279, 120, 121, 122, 123, 124, - /* 670 */ 8, 9, 296, 260, 12, 13, 14, 15, 16, 328, - /* 680 */ 260, 296, 89, 332, 333, 334, 335, 336, 337, 301, - /* 690 */ 339, 8, 9, 317, 321, 12, 13, 14, 15, 16, - /* 700 */ 358, 8, 9, 358, 111, 12, 13, 14, 15, 16, - /* 710 */ 129, 130, 336, 371, 301, 317, 371, 375, 125, 126, - /* 720 */ 375, 301, 313, 61, 315, 214, 260, 351, 352, 353, - /* 730 */ 268, 355, 12, 13, 358, 224, 260, 18, 330, 20, - /* 740 */ 20, 279, 22, 268, 61, 244, 27, 371, 286, 30, - /* 750 */ 289, 375, 90, 33, 279, 35, 358, 289, 296, 165, - /* 760 */ 98, 330, 354, 170, 0, 172, 47, 301, 49, 371, - /* 770 */ 51, 296, 260, 375, 260, 20, 56, 301, 184, 185, - /* 780 */ 313, 98, 315, 90, 260, 354, 193, 194, 68, 196, + /* 600 */ 209, 210, 211, 212, 213, 12, 13, 0, 320, 288, + /* 610 */ 280, 77, 0, 20, 268, 22, 289, 296, 288, 268, + /* 620 */ 244, 257, 301, 90, 303, 279, 33, 297, 35, 89, + /* 630 */ 279, 8, 9, 289, 329, 12, 13, 14, 15, 16, + /* 640 */ 193, 92, 296, 94, 95, 14, 97, 296, 327, 56, + /* 650 */ 101, 20, 331, 332, 333, 334, 335, 336, 353, 338, + /* 660 */ 48, 68, 341, 129, 130, 260, 345, 346, 347, 289, + /* 670 */ 8, 9, 123, 280, 12, 13, 14, 15, 16, 19, + /* 680 */ 316, 288, 89, 236, 237, 238, 239, 240, 367, 289, + /* 690 */ 297, 8, 9, 33, 268, 12, 13, 14, 15, 16, + /* 700 */ 14, 15, 16, 261, 111, 279, 301, 47, 101, 169, + /* 710 */ 288, 171, 52, 53, 54, 55, 56, 295, 125, 126, + /* 720 */ 377, 357, 296, 61, 368, 290, 304, 120, 121, 122, + /* 730 */ 123, 124, 12, 13, 370, 329, 301, 18, 374, 20, + /* 740 */ 20, 260, 22, 268, 61, 197, 27, 298, 88, 30, + /* 750 */ 301, 91, 90, 33, 279, 35, 39, 64, 65, 353, + /* 760 */ 98, 326, 327, 170, 71, 172, 47, 227, 49, 316, + /* 770 */ 51, 296, 316, 338, 81, 82, 56, 260, 4, 316, + /* 780 */ 157, 98, 301, 260, 124, 20, 193, 194, 68, 196, /* 790 */ 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - /* 800 */ 207, 208, 209, 210, 211, 212, 213, 88, 260, 89, - /* 810 */ 2, 288, 48, 301, 152, 301, 8, 9, 295, 100, - /* 820 */ 12, 13, 14, 15, 16, 301, 2, 304, 288, 226, - /* 830 */ 260, 111, 8, 9, 260, 152, 12, 13, 14, 15, - /* 840 */ 16, 276, 20, 278, 304, 125, 126, 128, 260, 301, + /* 800 */ 207, 208, 209, 210, 211, 212, 213, 88, 270, 89, + /* 810 */ 357, 268, 277, 357, 152, 303, 156, 329, 301, 100, + /* 820 */ 357, 283, 279, 370, 301, 313, 370, 374, 197, 291, + /* 830 */ 374, 111, 260, 370, 174, 152, 176, 374, 312, 296, + /* 840 */ 314, 353, 276, 323, 278, 125, 126, 128, 260, 269, /* 850 */ 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, /* 860 */ 141, 142, 143, 144, 145, 146, 147, 148, 260, 150, - /* 870 */ 151, 301, 101, 4, 260, 301, 214, 215, 216, 217, - /* 880 */ 218, 219, 220, 221, 222, 223, 224, 330, 298, 301, - /* 890 */ 170, 301, 172, 298, 123, 289, 301, 214, 215, 216, + /* 870 */ 151, 260, 298, 301, 260, 301, 214, 215, 216, 217, + /* 880 */ 218, 219, 220, 221, 222, 223, 224, 44, 45, 301, + /* 890 */ 170, 281, 172, 260, 284, 42, 43, 214, 215, 216, /* 900 */ 217, 218, 219, 220, 221, 222, 223, 224, 260, 301, - /* 910 */ 260, 354, 157, 193, 194, 301, 196, 197, 198, 199, + /* 910 */ 260, 260, 301, 193, 194, 301, 196, 197, 198, 199, /* 920 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - /* 930 */ 210, 211, 212, 213, 268, 18, 268, 268, 288, 35, - /* 940 */ 23, 268, 225, 226, 268, 279, 296, 279, 279, 301, - /* 950 */ 289, 301, 279, 303, 37, 38, 281, 43, 41, 284, - /* 960 */ 42, 43, 296, 0, 296, 296, 261, 317, 93, 296, - /* 970 */ 268, 96, 296, 0, 57, 58, 59, 290, 328, 0, - /* 980 */ 43, 279, 332, 333, 334, 335, 336, 337, 301, 339, - /* 990 */ 61, 93, 342, 317, 96, 22, 346, 347, 296, 12, - /* 1000 */ 13, 22, 268, 43, 90, 43, 89, 43, 358, 22, - /* 1010 */ 47, 0, 336, 279, 327, 328, 329, 157, 158, 197, - /* 1020 */ 33, 371, 35, 1, 2, 375, 339, 351, 352, 353, - /* 1030 */ 296, 355, 378, 22, 358, 268, 93, 290, 93, 96, - /* 1040 */ 43, 96, 260, 56, 127, 43, 279, 371, 301, 43, - /* 1050 */ 90, 375, 8, 9, 90, 68, 12, 13, 14, 15, - /* 1060 */ 16, 8, 9, 296, 43, 12, 13, 14, 15, 16, - /* 1070 */ 288, 268, 125, 126, 327, 328, 172, 277, 296, 162, - /* 1080 */ 163, 164, 279, 301, 167, 303, 339, 90, 269, 46, - /* 1090 */ 13, 369, 90, 35, 89, 365, 90, 228, 111, 296, - /* 1100 */ 183, 324, 43, 186, 99, 188, 189, 190, 191, 192, - /* 1110 */ 328, 90, 35, 43, 332, 333, 334, 335, 336, 337, - /* 1120 */ 268, 339, 193, 268, 342, 268, 268, 268, 346, 347, - /* 1130 */ 348, 279, 89, 35, 279, 268, 279, 279, 279, 13, - /* 1140 */ 43, 260, 360, 90, 227, 269, 279, 267, 296, 90, - /* 1150 */ 368, 296, 43, 296, 296, 296, 288, 170, 43, 172, - /* 1160 */ 90, 35, 300, 296, 331, 43, 68, 356, 372, 288, - /* 1170 */ 349, 372, 359, 372, 43, 43, 326, 296, 43, 229, - /* 1180 */ 193, 194, 301, 260, 303, 248, 47, 90, 325, 319, - /* 1190 */ 42, 168, 205, 206, 207, 208, 209, 210, 211, 90, - /* 1200 */ 308, 157, 20, 268, 268, 90, 152, 308, 246, 328, - /* 1210 */ 268, 288, 90, 332, 333, 334, 335, 336, 337, 296, - /* 1220 */ 339, 90, 90, 342, 301, 90, 303, 346, 347, 348, - /* 1230 */ 172, 306, 306, 268, 268, 20, 260, 262, 20, 262, - /* 1240 */ 272, 303, 323, 272, 316, 20, 20, 316, 318, 368, - /* 1250 */ 272, 328, 272, 260, 20, 332, 333, 334, 335, 336, - /* 1260 */ 337, 309, 339, 272, 288, 342, 272, 268, 272, 346, - /* 1270 */ 347, 348, 296, 288, 262, 262, 288, 301, 288, 303, - /* 1280 */ 357, 288, 268, 288, 301, 270, 288, 175, 288, 296, - /* 1290 */ 323, 288, 288, 268, 301, 288, 303, 288, 288, 270, - /* 1300 */ 268, 270, 316, 322, 328, 234, 154, 20, 332, 333, - /* 1310 */ 334, 335, 336, 337, 296, 339, 260, 270, 342, 303, - /* 1320 */ 312, 328, 346, 347, 348, 332, 333, 334, 335, 336, - /* 1330 */ 337, 301, 339, 357, 301, 342, 301, 301, 312, 346, - /* 1340 */ 347, 348, 301, 309, 288, 284, 270, 310, 331, 301, - /* 1350 */ 357, 312, 296, 235, 312, 241, 364, 301, 301, 303, - /* 1360 */ 161, 301, 243, 301, 301, 364, 260, 242, 230, 226, - /* 1370 */ 296, 326, 20, 317, 247, 245, 260, 89, 250, 330, - /* 1380 */ 89, 292, 301, 363, 328, 361, 367, 270, 332, 333, - /* 1390 */ 334, 335, 336, 337, 288, 339, 36, 268, 278, 263, - /* 1400 */ 362, 374, 296, 262, 288, 320, 366, 301, 315, 303, - /* 1410 */ 364, 345, 296, 271, 358, 282, 282, 301, 260, 303, - /* 1420 */ 258, 0, 282, 317, 373, 0, 374, 371, 373, 379, - /* 1430 */ 177, 375, 0, 0, 328, 42, 0, 373, 332, 333, - /* 1440 */ 334, 335, 336, 337, 328, 339, 288, 374, 332, 333, - /* 1450 */ 334, 335, 336, 337, 296, 339, 187, 35, 342, 301, - /* 1460 */ 187, 303, 346, 347, 358, 35, 35, 0, 0, 35, - /* 1470 */ 35, 187, 260, 35, 0, 35, 187, 371, 0, 22, - /* 1480 */ 0, 375, 35, 172, 260, 170, 328, 0, 0, 165, - /* 1490 */ 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - /* 1500 */ 288, 166, 0, 0, 46, 0, 42, 0, 296, 0, - /* 1510 */ 0, 149, 288, 301, 0, 303, 0, 0, 0, 0, - /* 1520 */ 296, 144, 0, 144, 35, 301, 0, 303, 0, 0, - /* 1530 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* 1540 */ 328, 260, 0, 42, 332, 333, 334, 335, 336, 337, - /* 1550 */ 0, 339, 328, 42, 56, 0, 332, 333, 334, 335, - /* 1560 */ 336, 337, 0, 339, 0, 260, 342, 22, 0, 288, - /* 1570 */ 0, 347, 0, 0, 293, 0, 0, 296, 0, 0, - /* 1580 */ 56, 0, 301, 260, 303, 0, 39, 43, 376, 377, - /* 1590 */ 0, 14, 46, 288, 14, 46, 40, 39, 293, 0, - /* 1600 */ 0, 296, 0, 161, 39, 0, 301, 0, 303, 328, - /* 1610 */ 0, 288, 0, 332, 333, 334, 335, 336, 337, 296, - /* 1620 */ 339, 62, 0, 35, 301, 39, 303, 0, 35, 47, - /* 1630 */ 47, 39, 0, 328, 47, 39, 35, 332, 333, 334, - /* 1640 */ 335, 336, 337, 0, 339, 260, 35, 39, 0, 0, - /* 1650 */ 47, 328, 0, 0, 0, 332, 333, 334, 335, 336, - /* 1660 */ 337, 98, 339, 260, 35, 96, 22, 43, 35, 43, - /* 1670 */ 35, 35, 22, 288, 0, 0, 0, 22, 22, 49, - /* 1680 */ 22, 296, 35, 0, 0, 0, 301, 22, 303, 20, - /* 1690 */ 0, 288, 35, 370, 35, 35, 0, 157, 173, 296, - /* 1700 */ 22, 0, 0, 0, 301, 157, 303, 0, 154, 157, - /* 1710 */ 159, 0, 89, 328, 89, 260, 0, 332, 333, 334, - /* 1720 */ 335, 336, 337, 182, 339, 0, 155, 90, 89, 89, - /* 1730 */ 39, 328, 46, 260, 89, 332, 333, 334, 335, 336, - /* 1740 */ 337, 99, 339, 288, 341, 46, 231, 153, 293, 43, - /* 1750 */ 46, 296, 90, 89, 231, 89, 301, 260, 303, 46, - /* 1760 */ 90, 288, 377, 90, 43, 43, 293, 90, 89, 296, - /* 1770 */ 89, 89, 43, 43, 301, 35, 303, 90, 89, 46, - /* 1780 */ 46, 43, 90, 328, 90, 288, 225, 332, 333, 334, - /* 1790 */ 335, 336, 337, 296, 339, 90, 35, 231, 301, 90, - /* 1800 */ 303, 328, 35, 35, 35, 332, 333, 334, 335, 336, - /* 1810 */ 337, 35, 339, 260, 2, 22, 43, 89, 46, 22, - /* 1820 */ 89, 193, 35, 46, 89, 328, 90, 260, 89, 332, - /* 1830 */ 333, 334, 335, 336, 337, 90, 339, 90, 89, 89, - /* 1840 */ 35, 288, 100, 90, 89, 89, 195, 90, 35, 296, - /* 1850 */ 90, 35, 89, 35, 301, 288, 303, 35, 22, 113, - /* 1860 */ 90, 90, 35, 296, 89, 113, 101, 89, 301, 260, - /* 1870 */ 303, 113, 113, 43, 89, 89, 22, 89, 61, 260, - /* 1880 */ 35, 328, 62, 35, 35, 332, 333, 334, 335, 336, - /* 1890 */ 337, 35, 339, 35, 35, 328, 35, 288, 87, 332, - /* 1900 */ 333, 334, 335, 336, 337, 296, 339, 288, 68, 43, - /* 1910 */ 301, 35, 303, 35, 22, 296, 35, 22, 35, 35, - /* 1920 */ 301, 260, 303, 68, 35, 22, 35, 0, 35, 35, - /* 1930 */ 0, 35, 35, 35, 47, 35, 0, 328, 39, 35, - /* 1940 */ 39, 332, 333, 334, 335, 336, 337, 328, 339, 288, - /* 1950 */ 39, 332, 333, 334, 335, 336, 337, 296, 339, 47, - /* 1960 */ 47, 0, 301, 35, 303, 47, 0, 35, 39, 35, - /* 1970 */ 0, 22, 21, 21, 260, 22, 22, 20, 380, 380, - /* 1980 */ 380, 380, 380, 380, 380, 380, 380, 380, 380, 328, - /* 1990 */ 380, 380, 260, 332, 333, 334, 335, 336, 337, 380, - /* 2000 */ 339, 380, 288, 380, 380, 380, 380, 380, 380, 380, - /* 2010 */ 296, 380, 380, 380, 380, 301, 380, 303, 380, 380, - /* 2020 */ 288, 380, 380, 380, 380, 380, 380, 380, 296, 380, - /* 2030 */ 380, 380, 380, 301, 380, 303, 380, 380, 380, 380, - /* 2040 */ 380, 380, 328, 380, 260, 380, 332, 333, 334, 335, - /* 2050 */ 336, 337, 380, 339, 260, 380, 380, 380, 380, 380, - /* 2060 */ 328, 380, 380, 380, 332, 333, 334, 335, 336, 337, - /* 2070 */ 260, 339, 288, 380, 380, 380, 380, 380, 380, 380, - /* 2080 */ 296, 380, 288, 380, 380, 301, 380, 303, 380, 380, - /* 2090 */ 296, 380, 380, 380, 380, 301, 380, 303, 288, 380, - /* 2100 */ 380, 380, 380, 380, 380, 380, 296, 380, 380, 380, - /* 2110 */ 380, 301, 328, 303, 380, 380, 332, 333, 334, 335, - /* 2120 */ 336, 337, 328, 339, 260, 380, 332, 333, 334, 335, - /* 2130 */ 336, 337, 380, 339, 380, 380, 380, 380, 328, 380, - /* 2140 */ 260, 380, 332, 333, 334, 335, 336, 337, 380, 339, - /* 2150 */ 260, 380, 288, 380, 380, 380, 380, 380, 380, 380, - /* 2160 */ 296, 380, 380, 380, 380, 301, 260, 303, 288, 380, - /* 2170 */ 380, 380, 380, 380, 380, 380, 296, 380, 288, 380, - /* 2180 */ 380, 301, 380, 303, 380, 380, 296, 380, 380, 380, - /* 2190 */ 380, 301, 328, 303, 288, 380, 332, 333, 334, 335, - /* 2200 */ 336, 337, 296, 339, 380, 380, 380, 301, 328, 303, - /* 2210 */ 380, 380, 332, 333, 334, 335, 336, 337, 328, 339, - /* 2220 */ 380, 380, 332, 333, 334, 335, 336, 337, 380, 339, - /* 2230 */ 380, 380, 380, 380, 328, 260, 380, 380, 332, 333, - /* 2240 */ 334, 335, 336, 337, 380, 339, 380, 380, 380, 380, - /* 2250 */ 380, 380, 380, 260, 380, 380, 380, 380, 380, 380, - /* 2260 */ 380, 380, 380, 288, 380, 380, 380, 380, 380, 380, - /* 2270 */ 380, 296, 380, 380, 380, 380, 301, 380, 303, 380, - /* 2280 */ 380, 288, 380, 380, 380, 380, 380, 380, 380, 296, - /* 2290 */ 380, 380, 380, 380, 301, 380, 303, 380, 380, 380, - /* 2300 */ 380, 380, 380, 328, 380, 260, 380, 332, 333, 334, - /* 2310 */ 335, 336, 337, 380, 339, 260, 380, 380, 380, 380, - /* 2320 */ 380, 328, 380, 380, 380, 332, 333, 334, 335, 336, - /* 2330 */ 337, 380, 339, 288, 380, 380, 380, 380, 380, 380, - /* 2340 */ 380, 296, 380, 288, 380, 380, 301, 380, 303, 380, - /* 2350 */ 380, 296, 380, 380, 380, 380, 301, 380, 303, 380, - /* 2360 */ 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, - /* 2370 */ 380, 380, 380, 328, 380, 380, 380, 332, 333, 334, - /* 2380 */ 335, 336, 337, 328, 339, 380, 380, 332, 333, 334, - /* 2390 */ 335, 336, 337, 380, 339, + /* 930 */ 210, 211, 212, 213, 301, 18, 296, 260, 288, 296, + /* 940 */ 23, 225, 226, 226, 56, 43, 296, 307, 260, 301, + /* 950 */ 307, 301, 301, 303, 37, 38, 260, 260, 41, 260, + /* 960 */ 157, 158, 197, 8, 9, 288, 316, 12, 13, 14, + /* 970 */ 15, 16, 0, 296, 57, 58, 59, 327, 301, 91, + /* 980 */ 303, 331, 332, 333, 334, 335, 336, 93, 338, 301, + /* 990 */ 96, 341, 90, 316, 364, 345, 346, 301, 301, 0, + /* 1000 */ 301, 316, 228, 43, 327, 268, 89, 357, 331, 332, + /* 1010 */ 333, 334, 335, 336, 93, 338, 279, 96, 341, 47, + /* 1020 */ 370, 22, 345, 346, 374, 93, 35, 93, 96, 268, + /* 1030 */ 96, 12, 13, 296, 357, 268, 0, 268, 268, 35, + /* 1040 */ 279, 22, 357, 43, 127, 90, 279, 370, 279, 279, + /* 1050 */ 260, 374, 33, 269, 35, 370, 288, 296, 22, 374, + /* 1060 */ 268, 268, 268, 296, 61, 296, 296, 43, 35, 43, + /* 1070 */ 330, 279, 279, 279, 268, 56, 0, 267, 288, 162, + /* 1080 */ 163, 164, 43, 268, 167, 279, 296, 68, 296, 296, + /* 1090 */ 296, 301, 43, 303, 279, 43, 43, 300, 22, 268, + /* 1100 */ 183, 68, 296, 186, 268, 188, 189, 190, 191, 192, + /* 1110 */ 279, 296, 260, 43, 90, 279, 90, 327, 1, 2, + /* 1120 */ 43, 331, 332, 333, 334, 335, 336, 296, 338, 90, + /* 1130 */ 111, 341, 296, 125, 126, 345, 346, 347, 46, 90, + /* 1140 */ 288, 355, 90, 90, 227, 229, 356, 43, 296, 89, + /* 1150 */ 13, 13, 348, 301, 43, 303, 43, 43, 371, 99, + /* 1160 */ 90, 324, 43, 172, 260, 358, 371, 90, 43, 371, + /* 1170 */ 43, 325, 35, 35, 168, 47, 172, 318, 42, 327, + /* 1180 */ 308, 89, 20, 331, 332, 333, 334, 335, 336, 170, + /* 1190 */ 338, 172, 288, 341, 90, 268, 193, 345, 346, 347, + /* 1200 */ 296, 90, 152, 90, 90, 301, 246, 303, 356, 90, + /* 1210 */ 268, 308, 193, 194, 306, 90, 260, 90, 306, 268, + /* 1220 */ 268, 268, 20, 262, 205, 206, 207, 208, 209, 210, + /* 1230 */ 211, 327, 262, 20, 272, 331, 332, 333, 334, 335, + /* 1240 */ 336, 322, 338, 260, 288, 341, 303, 272, 248, 345, + /* 1250 */ 346, 347, 296, 20, 315, 20, 272, 301, 317, 303, + /* 1260 */ 356, 315, 272, 268, 272, 272, 272, 262, 288, 288, + /* 1270 */ 288, 288, 316, 288, 288, 288, 288, 288, 262, 296, + /* 1280 */ 268, 322, 175, 327, 301, 288, 303, 331, 332, 333, + /* 1290 */ 334, 335, 336, 270, 338, 260, 268, 288, 288, 316, + /* 1300 */ 321, 303, 301, 234, 270, 268, 154, 311, 270, 284, + /* 1310 */ 327, 260, 301, 357, 331, 332, 333, 334, 335, 336, + /* 1320 */ 235, 338, 315, 288, 311, 270, 370, 309, 301, 270, + /* 1330 */ 374, 296, 301, 301, 20, 241, 301, 296, 303, 288, + /* 1340 */ 357, 301, 366, 301, 330, 161, 301, 296, 301, 243, + /* 1350 */ 242, 230, 301, 370, 303, 311, 226, 374, 301, 311, + /* 1360 */ 296, 20, 327, 301, 89, 363, 331, 332, 333, 334, + /* 1370 */ 335, 336, 250, 338, 245, 89, 341, 362, 327, 247, + /* 1380 */ 345, 346, 331, 332, 333, 334, 335, 336, 325, 338, + /* 1390 */ 329, 260, 341, 363, 365, 373, 345, 346, 378, 301, + /* 1400 */ 36, 260, 292, 268, 278, 263, 363, 361, 262, 344, + /* 1410 */ 270, 314, 319, 258, 360, 282, 282, 0, 271, 288, + /* 1420 */ 0, 282, 177, 0, 0, 42, 0, 296, 372, 288, + /* 1430 */ 35, 373, 301, 187, 303, 35, 35, 296, 372, 35, + /* 1440 */ 373, 187, 301, 372, 303, 0, 35, 35, 187, 0, + /* 1450 */ 260, 187, 0, 35, 0, 22, 0, 35, 327, 172, + /* 1460 */ 170, 0, 331, 332, 333, 334, 335, 336, 327, 338, + /* 1470 */ 0, 166, 331, 332, 333, 334, 335, 336, 288, 338, + /* 1480 */ 165, 0, 341, 293, 0, 46, 296, 346, 0, 42, + /* 1490 */ 0, 301, 0, 303, 0, 149, 0, 0, 0, 260, + /* 1500 */ 144, 35, 0, 144, 0, 0, 375, 376, 0, 0, + /* 1510 */ 0, 260, 0, 0, 0, 0, 0, 327, 0, 0, + /* 1520 */ 0, 331, 332, 333, 334, 335, 336, 288, 338, 0, + /* 1530 */ 0, 0, 293, 42, 0, 296, 0, 0, 0, 288, + /* 1540 */ 301, 0, 303, 0, 22, 0, 0, 296, 0, 0, + /* 1550 */ 0, 56, 301, 0, 303, 56, 0, 0, 14, 42, + /* 1560 */ 260, 14, 39, 0, 43, 40, 327, 39, 0, 0, + /* 1570 */ 331, 332, 333, 334, 335, 336, 260, 338, 327, 46, + /* 1580 */ 0, 46, 331, 332, 333, 334, 335, 336, 288, 338, + /* 1590 */ 39, 0, 161, 0, 0, 0, 296, 0, 39, 35, + /* 1600 */ 0, 301, 62, 303, 288, 47, 35, 47, 0, 39, + /* 1610 */ 35, 39, 296, 47, 0, 39, 35, 301, 0, 303, + /* 1620 */ 369, 47, 0, 0, 0, 98, 22, 327, 96, 260, + /* 1630 */ 43, 331, 332, 333, 334, 335, 336, 35, 338, 0, + /* 1640 */ 35, 260, 43, 327, 35, 35, 0, 331, 332, 333, + /* 1650 */ 334, 335, 336, 22, 338, 0, 340, 288, 22, 22, + /* 1660 */ 49, 0, 293, 22, 35, 296, 33, 0, 0, 288, + /* 1670 */ 301, 0, 303, 35, 293, 35, 376, 296, 22, 20, + /* 1680 */ 47, 0, 301, 157, 303, 52, 53, 54, 55, 56, + /* 1690 */ 260, 22, 35, 0, 0, 0, 327, 173, 159, 157, + /* 1700 */ 331, 332, 333, 334, 335, 336, 154, 338, 327, 0, + /* 1710 */ 0, 157, 331, 332, 333, 334, 335, 336, 288, 338, + /* 1720 */ 0, 88, 0, 89, 91, 90, 296, 0, 155, 39, + /* 1730 */ 46, 301, 89, 303, 89, 153, 89, 182, 231, 260, + /* 1740 */ 43, 89, 89, 99, 90, 43, 43, 46, 90, 35, + /* 1750 */ 90, 89, 46, 90, 89, 89, 43, 327, 46, 89, + /* 1760 */ 260, 331, 332, 333, 334, 335, 336, 288, 338, 90, + /* 1770 */ 90, 89, 43, 90, 46, 296, 46, 90, 43, 90, + /* 1780 */ 301, 35, 303, 35, 35, 35, 153, 154, 288, 156, + /* 1790 */ 225, 35, 2, 160, 22, 43, 296, 89, 231, 193, + /* 1800 */ 89, 301, 22, 303, 46, 90, 327, 90, 89, 176, + /* 1810 */ 331, 332, 333, 334, 335, 336, 90, 338, 100, 231, + /* 1820 */ 89, 260, 89, 46, 90, 89, 35, 327, 35, 90, + /* 1830 */ 89, 331, 332, 333, 334, 335, 336, 260, 338, 35, + /* 1840 */ 89, 35, 89, 195, 90, 90, 35, 90, 89, 288, + /* 1850 */ 35, 89, 22, 268, 89, 113, 113, 296, 113, 89, + /* 1860 */ 113, 101, 301, 35, 303, 288, 43, 89, 22, 62, + /* 1870 */ 61, 35, 35, 296, 35, 35, 35, 35, 301, 35, + /* 1880 */ 303, 296, 68, 87, 35, 35, 43, 22, 327, 35, + /* 1890 */ 260, 22, 331, 332, 333, 334, 335, 336, 35, 338, + /* 1900 */ 268, 316, 260, 35, 327, 35, 68, 35, 331, 332, + /* 1910 */ 333, 334, 335, 336, 35, 338, 35, 35, 288, 22, + /* 1920 */ 335, 35, 0, 35, 47, 0, 296, 35, 296, 39, + /* 1930 */ 288, 301, 47, 303, 39, 350, 351, 352, 296, 354, + /* 1940 */ 0, 35, 357, 301, 39, 303, 47, 0, 316, 35, + /* 1950 */ 47, 260, 39, 0, 35, 370, 35, 327, 0, 374, + /* 1960 */ 22, 331, 332, 333, 334, 335, 336, 335, 338, 327, + /* 1970 */ 21, 20, 22, 331, 332, 333, 334, 335, 336, 288, + /* 1980 */ 338, 22, 350, 351, 352, 21, 354, 296, 379, 357, + /* 1990 */ 379, 379, 301, 379, 303, 379, 379, 379, 379, 379, + /* 2000 */ 260, 379, 370, 379, 379, 379, 374, 379, 379, 379, + /* 2010 */ 379, 379, 379, 379, 379, 379, 379, 379, 327, 379, + /* 2020 */ 379, 260, 331, 332, 333, 334, 335, 336, 288, 338, + /* 2030 */ 379, 379, 379, 379, 379, 379, 296, 379, 379, 379, + /* 2040 */ 379, 301, 379, 303, 379, 379, 379, 379, 379, 288, + /* 2050 */ 379, 379, 379, 379, 379, 379, 379, 296, 379, 379, + /* 2060 */ 379, 379, 301, 379, 303, 379, 379, 327, 379, 379, + /* 2070 */ 260, 331, 332, 333, 334, 335, 336, 379, 338, 379, + /* 2080 */ 379, 379, 260, 379, 379, 379, 379, 379, 327, 379, + /* 2090 */ 379, 379, 331, 332, 333, 334, 335, 336, 288, 338, + /* 2100 */ 379, 379, 379, 379, 379, 379, 296, 379, 379, 379, + /* 2110 */ 288, 301, 379, 303, 379, 379, 379, 379, 296, 379, + /* 2120 */ 379, 379, 379, 301, 379, 303, 379, 379, 379, 379, + /* 2130 */ 379, 379, 379, 379, 260, 379, 379, 327, 379, 379, + /* 2140 */ 379, 331, 332, 333, 334, 335, 336, 379, 338, 327, + /* 2150 */ 379, 260, 379, 331, 332, 333, 334, 335, 336, 379, + /* 2160 */ 338, 379, 288, 379, 379, 379, 379, 379, 379, 379, + /* 2170 */ 296, 379, 379, 379, 379, 301, 379, 303, 379, 288, + /* 2180 */ 379, 379, 379, 379, 379, 379, 379, 296, 379, 379, + /* 2190 */ 379, 379, 301, 379, 303, 379, 379, 379, 379, 379, + /* 2200 */ 379, 327, 379, 379, 260, 331, 332, 333, 334, 335, + /* 2210 */ 336, 379, 338, 379, 379, 379, 379, 379, 327, 379, + /* 2220 */ 379, 379, 331, 332, 333, 334, 335, 336, 379, 338, + /* 2230 */ 379, 379, 288, 379, 379, 379, 379, 379, 379, 379, + /* 2240 */ 296, 379, 379, 379, 379, 301, 379, 303, 379, 379, + /* 2250 */ 379, 379, 379, 260, 379, 379, 379, 379, 379, 379, + /* 2260 */ 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, + /* 2270 */ 379, 327, 379, 379, 379, 331, 332, 333, 334, 335, + /* 2280 */ 336, 288, 338, 379, 379, 379, 379, 379, 379, 296, + /* 2290 */ 379, 379, 379, 379, 301, 379, 303, 379, 379, 379, + /* 2300 */ 379, 379, 260, 379, 379, 379, 379, 379, 379, 379, + /* 2310 */ 379, 379, 379, 379, 379, 379, 379, 379, 260, 379, + /* 2320 */ 327, 379, 379, 379, 331, 332, 333, 334, 335, 336, + /* 2330 */ 288, 338, 379, 379, 379, 379, 379, 379, 296, 379, + /* 2340 */ 379, 379, 379, 301, 379, 303, 288, 379, 379, 379, + /* 2350 */ 379, 379, 379, 379, 296, 379, 379, 379, 379, 301, + /* 2360 */ 379, 303, 379, 379, 379, 379, 379, 260, 379, 327, + /* 2370 */ 379, 379, 379, 331, 332, 333, 334, 335, 336, 260, + /* 2380 */ 338, 379, 379, 379, 379, 327, 379, 379, 379, 331, + /* 2390 */ 332, 333, 334, 335, 336, 288, 338, 379, 379, 379, + /* 2400 */ 379, 379, 379, 296, 379, 379, 379, 288, 301, 379, + /* 2410 */ 303, 379, 379, 379, 379, 296, 379, 379, 379, 379, + /* 2420 */ 301, 379, 303, 379, 379, 379, 379, 379, 379, 379, + /* 2430 */ 379, 379, 379, 379, 327, 379, 379, 379, 331, 332, + /* 2440 */ 333, 334, 335, 336, 379, 338, 327, 379, 379, 379, + /* 2450 */ 331, 332, 333, 334, 335, 336, 379, 338, }; #define YY_SHIFT_COUNT (665) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (1970) +#define YY_SHIFT_MAX (1964) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 917, 0, 0, 62, 62, 264, 264, 264, 326, 326, /* 10 */ 264, 264, 391, 593, 720, 593, 593, 593, 593, 593, /* 20 */ 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, /* 30 */ 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, - /* 40 */ 593, 593, 313, 313, 199, 199, 199, 987, 987, 354, - /* 50 */ 987, 987, 165, 341, 254, 258, 254, 79, 79, 36, - /* 60 */ 36, 97, 18, 254, 254, 79, 79, 79, 79, 79, - /* 70 */ 79, 79, 79, 79, 82, 79, 79, 79, 170, 79, - /* 80 */ 205, 79, 79, 205, 405, 79, 205, 205, 205, 79, - /* 90 */ 158, 719, 662, 683, 683, 108, 371, 371, 371, 371, - /* 100 */ 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, - /* 110 */ 371, 371, 371, 371, 371, 134, 419, 18, 636, 636, - /* 120 */ 488, 551, 562, 90, 90, 90, 551, 526, 526, 170, - /* 130 */ 16, 16, 205, 205, 323, 323, 483, 498, 198, 198, - /* 140 */ 198, 198, 198, 198, 198, 331, 21, 167, 559, 43, - /* 150 */ 50, 112, 168, 99, 421, 19, 530, 771, 755, 717, - /* 160 */ 603, 717, 918, 501, 501, 501, 869, 822, 950, 1139, - /* 170 */ 1023, 1148, 1182, 1182, 1148, 1054, 1054, 1182, 1182, 1182, - /* 180 */ 1215, 1215, 1218, 82, 170, 82, 1225, 1226, 82, 1225, - /* 190 */ 82, 1234, 82, 82, 1182, 82, 1215, 205, 205, 205, - /* 200 */ 205, 205, 205, 205, 205, 205, 205, 205, 1182, 1215, - /* 210 */ 323, 1218, 158, 1112, 170, 158, 1182, 1182, 1225, 158, - /* 220 */ 1071, 323, 323, 323, 323, 1071, 323, 1152, 1234, 158, - /* 230 */ 483, 158, 526, 1287, 323, 1118, 1071, 323, 323, 1118, - /* 240 */ 1071, 323, 323, 205, 1114, 1199, 1118, 1119, 1125, 1138, - /* 250 */ 950, 1143, 526, 1352, 1127, 1130, 1128, 1127, 1130, 1127, - /* 260 */ 1130, 1288, 1291, 323, 498, 1182, 158, 1360, 1215, 2395, - /* 270 */ 2395, 2395, 2395, 2395, 2395, 2395, 83, 456, 214, 307, - /* 280 */ 208, 564, 693, 808, 824, 1044, 1053, 513, 542, 542, - /* 290 */ 542, 542, 542, 542, 542, 542, 545, 129, 13, 13, - /* 300 */ 236, 594, 430, 581, 387, 172, 452, 511, 106, 106, - /* 310 */ 106, 106, 914, 963, 875, 898, 943, 945, 973, 979, - /* 320 */ 1011, 423, 860, 960, 964, 997, 1002, 1021, 1059, 1070, - /* 330 */ 1022, 947, 962, 937, 1006, 904, 1058, 929, 1097, 1043, - /* 340 */ 1109, 1115, 1122, 1131, 1132, 1135, 1005, 1077, 1126, 1098, - /* 350 */ 764, 1421, 1425, 1253, 1432, 1433, 1393, 1436, 1422, 1269, - /* 360 */ 1430, 1431, 1434, 1273, 1467, 1435, 1438, 1284, 1468, 1289, - /* 370 */ 1474, 1440, 1478, 1457, 1480, 1447, 1311, 1315, 1487, 1488, - /* 380 */ 1335, 1324, 1502, 1503, 1458, 1505, 1464, 1507, 1509, 1510, - /* 390 */ 1362, 1514, 1516, 1517, 1518, 1519, 1377, 1489, 1522, 1379, - /* 400 */ 1526, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, - /* 410 */ 1537, 1538, 1539, 1542, 1501, 1550, 1562, 1564, 1570, 1572, - /* 420 */ 1573, 1545, 1568, 1575, 1576, 1578, 1579, 1498, 1555, 1524, - /* 430 */ 1581, 1585, 1511, 1547, 1544, 1577, 1546, 1580, 1549, 1590, - /* 440 */ 1556, 1558, 1599, 1600, 1602, 1565, 1442, 1605, 1607, 1610, - /* 450 */ 1559, 1612, 1622, 1588, 1582, 1586, 1627, 1593, 1583, 1592, - /* 460 */ 1632, 1601, 1587, 1596, 1643, 1611, 1603, 1608, 1648, 1649, - /* 470 */ 1652, 1653, 1563, 1569, 1629, 1644, 1654, 1633, 1624, 1626, - /* 480 */ 1635, 1636, 1650, 1674, 1655, 1675, 1656, 1630, 1676, 1658, - /* 490 */ 1647, 1683, 1657, 1684, 1659, 1685, 1665, 1669, 1690, 1540, - /* 500 */ 1660, 1696, 1525, 1678, 1548, 1554, 1701, 1702, 1552, 1551, - /* 510 */ 1703, 1707, 1711, 1623, 1637, 1541, 1716, 1625, 1571, 1639, - /* 520 */ 1725, 1691, 1594, 1640, 1642, 1686, 1706, 1515, 1645, 1662, - /* 530 */ 1664, 1670, 1673, 1666, 1721, 1677, 1679, 1681, 1682, 1687, - /* 540 */ 1722, 1699, 1704, 1689, 1729, 1523, 1692, 1694, 1713, 1561, - /* 550 */ 1730, 1733, 1734, 1705, 1738, 1566, 1709, 1740, 1761, 1767, - /* 560 */ 1768, 1769, 1776, 1709, 1812, 1793, 1628, 1773, 1728, 1736, - /* 570 */ 1731, 1745, 1735, 1747, 1772, 1739, 1749, 1777, 1797, 1651, - /* 580 */ 1750, 1742, 1753, 1787, 1805, 1755, 1757, 1813, 1756, 1760, - /* 590 */ 1816, 1763, 1770, 1818, 1775, 1771, 1822, 1778, 1746, 1752, - /* 600 */ 1758, 1759, 1836, 1765, 1785, 1786, 1827, 1788, 1830, 1830, - /* 610 */ 1854, 1820, 1817, 1845, 1848, 1849, 1856, 1858, 1859, 1861, - /* 620 */ 1840, 1811, 1866, 1876, 1878, 1892, 1881, 1895, 1883, 1884, - /* 630 */ 1855, 1624, 1889, 1626, 1891, 1893, 1894, 1896, 1903, 1897, - /* 640 */ 1927, 1898, 1887, 1899, 1930, 1900, 1912, 1901, 1936, 1904, - /* 650 */ 1913, 1911, 1961, 1928, 1918, 1929, 1966, 1932, 1934, 1970, - /* 660 */ 1949, 1951, 1953, 1954, 1952, 1957, + /* 40 */ 593, 593, 102, 102, 262, 262, 262, 1019, 1019, 267, + /* 50 */ 1019, 1019, 540, 139, 4, 96, 4, 6, 6, 19, + /* 60 */ 19, 276, 205, 4, 4, 6, 6, 6, 6, 6, + /* 70 */ 6, 6, 6, 6, 6, 9, 6, 6, 6, 24, + /* 80 */ 6, 6, 74, 6, 6, 74, 258, 6, 74, 74, + /* 90 */ 74, 6, 314, 719, 662, 683, 683, 150, 213, 213, + /* 100 */ 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + /* 110 */ 213, 213, 213, 213, 213, 213, 213, 549, 693, 205, + /* 120 */ 494, 494, 504, 151, 507, 263, 263, 263, 151, 308, + /* 130 */ 308, 24, 362, 362, 74, 74, 331, 331, 319, 410, + /* 140 */ 198, 198, 198, 198, 198, 198, 198, 660, 21, 129, + /* 150 */ 368, 447, 5, 215, 268, 548, 631, 299, 843, 451, + /* 160 */ 425, 716, 717, 716, 853, 376, 376, 376, 774, 765, + /* 170 */ 916, 1128, 1006, 1136, 1162, 1162, 1136, 1050, 1050, 1162, + /* 180 */ 1162, 1162, 1202, 1202, 1213, 9, 24, 9, 1233, 1235, + /* 190 */ 9, 1233, 9, 9, 9, 1162, 9, 1202, 74, 74, + /* 200 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 1162, + /* 210 */ 1202, 331, 1213, 314, 1107, 24, 314, 1162, 1162, 1233, + /* 220 */ 314, 1069, 331, 331, 331, 331, 1069, 331, 1152, 314, + /* 230 */ 319, 314, 308, 1314, 331, 1085, 1069, 331, 331, 1085, + /* 240 */ 1069, 331, 331, 74, 1094, 1184, 1085, 1106, 1108, 1121, + /* 250 */ 916, 1130, 308, 1341, 1132, 1129, 1122, 1132, 1129, 1132, + /* 260 */ 1129, 1275, 1286, 331, 410, 1162, 314, 1364, 1202, 2458, + /* 270 */ 2458, 2458, 2458, 2458, 2458, 2458, 83, 1633, 214, 307, + /* 280 */ 208, 497, 533, 542, 557, 623, 955, 249, 280, 280, + /* 290 */ 280, 280, 280, 280, 280, 280, 607, 221, 119, 119, + /* 300 */ 69, 68, 127, 534, 85, 302, 8, 133, 686, 686, + /* 310 */ 686, 686, 902, 972, 894, 921, 932, 934, 999, 1036, + /* 320 */ 1076, 888, 803, 1024, 1026, 1039, 1049, 1052, 1053, 1070, + /* 330 */ 1117, 1008, 960, 1000, 1077, 991, 1004, 1003, 1104, 1092, + /* 340 */ 1111, 1113, 1114, 1119, 1125, 1127, 1060, 1137, 1138, 1033, + /* 350 */ 612, 1417, 1420, 1245, 1423, 1424, 1383, 1426, 1395, 1246, + /* 360 */ 1400, 1401, 1404, 1254, 1445, 1411, 1412, 1261, 1449, 1264, + /* 370 */ 1452, 1418, 1454, 1433, 1456, 1422, 1287, 1290, 1461, 1470, + /* 380 */ 1305, 1315, 1481, 1484, 1439, 1488, 1447, 1490, 1492, 1494, + /* 390 */ 1346, 1496, 1497, 1498, 1508, 1509, 1356, 1466, 1502, 1359, + /* 400 */ 1504, 1505, 1510, 1512, 1513, 1514, 1515, 1516, 1518, 1519, + /* 410 */ 1520, 1529, 1530, 1531, 1491, 1534, 1536, 1537, 1538, 1541, + /* 420 */ 1543, 1522, 1545, 1546, 1548, 1549, 1550, 1495, 1553, 1499, + /* 430 */ 1556, 1557, 1517, 1523, 1521, 1544, 1533, 1547, 1535, 1563, + /* 440 */ 1525, 1528, 1568, 1569, 1580, 1551, 1431, 1591, 1593, 1594, + /* 450 */ 1540, 1595, 1597, 1564, 1558, 1559, 1600, 1571, 1560, 1570, + /* 460 */ 1608, 1575, 1566, 1572, 1614, 1581, 1574, 1576, 1618, 1622, + /* 470 */ 1623, 1624, 1527, 1532, 1602, 1604, 1639, 1605, 1587, 1599, + /* 480 */ 1609, 1610, 1631, 1646, 1636, 1655, 1637, 1611, 1661, 1641, + /* 490 */ 1629, 1667, 1638, 1668, 1640, 1671, 1656, 1659, 1681, 1526, + /* 500 */ 1657, 1693, 1524, 1669, 1542, 1552, 1694, 1695, 1554, 1539, + /* 510 */ 1709, 1710, 1720, 1634, 1635, 1555, 1722, 1643, 1573, 1645, + /* 520 */ 1727, 1690, 1582, 1647, 1644, 1684, 1697, 1507, 1652, 1654, + /* 530 */ 1653, 1658, 1660, 1662, 1702, 1663, 1665, 1666, 1670, 1679, + /* 540 */ 1703, 1701, 1706, 1682, 1713, 1567, 1680, 1683, 1712, 1565, + /* 550 */ 1729, 1728, 1730, 1687, 1735, 1588, 1689, 1714, 1746, 1748, + /* 560 */ 1749, 1750, 1756, 1689, 1790, 1772, 1606, 1752, 1708, 1715, + /* 570 */ 1711, 1717, 1719, 1726, 1758, 1731, 1733, 1777, 1780, 1648, + /* 580 */ 1736, 1718, 1734, 1791, 1793, 1741, 1739, 1804, 1751, 1754, + /* 590 */ 1806, 1753, 1755, 1811, 1759, 1757, 1815, 1762, 1742, 1743, + /* 600 */ 1745, 1747, 1830, 1760, 1765, 1770, 1828, 1778, 1823, 1823, + /* 610 */ 1846, 1807, 1809, 1836, 1837, 1839, 1840, 1841, 1842, 1844, + /* 620 */ 1814, 1796, 1843, 1849, 1850, 1865, 1854, 1869, 1863, 1868, + /* 630 */ 1838, 1587, 1870, 1599, 1872, 1879, 1881, 1882, 1897, 1886, + /* 640 */ 1922, 1888, 1877, 1890, 1925, 1892, 1885, 1895, 1940, 1906, + /* 650 */ 1899, 1905, 1947, 1914, 1903, 1913, 1953, 1919, 1921, 1958, + /* 660 */ 1938, 1949, 1950, 1959, 1964, 1951, }; #define YY_REDUCE_COUNT (275) -#define YY_REDUCE_MIN (-357) -#define YY_REDUCE_MAX (2055) +#define YY_REDUCE_MIN (-341) +#define YY_REDUCE_MAX (2119) static const short yy_reduce_ofst[] = { - /* 0 */ -80, -230, 650, 782, 881, 923, 976, 993, 1056, 1106, - /* 10 */ 34, 1116, 1158, 1212, 1224, 1281, 1305, 1323, 1385, 1403, - /* 20 */ 1455, 1473, 351, 1497, 1553, 1567, 1609, 1619, 1661, 1714, - /* 30 */ 1732, 1784, 1794, 1810, 1864, 1880, 1890, 1906, 1975, 1993, - /* 40 */ 2045, 2055, 376, 676, -259, 76, 142, 117, 687, -180, - /* 50 */ -284, 747, -30, 250, 342, 345, 398, 359, 462, -264, - /* 60 */ -256, -357, -240, -339, -244, 81, 385, 475, 666, 668, - /* 70 */ 669, 673, 702, 734, 148, 767, 803, 852, -280, 855, - /* 80 */ -273, 857, 858, 211, 31, 859, 272, 523, 363, 867, - /* 90 */ -205, -20, -159, -159, -159, -171, -86, 95, 139, 149, - /* 100 */ 388, 413, 420, 466, 476, 512, 514, 524, 548, 570, - /* 110 */ 574, 588, 608, 614, 648, -233, -213, -298, -76, 53, - /* 120 */ -215, 174, 279, 408, 431, 557, 217, 35, 275, 317, - /* 130 */ 409, 467, 91, 540, 590, 595, 675, 565, 328, 340, - /* 140 */ 368, 461, 468, 606, 661, 373, 705, 654, 800, 722, - /* 150 */ 819, 777, 730, 868, 868, 876, 880, 862, 833, 811, - /* 160 */ 811, 811, 821, 796, 799, 801, 813, 868, 850, 863, - /* 170 */ 870, 892, 935, 936, 899, 925, 926, 942, 965, 966, - /* 180 */ 975, 977, 919, 968, 938, 971, 928, 930, 978, 931, - /* 190 */ 980, 952, 991, 994, 999, 996, 1012, 985, 988, 990, - /* 200 */ 995, 998, 1000, 1003, 1004, 1007, 1009, 1010, 1014, 1013, - /* 210 */ 983, 967, 1015, 981, 1016, 1029, 1025, 1032, 986, 1031, - /* 220 */ 1008, 1030, 1033, 1035, 1036, 1026, 1041, 1037, 1034, 1047, - /* 230 */ 1061, 1076, 1018, 1017, 1048, 992, 1039, 1057, 1060, 1001, - /* 240 */ 1042, 1062, 1063, 868, 1019, 1040, 1046, 1020, 1038, 1024, - /* 250 */ 1045, 811, 1074, 1049, 1027, 1051, 1050, 1052, 1055, 1073, - /* 260 */ 1064, 1066, 1089, 1081, 1120, 1129, 1117, 1136, 1141, 1085, - /* 270 */ 1093, 1133, 1134, 1140, 1142, 1162, + /* 0 */ 364, 650, 677, -231, 321, 790, 852, 904, 956, 983, + /* 10 */ 1035, 1051, 152, 1131, 1141, 1190, 1239, 1251, 1300, 1316, + /* 20 */ 1369, 1381, 1430, 1479, 1500, 1561, 1577, 1630, 1642, 1691, + /* 30 */ 1740, 1761, 1810, 1822, 1874, 1891, 1944, 1993, 2042, 2058, + /* 40 */ 2107, 2119, 1585, 1632, -264, -17, 225, -247, 90, 72, + /* 50 */ -260, 435, -297, 453, 456, 463, 685, -268, -262, -259, + /* 60 */ -228, 7, -190, 40, 51, -265, -42, 346, 351, 426, + /* 70 */ 475, 543, 737, 761, 767, 115, 769, 770, 792, -186, + /* 80 */ 793, 794, 147, 806, 815, -196, -104, 831, 330, 422, + /* 90 */ 393, 836, 538, 22, -341, -341, -341, 125, 142, 194, + /* 100 */ 196, 405, 481, 517, 523, 572, 588, 608, 611, 614, + /* 110 */ 633, 648, 651, 688, 696, 697, 699, 101, -215, -287, + /* 120 */ 87, 173, -235, -135, -34, 305, 406, 488, 156, 640, + /* 130 */ 643, 512, 266, 526, -168, 211, 449, 574, 610, 566, + /* 140 */ 229, 254, 294, 327, 344, 380, 400, 288, 442, 343, + /* 150 */ 535, 356, 580, 520, 630, 768, 768, 784, 810, 797, + /* 160 */ 740, 786, 786, 786, 804, 787, 795, 798, 807, 768, + /* 170 */ 846, 837, 859, 872, 927, 942, 903, 908, 912, 951, + /* 180 */ 952, 953, 961, 970, 919, 962, 943, 975, 939, 941, + /* 190 */ 984, 946, 990, 992, 993, 995, 994, 1005, 980, 981, + /* 200 */ 982, 985, 986, 987, 988, 989, 997, 1009, 1010, 1012, + /* 210 */ 1016, 1001, 959, 1023, 979, 998, 1034, 1028, 1037, 1007, + /* 220 */ 1038, 996, 1011, 1027, 1031, 1032, 1013, 1040, 1018, 1055, + /* 230 */ 1025, 1059, 1041, 1014, 1042, 1002, 1044, 1045, 1047, 1030, + /* 240 */ 1048, 1057, 1062, 768, 976, 1029, 1043, 1015, 1046, 1054, + /* 250 */ 1063, 786, 1064, 1061, 1022, 1056, 1020, 1058, 1066, 1067, + /* 260 */ 1071, 1065, 1110, 1098, 1126, 1135, 1140, 1142, 1146, 1093, + /* 270 */ 1097, 1133, 1134, 1139, 1147, 1155, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 10 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 20 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 30 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 40 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 50 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 60 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 70 */ 1465, 1465, 1465, 1465, 1539, 1465, 1465, 1465, 1465, 1465, - /* 80 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 90 */ 1537, 1695, 1465, 1873, 1465, 1465, 1465, 1465, 1465, 1465, - /* 100 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 110 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 120 */ 1539, 1465, 1537, 1885, 1885, 1885, 1465, 1465, 1465, 1465, - /* 130 */ 1738, 1738, 1465, 1465, 1465, 1465, 1637, 1465, 1465, 1465, - /* 140 */ 1465, 1465, 1465, 1465, 1465, 1730, 1465, 1954, 1465, 1465, - /* 150 */ 1465, 1736, 1908, 1465, 1465, 1465, 1465, 1590, 1900, 1877, - /* 160 */ 1891, 1878, 1875, 1939, 1939, 1939, 1894, 1465, 1904, 1465, - /* 170 */ 1723, 1700, 1465, 1465, 1700, 1697, 1697, 1465, 1465, 1465, - /* 180 */ 1465, 1465, 1465, 1539, 1465, 1539, 1465, 1465, 1539, 1465, - /* 190 */ 1539, 1465, 1539, 1539, 1465, 1539, 1465, 1465, 1465, 1465, - /* 200 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 210 */ 1465, 1465, 1537, 1732, 1465, 1537, 1465, 1465, 1465, 1537, - /* 220 */ 1913, 1465, 1465, 1465, 1465, 1913, 1465, 1465, 1465, 1537, - /* 230 */ 1465, 1537, 1465, 1465, 1465, 1915, 1913, 1465, 1465, 1915, - /* 240 */ 1913, 1465, 1465, 1465, 1927, 1923, 1915, 1931, 1929, 1906, - /* 250 */ 1904, 1891, 1465, 1465, 1945, 1941, 1957, 1945, 1941, 1945, - /* 260 */ 1941, 1465, 1606, 1465, 1465, 1465, 1537, 1497, 1465, 1725, - /* 270 */ 1738, 1640, 1640, 1640, 1540, 1470, 1465, 1465, 1465, 1465, - /* 280 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1810, 1926, - /* 290 */ 1925, 1849, 1848, 1847, 1845, 1809, 1465, 1602, 1808, 1807, - /* 300 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1801, 1802, - /* 310 */ 1800, 1799, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 320 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 330 */ 1874, 1465, 1942, 1946, 1465, 1465, 1465, 1465, 1465, 1784, - /* 340 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 350 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 360 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 370 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 380 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 390 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 400 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 410 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 420 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 430 */ 1465, 1465, 1465, 1465, 1502, 1465, 1465, 1465, 1465, 1465, - /* 440 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 450 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 460 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 470 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1574, 1573, - /* 480 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 490 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 500 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 510 */ 1465, 1465, 1465, 1465, 1465, 1465, 1742, 1465, 1465, 1465, - /* 520 */ 1465, 1465, 1465, 1465, 1465, 1465, 1907, 1465, 1465, 1465, - /* 530 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 540 */ 1465, 1465, 1784, 1465, 1924, 1465, 1884, 1880, 1465, 1465, - /* 550 */ 1876, 1783, 1465, 1465, 1940, 1465, 1465, 1465, 1465, 1465, - /* 560 */ 1465, 1465, 1465, 1465, 1869, 1465, 1465, 1842, 1827, 1465, - /* 570 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1795, - /* 580 */ 1465, 1465, 1465, 1465, 1465, 1634, 1465, 1465, 1465, 1465, - /* 590 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1619, 1617, - /* 600 */ 1616, 1615, 1465, 1612, 1465, 1465, 1465, 1465, 1643, 1642, - /* 610 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 620 */ 1465, 1465, 1558, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 630 */ 1465, 1550, 1465, 1549, 1465, 1465, 1465, 1465, 1465, 1465, - /* 640 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 650 */ 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, - /* 660 */ 1465, 1465, 1465, 1465, 1465, 1465, + /* 0 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 10 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 20 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 30 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 40 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 50 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 60 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 70 */ 1463, 1463, 1463, 1463, 1463, 1537, 1463, 1463, 1463, 1463, + /* 80 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 90 */ 1463, 1463, 1535, 1693, 1463, 1870, 1463, 1463, 1463, 1463, + /* 100 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 110 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 120 */ 1463, 1463, 1537, 1463, 1535, 1882, 1882, 1882, 1463, 1463, + /* 130 */ 1463, 1463, 1736, 1736, 1463, 1463, 1463, 1463, 1635, 1463, + /* 140 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1728, 1463, 1951, + /* 150 */ 1463, 1463, 1463, 1734, 1905, 1463, 1463, 1463, 1463, 1588, + /* 160 */ 1897, 1874, 1888, 1875, 1872, 1936, 1936, 1936, 1891, 1463, + /* 170 */ 1901, 1463, 1721, 1698, 1463, 1463, 1698, 1695, 1695, 1463, + /* 180 */ 1463, 1463, 1463, 1463, 1463, 1537, 1463, 1537, 1463, 1463, + /* 190 */ 1537, 1463, 1537, 1537, 1537, 1463, 1537, 1463, 1463, 1463, + /* 200 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 210 */ 1463, 1463, 1463, 1535, 1730, 1463, 1535, 1463, 1463, 1463, + /* 220 */ 1535, 1910, 1463, 1463, 1463, 1463, 1910, 1463, 1463, 1535, + /* 230 */ 1463, 1535, 1463, 1463, 1463, 1912, 1910, 1463, 1463, 1912, + /* 240 */ 1910, 1463, 1463, 1463, 1924, 1920, 1912, 1928, 1926, 1903, + /* 250 */ 1901, 1888, 1463, 1463, 1942, 1938, 1954, 1942, 1938, 1942, + /* 260 */ 1938, 1463, 1604, 1463, 1463, 1463, 1535, 1495, 1463, 1723, + /* 270 */ 1736, 1638, 1638, 1638, 1538, 1468, 1463, 1463, 1463, 1463, + /* 280 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1807, 1923, + /* 290 */ 1922, 1846, 1845, 1844, 1842, 1806, 1463, 1600, 1805, 1804, + /* 300 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1798, 1799, + /* 310 */ 1797, 1796, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 320 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 330 */ 1871, 1463, 1939, 1943, 1463, 1463, 1463, 1463, 1463, 1782, + /* 340 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 350 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 360 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 370 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 380 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 390 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 400 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 410 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 420 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 430 */ 1463, 1463, 1463, 1463, 1500, 1463, 1463, 1463, 1463, 1463, + /* 440 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 450 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 460 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 470 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1572, 1571, + /* 480 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 490 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 500 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 510 */ 1463, 1463, 1463, 1463, 1463, 1463, 1740, 1463, 1463, 1463, + /* 520 */ 1463, 1463, 1463, 1463, 1463, 1463, 1904, 1463, 1463, 1463, + /* 530 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 540 */ 1463, 1463, 1782, 1463, 1921, 1463, 1881, 1877, 1463, 1463, + /* 550 */ 1873, 1781, 1463, 1463, 1937, 1463, 1463, 1463, 1463, 1463, + /* 560 */ 1463, 1463, 1463, 1463, 1866, 1463, 1463, 1839, 1824, 1463, + /* 570 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1792, + /* 580 */ 1463, 1463, 1463, 1463, 1463, 1632, 1463, 1463, 1463, 1463, + /* 590 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1617, 1615, + /* 600 */ 1614, 1613, 1463, 1610, 1463, 1463, 1463, 1463, 1641, 1640, + /* 610 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 620 */ 1463, 1463, 1556, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 630 */ 1463, 1548, 1463, 1547, 1463, 1463, 1463, 1463, 1463, 1463, + /* 640 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 650 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, + /* 660 */ 1463, 1463, 1463, 1463, 1463, 1463, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1546,77 +1558,76 @@ static const char *const yyTokenName[] = { /* 306 */ "like_pattern_opt", /* 307 */ "table_name_cond", /* 308 */ "from_db_opt", - /* 309 */ "index_name", - /* 310 */ "index_options", - /* 311 */ "func_list", - /* 312 */ "sliding_opt", - /* 313 */ "sma_stream_opt", - /* 314 */ "func", - /* 315 */ "stream_options", - /* 316 */ "topic_name", - /* 317 */ "query_expression", - /* 318 */ "cgroup_name", - /* 319 */ "analyze_opt", - /* 320 */ "explain_options", - /* 321 */ "agg_func_opt", - /* 322 */ "bufsize_opt", - /* 323 */ "stream_name", - /* 324 */ "into_opt", - /* 325 */ "dnode_list", - /* 326 */ "where_clause_opt", - /* 327 */ "signed", - /* 328 */ "literal_func", - /* 329 */ "literal_list", - /* 330 */ "table_alias", - /* 331 */ "column_alias", - /* 332 */ "expression", - /* 333 */ "pseudo_column", - /* 334 */ "column_reference", - /* 335 */ "function_expression", - /* 336 */ "subquery", - /* 337 */ "star_func", - /* 338 */ "star_func_para_list", - /* 339 */ "noarg_func", - /* 340 */ "other_para_list", - /* 341 */ "star_func_para", - /* 342 */ "predicate", - /* 343 */ "compare_op", - /* 344 */ "in_op", - /* 345 */ "in_predicate_value", - /* 346 */ "boolean_value_expression", - /* 347 */ "boolean_primary", - /* 348 */ "common_expression", - /* 349 */ "from_clause_opt", - /* 350 */ "table_reference_list", - /* 351 */ "table_reference", - /* 352 */ "table_primary", - /* 353 */ "joined_table", - /* 354 */ "alias_opt", - /* 355 */ "parenthesized_joined_table", - /* 356 */ "join_type", - /* 357 */ "search_condition", - /* 358 */ "query_specification", - /* 359 */ "set_quantifier_opt", - /* 360 */ "select_list", - /* 361 */ "partition_by_clause_opt", - /* 362 */ "range_opt", - /* 363 */ "every_opt", - /* 364 */ "fill_opt", - /* 365 */ "twindow_clause_opt", - /* 366 */ "group_by_clause_opt", - /* 367 */ "having_clause_opt", - /* 368 */ "select_item", - /* 369 */ "fill_mode", - /* 370 */ "group_by_list", - /* 371 */ "query_expression_body", - /* 372 */ "order_by_clause_opt", - /* 373 */ "slimit_clause_opt", - /* 374 */ "limit_clause_opt", - /* 375 */ "query_primary", - /* 376 */ "sort_specification_list", - /* 377 */ "sort_specification", - /* 378 */ "ordering_specification_opt", - /* 379 */ "null_ordering_opt", + /* 309 */ "index_options", + /* 310 */ "func_list", + /* 311 */ "sliding_opt", + /* 312 */ "sma_stream_opt", + /* 313 */ "func", + /* 314 */ "stream_options", + /* 315 */ "topic_name", + /* 316 */ "query_expression", + /* 317 */ "cgroup_name", + /* 318 */ "analyze_opt", + /* 319 */ "explain_options", + /* 320 */ "agg_func_opt", + /* 321 */ "bufsize_opt", + /* 322 */ "stream_name", + /* 323 */ "into_opt", + /* 324 */ "dnode_list", + /* 325 */ "where_clause_opt", + /* 326 */ "signed", + /* 327 */ "literal_func", + /* 328 */ "literal_list", + /* 329 */ "table_alias", + /* 330 */ "column_alias", + /* 331 */ "expression", + /* 332 */ "pseudo_column", + /* 333 */ "column_reference", + /* 334 */ "function_expression", + /* 335 */ "subquery", + /* 336 */ "star_func", + /* 337 */ "star_func_para_list", + /* 338 */ "noarg_func", + /* 339 */ "other_para_list", + /* 340 */ "star_func_para", + /* 341 */ "predicate", + /* 342 */ "compare_op", + /* 343 */ "in_op", + /* 344 */ "in_predicate_value", + /* 345 */ "boolean_value_expression", + /* 346 */ "boolean_primary", + /* 347 */ "common_expression", + /* 348 */ "from_clause_opt", + /* 349 */ "table_reference_list", + /* 350 */ "table_reference", + /* 351 */ "table_primary", + /* 352 */ "joined_table", + /* 353 */ "alias_opt", + /* 354 */ "parenthesized_joined_table", + /* 355 */ "join_type", + /* 356 */ "search_condition", + /* 357 */ "query_specification", + /* 358 */ "set_quantifier_opt", + /* 359 */ "select_list", + /* 360 */ "partition_by_clause_opt", + /* 361 */ "range_opt", + /* 362 */ "every_opt", + /* 363 */ "fill_opt", + /* 364 */ "twindow_clause_opt", + /* 365 */ "group_by_clause_opt", + /* 366 */ "having_clause_opt", + /* 367 */ "select_item", + /* 368 */ "fill_mode", + /* 369 */ "group_by_list", + /* 370 */ "query_expression_body", + /* 371 */ "order_by_clause_opt", + /* 372 */ "slimit_clause_opt", + /* 373 */ "limit_clause_opt", + /* 374 */ "query_primary", + /* 375 */ "sort_specification_list", + /* 376 */ "sort_specification", + /* 377 */ "ordering_specification_opt", + /* 378 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1858,8 +1869,8 @@ static const char *const yyRuleName[] = { /* 231 */ "table_name_cond ::= table_name", /* 232 */ "from_db_opt ::=", /* 233 */ "from_db_opt ::= FROM db_name", - /* 234 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON full_table_name index_options", - /* 235 */ "cmd ::= DROP INDEX exists_opt index_name", + /* 234 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", + /* 235 */ "cmd ::= DROP INDEX exists_opt full_table_name", /* 236 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", /* 237 */ "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", /* 238 */ "func_list ::= func", @@ -1945,177 +1956,176 @@ static const char *const yyRuleName[] = { /* 318 */ "table_alias ::= NK_ID", /* 319 */ "column_alias ::= NK_ID", /* 320 */ "user_name ::= NK_ID", - /* 321 */ "index_name ::= NK_ID", - /* 322 */ "topic_name ::= NK_ID", - /* 323 */ "stream_name ::= NK_ID", - /* 324 */ "cgroup_name ::= NK_ID", - /* 325 */ "expression ::= literal", - /* 326 */ "expression ::= pseudo_column", - /* 327 */ "expression ::= column_reference", - /* 328 */ "expression ::= function_expression", - /* 329 */ "expression ::= subquery", - /* 330 */ "expression ::= NK_LP expression NK_RP", - /* 331 */ "expression ::= NK_PLUS expression", - /* 332 */ "expression ::= NK_MINUS expression", - /* 333 */ "expression ::= expression NK_PLUS expression", - /* 334 */ "expression ::= expression NK_MINUS expression", - /* 335 */ "expression ::= expression NK_STAR expression", - /* 336 */ "expression ::= expression NK_SLASH expression", - /* 337 */ "expression ::= expression NK_REM expression", - /* 338 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 339 */ "expression ::= expression NK_BITAND expression", - /* 340 */ "expression ::= expression NK_BITOR expression", - /* 341 */ "expression_list ::= expression", - /* 342 */ "expression_list ::= expression_list NK_COMMA expression", - /* 343 */ "column_reference ::= column_name", - /* 344 */ "column_reference ::= table_name NK_DOT column_name", - /* 345 */ "pseudo_column ::= ROWTS", - /* 346 */ "pseudo_column ::= TBNAME", - /* 347 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 348 */ "pseudo_column ::= QSTART", - /* 349 */ "pseudo_column ::= QEND", - /* 350 */ "pseudo_column ::= QDURATION", - /* 351 */ "pseudo_column ::= WSTART", - /* 352 */ "pseudo_column ::= WEND", - /* 353 */ "pseudo_column ::= WDURATION", - /* 354 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 355 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 356 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", - /* 357 */ "function_expression ::= literal_func", - /* 358 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 359 */ "literal_func ::= NOW", - /* 360 */ "noarg_func ::= NOW", - /* 361 */ "noarg_func ::= TODAY", - /* 362 */ "noarg_func ::= TIMEZONE", - /* 363 */ "noarg_func ::= DATABASE", - /* 364 */ "noarg_func ::= CLIENT_VERSION", - /* 365 */ "noarg_func ::= SERVER_VERSION", - /* 366 */ "noarg_func ::= SERVER_STATUS", - /* 367 */ "noarg_func ::= CURRENT_USER", - /* 368 */ "noarg_func ::= USER", - /* 369 */ "star_func ::= COUNT", - /* 370 */ "star_func ::= FIRST", - /* 371 */ "star_func ::= LAST", - /* 372 */ "star_func ::= LAST_ROW", - /* 373 */ "star_func_para_list ::= NK_STAR", - /* 374 */ "star_func_para_list ::= other_para_list", - /* 375 */ "other_para_list ::= star_func_para", - /* 376 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 377 */ "star_func_para ::= expression", - /* 378 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 379 */ "predicate ::= expression compare_op expression", - /* 380 */ "predicate ::= expression BETWEEN expression AND expression", - /* 381 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 382 */ "predicate ::= expression IS NULL", - /* 383 */ "predicate ::= expression IS NOT NULL", - /* 384 */ "predicate ::= expression in_op in_predicate_value", - /* 385 */ "compare_op ::= NK_LT", - /* 386 */ "compare_op ::= NK_GT", - /* 387 */ "compare_op ::= NK_LE", - /* 388 */ "compare_op ::= NK_GE", - /* 389 */ "compare_op ::= NK_NE", - /* 390 */ "compare_op ::= NK_EQ", - /* 391 */ "compare_op ::= LIKE", - /* 392 */ "compare_op ::= NOT LIKE", - /* 393 */ "compare_op ::= MATCH", - /* 394 */ "compare_op ::= NMATCH", - /* 395 */ "compare_op ::= CONTAINS", - /* 396 */ "in_op ::= IN", - /* 397 */ "in_op ::= NOT IN", - /* 398 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 399 */ "boolean_value_expression ::= boolean_primary", - /* 400 */ "boolean_value_expression ::= NOT boolean_primary", - /* 401 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 402 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 403 */ "boolean_primary ::= predicate", - /* 404 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 405 */ "common_expression ::= expression", - /* 406 */ "common_expression ::= boolean_value_expression", - /* 407 */ "from_clause_opt ::=", - /* 408 */ "from_clause_opt ::= FROM table_reference_list", - /* 409 */ "table_reference_list ::= table_reference", - /* 410 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 411 */ "table_reference ::= table_primary", - /* 412 */ "table_reference ::= joined_table", - /* 413 */ "table_primary ::= table_name alias_opt", - /* 414 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 415 */ "table_primary ::= subquery alias_opt", - /* 416 */ "table_primary ::= parenthesized_joined_table", - /* 417 */ "alias_opt ::=", - /* 418 */ "alias_opt ::= table_alias", - /* 419 */ "alias_opt ::= AS table_alias", - /* 420 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 421 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 422 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 423 */ "join_type ::=", - /* 424 */ "join_type ::= INNER", - /* 425 */ "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", - /* 426 */ "set_quantifier_opt ::=", - /* 427 */ "set_quantifier_opt ::= DISTINCT", - /* 428 */ "set_quantifier_opt ::= ALL", - /* 429 */ "select_list ::= select_item", - /* 430 */ "select_list ::= select_list NK_COMMA select_item", - /* 431 */ "select_item ::= NK_STAR", - /* 432 */ "select_item ::= common_expression", - /* 433 */ "select_item ::= common_expression column_alias", - /* 434 */ "select_item ::= common_expression AS column_alias", - /* 435 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 436 */ "where_clause_opt ::=", - /* 437 */ "where_clause_opt ::= WHERE search_condition", - /* 438 */ "partition_by_clause_opt ::=", - /* 439 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 440 */ "twindow_clause_opt ::=", - /* 441 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 442 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", - /* 443 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 444 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 445 */ "sliding_opt ::=", - /* 446 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 447 */ "fill_opt ::=", - /* 448 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 449 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 450 */ "fill_mode ::= NONE", - /* 451 */ "fill_mode ::= PREV", - /* 452 */ "fill_mode ::= NULL", - /* 453 */ "fill_mode ::= LINEAR", - /* 454 */ "fill_mode ::= NEXT", - /* 455 */ "group_by_clause_opt ::=", - /* 456 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 457 */ "group_by_list ::= expression", - /* 458 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 459 */ "having_clause_opt ::=", - /* 460 */ "having_clause_opt ::= HAVING search_condition", - /* 461 */ "range_opt ::=", - /* 462 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP", - /* 463 */ "every_opt ::=", - /* 464 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 465 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 466 */ "query_expression_body ::= query_primary", - /* 467 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 468 */ "query_expression_body ::= query_expression_body UNION query_expression_body", - /* 469 */ "query_primary ::= query_specification", - /* 470 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", - /* 471 */ "order_by_clause_opt ::=", - /* 472 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 473 */ "slimit_clause_opt ::=", - /* 474 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 475 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 476 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 477 */ "limit_clause_opt ::=", - /* 478 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 479 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 480 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 481 */ "subquery ::= NK_LP query_expression NK_RP", - /* 482 */ "search_condition ::= common_expression", - /* 483 */ "sort_specification_list ::= sort_specification", - /* 484 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 485 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 486 */ "ordering_specification_opt ::=", - /* 487 */ "ordering_specification_opt ::= ASC", - /* 488 */ "ordering_specification_opt ::= DESC", - /* 489 */ "null_ordering_opt ::=", - /* 490 */ "null_ordering_opt ::= NULLS FIRST", - /* 491 */ "null_ordering_opt ::= NULLS LAST", + /* 321 */ "topic_name ::= NK_ID", + /* 322 */ "stream_name ::= NK_ID", + /* 323 */ "cgroup_name ::= NK_ID", + /* 324 */ "expression ::= literal", + /* 325 */ "expression ::= pseudo_column", + /* 326 */ "expression ::= column_reference", + /* 327 */ "expression ::= function_expression", + /* 328 */ "expression ::= subquery", + /* 329 */ "expression ::= NK_LP expression NK_RP", + /* 330 */ "expression ::= NK_PLUS expression", + /* 331 */ "expression ::= NK_MINUS expression", + /* 332 */ "expression ::= expression NK_PLUS expression", + /* 333 */ "expression ::= expression NK_MINUS expression", + /* 334 */ "expression ::= expression NK_STAR expression", + /* 335 */ "expression ::= expression NK_SLASH expression", + /* 336 */ "expression ::= expression NK_REM expression", + /* 337 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 338 */ "expression ::= expression NK_BITAND expression", + /* 339 */ "expression ::= expression NK_BITOR expression", + /* 340 */ "expression_list ::= expression", + /* 341 */ "expression_list ::= expression_list NK_COMMA expression", + /* 342 */ "column_reference ::= column_name", + /* 343 */ "column_reference ::= table_name NK_DOT column_name", + /* 344 */ "pseudo_column ::= ROWTS", + /* 345 */ "pseudo_column ::= TBNAME", + /* 346 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 347 */ "pseudo_column ::= QSTART", + /* 348 */ "pseudo_column ::= QEND", + /* 349 */ "pseudo_column ::= QDURATION", + /* 350 */ "pseudo_column ::= WSTART", + /* 351 */ "pseudo_column ::= WEND", + /* 352 */ "pseudo_column ::= WDURATION", + /* 353 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 354 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 355 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", + /* 356 */ "function_expression ::= literal_func", + /* 357 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 358 */ "literal_func ::= NOW", + /* 359 */ "noarg_func ::= NOW", + /* 360 */ "noarg_func ::= TODAY", + /* 361 */ "noarg_func ::= TIMEZONE", + /* 362 */ "noarg_func ::= DATABASE", + /* 363 */ "noarg_func ::= CLIENT_VERSION", + /* 364 */ "noarg_func ::= SERVER_VERSION", + /* 365 */ "noarg_func ::= SERVER_STATUS", + /* 366 */ "noarg_func ::= CURRENT_USER", + /* 367 */ "noarg_func ::= USER", + /* 368 */ "star_func ::= COUNT", + /* 369 */ "star_func ::= FIRST", + /* 370 */ "star_func ::= LAST", + /* 371 */ "star_func ::= LAST_ROW", + /* 372 */ "star_func_para_list ::= NK_STAR", + /* 373 */ "star_func_para_list ::= other_para_list", + /* 374 */ "other_para_list ::= star_func_para", + /* 375 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 376 */ "star_func_para ::= expression", + /* 377 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 378 */ "predicate ::= expression compare_op expression", + /* 379 */ "predicate ::= expression BETWEEN expression AND expression", + /* 380 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 381 */ "predicate ::= expression IS NULL", + /* 382 */ "predicate ::= expression IS NOT NULL", + /* 383 */ "predicate ::= expression in_op in_predicate_value", + /* 384 */ "compare_op ::= NK_LT", + /* 385 */ "compare_op ::= NK_GT", + /* 386 */ "compare_op ::= NK_LE", + /* 387 */ "compare_op ::= NK_GE", + /* 388 */ "compare_op ::= NK_NE", + /* 389 */ "compare_op ::= NK_EQ", + /* 390 */ "compare_op ::= LIKE", + /* 391 */ "compare_op ::= NOT LIKE", + /* 392 */ "compare_op ::= MATCH", + /* 393 */ "compare_op ::= NMATCH", + /* 394 */ "compare_op ::= CONTAINS", + /* 395 */ "in_op ::= IN", + /* 396 */ "in_op ::= NOT IN", + /* 397 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 398 */ "boolean_value_expression ::= boolean_primary", + /* 399 */ "boolean_value_expression ::= NOT boolean_primary", + /* 400 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 401 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 402 */ "boolean_primary ::= predicate", + /* 403 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 404 */ "common_expression ::= expression", + /* 405 */ "common_expression ::= boolean_value_expression", + /* 406 */ "from_clause_opt ::=", + /* 407 */ "from_clause_opt ::= FROM table_reference_list", + /* 408 */ "table_reference_list ::= table_reference", + /* 409 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 410 */ "table_reference ::= table_primary", + /* 411 */ "table_reference ::= joined_table", + /* 412 */ "table_primary ::= table_name alias_opt", + /* 413 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 414 */ "table_primary ::= subquery alias_opt", + /* 415 */ "table_primary ::= parenthesized_joined_table", + /* 416 */ "alias_opt ::=", + /* 417 */ "alias_opt ::= table_alias", + /* 418 */ "alias_opt ::= AS table_alias", + /* 419 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 420 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 421 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 422 */ "join_type ::=", + /* 423 */ "join_type ::= INNER", + /* 424 */ "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", + /* 425 */ "set_quantifier_opt ::=", + /* 426 */ "set_quantifier_opt ::= DISTINCT", + /* 427 */ "set_quantifier_opt ::= ALL", + /* 428 */ "select_list ::= select_item", + /* 429 */ "select_list ::= select_list NK_COMMA select_item", + /* 430 */ "select_item ::= NK_STAR", + /* 431 */ "select_item ::= common_expression", + /* 432 */ "select_item ::= common_expression column_alias", + /* 433 */ "select_item ::= common_expression AS column_alias", + /* 434 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 435 */ "where_clause_opt ::=", + /* 436 */ "where_clause_opt ::= WHERE search_condition", + /* 437 */ "partition_by_clause_opt ::=", + /* 438 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 439 */ "twindow_clause_opt ::=", + /* 440 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 441 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", + /* 442 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 443 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 444 */ "sliding_opt ::=", + /* 445 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 446 */ "fill_opt ::=", + /* 447 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 448 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 449 */ "fill_mode ::= NONE", + /* 450 */ "fill_mode ::= PREV", + /* 451 */ "fill_mode ::= NULL", + /* 452 */ "fill_mode ::= LINEAR", + /* 453 */ "fill_mode ::= NEXT", + /* 454 */ "group_by_clause_opt ::=", + /* 455 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 456 */ "group_by_list ::= expression", + /* 457 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 458 */ "having_clause_opt ::=", + /* 459 */ "having_clause_opt ::= HAVING search_condition", + /* 460 */ "range_opt ::=", + /* 461 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP", + /* 462 */ "every_opt ::=", + /* 463 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 464 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 465 */ "query_expression_body ::= query_primary", + /* 466 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 467 */ "query_expression_body ::= query_expression_body UNION query_expression_body", + /* 468 */ "query_primary ::= query_specification", + /* 469 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", + /* 470 */ "order_by_clause_opt ::=", + /* 471 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 472 */ "slimit_clause_opt ::=", + /* 473 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 474 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 475 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 476 */ "limit_clause_opt ::=", + /* 477 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 478 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 479 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 480 */ "subquery ::= NK_LP query_expression NK_RP", + /* 481 */ "search_condition ::= common_expression", + /* 482 */ "sort_specification_list ::= sort_specification", + /* 483 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 484 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 485 */ "ordering_specification_opt ::=", + /* 486 */ "ordering_specification_opt ::= ASC", + /* 487 */ "ordering_specification_opt ::= DESC", + /* 488 */ "null_ordering_opt ::=", + /* 489 */ "null_ordering_opt ::= NULLS FIRST", + /* 490 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2262,55 +2272,55 @@ static void yy_destructor( case 306: /* like_pattern_opt */ case 307: /* table_name_cond */ case 308: /* from_db_opt */ - case 310: /* index_options */ - case 312: /* sliding_opt */ - case 313: /* sma_stream_opt */ - case 314: /* func */ - case 315: /* stream_options */ - case 317: /* query_expression */ - case 320: /* explain_options */ - case 324: /* into_opt */ - case 326: /* where_clause_opt */ - case 327: /* signed */ - case 328: /* literal_func */ - case 332: /* expression */ - case 333: /* pseudo_column */ - case 334: /* column_reference */ - case 335: /* function_expression */ - case 336: /* subquery */ - case 341: /* star_func_para */ - case 342: /* predicate */ - case 345: /* in_predicate_value */ - case 346: /* boolean_value_expression */ - case 347: /* boolean_primary */ - case 348: /* common_expression */ - case 349: /* from_clause_opt */ - case 350: /* table_reference_list */ - case 351: /* table_reference */ - case 352: /* table_primary */ - case 353: /* joined_table */ - case 355: /* parenthesized_joined_table */ - case 357: /* search_condition */ - case 358: /* query_specification */ - case 362: /* range_opt */ - case 363: /* every_opt */ - case 364: /* fill_opt */ - case 365: /* twindow_clause_opt */ - case 367: /* having_clause_opt */ - case 368: /* select_item */ - case 371: /* query_expression_body */ - case 373: /* slimit_clause_opt */ - case 374: /* limit_clause_opt */ - case 375: /* query_primary */ - case 377: /* sort_specification */ + case 309: /* index_options */ + case 311: /* sliding_opt */ + case 312: /* sma_stream_opt */ + case 313: /* func */ + case 314: /* stream_options */ + case 316: /* query_expression */ + case 319: /* explain_options */ + case 323: /* into_opt */ + case 325: /* where_clause_opt */ + case 326: /* signed */ + case 327: /* literal_func */ + case 331: /* expression */ + case 332: /* pseudo_column */ + case 333: /* column_reference */ + case 334: /* function_expression */ + case 335: /* subquery */ + case 340: /* star_func_para */ + case 341: /* predicate */ + case 344: /* in_predicate_value */ + case 345: /* boolean_value_expression */ + case 346: /* boolean_primary */ + case 347: /* common_expression */ + case 348: /* from_clause_opt */ + case 349: /* table_reference_list */ + case 350: /* table_reference */ + case 351: /* table_primary */ + case 352: /* joined_table */ + case 354: /* parenthesized_joined_table */ + case 356: /* search_condition */ + case 357: /* query_specification */ + case 361: /* range_opt */ + case 362: /* every_opt */ + case 363: /* fill_opt */ + case 364: /* twindow_clause_opt */ + case 366: /* having_clause_opt */ + case 367: /* select_item */ + case 370: /* query_expression_body */ + case 372: /* slimit_clause_opt */ + case 373: /* limit_clause_opt */ + case 374: /* query_primary */ + case 376: /* sort_specification */ { - nodesDestroyNode((yypminor->yy712)); + nodesDestroyNode((yypminor->yy616)); } break; case 258: /* account_options */ case 259: /* alter_account_options */ case 261: /* alter_account_option */ - case 322: /* bufsize_opt */ + case 321: /* bufsize_opt */ { } @@ -2322,15 +2332,14 @@ static void yy_destructor( case 288: /* column_name */ case 296: /* table_name */ case 303: /* function_name */ - case 309: /* index_name */ - case 316: /* topic_name */ - case 318: /* cgroup_name */ - case 323: /* stream_name */ - case 330: /* table_alias */ - case 331: /* column_alias */ - case 337: /* star_func */ - case 339: /* noarg_func */ - case 354: /* alias_opt */ + case 315: /* topic_name */ + case 317: /* cgroup_name */ + case 322: /* stream_name */ + case 329: /* table_alias */ + case 330: /* column_alias */ + case 336: /* star_func */ + case 338: /* noarg_func */ + case 353: /* alias_opt */ { } @@ -2349,9 +2358,9 @@ static void yy_destructor( break; case 270: /* not_exists_opt */ case 272: /* exists_opt */ - case 319: /* analyze_opt */ - case 321: /* agg_func_opt */ - case 359: /* set_quantifier_opt */ + case 318: /* analyze_opt */ + case 320: /* agg_func_opt */ + case 358: /* set_quantifier_opt */ { } @@ -2369,19 +2378,19 @@ static void yy_destructor( case 295: /* col_name_list */ case 298: /* duration_list */ case 299: /* rollup_func_list */ - case 311: /* func_list */ - case 325: /* dnode_list */ - case 329: /* literal_list */ - case 338: /* star_func_para_list */ - case 340: /* other_para_list */ - case 360: /* select_list */ - case 361: /* partition_by_clause_opt */ - case 366: /* group_by_clause_opt */ - case 370: /* group_by_list */ - case 372: /* order_by_clause_opt */ - case 376: /* sort_specification_list */ + case 310: /* func_list */ + case 324: /* dnode_list */ + case 328: /* literal_list */ + case 337: /* star_func_para_list */ + case 339: /* other_para_list */ + case 359: /* select_list */ + case 360: /* partition_by_clause_opt */ + case 365: /* group_by_clause_opt */ + case 369: /* group_by_list */ + case 371: /* order_by_clause_opt */ + case 375: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy464)); + nodesDestroyList((yypminor->yy356)); } break; case 277: /* alter_db_option */ @@ -2395,28 +2404,28 @@ static void yy_destructor( } break; - case 343: /* compare_op */ - case 344: /* in_op */ + case 342: /* compare_op */ + case 343: /* in_op */ { } break; - case 356: /* join_type */ + case 355: /* join_type */ { } break; - case 369: /* fill_mode */ + case 368: /* fill_mode */ { } break; - case 378: /* ordering_specification_opt */ + case 377: /* ordering_specification_opt */ { } break; - case 379: /* null_ordering_opt */ + case 378: /* null_ordering_opt */ { } @@ -2949,16 +2958,16 @@ static const struct { { 307, -1 }, /* (231) table_name_cond ::= table_name */ { 308, 0 }, /* (232) from_db_opt ::= */ { 308, -2 }, /* (233) from_db_opt ::= FROM db_name */ - { 257, -8 }, /* (234) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON full_table_name index_options */ - { 257, -4 }, /* (235) cmd ::= DROP INDEX exists_opt index_name */ - { 310, -10 }, /* (236) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 310, -12 }, /* (237) 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 */ - { 311, -1 }, /* (238) func_list ::= func */ - { 311, -3 }, /* (239) func_list ::= func_list NK_COMMA func */ - { 314, -4 }, /* (240) func ::= function_name NK_LP expression_list NK_RP */ - { 313, 0 }, /* (241) sma_stream_opt ::= */ - { 313, -3 }, /* (242) sma_stream_opt ::= stream_options WATERMARK duration_literal */ - { 313, -3 }, /* (243) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ + { 257, -8 }, /* (234) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 257, -4 }, /* (235) cmd ::= DROP INDEX exists_opt full_table_name */ + { 309, -10 }, /* (236) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 309, -12 }, /* (237) 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 */ + { 310, -1 }, /* (238) func_list ::= func */ + { 310, -3 }, /* (239) func_list ::= func_list NK_COMMA func */ + { 313, -4 }, /* (240) func ::= function_name NK_LP expression_list NK_RP */ + { 312, 0 }, /* (241) sma_stream_opt ::= */ + { 312, -3 }, /* (242) sma_stream_opt ::= stream_options WATERMARK duration_literal */ + { 312, -3 }, /* (243) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ { 257, -6 }, /* (244) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ { 257, -7 }, /* (245) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ { 257, -9 }, /* (246) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ @@ -2970,27 +2979,27 @@ static const struct { { 257, -2 }, /* (252) cmd ::= DESCRIBE full_table_name */ { 257, -3 }, /* (253) cmd ::= RESET QUERY CACHE */ { 257, -4 }, /* (254) cmd ::= EXPLAIN analyze_opt explain_options query_expression */ - { 319, 0 }, /* (255) analyze_opt ::= */ - { 319, -1 }, /* (256) analyze_opt ::= ANALYZE */ - { 320, 0 }, /* (257) explain_options ::= */ - { 320, -3 }, /* (258) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 320, -3 }, /* (259) explain_options ::= explain_options RATIO NK_FLOAT */ + { 318, 0 }, /* (255) analyze_opt ::= */ + { 318, -1 }, /* (256) analyze_opt ::= ANALYZE */ + { 319, 0 }, /* (257) explain_options ::= */ + { 319, -3 }, /* (258) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 319, -3 }, /* (259) explain_options ::= explain_options RATIO NK_FLOAT */ { 257, -10 }, /* (260) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ { 257, -4 }, /* (261) cmd ::= DROP FUNCTION exists_opt function_name */ - { 321, 0 }, /* (262) agg_func_opt ::= */ - { 321, -1 }, /* (263) agg_func_opt ::= AGGREGATE */ - { 322, 0 }, /* (264) bufsize_opt ::= */ - { 322, -2 }, /* (265) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 320, 0 }, /* (262) agg_func_opt ::= */ + { 320, -1 }, /* (263) agg_func_opt ::= AGGREGATE */ + { 321, 0 }, /* (264) bufsize_opt ::= */ + { 321, -2 }, /* (265) bufsize_opt ::= BUFSIZE NK_INTEGER */ { 257, -8 }, /* (266) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ { 257, -4 }, /* (267) cmd ::= DROP STREAM exists_opt stream_name */ - { 324, 0 }, /* (268) into_opt ::= */ - { 324, -2 }, /* (269) into_opt ::= INTO full_table_name */ - { 315, 0 }, /* (270) stream_options ::= */ - { 315, -3 }, /* (271) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 315, -3 }, /* (272) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 315, -4 }, /* (273) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 315, -3 }, /* (274) stream_options ::= stream_options WATERMARK duration_literal */ - { 315, -3 }, /* (275) stream_options ::= stream_options IGNORE EXPIRED */ + { 323, 0 }, /* (268) into_opt ::= */ + { 323, -2 }, /* (269) into_opt ::= INTO full_table_name */ + { 314, 0 }, /* (270) stream_options ::= */ + { 314, -3 }, /* (271) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 314, -3 }, /* (272) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 314, -4 }, /* (273) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 314, -3 }, /* (274) stream_options ::= stream_options WATERMARK duration_literal */ + { 314, -3 }, /* (275) stream_options ::= stream_options IGNORE EXPIRED */ { 257, -3 }, /* (276) cmd ::= KILL CONNECTION NK_INTEGER */ { 257, -3 }, /* (277) cmd ::= KILL QUERY NK_STRING */ { 257, -3 }, /* (278) cmd ::= KILL TRANSACTION NK_INTEGER */ @@ -2998,8 +3007,8 @@ static const struct { { 257, -4 }, /* (280) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { 257, -4 }, /* (281) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ { 257, -3 }, /* (282) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 325, -2 }, /* (283) dnode_list ::= DNODE NK_INTEGER */ - { 325, -3 }, /* (284) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 324, -2 }, /* (283) dnode_list ::= DNODE NK_INTEGER */ + { 324, -3 }, /* (284) dnode_list ::= dnode_list DNODE NK_INTEGER */ { 257, -4 }, /* (285) cmd ::= DELETE FROM full_table_name where_clause_opt */ { 257, -1 }, /* (286) cmd ::= query_expression */ { 257, -7 }, /* (287) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression */ @@ -3013,12 +3022,12 @@ static const struct { { 260, -1 }, /* (295) literal ::= NULL */ { 260, -1 }, /* (296) literal ::= NK_QUESTION */ { 301, -1 }, /* (297) duration_literal ::= NK_VARIABLE */ - { 327, -1 }, /* (298) signed ::= NK_INTEGER */ - { 327, -2 }, /* (299) signed ::= NK_PLUS NK_INTEGER */ - { 327, -2 }, /* (300) signed ::= NK_MINUS NK_INTEGER */ - { 327, -1 }, /* (301) signed ::= NK_FLOAT */ - { 327, -2 }, /* (302) signed ::= NK_PLUS NK_FLOAT */ - { 327, -2 }, /* (303) signed ::= NK_MINUS NK_FLOAT */ + { 326, -1 }, /* (298) signed ::= NK_INTEGER */ + { 326, -2 }, /* (299) signed ::= NK_PLUS NK_INTEGER */ + { 326, -2 }, /* (300) signed ::= NK_MINUS NK_INTEGER */ + { 326, -1 }, /* (301) signed ::= NK_FLOAT */ + { 326, -2 }, /* (302) signed ::= NK_PLUS NK_FLOAT */ + { 326, -2 }, /* (303) signed ::= NK_MINUS NK_FLOAT */ { 290, -1 }, /* (304) signed_literal ::= signed */ { 290, -1 }, /* (305) signed_literal ::= NK_STRING */ { 290, -1 }, /* (306) signed_literal ::= NK_BOOL */ @@ -3027,186 +3036,185 @@ static const struct { { 290, -1 }, /* (309) signed_literal ::= NULL */ { 290, -1 }, /* (310) signed_literal ::= literal_func */ { 290, -1 }, /* (311) signed_literal ::= NK_QUESTION */ - { 329, -1 }, /* (312) literal_list ::= signed_literal */ - { 329, -3 }, /* (313) literal_list ::= literal_list NK_COMMA signed_literal */ + { 328, -1 }, /* (312) literal_list ::= signed_literal */ + { 328, -3 }, /* (313) literal_list ::= literal_list NK_COMMA signed_literal */ { 268, -1 }, /* (314) db_name ::= NK_ID */ { 296, -1 }, /* (315) table_name ::= NK_ID */ { 288, -1 }, /* (316) column_name ::= NK_ID */ { 303, -1 }, /* (317) function_name ::= NK_ID */ - { 330, -1 }, /* (318) table_alias ::= NK_ID */ - { 331, -1 }, /* (319) column_alias ::= NK_ID */ + { 329, -1 }, /* (318) table_alias ::= NK_ID */ + { 330, -1 }, /* (319) column_alias ::= NK_ID */ { 262, -1 }, /* (320) user_name ::= NK_ID */ - { 309, -1 }, /* (321) index_name ::= NK_ID */ - { 316, -1 }, /* (322) topic_name ::= NK_ID */ - { 323, -1 }, /* (323) stream_name ::= NK_ID */ - { 318, -1 }, /* (324) cgroup_name ::= NK_ID */ - { 332, -1 }, /* (325) expression ::= literal */ - { 332, -1 }, /* (326) expression ::= pseudo_column */ - { 332, -1 }, /* (327) expression ::= column_reference */ - { 332, -1 }, /* (328) expression ::= function_expression */ - { 332, -1 }, /* (329) expression ::= subquery */ - { 332, -3 }, /* (330) expression ::= NK_LP expression NK_RP */ - { 332, -2 }, /* (331) expression ::= NK_PLUS expression */ - { 332, -2 }, /* (332) expression ::= NK_MINUS expression */ - { 332, -3 }, /* (333) expression ::= expression NK_PLUS expression */ - { 332, -3 }, /* (334) expression ::= expression NK_MINUS expression */ - { 332, -3 }, /* (335) expression ::= expression NK_STAR expression */ - { 332, -3 }, /* (336) expression ::= expression NK_SLASH expression */ - { 332, -3 }, /* (337) expression ::= expression NK_REM expression */ - { 332, -3 }, /* (338) expression ::= column_reference NK_ARROW NK_STRING */ - { 332, -3 }, /* (339) expression ::= expression NK_BITAND expression */ - { 332, -3 }, /* (340) expression ::= expression NK_BITOR expression */ - { 293, -1 }, /* (341) expression_list ::= expression */ - { 293, -3 }, /* (342) expression_list ::= expression_list NK_COMMA expression */ - { 334, -1 }, /* (343) column_reference ::= column_name */ - { 334, -3 }, /* (344) column_reference ::= table_name NK_DOT column_name */ - { 333, -1 }, /* (345) pseudo_column ::= ROWTS */ - { 333, -1 }, /* (346) pseudo_column ::= TBNAME */ - { 333, -3 }, /* (347) pseudo_column ::= table_name NK_DOT TBNAME */ - { 333, -1 }, /* (348) pseudo_column ::= QSTART */ - { 333, -1 }, /* (349) pseudo_column ::= QEND */ - { 333, -1 }, /* (350) pseudo_column ::= QDURATION */ - { 333, -1 }, /* (351) pseudo_column ::= WSTART */ - { 333, -1 }, /* (352) pseudo_column ::= WEND */ - { 333, -1 }, /* (353) pseudo_column ::= WDURATION */ - { 335, -4 }, /* (354) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 335, -4 }, /* (355) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 335, -6 }, /* (356) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ - { 335, -1 }, /* (357) function_expression ::= literal_func */ - { 328, -3 }, /* (358) literal_func ::= noarg_func NK_LP NK_RP */ - { 328, -1 }, /* (359) literal_func ::= NOW */ - { 339, -1 }, /* (360) noarg_func ::= NOW */ - { 339, -1 }, /* (361) noarg_func ::= TODAY */ - { 339, -1 }, /* (362) noarg_func ::= TIMEZONE */ - { 339, -1 }, /* (363) noarg_func ::= DATABASE */ - { 339, -1 }, /* (364) noarg_func ::= CLIENT_VERSION */ - { 339, -1 }, /* (365) noarg_func ::= SERVER_VERSION */ - { 339, -1 }, /* (366) noarg_func ::= SERVER_STATUS */ - { 339, -1 }, /* (367) noarg_func ::= CURRENT_USER */ - { 339, -1 }, /* (368) noarg_func ::= USER */ - { 337, -1 }, /* (369) star_func ::= COUNT */ - { 337, -1 }, /* (370) star_func ::= FIRST */ - { 337, -1 }, /* (371) star_func ::= LAST */ - { 337, -1 }, /* (372) star_func ::= LAST_ROW */ - { 338, -1 }, /* (373) star_func_para_list ::= NK_STAR */ - { 338, -1 }, /* (374) star_func_para_list ::= other_para_list */ - { 340, -1 }, /* (375) other_para_list ::= star_func_para */ - { 340, -3 }, /* (376) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 341, -1 }, /* (377) star_func_para ::= expression */ - { 341, -3 }, /* (378) star_func_para ::= table_name NK_DOT NK_STAR */ - { 342, -3 }, /* (379) predicate ::= expression compare_op expression */ - { 342, -5 }, /* (380) predicate ::= expression BETWEEN expression AND expression */ - { 342, -6 }, /* (381) predicate ::= expression NOT BETWEEN expression AND expression */ - { 342, -3 }, /* (382) predicate ::= expression IS NULL */ - { 342, -4 }, /* (383) predicate ::= expression IS NOT NULL */ - { 342, -3 }, /* (384) predicate ::= expression in_op in_predicate_value */ - { 343, -1 }, /* (385) compare_op ::= NK_LT */ - { 343, -1 }, /* (386) compare_op ::= NK_GT */ - { 343, -1 }, /* (387) compare_op ::= NK_LE */ - { 343, -1 }, /* (388) compare_op ::= NK_GE */ - { 343, -1 }, /* (389) compare_op ::= NK_NE */ - { 343, -1 }, /* (390) compare_op ::= NK_EQ */ - { 343, -1 }, /* (391) compare_op ::= LIKE */ - { 343, -2 }, /* (392) compare_op ::= NOT LIKE */ - { 343, -1 }, /* (393) compare_op ::= MATCH */ - { 343, -1 }, /* (394) compare_op ::= NMATCH */ - { 343, -1 }, /* (395) compare_op ::= CONTAINS */ - { 344, -1 }, /* (396) in_op ::= IN */ - { 344, -2 }, /* (397) in_op ::= NOT IN */ - { 345, -3 }, /* (398) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 346, -1 }, /* (399) boolean_value_expression ::= boolean_primary */ - { 346, -2 }, /* (400) boolean_value_expression ::= NOT boolean_primary */ - { 346, -3 }, /* (401) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 346, -3 }, /* (402) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 347, -1 }, /* (403) boolean_primary ::= predicate */ - { 347, -3 }, /* (404) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 348, -1 }, /* (405) common_expression ::= expression */ - { 348, -1 }, /* (406) common_expression ::= boolean_value_expression */ - { 349, 0 }, /* (407) from_clause_opt ::= */ - { 349, -2 }, /* (408) from_clause_opt ::= FROM table_reference_list */ - { 350, -1 }, /* (409) table_reference_list ::= table_reference */ - { 350, -3 }, /* (410) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 351, -1 }, /* (411) table_reference ::= table_primary */ - { 351, -1 }, /* (412) table_reference ::= joined_table */ - { 352, -2 }, /* (413) table_primary ::= table_name alias_opt */ - { 352, -4 }, /* (414) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 352, -2 }, /* (415) table_primary ::= subquery alias_opt */ - { 352, -1 }, /* (416) table_primary ::= parenthesized_joined_table */ - { 354, 0 }, /* (417) alias_opt ::= */ - { 354, -1 }, /* (418) alias_opt ::= table_alias */ - { 354, -2 }, /* (419) alias_opt ::= AS table_alias */ - { 355, -3 }, /* (420) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 355, -3 }, /* (421) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 353, -6 }, /* (422) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 356, 0 }, /* (423) join_type ::= */ - { 356, -1 }, /* (424) join_type ::= INNER */ - { 358, -12 }, /* (425) 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 */ - { 359, 0 }, /* (426) set_quantifier_opt ::= */ - { 359, -1 }, /* (427) set_quantifier_opt ::= DISTINCT */ - { 359, -1 }, /* (428) set_quantifier_opt ::= ALL */ - { 360, -1 }, /* (429) select_list ::= select_item */ - { 360, -3 }, /* (430) select_list ::= select_list NK_COMMA select_item */ - { 368, -1 }, /* (431) select_item ::= NK_STAR */ - { 368, -1 }, /* (432) select_item ::= common_expression */ - { 368, -2 }, /* (433) select_item ::= common_expression column_alias */ - { 368, -3 }, /* (434) select_item ::= common_expression AS column_alias */ - { 368, -3 }, /* (435) select_item ::= table_name NK_DOT NK_STAR */ - { 326, 0 }, /* (436) where_clause_opt ::= */ - { 326, -2 }, /* (437) where_clause_opt ::= WHERE search_condition */ - { 361, 0 }, /* (438) partition_by_clause_opt ::= */ - { 361, -3 }, /* (439) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 365, 0 }, /* (440) twindow_clause_opt ::= */ - { 365, -6 }, /* (441) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 365, -4 }, /* (442) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ - { 365, -6 }, /* (443) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 365, -8 }, /* (444) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 312, 0 }, /* (445) sliding_opt ::= */ - { 312, -4 }, /* (446) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 364, 0 }, /* (447) fill_opt ::= */ - { 364, -4 }, /* (448) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 364, -6 }, /* (449) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 369, -1 }, /* (450) fill_mode ::= NONE */ - { 369, -1 }, /* (451) fill_mode ::= PREV */ - { 369, -1 }, /* (452) fill_mode ::= NULL */ - { 369, -1 }, /* (453) fill_mode ::= LINEAR */ - { 369, -1 }, /* (454) fill_mode ::= NEXT */ - { 366, 0 }, /* (455) group_by_clause_opt ::= */ - { 366, -3 }, /* (456) group_by_clause_opt ::= GROUP BY group_by_list */ - { 370, -1 }, /* (457) group_by_list ::= expression */ - { 370, -3 }, /* (458) group_by_list ::= group_by_list NK_COMMA expression */ - { 367, 0 }, /* (459) having_clause_opt ::= */ - { 367, -2 }, /* (460) having_clause_opt ::= HAVING search_condition */ - { 362, 0 }, /* (461) range_opt ::= */ - { 362, -6 }, /* (462) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ - { 363, 0 }, /* (463) every_opt ::= */ - { 363, -4 }, /* (464) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 317, -4 }, /* (465) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 371, -1 }, /* (466) query_expression_body ::= query_primary */ - { 371, -4 }, /* (467) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 371, -3 }, /* (468) query_expression_body ::= query_expression_body UNION query_expression_body */ - { 375, -1 }, /* (469) query_primary ::= query_specification */ - { 375, -6 }, /* (470) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ - { 372, 0 }, /* (471) order_by_clause_opt ::= */ - { 372, -3 }, /* (472) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 373, 0 }, /* (473) slimit_clause_opt ::= */ - { 373, -2 }, /* (474) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 373, -4 }, /* (475) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 373, -4 }, /* (476) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 374, 0 }, /* (477) limit_clause_opt ::= */ - { 374, -2 }, /* (478) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 374, -4 }, /* (479) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 374, -4 }, /* (480) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 336, -3 }, /* (481) subquery ::= NK_LP query_expression NK_RP */ - { 357, -1 }, /* (482) search_condition ::= common_expression */ - { 376, -1 }, /* (483) sort_specification_list ::= sort_specification */ - { 376, -3 }, /* (484) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 377, -3 }, /* (485) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 378, 0 }, /* (486) ordering_specification_opt ::= */ - { 378, -1 }, /* (487) ordering_specification_opt ::= ASC */ - { 378, -1 }, /* (488) ordering_specification_opt ::= DESC */ - { 379, 0 }, /* (489) null_ordering_opt ::= */ - { 379, -2 }, /* (490) null_ordering_opt ::= NULLS FIRST */ - { 379, -2 }, /* (491) null_ordering_opt ::= NULLS LAST */ + { 315, -1 }, /* (321) topic_name ::= NK_ID */ + { 322, -1 }, /* (322) stream_name ::= NK_ID */ + { 317, -1 }, /* (323) cgroup_name ::= NK_ID */ + { 331, -1 }, /* (324) expression ::= literal */ + { 331, -1 }, /* (325) expression ::= pseudo_column */ + { 331, -1 }, /* (326) expression ::= column_reference */ + { 331, -1 }, /* (327) expression ::= function_expression */ + { 331, -1 }, /* (328) expression ::= subquery */ + { 331, -3 }, /* (329) expression ::= NK_LP expression NK_RP */ + { 331, -2 }, /* (330) expression ::= NK_PLUS expression */ + { 331, -2 }, /* (331) expression ::= NK_MINUS expression */ + { 331, -3 }, /* (332) expression ::= expression NK_PLUS expression */ + { 331, -3 }, /* (333) expression ::= expression NK_MINUS expression */ + { 331, -3 }, /* (334) expression ::= expression NK_STAR expression */ + { 331, -3 }, /* (335) expression ::= expression NK_SLASH expression */ + { 331, -3 }, /* (336) expression ::= expression NK_REM expression */ + { 331, -3 }, /* (337) expression ::= column_reference NK_ARROW NK_STRING */ + { 331, -3 }, /* (338) expression ::= expression NK_BITAND expression */ + { 331, -3 }, /* (339) expression ::= expression NK_BITOR expression */ + { 293, -1 }, /* (340) expression_list ::= expression */ + { 293, -3 }, /* (341) expression_list ::= expression_list NK_COMMA expression */ + { 333, -1 }, /* (342) column_reference ::= column_name */ + { 333, -3 }, /* (343) column_reference ::= table_name NK_DOT column_name */ + { 332, -1 }, /* (344) pseudo_column ::= ROWTS */ + { 332, -1 }, /* (345) pseudo_column ::= TBNAME */ + { 332, -3 }, /* (346) pseudo_column ::= table_name NK_DOT TBNAME */ + { 332, -1 }, /* (347) pseudo_column ::= QSTART */ + { 332, -1 }, /* (348) pseudo_column ::= QEND */ + { 332, -1 }, /* (349) pseudo_column ::= QDURATION */ + { 332, -1 }, /* (350) pseudo_column ::= WSTART */ + { 332, -1 }, /* (351) pseudo_column ::= WEND */ + { 332, -1 }, /* (352) pseudo_column ::= WDURATION */ + { 334, -4 }, /* (353) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 334, -4 }, /* (354) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 334, -6 }, /* (355) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ + { 334, -1 }, /* (356) function_expression ::= literal_func */ + { 327, -3 }, /* (357) literal_func ::= noarg_func NK_LP NK_RP */ + { 327, -1 }, /* (358) literal_func ::= NOW */ + { 338, -1 }, /* (359) noarg_func ::= NOW */ + { 338, -1 }, /* (360) noarg_func ::= TODAY */ + { 338, -1 }, /* (361) noarg_func ::= TIMEZONE */ + { 338, -1 }, /* (362) noarg_func ::= DATABASE */ + { 338, -1 }, /* (363) noarg_func ::= CLIENT_VERSION */ + { 338, -1 }, /* (364) noarg_func ::= SERVER_VERSION */ + { 338, -1 }, /* (365) noarg_func ::= SERVER_STATUS */ + { 338, -1 }, /* (366) noarg_func ::= CURRENT_USER */ + { 338, -1 }, /* (367) noarg_func ::= USER */ + { 336, -1 }, /* (368) star_func ::= COUNT */ + { 336, -1 }, /* (369) star_func ::= FIRST */ + { 336, -1 }, /* (370) star_func ::= LAST */ + { 336, -1 }, /* (371) star_func ::= LAST_ROW */ + { 337, -1 }, /* (372) star_func_para_list ::= NK_STAR */ + { 337, -1 }, /* (373) star_func_para_list ::= other_para_list */ + { 339, -1 }, /* (374) other_para_list ::= star_func_para */ + { 339, -3 }, /* (375) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 340, -1 }, /* (376) star_func_para ::= expression */ + { 340, -3 }, /* (377) star_func_para ::= table_name NK_DOT NK_STAR */ + { 341, -3 }, /* (378) predicate ::= expression compare_op expression */ + { 341, -5 }, /* (379) predicate ::= expression BETWEEN expression AND expression */ + { 341, -6 }, /* (380) predicate ::= expression NOT BETWEEN expression AND expression */ + { 341, -3 }, /* (381) predicate ::= expression IS NULL */ + { 341, -4 }, /* (382) predicate ::= expression IS NOT NULL */ + { 341, -3 }, /* (383) predicate ::= expression in_op in_predicate_value */ + { 342, -1 }, /* (384) compare_op ::= NK_LT */ + { 342, -1 }, /* (385) compare_op ::= NK_GT */ + { 342, -1 }, /* (386) compare_op ::= NK_LE */ + { 342, -1 }, /* (387) compare_op ::= NK_GE */ + { 342, -1 }, /* (388) compare_op ::= NK_NE */ + { 342, -1 }, /* (389) compare_op ::= NK_EQ */ + { 342, -1 }, /* (390) compare_op ::= LIKE */ + { 342, -2 }, /* (391) compare_op ::= NOT LIKE */ + { 342, -1 }, /* (392) compare_op ::= MATCH */ + { 342, -1 }, /* (393) compare_op ::= NMATCH */ + { 342, -1 }, /* (394) compare_op ::= CONTAINS */ + { 343, -1 }, /* (395) in_op ::= IN */ + { 343, -2 }, /* (396) in_op ::= NOT IN */ + { 344, -3 }, /* (397) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 345, -1 }, /* (398) boolean_value_expression ::= boolean_primary */ + { 345, -2 }, /* (399) boolean_value_expression ::= NOT boolean_primary */ + { 345, -3 }, /* (400) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 345, -3 }, /* (401) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 346, -1 }, /* (402) boolean_primary ::= predicate */ + { 346, -3 }, /* (403) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 347, -1 }, /* (404) common_expression ::= expression */ + { 347, -1 }, /* (405) common_expression ::= boolean_value_expression */ + { 348, 0 }, /* (406) from_clause_opt ::= */ + { 348, -2 }, /* (407) from_clause_opt ::= FROM table_reference_list */ + { 349, -1 }, /* (408) table_reference_list ::= table_reference */ + { 349, -3 }, /* (409) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 350, -1 }, /* (410) table_reference ::= table_primary */ + { 350, -1 }, /* (411) table_reference ::= joined_table */ + { 351, -2 }, /* (412) table_primary ::= table_name alias_opt */ + { 351, -4 }, /* (413) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 351, -2 }, /* (414) table_primary ::= subquery alias_opt */ + { 351, -1 }, /* (415) table_primary ::= parenthesized_joined_table */ + { 353, 0 }, /* (416) alias_opt ::= */ + { 353, -1 }, /* (417) alias_opt ::= table_alias */ + { 353, -2 }, /* (418) alias_opt ::= AS table_alias */ + { 354, -3 }, /* (419) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 354, -3 }, /* (420) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 352, -6 }, /* (421) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 355, 0 }, /* (422) join_type ::= */ + { 355, -1 }, /* (423) join_type ::= INNER */ + { 357, -12 }, /* (424) 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 */ + { 358, 0 }, /* (425) set_quantifier_opt ::= */ + { 358, -1 }, /* (426) set_quantifier_opt ::= DISTINCT */ + { 358, -1 }, /* (427) set_quantifier_opt ::= ALL */ + { 359, -1 }, /* (428) select_list ::= select_item */ + { 359, -3 }, /* (429) select_list ::= select_list NK_COMMA select_item */ + { 367, -1 }, /* (430) select_item ::= NK_STAR */ + { 367, -1 }, /* (431) select_item ::= common_expression */ + { 367, -2 }, /* (432) select_item ::= common_expression column_alias */ + { 367, -3 }, /* (433) select_item ::= common_expression AS column_alias */ + { 367, -3 }, /* (434) select_item ::= table_name NK_DOT NK_STAR */ + { 325, 0 }, /* (435) where_clause_opt ::= */ + { 325, -2 }, /* (436) where_clause_opt ::= WHERE search_condition */ + { 360, 0 }, /* (437) partition_by_clause_opt ::= */ + { 360, -3 }, /* (438) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 364, 0 }, /* (439) twindow_clause_opt ::= */ + { 364, -6 }, /* (440) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 364, -4 }, /* (441) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ + { 364, -6 }, /* (442) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 364, -8 }, /* (443) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 311, 0 }, /* (444) sliding_opt ::= */ + { 311, -4 }, /* (445) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 363, 0 }, /* (446) fill_opt ::= */ + { 363, -4 }, /* (447) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 363, -6 }, /* (448) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 368, -1 }, /* (449) fill_mode ::= NONE */ + { 368, -1 }, /* (450) fill_mode ::= PREV */ + { 368, -1 }, /* (451) fill_mode ::= NULL */ + { 368, -1 }, /* (452) fill_mode ::= LINEAR */ + { 368, -1 }, /* (453) fill_mode ::= NEXT */ + { 365, 0 }, /* (454) group_by_clause_opt ::= */ + { 365, -3 }, /* (455) group_by_clause_opt ::= GROUP BY group_by_list */ + { 369, -1 }, /* (456) group_by_list ::= expression */ + { 369, -3 }, /* (457) group_by_list ::= group_by_list NK_COMMA expression */ + { 366, 0 }, /* (458) having_clause_opt ::= */ + { 366, -2 }, /* (459) having_clause_opt ::= HAVING search_condition */ + { 361, 0 }, /* (460) range_opt ::= */ + { 361, -6 }, /* (461) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ + { 362, 0 }, /* (462) every_opt ::= */ + { 362, -4 }, /* (463) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 316, -4 }, /* (464) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 370, -1 }, /* (465) query_expression_body ::= query_primary */ + { 370, -4 }, /* (466) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 370, -3 }, /* (467) query_expression_body ::= query_expression_body UNION query_expression_body */ + { 374, -1 }, /* (468) query_primary ::= query_specification */ + { 374, -6 }, /* (469) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ + { 371, 0 }, /* (470) order_by_clause_opt ::= */ + { 371, -3 }, /* (471) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 372, 0 }, /* (472) slimit_clause_opt ::= */ + { 372, -2 }, /* (473) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 372, -4 }, /* (474) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 372, -4 }, /* (475) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 373, 0 }, /* (476) limit_clause_opt ::= */ + { 373, -2 }, /* (477) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 373, -4 }, /* (478) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 373, -4 }, /* (479) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 335, -3 }, /* (480) subquery ::= NK_LP query_expression NK_RP */ + { 356, -1 }, /* (481) search_condition ::= common_expression */ + { 375, -1 }, /* (482) sort_specification_list ::= sort_specification */ + { 375, -3 }, /* (483) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 376, -3 }, /* (484) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 377, 0 }, /* (485) ordering_specification_opt ::= */ + { 377, -1 }, /* (486) ordering_specification_opt ::= ASC */ + { 377, -1 }, /* (487) ordering_specification_opt ::= DESC */ + { 378, 0 }, /* (488) null_ordering_opt ::= */ + { 378, -2 }, /* (489) null_ordering_opt ::= NULLS FIRST */ + { 378, -2 }, /* (490) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3343,69 +3351,69 @@ static YYACTIONTYPE yy_reduce( yy_destructor(yypParser,260,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy0, yymsp[0].minor.yy543); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy361, &yymsp[-1].minor.yy0, yymsp[0].minor.yy285); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy361, 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.yy129, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy361, 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.yy129, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy361, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy361); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy543 = 1; } +{ yymsp[1].minor.yy285 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy543 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy285 = 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.yy549, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy457, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy549, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy457, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy549 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy457 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 35: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==35); -{ yylhsminor.yy549 = yymsp[0].minor.yy549; } - yymsp[0].minor.yy549 = yylhsminor.yy549; +{ yylhsminor.yy457 = yymsp[0].minor.yy457; } + yymsp[0].minor.yy457 = yylhsminor.yy457; break; case 36: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy549 = yymsp[-2].minor.yy549 | yymsp[0].minor.yy549; } - yymsp[-2].minor.yy549 = yylhsminor.yy549; +{ yylhsminor.yy457 = yymsp[-2].minor.yy457 | yymsp[0].minor.yy457; } + yymsp[-2].minor.yy457 = yylhsminor.yy457; break; case 37: /* priv_type ::= READ */ -{ yymsp[0].minor.yy549 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy457 = PRIVILEGE_TYPE_READ; } break; case 38: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy549 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy457 = PRIVILEGE_TYPE_WRITE; } break; case 39: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy129 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy129 = yylhsminor.yy129; +{ yylhsminor.yy361 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy361 = yylhsminor.yy361; break; case 40: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy129 = yymsp[-2].minor.yy129; } - yymsp[-2].minor.yy129 = yylhsminor.yy129; +{ yylhsminor.yy361 = yymsp[-2].minor.yy361; } + yymsp[-2].minor.yy361 = yylhsminor.yy361; break; case 41: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy129, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy361, NULL); } break; case 42: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy0); } break; case 43: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 44: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy361); } break; case 45: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3429,25 +3437,24 @@ static YYACTIONTYPE yy_reduce( case 318: /* table_alias ::= NK_ID */ yytestcase(yyruleno==318); case 319: /* column_alias ::= NK_ID */ yytestcase(yyruleno==319); case 320: /* user_name ::= NK_ID */ yytestcase(yyruleno==320); - case 321: /* index_name ::= NK_ID */ yytestcase(yyruleno==321); - case 322: /* topic_name ::= NK_ID */ yytestcase(yyruleno==322); - case 323: /* stream_name ::= NK_ID */ yytestcase(yyruleno==323); - case 324: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==324); - case 360: /* noarg_func ::= NOW */ yytestcase(yyruleno==360); - case 361: /* noarg_func ::= TODAY */ yytestcase(yyruleno==361); - case 362: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==362); - case 363: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==363); - case 364: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==364); - case 365: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==365); - case 366: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==366); - case 367: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==367); - case 368: /* noarg_func ::= USER */ yytestcase(yyruleno==368); - case 369: /* star_func ::= COUNT */ yytestcase(yyruleno==369); - case 370: /* star_func ::= FIRST */ yytestcase(yyruleno==370); - case 371: /* star_func ::= LAST */ yytestcase(yyruleno==371); - case 372: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==372); -{ yylhsminor.yy129 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy129 = yylhsminor.yy129; + case 321: /* topic_name ::= NK_ID */ yytestcase(yyruleno==321); + case 322: /* stream_name ::= NK_ID */ yytestcase(yyruleno==322); + case 323: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==323); + case 359: /* noarg_func ::= NOW */ yytestcase(yyruleno==359); + case 360: /* noarg_func ::= TODAY */ yytestcase(yyruleno==360); + case 361: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==361); + case 362: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==362); + case 363: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==363); + case 364: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==364); + case 365: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==365); + case 366: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==366); + case 367: /* noarg_func ::= USER */ yytestcase(yyruleno==367); + case 368: /* star_func ::= COUNT */ yytestcase(yyruleno==368); + case 369: /* star_func ::= FIRST */ yytestcase(yyruleno==369); + case 370: /* star_func ::= LAST */ yytestcase(yyruleno==370); + case 371: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==371); +{ yylhsminor.yy361 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy361 = yylhsminor.yy361; break; case 52: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3480,189 +3487,189 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 62: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy337, &yymsp[-1].minor.yy129, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy151, &yymsp[-1].minor.yy361, yymsp[0].minor.yy616); } break; case 63: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy337, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy361); } break; case 64: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy361); } break; case 65: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy361, yymsp[0].minor.yy616); } break; case 66: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy361); } break; case 67: /* cmd ::= TRIM DATABASE db_name */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[0].minor.yy361); } break; case 68: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy337 = true; } +{ yymsp[-2].minor.yy151 = true; } break; case 69: /* not_exists_opt ::= */ case 71: /* exists_opt ::= */ yytestcase(yyruleno==71); case 255: /* analyze_opt ::= */ yytestcase(yyruleno==255); case 262: /* agg_func_opt ::= */ yytestcase(yyruleno==262); - case 426: /* set_quantifier_opt ::= */ yytestcase(yyruleno==426); -{ yymsp[1].minor.yy337 = false; } + case 425: /* set_quantifier_opt ::= */ yytestcase(yyruleno==425); +{ yymsp[1].minor.yy151 = false; } break; case 70: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy337 = true; } +{ yymsp[-1].minor.yy151 = true; } break; case 72: /* db_options ::= */ -{ yymsp[1].minor.yy712 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy616 = createDefaultDatabaseOptions(pCxt); } break; case 73: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 74: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 75: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 76: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 77: /* db_options ::= db_options DURATION NK_INTEGER */ case 78: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==78); -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 79: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 80: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 81: /* db_options ::= db_options KEEP integer_list */ case 82: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==82); -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_KEEP, yymsp[0].minor.yy464); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_KEEP, yymsp[0].minor.yy356); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 83: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 84: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 85: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 86: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 87: /* db_options ::= db_options STRICT NK_STRING */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 88: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 89: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 90: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_RETENTIONS, yymsp[0].minor.yy464); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_RETENTIONS, yymsp[0].minor.yy356); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 91: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 92: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 93: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 94: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 95: /* 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.yy712 = setDatabaseOption(pCxt, yymsp[-3].minor.yy712, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-3].minor.yy616, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; case 96: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 97: /* 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.yy712 = setDatabaseOption(pCxt, yymsp[-3].minor.yy712, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-3].minor.yy616, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; case 98: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 99: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy712 = setDatabaseOption(pCxt, yymsp[-2].minor.yy712, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setDatabaseOption(pCxt, yymsp[-2].minor.yy616, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 100: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy712 = createAlterDatabaseOptions(pCxt); yylhsminor.yy712 = setAlterDatabaseOption(pCxt, yylhsminor.yy712, &yymsp[0].minor.yy405); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterDatabaseOptions(pCxt); yylhsminor.yy616 = setAlterDatabaseOption(pCxt, yylhsminor.yy616, &yymsp[0].minor.yy409); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 101: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy712 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy712, &yymsp[0].minor.yy405); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy616, &yymsp[0].minor.yy409); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; case 102: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy405.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy405.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy409.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; } break; case 103: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy405.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy405.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy409.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; } break; case 104: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy405.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy405.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy409.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; } break; case 105: /* alter_db_option ::= KEEP integer_list */ case 106: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==106); -{ yymsp[-1].minor.yy405.type = DB_OPTION_KEEP; yymsp[-1].minor.yy405.pList = yymsp[0].minor.yy464; } +{ yymsp[-1].minor.yy409.type = DB_OPTION_KEEP; yymsp[-1].minor.yy409.pList = yymsp[0].minor.yy356; } break; case 107: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy405.type = DB_OPTION_WAL; yymsp[-1].minor.yy405.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy409.type = DB_OPTION_WAL; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; } break; case 108: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy464 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy464 = yylhsminor.yy464; +{ yylhsminor.yy356 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy356 = yylhsminor.yy356; break; case 109: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ case 284: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==284); -{ yylhsminor.yy464 = addNodeToList(pCxt, yymsp[-2].minor.yy464, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy464 = yylhsminor.yy464; +{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy356 = yylhsminor.yy356; break; case 110: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy464 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy464 = yylhsminor.yy464; +{ yylhsminor.yy356 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy356 = yylhsminor.yy356; break; case 111: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy464 = addNodeToList(pCxt, yymsp[-2].minor.yy464, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy464 = yylhsminor.yy464; +{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy356 = yylhsminor.yy356; break; case 112: /* retention_list ::= retention */ case 132: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==132); @@ -3672,11 +3679,11 @@ static YYACTIONTYPE yy_reduce( case 190: /* col_name_list ::= col_name */ yytestcase(yyruleno==190); case 238: /* func_list ::= func */ yytestcase(yyruleno==238); case 312: /* literal_list ::= signed_literal */ yytestcase(yyruleno==312); - case 375: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==375); - case 429: /* select_list ::= select_item */ yytestcase(yyruleno==429); - case 483: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==483); -{ yylhsminor.yy464 = createNodeList(pCxt, yymsp[0].minor.yy712); } - yymsp[0].minor.yy464 = yylhsminor.yy464; + case 374: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==374); + case 428: /* select_list ::= select_item */ yytestcase(yyruleno==428); + case 482: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==482); +{ yylhsminor.yy356 = createNodeList(pCxt, yymsp[0].minor.yy616); } + yymsp[0].minor.yy356 = yylhsminor.yy356; break; case 113: /* retention_list ::= retention_list NK_COMMA retention */ case 143: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==143); @@ -3684,253 +3691,253 @@ static YYACTIONTYPE yy_reduce( case 191: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==191); case 239: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==239); case 313: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==313); - case 376: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==376); - case 430: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==430); - case 484: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==484); -{ yylhsminor.yy464 = addNodeToList(pCxt, yymsp[-2].minor.yy464, yymsp[0].minor.yy712); } - yymsp[-2].minor.yy464 = yylhsminor.yy464; + case 375: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==375); + case 429: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==429); + case 483: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==483); +{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, yymsp[0].minor.yy616); } + yymsp[-2].minor.yy356 = yylhsminor.yy356; break; case 114: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy712 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 115: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 117: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==117); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy337, yymsp[-5].minor.yy712, yymsp[-3].minor.yy464, yymsp[-1].minor.yy464, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy151, yymsp[-5].minor.yy616, yymsp[-3].minor.yy356, yymsp[-1].minor.yy356, yymsp[0].minor.yy616); } break; case 116: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy464); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy356); } break; case 118: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy464); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy356); } break; case 119: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy337, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy151, yymsp[0].minor.yy616); } break; case 120: /* cmd ::= ALTER TABLE alter_table_clause */ case 286: /* cmd ::= query_expression */ yytestcase(yyruleno==286); -{ pCxt->pRootNode = yymsp[0].minor.yy712; } +{ pCxt->pRootNode = yymsp[0].minor.yy616; } break; case 121: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy712); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy616); } break; case 122: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy712 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; case 123: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy712 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184); } - yymsp[-4].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600); } + yymsp[-4].minor.yy616 = yylhsminor.yy616; break; case 124: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy712 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy712, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy129); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy616, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy361); } + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; case 125: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy712 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184); } - yymsp[-4].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600); } + yymsp[-4].minor.yy616 = yylhsminor.yy616; break; case 126: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy712 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-4].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy361, &yymsp[0].minor.yy361); } + yymsp[-4].minor.yy616 = yylhsminor.yy616; break; case 127: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy712 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184); } - yymsp[-4].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600); } + yymsp[-4].minor.yy616 = yylhsminor.yy616; break; case 128: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy712 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy712, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy129); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy616, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy361); } + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; case 129: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy712 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184); } - yymsp[-4].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600); } + yymsp[-4].minor.yy616 = yylhsminor.yy616; break; case 130: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy712 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy712, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-4].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy616, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy361, &yymsp[0].minor.yy361); } + yymsp[-4].minor.yy616 = yylhsminor.yy616; break; case 131: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy712 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy712, &yymsp[-2].minor.yy129, yymsp[0].minor.yy712); } - yymsp[-5].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy616, &yymsp[-2].minor.yy361, yymsp[0].minor.yy616); } + yymsp[-5].minor.yy616 = yylhsminor.yy616; break; case 133: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 136: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==136); -{ yylhsminor.yy464 = addNodeToList(pCxt, yymsp[-1].minor.yy464, yymsp[0].minor.yy712); } - yymsp[-1].minor.yy464 = yylhsminor.yy464; +{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-1].minor.yy356, yymsp[0].minor.yy616); } + yymsp[-1].minor.yy356 = yylhsminor.yy356; break; case 134: /* 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.yy712 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy337, yymsp[-8].minor.yy712, yymsp[-6].minor.yy712, yymsp[-5].minor.yy464, yymsp[-2].minor.yy464, yymsp[0].minor.yy712); } - yymsp[-9].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy151, yymsp[-8].minor.yy616, yymsp[-6].minor.yy616, yymsp[-5].minor.yy356, yymsp[-2].minor.yy356, yymsp[0].minor.yy616); } + yymsp[-9].minor.yy616 = yylhsminor.yy616; break; case 137: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy712 = createDropTableClause(pCxt, yymsp[-1].minor.yy337, yymsp[0].minor.yy712); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createDropTableClause(pCxt, yymsp[-1].minor.yy151, yymsp[0].minor.yy616); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; case 138: /* specific_cols_opt ::= */ case 169: /* tags_def_opt ::= */ yytestcase(yyruleno==169); - case 438: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==438); - case 455: /* group_by_clause_opt ::= */ yytestcase(yyruleno==455); - case 471: /* order_by_clause_opt ::= */ yytestcase(yyruleno==471); -{ yymsp[1].minor.yy464 = NULL; } + case 437: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==437); + case 454: /* group_by_clause_opt ::= */ yytestcase(yyruleno==454); + case 470: /* order_by_clause_opt ::= */ yytestcase(yyruleno==470); +{ yymsp[1].minor.yy356 = NULL; } break; case 139: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy464 = yymsp[-1].minor.yy464; } +{ yymsp[-2].minor.yy356 = yymsp[-1].minor.yy356; } break; case 140: /* full_table_name ::= table_name */ -{ yylhsminor.yy712 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy129, NULL); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy361, NULL); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 141: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy712 = createRealTableNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, NULL); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRealTableNode(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361, NULL); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 144: /* column_def ::= column_name type_name */ -{ yylhsminor.yy712 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy184, NULL); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy361, yymsp[0].minor.yy600, NULL); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; case 145: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy712 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-2].minor.yy184, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy361, yymsp[-2].minor.yy600, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; case 146: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 147: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 148: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 149: /* type_name ::= INT */ case 150: /* type_name ::= INTEGER */ yytestcase(yyruleno==150); -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_INT); } break; case 151: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 152: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 153: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 154: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy184 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy600 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 155: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 156: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy184 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy600 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 157: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy184 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy600 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 158: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy184 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy600 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 159: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy184 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy600 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 160: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy184 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy600 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 161: /* type_name ::= JSON */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 162: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy184 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy600 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 163: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 164: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 165: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy184 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy600 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 166: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy184 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy600 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 167: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy184 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy600 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 168: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy184 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy600 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 170: /* tags_def_opt ::= tags_def */ - case 374: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==374); -{ yylhsminor.yy464 = yymsp[0].minor.yy464; } - yymsp[0].minor.yy464 = yylhsminor.yy464; + case 373: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==373); +{ yylhsminor.yy356 = yymsp[0].minor.yy356; } + yymsp[0].minor.yy356 = yylhsminor.yy356; break; case 171: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy464 = yymsp[-1].minor.yy464; } +{ yymsp[-3].minor.yy356 = yymsp[-1].minor.yy356; } break; case 172: /* table_options ::= */ -{ yymsp[1].minor.yy712 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy616 = createDefaultTableOptions(pCxt); } break; case 173: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-2].minor.yy712, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-2].minor.yy616, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 174: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-2].minor.yy712, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy464); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-2].minor.yy616, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy356); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 175: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-2].minor.yy712, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy464); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-2].minor.yy616, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy356); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 176: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-4].minor.yy712, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy464); } - yymsp[-4].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-4].minor.yy616, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy356); } + yymsp[-4].minor.yy616 = yylhsminor.yy616; break; case 177: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-2].minor.yy712, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-2].minor.yy616, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 178: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-4].minor.yy712, TABLE_OPTION_SMA, yymsp[-1].minor.yy464); } - yymsp[-4].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-4].minor.yy616, TABLE_OPTION_SMA, yymsp[-1].minor.yy356); } + yymsp[-4].minor.yy616 = yylhsminor.yy616; break; case 179: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy712 = createAlterTableOptions(pCxt); yylhsminor.yy712 = setTableOption(pCxt, yylhsminor.yy712, yymsp[0].minor.yy405.type, &yymsp[0].minor.yy405.val); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createAlterTableOptions(pCxt); yylhsminor.yy616 = setTableOption(pCxt, yylhsminor.yy616, yymsp[0].minor.yy409.type, &yymsp[0].minor.yy409.val); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 180: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy712 = setTableOption(pCxt, yymsp[-1].minor.yy712, yymsp[0].minor.yy405.type, &yymsp[0].minor.yy405.val); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setTableOption(pCxt, yymsp[-1].minor.yy616, yymsp[0].minor.yy409.type, &yymsp[0].minor.yy409.val); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; case 181: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy405.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy405.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy409.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; } break; case 182: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy405.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy405.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy409.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy409.val = yymsp[0].minor.yy0; } break; case 183: /* duration_list ::= duration_literal */ - case 341: /* expression_list ::= expression */ yytestcase(yyruleno==341); -{ yylhsminor.yy464 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy712)); } - yymsp[0].minor.yy464 = yylhsminor.yy464; + case 340: /* expression_list ::= expression */ yytestcase(yyruleno==340); +{ yylhsminor.yy356 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy616)); } + yymsp[0].minor.yy356 = yylhsminor.yy356; break; case 184: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 342: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==342); -{ yylhsminor.yy464 = addNodeToList(pCxt, yymsp[-2].minor.yy464, releaseRawExprNode(pCxt, yymsp[0].minor.yy712)); } - yymsp[-2].minor.yy464 = yylhsminor.yy464; + case 341: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==341); +{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, releaseRawExprNode(pCxt, yymsp[0].minor.yy616)); } + yymsp[-2].minor.yy356 = yylhsminor.yy356; break; case 187: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy712 = createFunctionNode(pCxt, &yymsp[0].minor.yy129, NULL); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createFunctionNode(pCxt, &yymsp[0].minor.yy361, NULL); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 188: /* rollup_func_name ::= FIRST */ case 189: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==189); -{ yylhsminor.yy712 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 192: /* col_name ::= column_name */ -{ yylhsminor.yy712 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy361); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 193: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -3942,13 +3949,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; case 196: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy712, yymsp[0].minor.yy712, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy616, yymsp[0].minor.yy616, OP_TYPE_LIKE); } break; case 197: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy712, yymsp[0].minor.yy712, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy616, yymsp[0].minor.yy616, OP_TYPE_LIKE); } break; case 198: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy712, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy616, NULL, OP_TYPE_LIKE); } break; case 199: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -3963,7 +3970,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; case 203: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy712, yymsp[-1].minor.yy712, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy616, yymsp[-1].minor.yy616, OP_TYPE_EQUAL); } break; case 204: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } @@ -3982,13 +3989,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT); } break; case 210: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy361); } break; case 211: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy616); } break; case 212: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy616); } break; case 213: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } @@ -4021,7 +4028,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; case 223: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy616); } break; case 224: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } @@ -4030,155 +4037,155 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; case 226: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy712, yymsp[-1].minor.yy712, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy616, yymsp[-1].minor.yy616, OP_TYPE_EQUAL); } break; case 227: /* db_name_cond_opt ::= */ case 232: /* from_db_opt ::= */ yytestcase(yyruleno==232); -{ yymsp[1].minor.yy712 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy616 = createDefaultDatabaseCondValue(pCxt); } break; case 228: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy129); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy361); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; case 229: /* like_pattern_opt ::= */ case 268: /* into_opt ::= */ yytestcase(yyruleno==268); - case 407: /* from_clause_opt ::= */ yytestcase(yyruleno==407); - case 436: /* where_clause_opt ::= */ yytestcase(yyruleno==436); - case 440: /* twindow_clause_opt ::= */ yytestcase(yyruleno==440); - case 445: /* sliding_opt ::= */ yytestcase(yyruleno==445); - case 447: /* fill_opt ::= */ yytestcase(yyruleno==447); - case 459: /* having_clause_opt ::= */ yytestcase(yyruleno==459); - case 461: /* range_opt ::= */ yytestcase(yyruleno==461); - case 463: /* every_opt ::= */ yytestcase(yyruleno==463); - case 473: /* slimit_clause_opt ::= */ yytestcase(yyruleno==473); - case 477: /* limit_clause_opt ::= */ yytestcase(yyruleno==477); -{ yymsp[1].minor.yy712 = NULL; } + case 406: /* from_clause_opt ::= */ yytestcase(yyruleno==406); + case 435: /* where_clause_opt ::= */ yytestcase(yyruleno==435); + case 439: /* twindow_clause_opt ::= */ yytestcase(yyruleno==439); + case 444: /* sliding_opt ::= */ yytestcase(yyruleno==444); + case 446: /* fill_opt ::= */ yytestcase(yyruleno==446); + case 458: /* having_clause_opt ::= */ yytestcase(yyruleno==458); + case 460: /* range_opt ::= */ yytestcase(yyruleno==460); + case 462: /* every_opt ::= */ yytestcase(yyruleno==462); + case 472: /* slimit_clause_opt ::= */ yytestcase(yyruleno==472); + case 476: /* limit_clause_opt ::= */ yytestcase(yyruleno==476); +{ yymsp[1].minor.yy616 = NULL; } break; case 230: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 231: /* table_name_cond ::= table_name */ -{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy129); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy361); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 233: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy129); } +{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy361); } break; - case 234: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy337, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy712, NULL, yymsp[0].minor.yy712); } + case 234: /* 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.yy151, yymsp[-3].minor.yy616, yymsp[-1].minor.yy616, NULL, yymsp[0].minor.yy616); } break; - case 235: /* cmd ::= DROP INDEX exists_opt index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy337, &yymsp[0].minor.yy129); } + case 235: /* cmd ::= DROP INDEX exists_opt full_table_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy151, yymsp[0].minor.yy616); } break; case 236: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy712 = createIndexOption(pCxt, yymsp[-7].minor.yy464, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), NULL, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); } +{ yymsp[-9].minor.yy616 = createIndexOption(pCxt, yymsp[-7].minor.yy356, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), NULL, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); } break; case 237: /* 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.yy712 = createIndexOption(pCxt, yymsp[-9].minor.yy464, releaseRawExprNode(pCxt, yymsp[-5].minor.yy712), releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), yymsp[-1].minor.yy712, yymsp[0].minor.yy712); } +{ yymsp[-11].minor.yy616 = createIndexOption(pCxt, yymsp[-9].minor.yy356, releaseRawExprNode(pCxt, yymsp[-5].minor.yy616), releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), yymsp[-1].minor.yy616, yymsp[0].minor.yy616); } break; case 240: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy712 = createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy464); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createFunctionNode(pCxt, &yymsp[-3].minor.yy361, yymsp[-1].minor.yy356); } + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; case 241: /* sma_stream_opt ::= */ case 270: /* stream_options ::= */ yytestcase(yyruleno==270); -{ yymsp[1].minor.yy712 = createStreamOptions(pCxt); } +{ yymsp[1].minor.yy616 = createStreamOptions(pCxt); } break; case 242: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ case 274: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==274); -{ ((SStreamOptions*)yymsp[-2].minor.yy712)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy712); yylhsminor.yy712 = yymsp[-2].minor.yy712; } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ ((SStreamOptions*)yymsp[-2].minor.yy616)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy616); yylhsminor.yy616 = yymsp[-2].minor.yy616; } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 243: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy712)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy712); yylhsminor.yy712 = yymsp[-2].minor.yy712; } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ ((SStreamOptions*)yymsp[-2].minor.yy616)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy616); yylhsminor.yy616 = yymsp[-2].minor.yy616; } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 244: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy337, &yymsp[-2].minor.yy129, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy151, &yymsp[-2].minor.yy361, yymsp[0].minor.yy616); } break; case 245: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy337, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy129, false); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy151, &yymsp[-3].minor.yy361, &yymsp[0].minor.yy361, false); } break; case 246: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy337, &yymsp[-5].minor.yy129, &yymsp[0].minor.yy129, true); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy151, &yymsp[-5].minor.yy361, &yymsp[0].minor.yy361, true); } break; case 247: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy337, &yymsp[-3].minor.yy129, yymsp[0].minor.yy712, false); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy151, &yymsp[-3].minor.yy361, yymsp[0].minor.yy616, false); } break; case 248: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy337, &yymsp[-5].minor.yy129, yymsp[0].minor.yy712, true); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy151, &yymsp[-5].minor.yy361, yymsp[0].minor.yy616, true); } break; case 249: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy337, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy361); } break; case 250: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy337, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy151, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361); } break; case 251: /* cmd ::= DESC full_table_name */ case 252: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==252); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy616); } break; case 253: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; case 254: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy337, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy151, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); } break; case 256: /* analyze_opt ::= ANALYZE */ case 263: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==263); - case 427: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==427); -{ yymsp[0].minor.yy337 = true; } + case 426: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==426); +{ yymsp[0].minor.yy151 = true; } break; case 257: /* explain_options ::= */ -{ yymsp[1].minor.yy712 = createDefaultExplainOptions(pCxt); } +{ yymsp[1].minor.yy616 = createDefaultExplainOptions(pCxt); } break; case 258: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy712 = setExplainVerbose(pCxt, yymsp[-2].minor.yy712, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setExplainVerbose(pCxt, yymsp[-2].minor.yy616, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 259: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy712 = setExplainRatio(pCxt, yymsp[-2].minor.yy712, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = setExplainRatio(pCxt, yymsp[-2].minor.yy616, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 260: /* 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.yy337, yymsp[-8].minor.yy337, &yymsp[-5].minor.yy129, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy184, yymsp[0].minor.yy500); } +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy151, yymsp[-8].minor.yy151, &yymsp[-5].minor.yy361, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy600, yymsp[0].minor.yy734); } break; case 261: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy337, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy361); } break; case 264: /* bufsize_opt ::= */ -{ yymsp[1].minor.yy500 = 0; } +{ yymsp[1].minor.yy734 = 0; } break; case 265: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ -{ yymsp[-1].minor.yy500 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy734 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 266: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy337, &yymsp[-4].minor.yy129, yymsp[-2].minor.yy712, yymsp[-3].minor.yy712, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy151, &yymsp[-4].minor.yy361, yymsp[-2].minor.yy616, yymsp[-3].minor.yy616, yymsp[0].minor.yy616); } break; case 267: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy337, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy151, &yymsp[0].minor.yy361); } break; case 269: /* into_opt ::= INTO full_table_name */ - case 408: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==408); - case 437: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==437); - case 460: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==460); -{ yymsp[-1].minor.yy712 = yymsp[0].minor.yy712; } + case 407: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==407); + case 436: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==436); + case 459: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==459); +{ yymsp[-1].minor.yy616 = yymsp[0].minor.yy616; } break; case 271: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy712)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy712 = yymsp[-2].minor.yy712; } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ ((SStreamOptions*)yymsp[-2].minor.yy616)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy616 = yymsp[-2].minor.yy616; } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 272: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy712)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy712 = yymsp[-2].minor.yy712; } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ ((SStreamOptions*)yymsp[-2].minor.yy616)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy616 = yymsp[-2].minor.yy616; } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 273: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy712)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy712)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy712); yylhsminor.yy712 = yymsp[-3].minor.yy712; } - yymsp[-3].minor.yy712 = yylhsminor.yy712; +{ ((SStreamOptions*)yymsp[-3].minor.yy616)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy616)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy616); yylhsminor.yy616 = yymsp[-3].minor.yy616; } + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; case 275: /* stream_options ::= stream_options IGNORE EXPIRED */ -{ ((SStreamOptions*)yymsp[-2].minor.yy712)->ignoreExpired = true; yylhsminor.yy712 = yymsp[-2].minor.yy712; } - yymsp[-2].minor.yy712 = yylhsminor.yy712; +{ ((SStreamOptions*)yymsp[-2].minor.yy616)->ignoreExpired = true; yylhsminor.yy616 = yymsp[-2].minor.yy616; } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; case 276: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } @@ -4196,547 +4203,547 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; case 281: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy464); } +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy356); } break; case 282: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; case 283: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy464 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +{ yymsp[-1].minor.yy356 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; case 285: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); } break; case 287: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy712, yymsp[-2].minor.yy464, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy616, yymsp[-2].minor.yy356, yymsp[0].minor.yy616); } break; case 288: /* cmd ::= INSERT INTO full_table_name query_expression */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy712, NULL, yymsp[0].minor.yy712); } +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy616, NULL, yymsp[0].minor.yy616); } break; case 289: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 290: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 291: /* literal ::= NK_STRING */ -{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 292: /* literal ::= NK_BOOL */ -{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 293: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; case 294: /* literal ::= duration_literal */ case 304: /* signed_literal ::= signed */ yytestcase(yyruleno==304); - case 325: /* expression ::= literal */ yytestcase(yyruleno==325); - case 326: /* expression ::= pseudo_column */ yytestcase(yyruleno==326); - case 327: /* expression ::= column_reference */ yytestcase(yyruleno==327); - case 328: /* expression ::= function_expression */ yytestcase(yyruleno==328); - case 329: /* expression ::= subquery */ yytestcase(yyruleno==329); - case 357: /* function_expression ::= literal_func */ yytestcase(yyruleno==357); - case 399: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==399); - case 403: /* boolean_primary ::= predicate */ yytestcase(yyruleno==403); - case 405: /* common_expression ::= expression */ yytestcase(yyruleno==405); - case 406: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==406); - case 409: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==409); - case 411: /* table_reference ::= table_primary */ yytestcase(yyruleno==411); - case 412: /* table_reference ::= joined_table */ yytestcase(yyruleno==412); - case 416: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==416); - case 466: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==466); - case 469: /* query_primary ::= query_specification */ yytestcase(yyruleno==469); -{ yylhsminor.yy712 = yymsp[0].minor.yy712; } - yymsp[0].minor.yy712 = yylhsminor.yy712; + case 324: /* expression ::= literal */ yytestcase(yyruleno==324); + case 325: /* expression ::= pseudo_column */ yytestcase(yyruleno==325); + case 326: /* expression ::= column_reference */ yytestcase(yyruleno==326); + case 327: /* expression ::= function_expression */ yytestcase(yyruleno==327); + case 328: /* expression ::= subquery */ yytestcase(yyruleno==328); + case 356: /* function_expression ::= literal_func */ yytestcase(yyruleno==356); + case 398: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==398); + case 402: /* boolean_primary ::= predicate */ yytestcase(yyruleno==402); + case 404: /* common_expression ::= expression */ yytestcase(yyruleno==404); + case 405: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==405); + case 408: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==408); + case 410: /* table_reference ::= table_primary */ yytestcase(yyruleno==410); + case 411: /* table_reference ::= joined_table */ yytestcase(yyruleno==411); + case 415: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==415); + case 465: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==465); + case 468: /* query_primary ::= query_specification */ yytestcase(yyruleno==468); +{ yylhsminor.yy616 = yymsp[0].minor.yy616; } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 295: /* literal ::= NULL */ -{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 296: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 297: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 298: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 299: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; case 300: /* 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.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; case 301: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 302: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; case 303: /* 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.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; case 305: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 306: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 307: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 308: /* signed_literal ::= duration_literal */ case 310: /* signed_literal ::= literal_func */ yytestcase(yyruleno==310); - case 377: /* star_func_para ::= expression */ yytestcase(yyruleno==377); - case 432: /* select_item ::= common_expression */ yytestcase(yyruleno==432); - case 482: /* search_condition ::= common_expression */ yytestcase(yyruleno==482); -{ yylhsminor.yy712 = releaseRawExprNode(pCxt, yymsp[0].minor.yy712); } - yymsp[0].minor.yy712 = yylhsminor.yy712; + case 376: /* star_func_para ::= expression */ yytestcase(yyruleno==376); + case 431: /* select_item ::= common_expression */ yytestcase(yyruleno==431); + case 481: /* search_condition ::= common_expression */ yytestcase(yyruleno==481); +{ yylhsminor.yy616 = releaseRawExprNode(pCxt, yymsp[0].minor.yy616); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 309: /* signed_literal ::= NULL */ -{ yylhsminor.yy712 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; case 311: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy712 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy712 = yylhsminor.yy712; +{ yylhsminor.yy616 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; - case 330: /* expression ::= NK_LP expression NK_RP */ - case 404: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==404); -{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy712)); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 329: /* expression ::= NK_LP expression NK_RP */ + case 403: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==403); +{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy616)); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 331: /* expression ::= NK_PLUS expression */ + case 330: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy712)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy616)); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; - case 332: /* expression ::= NK_MINUS expression */ + case 331: /* expression ::= NK_MINUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy712), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy616), NULL)); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; - case 333: /* expression ::= expression NK_PLUS expression */ + case 332: /* expression ::= expression NK_PLUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 334: /* expression ::= expression NK_MINUS expression */ + case 333: /* expression ::= expression NK_MINUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 335: /* expression ::= expression NK_STAR expression */ + case 334: /* expression ::= expression NK_STAR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 336: /* expression ::= expression NK_SLASH expression */ + case 335: /* expression ::= expression NK_SLASH expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 337: /* expression ::= expression NK_REM expression */ + case 336: /* expression ::= expression NK_REM expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 338: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 337: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 339: /* expression ::= expression NK_BITAND expression */ + case 338: /* expression ::= expression NK_BITAND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 340: /* expression ::= expression NK_BITOR expression */ + case 339: /* expression ::= expression NK_BITOR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 343: /* column_reference ::= column_name */ -{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy129, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129)); } - yymsp[0].minor.yy712 = yylhsminor.yy712; + case 342: /* column_reference ::= column_name */ +{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy361, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy361)); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; - case 344: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129)); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 343: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361, createColumnNode(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy361)); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 345: /* pseudo_column ::= ROWTS */ - case 346: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==346); - case 348: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==348); - case 349: /* pseudo_column ::= QEND */ yytestcase(yyruleno==349); - case 350: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==350); - case 351: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==351); - case 352: /* pseudo_column ::= WEND */ yytestcase(yyruleno==352); - case 353: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==353); - case 359: /* literal_func ::= NOW */ yytestcase(yyruleno==359); -{ yylhsminor.yy712 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy712 = yylhsminor.yy712; + case 344: /* pseudo_column ::= ROWTS */ + case 345: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==345); + case 347: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==347); + case 348: /* pseudo_column ::= QEND */ yytestcase(yyruleno==348); + case 349: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==349); + case 350: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==350); + case 351: /* pseudo_column ::= WEND */ yytestcase(yyruleno==351); + case 352: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==352); + case 358: /* literal_func ::= NOW */ yytestcase(yyruleno==358); +{ yylhsminor.yy616 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; - case 347: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy129)))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 346: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy361)))); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 354: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 355: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==355); -{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy464)); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; + case 353: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 354: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==354); +{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy361, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy361, yymsp[-1].minor.yy356)); } + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; - case 356: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ -{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), yymsp[-1].minor.yy184)); } - yymsp[-5].minor.yy712 = yylhsminor.yy712; + case 355: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ +{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), yymsp[-1].minor.yy600)); } + yymsp[-5].minor.yy616 = yylhsminor.yy616; break; - case 358: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy129, NULL)); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 357: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy361, NULL)); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 373: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy464 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy464 = yylhsminor.yy464; + case 372: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy356 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy356 = yylhsminor.yy356; break; - case 378: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 435: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==435); -{ yylhsminor.yy712 = createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 377: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 434: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==434); +{ yylhsminor.yy616 = createColumnNode(pCxt, &yymsp[-2].minor.yy361, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 379: /* predicate ::= expression compare_op expression */ - case 384: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==384); + case 378: /* predicate ::= expression compare_op expression */ + case 383: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==383); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy60, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy526, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 380: /* predicate ::= expression BETWEEN expression AND expression */ + case 379: /* predicate ::= expression BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy712), releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy616), releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-4].minor.yy712 = yylhsminor.yy712; + yymsp[-4].minor.yy616 = yylhsminor.yy616; break; - case 381: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 380: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy712), releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy616), releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-5].minor.yy712 = yylhsminor.yy712; + yymsp[-5].minor.yy616 = yylhsminor.yy616; break; - case 382: /* predicate ::= expression IS NULL */ + case 381: /* predicate ::= expression IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), NULL)); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 383: /* predicate ::= expression IS NOT NULL */ + case 382: /* predicate ::= expression IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), NULL)); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; - case 385: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy60 = OP_TYPE_LOWER_THAN; } + case 384: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy526 = OP_TYPE_LOWER_THAN; } break; - case 386: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy60 = OP_TYPE_GREATER_THAN; } + case 385: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy526 = OP_TYPE_GREATER_THAN; } break; - case 387: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy60 = OP_TYPE_LOWER_EQUAL; } + case 386: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy526 = OP_TYPE_LOWER_EQUAL; } break; - case 388: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy60 = OP_TYPE_GREATER_EQUAL; } + case 387: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy526 = OP_TYPE_GREATER_EQUAL; } break; - case 389: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy60 = OP_TYPE_NOT_EQUAL; } + case 388: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy526 = OP_TYPE_NOT_EQUAL; } break; - case 390: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy60 = OP_TYPE_EQUAL; } + case 389: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy526 = OP_TYPE_EQUAL; } break; - case 391: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy60 = OP_TYPE_LIKE; } + case 390: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy526 = OP_TYPE_LIKE; } break; - case 392: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy60 = OP_TYPE_NOT_LIKE; } + case 391: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy526 = OP_TYPE_NOT_LIKE; } break; - case 393: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy60 = OP_TYPE_MATCH; } + case 392: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy526 = OP_TYPE_MATCH; } break; - case 394: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy60 = OP_TYPE_NMATCH; } + case 393: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy526 = OP_TYPE_NMATCH; } break; - case 395: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy60 = OP_TYPE_JSON_CONTAINS; } + case 394: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy526 = OP_TYPE_JSON_CONTAINS; } break; - case 396: /* in_op ::= IN */ -{ yymsp[0].minor.yy60 = OP_TYPE_IN; } + case 395: /* in_op ::= IN */ +{ yymsp[0].minor.yy526 = OP_TYPE_IN; } break; - case 397: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy60 = OP_TYPE_NOT_IN; } + case 396: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy526 = OP_TYPE_NOT_IN; } break; - case 398: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy464)); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 397: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy356)); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 400: /* boolean_value_expression ::= NOT boolean_primary */ + case 399: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy712), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy616), NULL)); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; - case 401: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 400: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 402: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 401: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy712); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy712); - yylhsminor.yy712 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy616); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy616); + yylhsminor.yy616 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 410: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy712 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy712, yymsp[0].minor.yy712, NULL); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 409: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy616 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy616, yymsp[0].minor.yy616, NULL); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 413: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy712 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; + case 412: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy616 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy361, &yymsp[0].minor.yy361); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; - case 414: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy712 = createRealTableNode(pCxt, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; + case 413: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy616 = createRealTableNode(pCxt, &yymsp[-3].minor.yy361, &yymsp[-1].minor.yy361, &yymsp[0].minor.yy361); } + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; - case 415: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy712 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy712), &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; + case 414: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy616 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy616), &yymsp[0].minor.yy361); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; - case 417: /* alias_opt ::= */ -{ yymsp[1].minor.yy129 = nil_token; } + case 416: /* alias_opt ::= */ +{ yymsp[1].minor.yy361 = nil_token; } break; - case 418: /* alias_opt ::= table_alias */ -{ yylhsminor.yy129 = yymsp[0].minor.yy129; } - yymsp[0].minor.yy129 = yylhsminor.yy129; + case 417: /* alias_opt ::= table_alias */ +{ yylhsminor.yy361 = yymsp[0].minor.yy361; } + yymsp[0].minor.yy361 = yylhsminor.yy361; break; - case 419: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy129 = yymsp[0].minor.yy129; } + case 418: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy361 = yymsp[0].minor.yy361; } break; - case 420: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 421: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==421); -{ yymsp[-2].minor.yy712 = yymsp[-1].minor.yy712; } + case 419: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 420: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==420); +{ yymsp[-2].minor.yy616 = yymsp[-1].minor.yy616; } break; - case 422: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy712 = createJoinTableNode(pCxt, yymsp[-4].minor.yy532, yymsp[-5].minor.yy712, yymsp[-2].minor.yy712, yymsp[0].minor.yy712); } - yymsp[-5].minor.yy712 = yylhsminor.yy712; + case 421: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy616 = createJoinTableNode(pCxt, yymsp[-4].minor.yy504, yymsp[-5].minor.yy616, yymsp[-2].minor.yy616, yymsp[0].minor.yy616); } + yymsp[-5].minor.yy616 = yylhsminor.yy616; break; - case 423: /* join_type ::= */ -{ yymsp[1].minor.yy532 = JOIN_TYPE_INNER; } + case 422: /* join_type ::= */ +{ yymsp[1].minor.yy504 = JOIN_TYPE_INNER; } break; - case 424: /* join_type ::= INNER */ -{ yymsp[0].minor.yy532 = JOIN_TYPE_INNER; } + case 423: /* join_type ::= INNER */ +{ yymsp[0].minor.yy504 = JOIN_TYPE_INNER; } break; - case 425: /* 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 424: /* 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.yy712 = createSelectStmt(pCxt, yymsp[-10].minor.yy337, yymsp[-9].minor.yy464, yymsp[-8].minor.yy712); - yymsp[-11].minor.yy712 = addWhereClause(pCxt, yymsp[-11].minor.yy712, yymsp[-7].minor.yy712); - yymsp[-11].minor.yy712 = addPartitionByClause(pCxt, yymsp[-11].minor.yy712, yymsp[-6].minor.yy464); - yymsp[-11].minor.yy712 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy712, yymsp[-2].minor.yy712); - yymsp[-11].minor.yy712 = addGroupByClause(pCxt, yymsp[-11].minor.yy712, yymsp[-1].minor.yy464); - yymsp[-11].minor.yy712 = addHavingClause(pCxt, yymsp[-11].minor.yy712, yymsp[0].minor.yy712); - yymsp[-11].minor.yy712 = addRangeClause(pCxt, yymsp[-11].minor.yy712, yymsp[-5].minor.yy712); - yymsp[-11].minor.yy712 = addEveryClause(pCxt, yymsp[-11].minor.yy712, yymsp[-4].minor.yy712); - yymsp[-11].minor.yy712 = addFillClause(pCxt, yymsp[-11].minor.yy712, yymsp[-3].minor.yy712); + yymsp[-11].minor.yy616 = createSelectStmt(pCxt, yymsp[-10].minor.yy151, yymsp[-9].minor.yy356, yymsp[-8].minor.yy616); + yymsp[-11].minor.yy616 = addWhereClause(pCxt, yymsp[-11].minor.yy616, yymsp[-7].minor.yy616); + yymsp[-11].minor.yy616 = addPartitionByClause(pCxt, yymsp[-11].minor.yy616, yymsp[-6].minor.yy356); + yymsp[-11].minor.yy616 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy616, yymsp[-2].minor.yy616); + yymsp[-11].minor.yy616 = addGroupByClause(pCxt, yymsp[-11].minor.yy616, yymsp[-1].minor.yy356); + yymsp[-11].minor.yy616 = addHavingClause(pCxt, yymsp[-11].minor.yy616, yymsp[0].minor.yy616); + yymsp[-11].minor.yy616 = addRangeClause(pCxt, yymsp[-11].minor.yy616, yymsp[-5].minor.yy616); + yymsp[-11].minor.yy616 = addEveryClause(pCxt, yymsp[-11].minor.yy616, yymsp[-4].minor.yy616); + yymsp[-11].minor.yy616 = addFillClause(pCxt, yymsp[-11].minor.yy616, yymsp[-3].minor.yy616); } break; - case 428: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy337 = false; } + case 427: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy151 = false; } break; - case 431: /* select_item ::= NK_STAR */ -{ yylhsminor.yy712 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy712 = yylhsminor.yy712; + case 430: /* select_item ::= NK_STAR */ +{ yylhsminor.yy616 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy616 = yylhsminor.yy616; break; - case 433: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy712 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy712), &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy712 = yylhsminor.yy712; + case 432: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy616 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy616), &yymsp[0].minor.yy361); } + yymsp[-1].minor.yy616 = yylhsminor.yy616; break; - case 434: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy712 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), &yymsp[0].minor.yy129); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 433: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy616 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), &yymsp[0].minor.yy361); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 439: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 456: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==456); - case 472: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==472); -{ yymsp[-2].minor.yy464 = yymsp[0].minor.yy464; } + case 438: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 455: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==455); + case 471: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==471); +{ yymsp[-2].minor.yy356 = yymsp[0].minor.yy356; } break; - case 441: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy712 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), releaseRawExprNode(pCxt, yymsp[-1].minor.yy712)); } + case 440: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy616 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), releaseRawExprNode(pCxt, yymsp[-1].minor.yy616)); } break; - case 442: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ -{ yymsp[-3].minor.yy712 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy712)); } + case 441: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ +{ yymsp[-3].minor.yy616 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy616)); } break; - case 443: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy712 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), NULL, yymsp[-1].minor.yy712, yymsp[0].minor.yy712); } + case 442: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy616 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), NULL, yymsp[-1].minor.yy616, yymsp[0].minor.yy616); } break; - case 444: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy712 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy712), releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), yymsp[-1].minor.yy712, yymsp[0].minor.yy712); } + case 443: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy616 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy616), releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), yymsp[-1].minor.yy616, yymsp[0].minor.yy616); } break; - case 446: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - case 464: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==464); -{ yymsp[-3].minor.yy712 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy712); } + case 445: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + case 463: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==463); +{ yymsp[-3].minor.yy616 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy616); } break; - case 448: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy712 = createFillNode(pCxt, yymsp[-1].minor.yy94, NULL); } + case 447: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy616 = createFillNode(pCxt, yymsp[-1].minor.yy494, NULL); } break; - case 449: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy712 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy464)); } + case 448: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy616 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy356)); } break; - case 450: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy94 = FILL_MODE_NONE; } + case 449: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy494 = FILL_MODE_NONE; } break; - case 451: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy94 = FILL_MODE_PREV; } + case 450: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy494 = FILL_MODE_PREV; } break; - case 452: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy94 = FILL_MODE_NULL; } + case 451: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy494 = FILL_MODE_NULL; } break; - case 453: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy94 = FILL_MODE_LINEAR; } + case 452: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy494 = FILL_MODE_LINEAR; } break; - case 454: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy94 = FILL_MODE_NEXT; } + case 453: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy494 = FILL_MODE_NEXT; } break; - case 457: /* group_by_list ::= expression */ -{ yylhsminor.yy464 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); } - yymsp[0].minor.yy464 = yylhsminor.yy464; + case 456: /* group_by_list ::= expression */ +{ yylhsminor.yy356 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } + yymsp[0].minor.yy356 = yylhsminor.yy356; break; - case 458: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy464 = addNodeToList(pCxt, yymsp[-2].minor.yy464, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy712))); } - yymsp[-2].minor.yy464 = yylhsminor.yy464; + case 457: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy356 = addNodeToList(pCxt, yymsp[-2].minor.yy356, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy616))); } + yymsp[-2].minor.yy356 = yylhsminor.yy356; break; - case 462: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ -{ yymsp[-5].minor.yy712 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy712), releaseRawExprNode(pCxt, yymsp[-1].minor.yy712)); } + case 461: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ +{ yymsp[-5].minor.yy616 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy616), releaseRawExprNode(pCxt, yymsp[-1].minor.yy616)); } break; - case 465: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 464: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy712 = addOrderByClause(pCxt, yymsp[-3].minor.yy712, yymsp[-2].minor.yy464); - yylhsminor.yy712 = addSlimitClause(pCxt, yylhsminor.yy712, yymsp[-1].minor.yy712); - yylhsminor.yy712 = addLimitClause(pCxt, yylhsminor.yy712, yymsp[0].minor.yy712); + yylhsminor.yy616 = addOrderByClause(pCxt, yymsp[-3].minor.yy616, yymsp[-2].minor.yy356); + yylhsminor.yy616 = addSlimitClause(pCxt, yylhsminor.yy616, yymsp[-1].minor.yy616); + yylhsminor.yy616 = addLimitClause(pCxt, yylhsminor.yy616, yymsp[0].minor.yy616); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; - case 467: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy712 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy712, yymsp[0].minor.yy712); } - yymsp[-3].minor.yy712 = yylhsminor.yy712; + case 466: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy616 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy616, yymsp[0].minor.yy616); } + yymsp[-3].minor.yy616 = yylhsminor.yy616; break; - case 468: /* query_expression_body ::= query_expression_body UNION query_expression_body */ -{ yylhsminor.yy712 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy712, yymsp[0].minor.yy712); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 467: /* query_expression_body ::= query_expression_body UNION query_expression_body */ +{ yylhsminor.yy616 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy616, yymsp[0].minor.yy616); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 470: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ + case 469: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ { - yymsp[-5].minor.yy712 = addOrderByClause(pCxt, yymsp[-4].minor.yy712, yymsp[-3].minor.yy464); - yymsp[-5].minor.yy712 = addSlimitClause(pCxt, yymsp[-5].minor.yy712, yymsp[-2].minor.yy712); - yymsp[-5].minor.yy712 = addLimitClause(pCxt, yymsp[-5].minor.yy712, yymsp[-1].minor.yy712); + yymsp[-5].minor.yy616 = addOrderByClause(pCxt, yymsp[-4].minor.yy616, yymsp[-3].minor.yy356); + yymsp[-5].minor.yy616 = addSlimitClause(pCxt, yymsp[-5].minor.yy616, yymsp[-2].minor.yy616); + yymsp[-5].minor.yy616 = addLimitClause(pCxt, yymsp[-5].minor.yy616, yymsp[-1].minor.yy616); } break; - case 474: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 478: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==478); -{ yymsp[-1].minor.yy712 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 473: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 477: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==477); +{ yymsp[-1].minor.yy616 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 475: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 479: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==479); -{ yymsp[-3].minor.yy712 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 474: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 478: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==478); +{ yymsp[-3].minor.yy616 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 476: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 480: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==480); -{ yymsp[-3].minor.yy712 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 475: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 479: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==479); +{ yymsp[-3].minor.yy616 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 481: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy712 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy712); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 480: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy616 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy616); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 485: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy712 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy712), yymsp[-1].minor.yy658, yymsp[0].minor.yy338); } - yymsp[-2].minor.yy712 = yylhsminor.yy712; + case 484: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy616 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy616), yymsp[-1].minor.yy58, yymsp[0].minor.yy613); } + yymsp[-2].minor.yy616 = yylhsminor.yy616; break; - case 486: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy658 = ORDER_ASC; } + case 485: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy58 = ORDER_ASC; } break; - case 487: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy658 = ORDER_ASC; } + case 486: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy58 = ORDER_ASC; } break; - case 488: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy658 = ORDER_DESC; } + case 487: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy58 = ORDER_DESC; } break; - case 489: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy338 = NULL_ORDER_DEFAULT; } + case 488: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy613 = NULL_ORDER_DEFAULT; } break; - case 490: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy338 = NULL_ORDER_FIRST; } + case 489: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy613 = NULL_ORDER_FIRST; } break; - case 491: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy338 = NULL_ORDER_LAST; } + case 490: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy613 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parSelectTest.cpp b/source/libs/parser/test/parSelectTest.cpp index 02a82f7602..5b222a8dec 100644 --- a/source/libs/parser/test/parSelectTest.cpp +++ b/source/libs/parser/test/parSelectTest.cpp @@ -316,7 +316,8 @@ TEST_F(ParserSelectTest, subquery) { run("SELECT SUM(a) FROM (SELECT MAX(c1) a, ts FROM st1s1 PARTITION BY TBNAME INTERVAL(1m)) INTERVAL(1n)"); - run("SELECT SUM(a) FROM (SELECT MAX(c1) a, _wstart FROM st1s1 PARTITION BY TBNAME INTERVAL(1m)) INTERVAL(1n)"); + run("SELECT SUM(a) FROM (SELECT MAX(c1) a, _wstart FROM st1s1 PARTITION BY TBNAME INTERVAL(1m) ORDER BY _WSTART) " + "INTERVAL(1n)"); run("SELECT _C0 FROM (SELECT _ROWTS, ts FROM st1s1)"); diff --git a/source/libs/parser/test/parShowToUse.cpp b/source/libs/parser/test/parShowToUse.cpp index 57f07b2285..7af6d8350c 100644 --- a/source/libs/parser/test/parShowToUse.cpp +++ b/source/libs/parser/test/parShowToUse.cpp @@ -54,7 +54,8 @@ TEST_F(ParserShowToUseTest, showCreateSTable) { ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_SHOW_CREATE_STABLE_STMT); ASSERT_EQ(pQuery->execMode, QUERY_EXEC_MODE_LOCAL); ASSERT_TRUE(pQuery->haveResultSet); - ASSERT_NE(((SShowCreateTableStmt*)pQuery->pRoot)->pCfg, nullptr); + ASSERT_NE(((SShowCreateTableStmt*)pQuery->pRoot)->pDbCfg, nullptr); + ASSERT_NE(((SShowCreateTableStmt*)pQuery->pRoot)->pTableCfg, nullptr); }); run("SHOW CREATE STABLE st1"); @@ -67,7 +68,8 @@ TEST_F(ParserShowToUseTest, showCreateTable) { ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_SHOW_CREATE_TABLE_STMT); ASSERT_EQ(pQuery->execMode, QUERY_EXEC_MODE_LOCAL); ASSERT_TRUE(pQuery->haveResultSet); - ASSERT_NE(((SShowCreateTableStmt*)pQuery->pRoot)->pCfg, nullptr); + ASSERT_NE(((SShowCreateTableStmt*)pQuery->pRoot)->pDbCfg, nullptr); + ASSERT_NE(((SShowCreateTableStmt*)pQuery->pRoot)->pTableCfg, nullptr); }); run("SHOW CREATE TABLE t1"); diff --git a/source/libs/planner/inc/planInt.h b/source/libs/planner/inc/planInt.h index 88c7c26276..82abc5d1a9 100644 --- a/source/libs/planner/inc/planInt.h +++ b/source/libs/planner/inc/planInt.h @@ -23,13 +23,13 @@ extern "C" { #include "planner.h" #include "taoserror.h" -#define planFatal(param, ...) qFatal("PLAN: " param, __VA_ARGS__) -#define planError(param, ...) qError("PLAN: " param, __VA_ARGS__) -#define planWarn(param, ...) qWarn("PLAN: " param, __VA_ARGS__) -#define planInfo(param, ...) qInfo("PLAN: " param, __VA_ARGS__) -#define planDebug(param, ...) qDebug("PLAN: " param, __VA_ARGS__) -#define planDebugL(param, ...) qDebugL("PLAN: " param, __VA_ARGS__) -#define planTrace(param, ...) qTrace("PLAN: " param, __VA_ARGS__) +#define planFatal(param, ...) qFatal("PLAN: " param, ##__VA_ARGS__) +#define planError(param, ...) qError("PLAN: " param, ##__VA_ARGS__) +#define planWarn(param, ...) qWarn("PLAN: " param, ##__VA_ARGS__) +#define planInfo(param, ...) qInfo("PLAN: " param, ##__VA_ARGS__) +#define planDebug(param, ...) qDebug("PLAN: " param, ##__VA_ARGS__) +#define planDebugL(param, ...) qDebugL("PLAN: " param, ##__VA_ARGS__) +#define planTrace(param, ...) qTrace("PLAN: " param, ##__VA_ARGS__) int32_t generateUsageErrMsg(char* pBuf, int32_t len, int32_t errCode, ...); int32_t createColumnByRewriteExprs(SNodeList* pExprs, SNodeList** pList); diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index b51624336b..0762b28188 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -480,6 +480,7 @@ static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, pAgg->hasLastRow = pSelect->hasLastRowFunc; pAgg->hasTimeLineFunc = pSelect->hasTimeLineFunc; + pAgg->onlyHasKeepOrderFunc = pSelect->onlyHasKeepOrderFunc; pAgg->node.groupAction = GROUP_ACTION_SET; pAgg->node.requireDataOrder = pAgg->hasTimeLineFunc ? DATA_ORDER_LEVEL_IN_GROUP : DATA_ORDER_LEVEL_NONE; pAgg->node.resultDataOrder = DATA_ORDER_LEVEL_NONE; diff --git a/source/libs/planner/src/planUtil.c b/source/libs/planner/src/planUtil.c index 7aab8a7ca3..d7310892de 100644 --- a/source/libs/planner/src/planUtil.c +++ b/source/libs/planner/src/planUtil.c @@ -146,19 +146,13 @@ static int32_t adjustJoinDataRequirement(SJoinLogicNode* pJoin, EDataOrderLevel return TSDB_CODE_SUCCESS; } -static bool isKeepOrderAggFunc(SNodeList* pFuncs) { - SNode* pFunc = NULL; - FOREACH(pFunc, pFuncs) { - if (!fmIsKeepOrderFunc(((SFunctionNode*)pFunc)->funcId)) { - return false; - } - } - return true; -} - static int32_t adjustAggDataRequirement(SAggLogicNode* pAgg, EDataOrderLevel requirement) { // The sort level of agg with group by output data can only be DATA_ORDER_LEVEL_NONE - if (requirement > DATA_ORDER_LEVEL_NONE && (NULL != pAgg->pGroupKeys || !isKeepOrderAggFunc(pAgg->pAggFuncs))) { + if (requirement > DATA_ORDER_LEVEL_NONE && (NULL != pAgg->pGroupKeys || !pAgg->onlyHasKeepOrderFunc)) { + planError( + "The output of aggregate cannot meet the requirements(%s) of the upper operator. " + "Illegal statement, should be intercepted in parser", + dataOrderStr(requirement)); return TSDB_CODE_PLAN_INTERNAL_ERROR; } pAgg->node.resultDataOrder = requirement; @@ -231,6 +225,10 @@ static int32_t adjustSortDataRequirement(SSortLogicNode* pSort, EDataOrderLevel static int32_t adjustPartitionDataRequirement(SPartitionLogicNode* pPart, EDataOrderLevel requirement) { if (DATA_ORDER_LEVEL_GLOBAL == requirement) { + planError( + "The output of partition cannot meet the requirements(%s) of the upper operator. " + "Illegal statement, should be intercepted in parser", + dataOrderStr(requirement)); return TSDB_CODE_PLAN_INTERNAL_ERROR; } pPart->node.resultDataOrder = requirement; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 10b14ffcbd..f6f1f4e032 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -484,7 +484,7 @@ SyncIndex syncNodeGetSnapshotConfigIndex(SSyncNode* pSyncNode, SyncIndex snapsho lastIndex = (pSyncNode->pRaftCfg->configIndexArr)[i]; } } - sTrace("vgId:%d, sync get snapshot last config index, index:%" PRId64 " lcindex:%" PRId64, pSyncNode->vgId, + sTrace("vgId:%d, sync get last config index, index:%" PRId64 " lcindex:%" PRId64, pSyncNode->vgId, snapshotLastApplyIndex, lastIndex); return lastIndex; @@ -730,7 +730,7 @@ int32_t syncNodeProposeBatch(SSyncNode* pSyncNode, SRpcMsg** pMsgPArr, bool* pIs for (int i = 0; i < arrSize; ++i) { do { char eventLog[128]; - snprintf(eventLog, sizeof(eventLog), "propose type:%s, batch:%d", TMSG_INFO(pMsgPArr[i]->msgType), arrSize); + snprintf(eventLog, sizeof(eventLog), "propose message, type:%s batch:%d", TMSG_INFO(pMsgPArr[i]->msgType), arrSize); syncNodeEventLog(pSyncNode, eventLog); } while (0); @@ -790,7 +790,7 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) { do { char eventLog[128]; - snprintf(eventLog, sizeof(eventLog), "propose type:%s", TMSG_INFO(pMsg->msgType)); + snprintf(eventLog, sizeof(eventLog), "propose message, type:%s", TMSG_INFO(pMsg->msgType)); syncNodeEventLog(pSyncNode, eventLog); } while (0); @@ -1894,7 +1894,9 @@ void syncNodeDoConfigChange(SSyncNode* pSyncNode, SSyncCfg* pNewConfig, SyncInde // Raft 3.6.2 Committing entries from previous terms syncNodeAppendNoop(pSyncNode); +#if 0 // simon syncNodeReplicate(pSyncNode); +#endif syncMaybeAdvanceCommitIndex(pSyncNode); } else { @@ -2070,7 +2072,9 @@ void syncNodeCandidate2Leader(SSyncNode* pSyncNode) { // Raft 3.6.2 Committing entries from previous terms syncNodeAppendNoop(pSyncNode); +#if 0 // simon syncNodeReplicate(pSyncNode); +#endif syncMaybeAdvanceCommitIndex(pSyncNode); } diff --git a/source/libs/sync/src/syncRespMgr.c b/source/libs/sync/src/syncRespMgr.c index db4c1e0ba5..da04b19e17 100644 --- a/source/libs/sync/src/syncRespMgr.c +++ b/source/libs/sync/src/syncRespMgr.c @@ -50,8 +50,8 @@ int64_t syncRespMgrAdd(SSyncRespMgr *pObj, SRespStub *pStub) { SSyncNode *pSyncNode = pObj->data; char eventLog[128]; - snprintf(eventLog, sizeof(eventLog), "save response handle, type:%s, seq:%" PRIu64 ", handle:%p, ahandle:%p", - TMSG_INFO(pStub->rpcMsg.msgType), keyCode, pStub->rpcMsg.info.handle, pStub->rpcMsg.info.ahandle); + snprintf(eventLog, sizeof(eventLog), "save message handle, type:%s seq:%" PRIu64 " handle:%p", + TMSG_INFO(pStub->rpcMsg.msgType), keyCode, pStub->rpcMsg.info.handle); syncNodeEventLog(pSyncNode, eventLog); taosThreadMutexUnlock(&(pObj->mutex)); @@ -76,8 +76,8 @@ int32_t syncRespMgrGet(SSyncRespMgr *pObj, uint64_t index, SRespStub *pStub) { SSyncNode *pSyncNode = pObj->data; char eventLog[128]; - snprintf(eventLog, sizeof(eventLog), "get response handle, type:%s, seq:%" PRIu64 ", handle:%p, ahandle:%p", - TMSG_INFO(pStub->rpcMsg.msgType), index, pStub->rpcMsg.info.handle, pStub->rpcMsg.info.ahandle); + snprintf(eventLog, sizeof(eventLog), "get message handle, type:%s seq:%" PRIu64 " handle:%p", + TMSG_INFO(pStub->rpcMsg.msgType), index, pStub->rpcMsg.info.handle); syncNodeEventLog(pSyncNode, eventLog); taosThreadMutexUnlock(&(pObj->mutex)); @@ -96,8 +96,8 @@ int32_t syncRespMgrGetAndDel(SSyncRespMgr *pObj, uint64_t index, SRespStub *pStu SSyncNode *pSyncNode = pObj->data; char eventLog[128]; - snprintf(eventLog, sizeof(eventLog), "get-and-del response handle, type:%s, seq:%" PRIu64 ", handle:%p, ahandle:%p", - TMSG_INFO(pStub->rpcMsg.msgType), index, pStub->rpcMsg.info.handle, pStub->rpcMsg.info.ahandle); + snprintf(eventLog, sizeof(eventLog), "get-and-del message handle, type:%s seq:%" PRIu64 " handle:%p", + TMSG_INFO(pStub->rpcMsg.msgType), index, pStub->rpcMsg.info.handle); syncNodeEventLog(pSyncNode, eventLog); taosHashRemove(pObj->pRespHash, &index, sizeof(index)); diff --git a/source/libs/sync/src/syncTimeout.c b/source/libs/sync/src/syncTimeout.c index ff1f2c5af9..4ae803d744 100644 --- a/source/libs/sync/src/syncTimeout.c +++ b/source/libs/sync/src/syncTimeout.c @@ -41,18 +41,21 @@ int32_t syncNodeOnTimeoutCb(SSyncNode* ths, SyncTimeout* pMsg) { // syncNodePingAll(ths); // syncNodePingPeers(ths); + sTrace("vgId:%d, sync timeout, type:ping count:%d", ths->vgId, ths->pingTimerCounter); syncNodeTimerRoutine(ths); } } else if (pMsg->timeoutType == SYNC_TIMEOUT_ELECTION) { if (atomic_load_64(&ths->electTimerLogicClockUser) <= pMsg->logicClock) { ++(ths->electTimerCounter); + sInfo("vgId:%d, sync timeout, type:election count:%d", ths->vgId, ths->electTimerCounter); syncNodeElect(ths); } } else if (pMsg->timeoutType == SYNC_TIMEOUT_HEARTBEAT) { if (atomic_load_64(&ths->heartbeatTimerLogicClockUser) <= pMsg->logicClock) { ++(ths->heartbeatTimerCounter); + sInfo("vgId:%d, sync timeout, type:replicate count:%d", ths->vgId, ths->heartbeatTimerCounter); syncNodeReplicate(ths); } } else { diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 51dfa1ce13..e4b6983dcb 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -410,6 +410,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_SPEED_LIMITED, "Write speed limited b TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_STORAGE_LIMITED, "Storage capacity limited by license") TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_QUERYTIME_LIMITED, "Query time limited by license") TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_CPU_LIMITED, "CPU cores limited by license") +TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_STABLE_LIMITED, "STable creation limited by license") +TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_TABLE_LIMITED, "Table creation limited by license") // sync TAOS_DEFINE_ERROR(TSDB_CODE_SYN_TIMEOUT, "Sync timeout") @@ -610,6 +612,7 @@ 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") //index TAOS_DEFINE_ERROR(TSDB_CODE_INDEX_REBUILDING, "Index is rebuilding") diff --git a/tests/pytest/tools/taosdumpTest.py b/tests/pytest/tools/taosdumpTest.py index bc31b9fbcc..d23e2f79af 100644 --- a/tests/pytest/tools/taosdumpTest.py +++ b/tests/pytest/tools/taosdumpTest.py @@ -35,7 +35,7 @@ class TDTestCase: else: return True - def getBuildPath(self): + def getPath(self, tool="taosdump"): selfPath = os.path.dirname(os.path.realpath(__file__)) if ("community" in selfPath): @@ -43,25 +43,33 @@ class TDTestCase: else: projPath = selfPath[:selfPath.find("tests")] + paths = [] for root, dirs, files in os.walk(projPath): - if ("taosdump" in files): + if ((tool) in files): rootRealPath = os.path.dirname(os.path.realpath(root)) if ("packaging" not in rootRealPath): - buildPath = root[:len(root) - len("/build/bin")] + paths.append(os.path.join(root, tool)) break - return buildPath + if (len(paths) == 0): + return "" + return paths[0] def run(self): if not os.path.exists("./taosdumptest/tmp1"): os.makedirs("./taosdumptest/tmp1") else: - print("目录存在") + os.system("rm -rf ./taosdumptest/tmp1") + os.makedirs("./taosdumptest/tmp1") if not os.path.exists("./taosdumptest/tmp2"): os.makedirs("./taosdumptest/tmp2") + else: + os.system("rm -rf ./taosdumptest/tmp2") + os.makedirs("./taosdumptest/tmp2") + tdSql.execute("drop database if exists db") - tdSql.execute("create database db duration 11 keep 3649 blocks 8 ") - tdSql.execute("create database db1 duration 12 keep 3640 blocks 7 ") + tdSql.execute("create database db duration 11 keep 3649") + tdSql.execute("create database db1 duration 12 keep 3640") tdSql.execute("use db") tdSql.execute( "create table st(ts timestamp, c1 int, c2 nchar(10)) tags(t1 int, t2 binary(10))") @@ -78,31 +86,30 @@ class TDTestCase: sql += "(%d, %d, 'nchar%d')" % (currts + i, i % 100, i % 100) tdSql.execute(sql) - buildPath = self.getBuildPath() - if (buildPath == ""): + binPath = self.getPath() + if (binPath == ""): tdLog.exit("taosdump not found!") else: - tdLog.info("taosdump found in %s" % buildPath) - binPath = buildPath + "/build/bin/" + tdLog.info("taosdump found: %s" % binPath) - os.system("%staosdump --databases db -o ./taosdumptest/tmp1" % binPath) + os.system("%s -y --databases db -o ./taosdumptest/tmp1" % binPath) os.system( - "%staosdump --databases db1 -o ./taosdumptest/tmp2" % + "%s -y --databases db1 -o ./taosdumptest/tmp2" % binPath) tdSql.execute("drop database db") tdSql.execute("drop database db1") tdSql.query("show databases") - tdSql.checkRows(0) + tdSql.checkRows(2) - os.system("%staosdump -i ./taosdumptest/tmp1" % binPath) - os.system("%staosdump -i ./taosdumptest/tmp2" % binPath) + os.system("%s -i ./taosdumptest/tmp1" % binPath) + os.system("%s -i ./taosdumptest/tmp2" % binPath) tdSql.execute("use db") tdSql.query("show databases") - tdSql.checkRows(2) + tdSql.checkRows(4) dbresult = tdSql.queryResult - # 6--duration,7--keep0,keep1,keep, 12--block, + # 6--duration,7--keep0,keep1,keep isCommunity = self.checkCommunity() print("iscommunity: %d" % isCommunity) @@ -111,20 +118,15 @@ class TDTestCase: print(dbresult[i]) print(type(dbresult[i][6])) print(type(dbresult[i][7])) - print(type(dbresult[i][9])) - assert dbresult[i][6] == 11 - if isCommunity: - assert dbresult[i][7] == "3649" - else: - assert dbresult[i][7] == "3649,3649,3649" - assert dbresult[i][9] == 8 + print((dbresult[i][6])) + assert dbresult[i][6] == "15840m" + print((dbresult[i][7])) + assert dbresult[i][7] == "5254560m,5254560m,5254560m" if dbresult[i][0] == 'db1': - assert dbresult[i][6] == 12 - if isCommunity: - assert dbresult[i][7] == "3640" - else: - assert dbresult[i][7] == "3640,3640,3640" - assert dbresult[i][9] == 7 + print((dbresult[i][6])) + assert dbresult[i][6] == "17280m" + print((dbresult[i][7])) + assert dbresult[i][7] == "5241600m,5241600m,5241600m" tdSql.query("show stables") tdSql.checkRows(1) @@ -132,8 +134,10 @@ class TDTestCase: tdSql.query("show tables") tdSql.checkRows(2) - tdSql.checkData(0, 0, 't2') - tdSql.checkData(1, 0, 't1') + dbresult = tdSql.queryResult + print(dbresult) + for i in range(len(dbresult)): + assert ((dbresult[i][0] == "t1") or (dbresult[i][0] == "t2")) tdSql.query("select * from t1") tdSql.checkRows(100) @@ -155,7 +159,7 @@ class TDTestCase: os.system("rm -rf ./taosdumptest/tmp2") os.makedirs("./taosdumptest/tmp1") tdSql.execute("create database db12312313231231321312312312_323") - tdSql.error("create database db12312313231231321312312312_3231") + tdSql.error("create database db012345678911234567892234567893323456789423456789523456789bcdefe") tdSql.execute("use db12312313231231321312312312_323") tdSql.execute("create stable st12345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678_9(ts timestamp, c1 int, c2 nchar(10)) tags(t1 int, t2 binary(10))") tdSql.error("create stable st_12345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678_9(ts timestamp, c1 int, c2 nchar(10)) tags(t1 int, t2 binary(10))") @@ -168,9 +172,10 @@ class TDTestCase: tdSql.query("show stables") tdSql.checkRows(2) os.system( - "%staosdump --databases db12312313231231321312312312_323 -o ./taosdumptest/tmp1" % binPath) + "%s -y --databases db12312313231231321312312312_323 -o ./taosdumptest/tmp1" % + binPath) tdSql.execute("drop database db12312313231231321312312312_323") - os.system("%staosdump -i ./taosdumptest/tmp1" % binPath) + os.system("%s -i ./taosdumptest/tmp1" % binPath) tdSql.execute("use db12312313231231321312312312_323") tdSql.query("show stables") tdSql.checkRows(2) diff --git a/tests/pytest/tools/taosdumpTest2.py b/tests/pytest/tools/taosdumpTest2.py index 839988375b..f611623241 100644 --- a/tests/pytest/tools/taosdumpTest2.py +++ b/tests/pytest/tools/taosdumpTest2.py @@ -26,9 +26,9 @@ class TDTestCase: self.ts = 1601481600000 self.numberOfTables = 1 - self.numberOfRecords = 15000 + self.numberOfRecords = 150 - def getBuildPath(self): + def getPath(self, tool="taosdump"): selfPath = os.path.dirname(os.path.realpath(__file__)) if ("community" in selfPath): @@ -36,15 +36,24 @@ class TDTestCase: else: projPath = selfPath[:selfPath.find("tests")] + paths = [] for root, dirs, files in os.walk(projPath): - if ("taosd" in files): + if ((tool) in files): rootRealPath = os.path.dirname(os.path.realpath(root)) if ("packaging" not in rootRealPath): - buildPath = root[:len(root) - len("/build/bin")] + paths.append(os.path.join(root, tool)) break - return buildPath + if (len(paths) == 0): + return "" + return paths[0] def run(self): + if not os.path.exists("./taosdumptest/tmp"): + os.makedirs("./taosdumptest/tmp") + else: + os.system("rm -rf ./taosdumptest/tmp") + os.makedirs("./taosdumptest/tmp") + tdSql.prepare() tdSql.execute("create table st(ts timestamp, c1 timestamp, c2 int, c3 bigint, c4 float, c5 double, c6 binary(8), c7 smallint, c8 tinyint, c9 bool, c10 nchar(8)) tags(t1 int)") @@ -60,27 +69,26 @@ class TDTestCase: break tdSql.execute(sql) - buildPath = self.getBuildPath() - if (buildPath == ""): + binPath = self.getPath() + if (binPath == ""): tdLog.exit("taosdump not found!") else: - tdLog.info("taosdump found in %s" % buildPath) - binPath = buildPath + "/build/bin/" + tdLog.info("taosdump found in %s" % binPath) - os.system("rm /tmp/*.sql") + os.system("rm ./taosdumptest/tmp/*.sql") os.system( - "%staosdump --databases db -o /tmp -B 32766 -L 1048576" % + "%s --databases db -o ./taosdumptest/tmp -B 32766 -L 1048576" % binPath) tdSql.execute("drop database db") tdSql.query("show databases") - tdSql.checkRows(0) + tdSql.checkRows(2) - os.system("%staosdump -i /tmp" % binPath) + os.system("%s -i ./taosdumptest/tmp" % binPath) tdSql.query("show databases") - tdSql.checkRows(1) - tdSql.checkData(0, 0, 'db') + tdSql.checkRows(3) + tdSql.checkData(2, 0, 'db') tdSql.execute("use db") tdSql.query("show stables") @@ -90,6 +98,38 @@ class TDTestCase: tdSql.query("select count(*) from t1") tdSql.checkData(0, 0, self.numberOfRecords) + # test case for TS-1225 + tdSql.execute("create database test") + tdSql.execute("use test") + tdSql.execute( + "create table stb(ts timestamp, c1 binary(16374), c2 binary(16374), c3 binary(16374)) tags(t1 nchar(256))") + tdSql.execute( + "insert into t1 using stb tags('t1') values(now, '%s', '%s', '%s')" % + ("16374", + "16374", + "16374")) + +# sys.exit(0) + os.system("rm ./taosdumptest/tmp/*.sql") + os.system("rm ./taosdumptest/tmp/*.avro*") + os.system("%s -D test -o ./taosdumptest/tmp -y" % binPath) + + tdSql.execute("drop database test") + tdSql.query("show databases") + tdSql.checkRows(3) + + os.system("%s -i ./taosdumptest/tmp -y" % binPath) + + tdSql.execute("use test") + tdSql.error("show vnodes '' ") + tdSql.query("show stables") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 'stb') + + tdSql.query("select * from stb") + tdSql.checkRows(1) + os.system("rm -rf dump_result.txt") + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) diff --git a/tests/pytest/tools/taosdumpTestNanoSupport.py b/tests/pytest/tools/taosdumpTestNanoSupport.py index e96de674d7..c40462b8db 100644 --- a/tests/pytest/tools/taosdumpTestNanoSupport.py +++ b/tests/pytest/tools/taosdumpTestNanoSupport.py @@ -35,7 +35,7 @@ class TDTestCase: else: return True - def getBuildPath(self): + def getPath(self, tool="taosdump"): selfPath = os.path.dirname(os.path.realpath(__file__)) if ("community" in selfPath): @@ -43,15 +43,16 @@ class TDTestCase: else: projPath = selfPath[:selfPath.find("tests")] + paths = [] for root, dirs, files in os.walk(projPath): - if ("taosd" in files): + if ((tool) in files): rootRealPath = os.path.dirname(os.path.realpath(root)) if ("packaging" not in rootRealPath): - buildPath = root[:len(root) - len("/build/bin")] + paths.append(os.path.join(root, tool)) break - return buildPath - - + if (len(paths) == 0): + return "" + return paths[0] def createdb(self, precision="ns"): tb_nums = self.numberOfTables @@ -60,13 +61,16 @@ class TDTestCase: def build_db(precision, start_time): tdSql.execute("drop database if exists timedb1") tdSql.execute( - "create database timedb1 duration 10 keep 36500 blocks 8 precision "+"\""+precision+"\"") + "create database timedb1 duration 10 keep 36500 precision " + + "\"" + + precision + + "\"") tdSql.execute("use timedb1") tdSql.execute( "create stable st(ts timestamp, c1 int, c2 nchar(10),c3 timestamp) tags(t1 int, t2 binary(10))") for tb in range(tb_nums): - tbname = "t"+str(tb) + tbname = "t" + str(tb) tdSql.execute("create table " + tbname + " using st tags(1, 'beijing')") sql = "insert into " + tbname + " values" @@ -79,8 +83,8 @@ class TDTestCase: ts_seed = 1000 for i in range(per_tb_rows): - sql += "(%d, %d, 'nchar%d',%d)" % (currts + i*ts_seed, i % - 100, i % 100, currts + i*100) # currts +1000ms (1000000000ns) + sql += "(%d, %d, 'nchar%d',%d)" % (currts + i * ts_seed, i % + 100, i % 100, currts + i * 100) # currts +1000ms (1000000000ns) tdSql.execute(sql) if precision == "ns": @@ -97,7 +101,6 @@ class TDTestCase: else: print("other time precision not valid , please check! ") - def run(self): @@ -118,12 +121,11 @@ class TDTestCase: if not os.path.exists("./taosdumptest/dumptmp3"): os.makedirs("./taosdumptest/dumptmp3") - buildPath = self.getBuildPath() - if (buildPath == ""): + binPath = self.getPath("taosdump") + if (binPath == ""): tdLog.exit("taosdump not found!") else: - tdLog.info("taosdump found in %s" % buildPath) - binPath = buildPath + "/build/bin/" + tdLog.info("taosdump found: %s" % binPath) # create nano second database @@ -132,67 +134,51 @@ class TDTestCase: # dump all data os.system( - "%staosdump --databases timedb1 -o ./taosdumptest/dumptmp1" % binPath) + "%s -y -g --databases timedb1 -o ./taosdumptest/dumptmp1" % + binPath) # dump part data with -S -E os.system( - '%staosdump --databases timedb1 -S 1625068810000000000 -E 1625068860000000000 -o ./taosdumptest/dumptmp2 ' % + '%s -y -g --databases timedb1 -S 1625068810000000000 -E 1625068860000000000 -o ./taosdumptest/dumptmp2 ' % binPath) os.system( - '%staosdump --databases timedb1 -S 1625068810000000000 -o ./taosdumptest/dumptmp3 ' % + '%s -y -g --databases timedb1 -S 1625068810000000000 -o ./taosdumptest/dumptmp3 ' % binPath) - # replace strings to dump in databases - os.system( - "sed -i \"s/timedb1/dumptmp1/g\" `grep timedb1 -rl ./taosdumptest/dumptmp1`") - os.system( - "sed -i \"s/timedb1/dumptmp2/g\" `grep timedb1 -rl ./taosdumptest/dumptmp2`") - os.system( - "sed -i \"s/timedb1/dumptmp3/g\" `grep timedb1 -rl ./taosdumptest/dumptmp3`") - - os.system( "%staosdump -i ./taosdumptest/dumptmp1" %binPath) - os.system( "%staosdump -i ./taosdumptest/dumptmp2" %binPath) - os.system( "%staosdump -i ./taosdumptest/dumptmp3" %binPath) - + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp2" % binPath) # dump data and check for taosdump - tdSql.query("select count(*) from dumptmp1.st") - tdSql.checkData(0,0,1000) + tdSql.query("select count(*) from timedb1.st") + tdSql.checkData(0, 0, 510) - tdSql.query("select count(*) from dumptmp2.st") - tdSql.checkData(0,0,510) + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp3" % binPath) + # dump data and check for taosdump + tdSql.query("select count(*) from timedb1.st") + tdSql.checkData(0, 0, 900) - tdSql.query("select count(*) from dumptmp3.st") - tdSql.checkData(0,0,900) + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp1" % binPath) + # dump data and check for taosdump + tdSql.query("select count(*) from timedb1.st") + tdSql.checkData(0, 0, 1000) # check data origin_res = tdSql.getResult("select * from timedb1.st") - dump_res = tdSql.getResult("select * from dumptmp1.st") + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp1" % binPath) + # dump data and check for taosdump + dump_res = tdSql.getResult("select * from timedb1.st") if origin_res == dump_res: - tdLog.info("test nano second : dump check data pass for all data!" ) + tdLog.info("test nano second : dump check data pass for all data!") else: - tdLog.info("test nano second : dump check data failed for all data!" ) - - origin_res = tdSql.getResult("select * from timedb1.st where ts >=1625068810000000000 and ts <= 1625068860000000000") - dump_res = tdSql.getResult("select * from dumptmp2.st") - if origin_res == dump_res: - tdLog.info(" test nano second : dump check data pass for data! " ) - else: - tdLog.info(" test nano second : dump check data failed for data !" ) - - origin_res = tdSql.getResult("select * from timedb1.st where ts >=1625068810000000000 ") - dump_res = tdSql.getResult("select * from dumptmp3.st") - if origin_res == dump_res: - tdLog.info(" test nano second : dump check data pass for data! " ) - else: - tdLog.info(" test nano second : dump check data failed for data !" ) - + tdLog.info( + "test nano second : dump check data failed for all data!") # us second support test case os.system("rm -rf ./taosdumptest/") - tdSql.execute("drop database if exists dumptmp1") - tdSql.execute("drop database if exists dumptmp2") - tdSql.execute("drop database if exists dumptmp3") + tdSql.execute("drop database if exists timedb1") if not os.path.exists("./taosdumptest/tmp1"): os.makedirs("./taosdumptest/dumptmp1") @@ -205,75 +191,63 @@ class TDTestCase: if not os.path.exists("./taosdumptest/dumptmp3"): os.makedirs("./taosdumptest/dumptmp3") - buildPath = self.getBuildPath() - if (buildPath == ""): + binPath = self.getPath() + if (binPath == ""): tdLog.exit("taosdump not found!") else: - tdLog.info("taosdump found in %s" % buildPath) - binPath = buildPath + "/build/bin/" + tdLog.info("taosdump found: %s" % binPath) self.createdb(precision="us") os.system( - "%staosdump --databases timedb1 -o ./taosdumptest/dumptmp1" % binPath) - - os.system( - '%staosdump --databases timedb1 -S 1625068810000000 -E 1625068860000000 -o ./taosdumptest/dumptmp2 ' % - binPath) - os.system( - '%staosdump --databases timedb1 -S 1625068810000000 -o ./taosdumptest/dumptmp3 ' % + "%s -y -g --databases timedb1 -o ./taosdumptest/dumptmp1" % binPath) os.system( - "sed -i \"s/timedb1/dumptmp1/g\" `grep timedb1 -rl ./taosdumptest/dumptmp1`") + '%s -y -g --databases timedb1 -S 1625068810000000 -E 1625068860000000 -o ./taosdumptest/dumptmp2 ' % + binPath) os.system( - "sed -i \"s/timedb1/dumptmp2/g\" `grep timedb1 -rl ./taosdumptest/dumptmp2`") - os.system( - "sed -i \"s/timedb1/dumptmp3/g\" `grep timedb1 -rl ./taosdumptest/dumptmp3`") + '%s -y -g --databases timedb1 -S 1625068810000000 -o ./taosdumptest/dumptmp3 ' % + binPath) - os.system( "%staosdump -i ./taosdumptest/dumptmp1" %binPath) - os.system( "%staosdump -i ./taosdumptest/dumptmp2" %binPath) - os.system( "%staosdump -i ./taosdumptest/dumptmp3" %binPath) + os.system("%s -i ./taosdumptest/dumptmp1" % binPath) + os.system("%s -i ./taosdumptest/dumptmp2" % binPath) + os.system("%s -i ./taosdumptest/dumptmp3" % binPath) - - tdSql.query("select count(*) from dumptmp1.st") - tdSql.checkData(0,0,1000) + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp2" % binPath) + # dump data and check for taosdump + tdSql.query("select count(*) from timedb1.st") + tdSql.checkData(0, 0, 510) - tdSql.query("select count(*) from dumptmp2.st") - tdSql.checkData(0,0,510) + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp3" % binPath) + # dump data and check for taosdump + tdSql.query("select count(*) from timedb1.st") + tdSql.checkData(0, 0, 900) - tdSql.query("select count(*) from dumptmp3.st") - tdSql.checkData(0,0,900) + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp1" % binPath) + # dump data and check for taosdump + tdSql.query("select count(*) from timedb1.st") + tdSql.checkData(0, 0, 1000) - + # check data origin_res = tdSql.getResult("select * from timedb1.st") - dump_res = tdSql.getResult("select * from dumptmp1.st") + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp1" % binPath) + # dump data and check for taosdump + dump_res = tdSql.getResult("select * from timedb1.st") if origin_res == dump_res: - tdLog.info("test us second : dump check data pass for all data!" ) + tdLog.info("test micro second : dump check data pass for all data!") else: - tdLog.info("test us second : dump check data failed for all data!" ) - - origin_res = tdSql.getResult("select * from timedb1.st where ts >=1625068810000000 and ts <= 1625068860000000") - dump_res = tdSql.getResult("select * from dumptmp2.st") - if origin_res == dump_res: - tdLog.info(" test us second : dump check data pass for data! " ) - else: - tdLog.info(" test us second : dump check data failed for data!" ) - - origin_res = tdSql.getResult("select * from timedb1.st where ts >=1625068810000000 ") - dump_res = tdSql.getResult("select * from dumptmp3.st") - if origin_res == dump_res: - tdLog.info(" test us second : dump check data pass for data! " ) - else: - tdLog.info(" test us second : dump check data failed for data! " ) + tdLog.info( + "test micro second : dump check data failed for all data!") - # ms second support test case os.system("rm -rf ./taosdumptest/") - tdSql.execute("drop database if exists dumptmp1") - tdSql.execute("drop database if exists dumptmp2") - tdSql.execute("drop database if exists dumptmp3") + tdSql.execute("drop database if exists timedb1") if not os.path.exists("./taosdumptest/tmp1"): os.makedirs("./taosdumptest/dumptmp1") @@ -286,69 +260,60 @@ class TDTestCase: if not os.path.exists("./taosdumptest/dumptmp3"): os.makedirs("./taosdumptest/dumptmp3") - buildPath = self.getBuildPath() - if (buildPath == ""): + binPath = self.getPath() + if (binPath == ""): tdLog.exit("taosdump not found!") else: - tdLog.info("taosdump found in %s" % buildPath) - binPath = buildPath + "/build/bin/" + tdLog.info("taosdump found: %s" % binPath) self.createdb(precision="ms") os.system( - "%staosdump --databases timedb1 -o ./taosdumptest/dumptmp1" % binPath) - - os.system( - '%staosdump --databases timedb1 -S 1625068810000 -E 1625068860000 -o ./taosdumptest/dumptmp2 ' % - binPath) - os.system( - '%staosdump --databases timedb1 -S 1625068810000 -o ./taosdumptest/dumptmp3 ' % + "%s -y -g --databases timedb1 -o ./taosdumptest/dumptmp1" % binPath) os.system( - "sed -i \"s/timedb1/dumptmp1/g\" `grep timedb1 -rl ./taosdumptest/dumptmp1`") + '%s -y -g --databases timedb1 -S 1625068810000 -E 1625068860000 -o ./taosdumptest/dumptmp2 ' % + binPath) os.system( - "sed -i \"s/timedb1/dumptmp2/g\" `grep timedb1 -rl ./taosdumptest/dumptmp2`") - os.system( - "sed -i \"s/timedb1/dumptmp3/g\" `grep timedb1 -rl ./taosdumptest/dumptmp3`") + '%s -y -g --databases timedb1 -S 1625068810000 -o ./taosdumptest/dumptmp3 ' % + binPath) - os.system( "%staosdump -i ./taosdumptest/dumptmp1" %binPath) - os.system( "%staosdump -i ./taosdumptest/dumptmp2" %binPath) - os.system( "%staosdump -i ./taosdumptest/dumptmp3" %binPath) + os.system("%s -i ./taosdumptest/dumptmp1" % binPath) + os.system("%s -i ./taosdumptest/dumptmp2" % binPath) + os.system("%s -i ./taosdumptest/dumptmp3" % binPath) - - tdSql.query("select count(*) from dumptmp1.st") - tdSql.checkData(0,0,1000) + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp2" % binPath) + # dump data and check for taosdump + tdSql.query("select count(*) from timedb1.st") + tdSql.checkData(0, 0, 510) - tdSql.query("select count(*) from dumptmp2.st") - tdSql.checkData(0,0,510) + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp3" % binPath) + # dump data and check for taosdump + tdSql.query("select count(*) from timedb1.st") + tdSql.checkData(0, 0, 900) - tdSql.query("select count(*) from dumptmp3.st") - tdSql.checkData(0,0,900) + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp1" % binPath) + # dump data and check for taosdump + tdSql.query("select count(*) from timedb1.st") + tdSql.checkData(0, 0, 1000) - + # check data origin_res = tdSql.getResult("select * from timedb1.st") - dump_res = tdSql.getResult("select * from dumptmp1.st") + tdSql.execute("drop database timedb1") + os.system("%s -i ./taosdumptest/dumptmp1" % binPath) + # dump data and check for taosdump + dump_res = tdSql.getResult("select * from timedb1.st") if origin_res == dump_res: - tdLog.info("test ms second : dump check data pass for all data!" ) + tdLog.info( + "test million second : dump check data pass for all data!") else: - tdLog.info("test ms second : dump check data failed for all data!" ) - - origin_res = tdSql.getResult("select * from timedb1.st where ts >=1625068810000 and ts <= 1625068860000") - dump_res = tdSql.getResult("select * from dumptmp2.st") - if origin_res == dump_res: - tdLog.info(" test ms second : dump check data pass for data! " ) - else: - tdLog.info(" test ms second : dump check data failed for data!" ) - - origin_res = tdSql.getResult("select * from timedb1.st where ts >=1625068810000 ") - dump_res = tdSql.getResult("select * from dumptmp3.st") - if origin_res == dump_res: - tdLog.info(" test ms second : dump check data pass for data! " ) - else: - tdLog.info(" test ms second : dump check data failed for data! " ) + tdLog.info( + "test million second : dump check data failed for all data!") - os.system("rm -rf ./taosdumptest/") os.system("rm -rf ./dump_result.txt") os.system("rm -rf *.py.sql") diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 882a4b6d91..356eaed57e 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -331,7 +331,7 @@ ./test.sh -f tsim/vnode/stable_replica3_vnode3.sim # --- sync -./test.sh -f tsim/sync/3Replica1VgElect.sim +#./test.sh -f tsim/sync/3Replica1VgElect.sim #./test.sh -f tsim/sync/3Replica5VgElect.sim ./test.sh -f tsim/sync/oneReplica1VgElect.sim ./test.sh -f tsim/sync/oneReplica5VgElect.sim diff --git a/tests/script/tsim/sync/3Replica1VgElect.sim b/tests/script/tsim/sync/3Replica1VgElect.sim index 1cadf7c81d..4e127654ee 100644 --- a/tests/script/tsim/sync/3Replica1VgElect.sim +++ b/tests/script/tsim/sync/3Replica1VgElect.sim @@ -140,6 +140,8 @@ if $rows != $totalTblNum then return -1 endi +print ====> start_switch_leader: + start_switch_leader: $switch_loop_cnt = 0 @@ -299,7 +301,7 @@ print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $da print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -print ===> $rows $data[4][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] +print ===> $rows $data[4][0] $data[4][1] $data[4][2] $data[4][3] $data[4][4] $data[4][5] $data[4][6] if $rows != 5 then return -1 @@ -341,6 +343,8 @@ print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $da print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] +print ===> $rows $data[4][0] $data[4][1] $data[4][2] $data[4][3] $data[4][4] $data[4][5] $data[4][6] + if $data[0][0] != 1 then return -1 endi @@ -358,6 +362,8 @@ if $data[3][4] != ready then goto check_dnode_ready_2 endi +print ====> final test: create child table ctb2* and table ntb2* + sql use db; $ctbPrefix = ctb2 $ntbPrefix = ntb2 diff --git a/tests/script/tsim/sync/3Replica5VgElect.sim b/tests/script/tsim/sync/3Replica5VgElect.sim index 2a9f8c30a2..c4ab9bd4bc 100644 --- a/tests/script/tsim/sync/3Replica5VgElect.sim +++ b/tests/script/tsim/sync/3Replica5VgElect.sim @@ -542,6 +542,8 @@ if $data[3][4] != ready then goto check_dnode_ready_2 endi +print ====> final test: create child table ctb2* and table ntb2* + sql use db; $ctbPrefix = ctb2 $ntbPrefix = ntb2 diff --git a/tests/system-test/1-insert/db_tb_name_check.py b/tests/system-test/1-insert/db_tb_name_check.py new file mode 100644 index 0000000000..e4b164e01f --- /dev/null +++ b/tests/system-test/1-insert/db_tb_name_check.py @@ -0,0 +1,88 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +from util.log import * +from util.cases import * +from util.sql import * +from util.common import * + +class TDTestCase: + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor()) + self.special_name = ['!','@','#','$','%','^','&','*','(',')','[',']','{','}',\ + ':',';','\'','\"',',','<','>','/','?','-','_','+','=','~'] + def db_name_check(self): + dbname = tdCom.getLongName(10) + for j in self.special_name: + for i in range(len(list(dbname))+1): + new_dbname = list(dbname) + new_dbname.insert(i,j) + dbname_1 = ''.join(new_dbname) + tdSql.execute(f'create database if not exists `{dbname_1}`') + tdSql.query('show databases') + tdSql.checkEqual(tdSql.queryResult[2][0],str(dbname_1)) + tdSql.execute(f'drop database `{dbname_1}`') + for i in range(len(list(dbname))+1): + new_dbname = list(dbname) + new_dbname.insert(i,'.') + dbname_1 = ''.join(new_dbname) + tdSql.error(f'create database if not exists `{dbname_1}`') + + def tb_name_check(self): + dbname = tdCom.getLongName(10) + tdSql.execute(f'create database if not exists `{dbname}`') + tdSql.execute(f'use `{dbname}`') + tbname = tdCom.getLongName(5) + for i in self.special_name: + for j in range(len(list(tbname))+1): + tbname1 = list(tbname) + tbname1.insert(j,i) + new_tbname = ''.join(tbname1) + for sql in [f'`{dbname}`.`{new_tbname}`',f'`{new_tbname}`']: + tdSql.execute(f'create table {sql} (ts timestamp,c0 int)') + tdSql.execute(f'insert into {sql} values(now,1)') + tdSql.query(f'select * from {sql}') + tdSql.checkRows(1) + tdSql.execute(f'drop table {sql}') + for i in range(len(list(tbname))+1): + tbname1 = list(tbname) + tbname1.insert(i,'.') + new_tbname = ''.join(tbname1) + for sql in [f'`{dbname}`.`{new_tbname}`',f'`{new_tbname}`']: + tdSql.error(f'create table {sql} (ts timestamp,c0 int)') + tdSql.execute(f'drop database `{dbname}`') + def run(self): + self.db_name_check() + self.tb_name_check() + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/system-test/2-query/check_tsdb.py b/tests/system-test/2-query/check_tsdb.py index 746906776d..8d5bcc370d 100644 --- a/tests/system-test/2-query/check_tsdb.py +++ b/tests/system-test/2-query/check_tsdb.py @@ -49,29 +49,11 @@ class TDTestCase: tdSql.execute(f"insert into {dbname}.ct4 values (now()-400d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ") tdSql.execute(f"insert into {dbname}.ct4 values (now()+90d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ") - # tdSql.execute( - # f'''insert into t1 values - # ( '2020-04-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) - # ( '2020-10-21 01:01:01.000', 1, 11111, 111, 11, 1.11, 11.11, 1, "binary1", "nchar1", now()+1a ) - # ( '2020-12-31 01:01:01.000', 2, 22222, 222, 22, 2.22, 22.22, 0, "binary2", "nchar2", now()+2a ) - # ( '2021-01-01 01:01:06.000', 3, 33333, 333, 33, 3.33, 33.33, 0, "binary3", "nchar3", now()+3a ) - # ( '2021-05-07 01:01:10.000', 4, 44444, 444, 44, 4.44, 44.44, 1, "binary4", "nchar4", now()+4a ) - # ( '2021-07-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) - # ( '2021-09-30 01:01:16.000', 5, 55555, 555, 55, 5.55, 55.55, 0, "binary5", "nchar5", now()+5a ) - # ( '2022-02-01 01:01:20.000', 6, 66666, 666, 66, 6.66, 66.66, 1, "binary6", "nchar6", now()+6a ) - # ( '2022-10-28 01:01:26.000', 7, 00000, 000, 00, 0.00, 00.00, 1, "binary7", "nchar7", "1970-01-01 08:00:00.000" ) - # ( '2022-12-01 01:01:30.000', 8, -88888, -888, -88, -8.88, -88.88, 0, "binary8", "nchar8", "1969-01-01 01:00:00.000" ) - # ( '2022-12-31 01:01:36.000', 9, -99999999999999999, -999, -99, -9.99, -999999999999999999999.99, 1, "binary9", "nchar9", "1900-01-01 00:00:00.000" ) - # ( '2023-02-21 01:01:01.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) - # ''' - # ) - - def restart_taosd_query_sum(self, dbname="db"): for i in range(5): - tdLog.info(" this is %d_th restart taosd " %i) - os.system(f"taos -s ' use db ;select c6 from {dbname}.stb1 ; '") + tdLog.notice(" this is %d_th restart taosd " %i) + # os.system(f"taos -s ' use db ;select c6 from {dbname}.stb1 ; '") tdSql.execute(f"use {dbname} ") tdSql.query(f"select count(*) from {dbname}.stb1") tdSql.checkRows(1) @@ -85,6 +67,25 @@ class TDTestCase: tdDnodes.stop(1) tdDnodes.start(1) time.sleep(2) + tdSql.query("show databases") + + status = False + while status==False: + tdSql.query("show databases") + for db_info in tdSql.queryResult: + if db_info[0]==dbname : + if db_info[15]=="ready": + status = True + tdLog.notice(" ==== database {} status is ready ==== ".format(dbname)) + break + else: + status = False + else: + continue + + + + @@ -96,7 +97,7 @@ class TDTestCase: self.prepare_datas() - os.system(f"taos -s ' select c6 from {dbname}.stb1 ; '") + # os.system(f"taos -s ' select c6 from {dbname}.stb1 ; '") self.restart_taosd_query_sum() def stop(self): diff --git a/tests/system-test/2-query/csum.py b/tests/system-test/2-query/csum.py index f38a99d809..953dd1e491 100644 --- a/tests/system-test/2-query/csum.py +++ b/tests/system-test/2-query/csum.py @@ -162,9 +162,9 @@ class TDTestCase: self.checkcsum(**case6) # case7~8: nested query - case7 = {"table_expr": "(select c1 from db.stb1 order by tbname ,ts )"} + case7 = {"table_expr": "(select c1 from db.stb1 order by ts, tbname )"} self.checkcsum(**case7) - case8 = {"table_expr": "(select csum(c1) c1 from db.t1 partition by tbname)"} + case8 = {"table_expr": "(select csum(c1) c1 from db.t1)"} self.checkcsum(**case8) # case9~10: mix with tbname/ts/tag/col not support , must partition by alias ,such as select tbname ,csum(c1) partition by tbname diff --git a/tests/system-test/2-query/irate.py b/tests/system-test/2-query/irate.py index 856006aaf1..f70f30f55a 100644 --- a/tests/system-test/2-query/irate.py +++ b/tests/system-test/2-query/irate.py @@ -6,7 +6,7 @@ import inspect from util.log import * from util.sql import * from util.cases import * -import random +import random ,math class TDTestCase: @@ -41,8 +41,8 @@ class TDTestCase: c2 = random.randint(0,100000) c3 = random.randint(0,125) c4 = random.randint(0,125) - c5 = random.random()/1.0 - c6 = random.random()/1.0 + c5 = random.randint(0,10000)/1000 + c6 = random.randint(0,10000)/1000 c7 = "'true'" c8 = "'binary_val'" c9 = "'nchar_val'" @@ -72,7 +72,7 @@ class TDTestCase: comput_irate_value = origin_result[1][0]*1000/( origin_result[1][-1] - origin_result[0][-1]) else: comput_irate_value = (origin_result[1][0] - origin_result[0][0])*1000/( origin_result[1][-1] - origin_result[0][-1]) - if comput_irate_value ==irate_value: + if abs(comput_irate_value - irate_value) <= 0.0000001: tdLog.info(" irate work as expected , sql is %s "% irate_sql) else: tdLog.exit(" irate work not as expected , sql is %s "% irate_sql) diff --git a/tests/system-test/2-query/json_tag.py b/tests/system-test/2-query/json_tag.py index b817b1afb4..d9d7ef2300 100644 --- a/tests/system-test/2-query/json_tag.py +++ b/tests/system-test/2-query/json_tag.py @@ -506,7 +506,7 @@ class TDTestCase: #show create table tdSql.query("show create table jsons1") - tdSql.checkData(0, 1, 'CREATE STABLE `jsons1` (`ts` TIMESTAMP, `dataint` INT, `databool` BOOL, `datastr` NCHAR(50), `datastrbin` VARCHAR(150)) TAGS (`jtag` JSON) WATERMARK 5000a, 5000a') + tdSql.checkData(0, 1, 'CREATE STABLE `jsons1` (`ts` TIMESTAMP, `dataint` INT, `databool` BOOL, `datastr` NCHAR(50), `datastrbin` VARCHAR(150)) TAGS (`jtag` JSON)') #test aggregate function:count/avg/twa/irate/sum/stddev/leastsquares tdSql.query("select count(*) from jsons1 where jtag is not null") diff --git a/tests/system-test/5-taos-tools/TD-12478.py b/tests/system-test/5-taos-tools/TD-12478.py new file mode 100644 index 0000000000..69849d3c7a --- /dev/null +++ b/tests/system-test/5-taos-tools/TD-12478.py @@ -0,0 +1,151 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import random +import string +import os +import sys +import time +import taos +from util.log import tdLog +from util.cases import tdCases +from util.sql import tdSql +from util.dnodes import tdDnodes +from util.dnodes import * +import itertools +from itertools import product +from itertools import combinations +from faker import Faker +import subprocess + +class TDTestCase: + def caseDescription(self): + ''' + case1[TD-12434]:taosdump null nchar/binary length can cause core:taos-tools/src/taosdump.c + case2[TD-12478]:taos_stmt_execute() failed! reason: WAL size exceeds limit + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + os.system("rm -rf 5-taos-tools/TD-12478.py.sql") + os.system("rm db*") + os.system("rm dump_result.txt*") + + def restartDnodes(self): + tdDnodes.stop(1) + tdDnodes.start(1) + + def dropandcreateDB_random(self,n): + self.ts = 1630000000000 + + fake = Faker('zh_CN') + self.num_random = fake.random_int(min=1000, max=5000, step=1) + print(self.num_random) + for i in range(n): + tdSql.execute('''drop database if exists db ;''') + tdSql.execute('''create database db keep 36500;''') + tdSql.execute('''use db;''') + + tdSql.execute('''create stable stable_1 (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \ + tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''') + tdSql.execute('''create stable stable_2 (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \ + tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''') + + tdSql.execute('''create table table_1 using stable_1 tags('table_1', '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0')''') + tdSql.execute('''create table table_2 using stable_1 tags('table_2', '2147483647' , '9223372036854775807' , '32767' , '127' , 1 , 'binary2' , 'nchar2' , '2' , '22' , \'1999-09-09 09:09:09.090\')''') + tdSql.execute('''create table table_3 using stable_1 tags('table_3', '-2147483647' , '-9223372036854775807' , '-32767' , '-127' , false , 'binary3' , 'nchar3nchar3' , '-3.3' , '-33.33' , \'2099-09-09 09:09:09.090\')''') + tdSql.execute('''create table table_21 using stable_2 tags('table_21' , '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0')''') + + #regular table + tdSql.execute('''create table regular_table_1 \ + (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) ;''') + tdSql.execute('''create table regular_table_2 \ + (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) ;''') + tdSql.execute('''create table regular_table_3 \ + (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) ;''') + + + for i in range(self.num_random): + tdSql.execute('''insert into table_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d)''' + % (self.ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , self.ts + i)) + tdSql.execute('''insert into regular_table_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d)''' + % (self.ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1) , + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1) , + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , self.ts + i)) + + tdSql.execute('''insert into table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d)''' + % (self.ts + i*1000, fake.random_int(min=0, max=2147483647, step=1), + fake.random_int(min=0, max=9223372036854775807, step=1), + fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , self.ts + i)) + tdSql.execute('''insert into regular_table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d)''' + % (self.ts + i*1000, fake.random_int(min=0, max=2147483647, step=1), + fake.random_int(min=0, max=9223372036854775807, step=1), + fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , self.ts + i)) + + tdSql.execute('''insert into table_3 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d)''' + % (self.ts + i*1000, fake.random_int(min=-2147483647, max=0, step=1), + fake.random_int(min=-9223372036854775807, max=0, step=1), + fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , self.ts + i)) + tdSql.execute('''insert into regular_table_3 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts) values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d)''' + % (self.ts + i*1000, fake.random_int(min=-2147483647, max=0, step=1), + fake.random_int(min=-9223372036854775807, max=0, step=1), + fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.address() , self.ts + i)) + + tdSql.query("select count(*) from stable_1;") + tdSql.checkData(0,0,3*self.num_random) + tdSql.query("select count(*) from regular_table_1;") + tdSql.checkData(0,0,self.num_random) + + def run(self): + tdSql.prepare() + + dcDB = self.dropandcreateDB_random(1) + + assert os.system("taosdump -D db") == 0 + + assert os.system("taosdump -i . -g") == 0 + + tdSql.query("select count(*) from stable_1;") + tdSql.checkData(0,0,3*self.num_random) + tdSql.query("select count(*) from regular_table_1;") + tdSql.checkData(0,0,self.num_random) + tdSql.query("select count(*) from regular_table_2;") + tdSql.checkData(0,0,self.num_random) + tdSql.query("select count(*) from regular_table_3;") + tdSql.checkData(0,0,self.num_random) + + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/system-test/5-taos-tools/taosdump/taosdumpTestColTag.py b/tests/system-test/5-taos-tools/taosdump/taosdumpTestColTag.py new file mode 100644 index 0000000000..eb4de435ec --- /dev/null +++ b/tests/system-test/5-taos-tools/taosdump/taosdumpTestColTag.py @@ -0,0 +1,1291 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +import taos +import time +import os +from util.log import tdLog +from util.cases import tdCases +from util.sql import tdSql + + +class TDTestCase: + def caseDescription(self): + ''' + case1:[TD-10540]The escape char "`" can be used for both tag name and column name + case2:[TD-12435]create table as cause column error; + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + self.tmpdir = "tmp" + now = time.time() + self.ts = int(round(now * 1000)) + + def getBuildPath(self): + selfPath = os.path.dirname(os.path.realpath(__file__)) + + if ("community" in selfPath): + projPath = selfPath[:selfPath.find("community")] + else: + projPath = selfPath[:selfPath.find("tests")] + + buildPath = "" + for root, dirs, files in os.walk(projPath): + if ("taosdump" in files): + rootRealPath = os.path.dirname(os.path.realpath(root)) + if ("packaging" not in rootRealPath): + buildPath = root[:len(root) - len("/build/bin")] + break + return buildPath + + def table1_checkall(self, sql): + tdLog.info(sql) + tdSql.query(sql) + tdSql.checkData(0, 1, 1) + tdSql.checkData(0, 2, 2) + tdSql.checkData(0, 3, 3) + tdSql.checkData(0, 4, 4) + tdSql.checkData(0, 5, 'True') + tdSql.checkData(0, 6, 6) + tdSql.checkData(0, 7, 7) + tdSql.checkData(0, 8, 8) + tdSql.checkData(0, 9, 9) + tdSql.checkData(0, 10, '1970-01-01 08:00:00.010') + + def table1_checkall_1(self, sql): + tdSql.query(sql) + tdSql.checkData(0, 1, 1) + + def table1_checkall_2(self, sql): + self.table1_checkall_1(sql) + tdSql.checkData(0, 2, 2) + + def table1_checkall_3(self, sql): + self.table1_checkall_2(sql) + tdSql.checkData(0, 3, 3) + + def table1_checkall_4(self, sql): + self.table1_checkall_3(sql) + tdSql.checkData(0, 4, 4) + + def table1_checkall_5(self, sql): + self.table1_checkall_4(sql) + tdSql.checkData(0, 5, 'True') + + def table1_checkall_6(self, sql): + self.table1_checkall_5(sql) + tdSql.checkData(0, 6, 6) + + def table1_checkall_7(self, sql): + self.table1_checkall_6(sql) + tdSql.checkData(0, 7, 7) + + def table1_checkall_8(self, sql): + self.table1_checkall_7(sql) + tdSql.checkData(0, 8, 8) + + def table1_checkall_9(self, sql): + self.table1_checkall_8(sql) + tdSql.checkData(0, 9, 9) + + def table1_checkall_10(self, sql): + self.table1_checkall_9(sql) + tdSql.checkData(0, 10, '1970-01-01 08:00:00.010') + + def run(self): + + testcaseFilename = os.path.split(__file__)[-1] + os.system("rm -rf 5-taos-tools/%s.sql" % testcaseFilename) + os.system("rm %s/db*" % self.tmpdir) + os.system("rm dump_result.txt*") + tdSql.prepare() + + print("==============step1") + print("prepare data") + + tdSql.execute("create database db2") + tdSql.execute("use db2") + + print( + "==============new version [escape character] for stable==============") + print("==============step1,#create db.stable,db.table; insert db.table; show db.table; select db.table; drop db.table;") + print("prepare data") + + self.stb1 = "stable_1~!@#$%^&*()-_+=[]{}':,<.>/?stST13579" + self.tb1 = "table_1~!@#$%^&*()-_+=[]{}':,<.>/?stST13579" + + self.col_base = "123~!@#$%^&*()-_+=[]{}':,<.>/?stST13579" + + self.col_int = "stable_col_int%s" % self.col_base + print(self.col_int) + self.col_bigint = "stable_col_bigint%s" % self.col_base + self.col_smallint = "stable_col_smallint%s" % self.col_base + self.col_tinyint = "stable_col_tinyint%s" % self.col_base + self.col_bool = "stable_col_bool%s" % self.col_base + self.col_binary = "stable_col_binary%s" % self.col_base + self.col_nchar = "stable_col_nchar%s" % self.col_base + self.col_float = "stable_col_float%s" % self.col_base + self.col_double = "stable_col_double%s" % self.col_base + self.col_ts = "stable_col_ts%s" % self.col_base + + self.tag_base = "abc~!@#$%^&*()-_+=[]{}':,<.>/?stST13579" + self.tag_int = "stable_tag_int%s" % self.tag_base + self.tag_bigint = "stable_tag_bigint%s" % self.tag_base + self.tag_smallint = "stable_tag_smallint%s" % self.tag_base + self.tag_tinyint = "stable_tag_tinyint%s" % self.tag_base + self.tag_bool = "stable_tag_bool%s" % self.tag_base + self.tag_binary = "stable_tag_binary%s" % self.tag_base + self.tag_nchar = "stable_tag_nchar%s" % self.tag_base + self.tag_float = "stable_tag_float%s" % self.tag_base + self.tag_double = "stable_tag_double%s" % self.tag_base + self.tag_ts = "stable_tag_ts%s" % self.tag_base + + tdSql.execute('''create stable db.`%s` (ts timestamp, `%s` int , `%s` bigint , `%s` smallint , `%s` tinyint, `%s` bool , + `%s` binary(20) , `%s` nchar(20) ,`%s` float , `%s` double , `%s` timestamp) + tags(loc nchar(20), `%s` int , `%s` bigint , `%s` smallint , `%s` tinyint, `%s` bool , + `%s` binary(20) , `%s` nchar(20) ,`%s` float , `%s` double , `%s` timestamp);''' + % (self.stb1, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, + self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, + self.tag_int, self.tag_bigint, self.tag_smallint, self.tag_tinyint, self.tag_bool, + self.tag_binary, self.tag_nchar, self.tag_float, self.tag_double, self.tag_ts)) + tdSql.query("describe db.`%s` ; " % self.stb1) + tdSql.checkRows(22) + + tdSql.query("select count(*) from db.`%s` ; " % self.stb1) + tdSql.checkRows(0) + + tdSql.query("show create stable db.`%s` ; " % self.stb1) + tdSql.checkData(0, 0, self.stb1) + tdSql.checkData(0, 1, "CREATE TABLE `%s` (`ts` TIMESTAMP,`%s` INT,`%s` BIGINT,`%s` SMALLINT,`%s` TINYINT,`%s` BOOL,`%s` BINARY(20),`%s` NCHAR(20),`%s` FLOAT,`%s` DOUBLE,`%s` TIMESTAMP)\ + TAGS (`loc` NCHAR(20),`%s` INT,`%s` BIGINT,`%s` SMALLINT,`%s` TINYINT,`%s` BOOL,`%s` BINARY(20),`%s` NCHAR(20),`%s` FLOAT,`%s` DOUBLE,`%s` TIMESTAMP)" + % (self.stb1, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, + self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, + self.tag_int, self.tag_bigint, self.tag_smallint, self.tag_tinyint, self.tag_bool, + self.tag_binary, self.tag_nchar, self.tag_float, self.tag_double, self.tag_ts)) + + tdSql.execute( + "create table db.`table!1` using db.`%s` tags('table_1' , '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0')" % + self.stb1) + tdSql.query("describe db.`table!1` ; ") + tdSql.checkRows(22) + + time.sleep(10) + tdSql.query("show create table db.`table!1` ; ") + tdSql.checkData(0, 0, "table!1") + tdSql.checkData( + 0, + 1, + "CREATE TABLE `table!1` USING `%s` TAGS (\"table_1\",0,0,0,0,false,\"0\",\"0\",0.000000,0.000000,\"0\")" % + self.stb1) + + tdSql.execute( + "insert into db.`table!1` values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)") + sql = " select * from db.`table!1`; " + datacheck = self.table1_checkall(sql) + tdSql.checkRows(1) + sql = '''select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from db.`table!1`; '''\ + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(1) + + time.sleep(1) + tdSql.execute('''insert into db.`table!1`(ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`) values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)''' + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts)) + sql = " select * from db.`table!1`; " + datacheck = self.table1_checkall(sql) + tdSql.checkRows(2) + + tdSql.query("select count(*) from db.`table!1`; ") + tdSql.checkData(0, 0, 2) + tdSql.query("select count(*) from db.`%s` ; " % self.stb1) + tdSql.checkRows(1) + + tdSql.execute( + "create table db.`%s` using db.`%s` TAGS (\"table_2\",2,2,2,2,true,\"2\",\"2\",2.000000,2.000000,\"2\")" % + (self.tb1, self.stb1)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.query("show create table db.`%s` ; " % self.tb1) + tdSql.checkData(0, 0, self.tb1) + tdSql.checkData( + 0, + 1, + "CREATE TABLE `%s` USING `%s` TAGS (\"table_2\",2,2,2,2,true,\"2\",\"2\",2.000000,2.000000,\"2\")" % + (self.tb1, + self.stb1)) + + tdSql.execute( + "insert into db.`%s` values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)" % + self.tb1) + sql = "select * from db.`%s` ; " % self.tb1 + datacheck = self.table1_checkall(sql) + tdSql.checkRows(1) + sql = '''select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from db.`%s` ; '''\ + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, + self.tag_int, self.tag_bigint, self.tag_smallint, self.tag_tinyint, self.tag_bool, self.tag_binary, self.tag_nchar, self.tag_float, self.tag_double, self.tag_ts, self.tb1) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(1) + + time.sleep(1) + tdSql.execute('''insert into db.`%s`(ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`) values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)''' + % (self.tb1, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts)) + sql = " select * from db.`%s` ; " % self.tb1 + datacheck = self.table1_checkall(sql) + tdSql.checkRows(2) + + sql = " select * from db.`%s` where `%s`=1 and `%s`=2 and `%s`=3 and `%s`=4 and `%s`='True' and `%s`=6 and `%s`=7 and `%s`=8 and `%s`=9 and `%s`=10; " \ + % (self.tb1, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(2) + + tdSql.query("select count(*) from db.`%s`; " % self.tb1) + tdSql.checkData(0, 0, 2) + sql = "select * from db.`%s` ; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.checkRows(4) + tdSql.query("select count(*) from db.`%s`; " % self.stb1) + tdSql.checkData(0, 0, 4) + + sql = "select * from (select * from db.`%s`) ; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.checkRows(4) + tdSql.query( + "select count(*) from (select * from db.`%s`) ; " % + self.stb1) + tdSql.checkData(0, 0, 4) + + sql = "select * from (select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from db.`%s`) ; " \ + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, self.stb1) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(4) + + sql = "select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from (select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from db.`%s`) ; " \ + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, + self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, self.stb1) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(4) + + sql = "select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from (select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from db.`%s`\ + where `%s`=1 and `%s`=2 and `%s`=3 and `%s`=4 and `%s`='True' and `%s`=6 and `%s`=7 and `%s`=8 and `%s`=9 and `%s`=10 ) ; " \ + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, + self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, self.stb1, + self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(4) + + tdSql.query("show db.stables like 'stable_1%' ") + tdSql.checkRows(1) + tdSql.query("show db.tables like 'table%' ") + tdSql.checkRows(2) + + self.cr_tb1 = "create_table_1~!@#$%^&*()-_+=[]{}':,<.>/?stST13579" + tdSql.execute( + "create table db.`%s` as select avg(`%s`) from db.`%s` where ts > now interval(1m) sliding(30s);" % + (self.cr_tb1, self.col_bigint, self.stb1)) + tdSql.query("show db.tables like 'create_table_%' ") + tdSql.checkRows(1) + + print(r"==============drop\ add\ change\ modify column or tag") + print("==============drop==============") + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_ts)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(21) + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_double)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(20) + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_float)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(19) + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_nchar)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(18) + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_binary)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(17) + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_bool)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(16) + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_tinyint)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(15) + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_smallint)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(14) + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_bigint)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(13) + tdSql.execute( + "ALTER TABLE db.`%s` DROP TAG `%s`; " % + (self.stb1, self.tag_int)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(12) + + tdSql.execute( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_ts)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall_9(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(11) + tdSql.execute( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_double)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall_8(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(10) + tdSql.execute( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_float)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall_7(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(9) + tdSql.execute( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_nchar)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall_6(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(8) + tdSql.execute( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_binary)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall_5(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(7) + tdSql.execute( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_bool)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall_4(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(6) + tdSql.execute( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_tinyint)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall_3(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(5) + tdSql.execute( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_smallint)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall_2(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(4) + tdSql.execute( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_bigint)) + sql = " select * from db.`%s`; " % self.stb1 + datacheck = self.table1_checkall_1(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(3) + tdSql.error( + "ALTER TABLE db.`%s` DROP COLUMN `%s`; " % + (self.stb1, self.col_int)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(3) + + print("==============add==============") + tdSql.execute( + "ALTER TABLE db.`%s` ADD COLUMN `%s` bigint; " % + (self.stb1, self.col_bigint)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(4) + tdSql.execute( + "ALTER TABLE db.`%s` ADD COLUMN `%s` smallint; " % + (self.stb1, self.col_smallint)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(5) + tdSql.execute( + "ALTER TABLE db.`%s` ADD COLUMN `%s` tinyint; " % + (self.stb1, self.col_tinyint)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(6) + tdSql.execute( + "ALTER TABLE db.`%s` ADD COLUMN `%s` bool; " % + (self.stb1, self.col_bool)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(7) + tdSql.execute( + "ALTER TABLE db.`%s` ADD COLUMN `%s` binary(20); " % + (self.stb1, self.col_binary)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(8) + + tdSql.execute( + "insert into db.`%s` values(now, 1 , 2, 3, 4, 5, 6)" % + self.tb1) + sql = "select * from db.`%s` order by ts desc; " % self.tb1 + datacheck = self.table1_checkall_5(sql) + + tdSql.execute( + "ALTER TABLE db.`%s` ADD COLUMN `%s` nchar(20); " % + (self.stb1, self.col_nchar)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(9) + tdSql.execute( + "ALTER TABLE db.`%s` ADD COLUMN `%s` float; " % + (self.stb1, self.col_float)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(10) + tdSql.execute( + "ALTER TABLE db.`%s` ADD COLUMN `%s` double; " % + (self.stb1, self.col_double)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(11) + tdSql.execute( + "ALTER TABLE db.`%s` ADD COLUMN `%s` timestamp; " % + (self.stb1, self.col_ts)) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(12) + + tdSql.execute( + "insert into db.`%s` values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)" % + self.tb1) + sql = "select * from db.`%s` order by ts desc; " % self.tb1 + datacheck = self.table1_checkall(sql) + + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` int; " % + (self.stb1, self.tag_int)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(13) + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` bigint; " % + (self.stb1, self.tag_bigint)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(14) + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` smallint; " % + (self.stb1, self.tag_smallint)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(15) + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` tinyint; " % + (self.stb1, self.tag_tinyint)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(16) + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` bool; " % + (self.stb1, self.tag_bool)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(17) + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` binary(20); " % + (self.stb1, self.tag_binary)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(18) + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` nchar(20); " % + (self.stb1, self.tag_nchar)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(19) + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` float; " % + (self.stb1, self.tag_float)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(20) + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` double; " % + (self.stb1, self.tag_double)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(21) + tdSql.execute( + "ALTER TABLE db.`%s` ADD TAG `%s` timestamp; " % + (self.stb1, self.tag_ts)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + + print("==============change==============") + self.tag_base_change = "abcdas" + self.tag_int_change = "stable_tag_int%s" % self.tag_base_change + self.tag_bigint_change = "stable_tag_bigint%s" % self.tag_base_change + self.tag_smallint_change = "stable_tag_smallint%s" % self.tag_base_change + self.tag_tinyint_change = "stable_tag_tinyint%s" % self.tag_base_change + self.tag_bool_change = "stable_tag_bool%s" % self.tag_base_change + self.tag_binary_change = "stable_tag_binary%s" % self.tag_base_change + self.tag_nchar_change = "stable_tag_nchar%s" % self.tag_base_change + self.tag_float_change = "stable_tag_float%s" % self.tag_base_change + self.tag_double_change = "stable_tag_double%s" % self.tag_base_change + self.tag_ts_change = "stable_tag_ts%s" % self.tag_base_change + + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_int, self.tag_int_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_bigint, self.tag_bigint_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_smallint, self.tag_smallint_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_tinyint, self.tag_tinyint_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_bool, self.tag_bool_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_binary, self.tag_binary_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_nchar, self.tag_nchar_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_float, self.tag_float_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_double, self.tag_double_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER TABLE db.`%s` CHANGE TAG `%s` `%s`; " % + (self.stb1, self.tag_ts, self.tag_ts_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + + print("==============modify==============") + # TD-10810 + tdSql.execute( + "ALTER STABLE db.`%s` MODIFY TAG `%s` binary(30); ; " % + (self.stb1, self.tag_binary_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER STABLE db.`%s` MODIFY TAG `%s` nchar(30); ; " % + (self.stb1, self.tag_nchar_change)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + + tdSql.execute( + "ALTER STABLE db.`%s` MODIFY COLUMN `%s` binary(30); ; " % + (self.stb1, self.col_binary)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + tdSql.execute( + "ALTER STABLE db.`%s` MODIFY COLUMN `%s` nchar(30); ; " % + (self.stb1, self.col_nchar)) + sql = " select * from db.`%s` order by ts desc; " % self.stb1 + datacheck = self.table1_checkall(sql) + tdSql.query("describe db.`%s` ; " % self.tb1) + tdSql.checkRows(22) + + print(r"==============drop table\stable") + try: + tdSql.execute("drop table db.`%s` " % self.tb1) + except Exception as e: + tdLog.exit(e) + + tdSql.error("select * from db.`%s`" % self.tb1) + tdSql.query("show db.stables like 'stable_1%' ") + tdSql.checkRows(1) + + try: + tdSql.execute("drop table db.`%s` " % self.stb1) + except Exception as e: + tdLog.exit(e) + + tdSql.error("select * from db.`%s`" % self.tb1) + tdSql.error("select * from db.`%s`" % self.stb1) + + print("==============step2,#create stable,table; insert table; show table; select table; drop table") + + self.stb2 = "stable_2~!@#$%^&*()-_+=[]{}';:,<.>/?stST24680~!@#$%^&*()-_+=[]{}" + self.tb2 = "table_2~!@#$%^&*()-_+=[]{}';:,<.>/?stST24680~!@#$%^&*()-_+=[]{}" + + tdSql.execute( + "create stable `%s` (ts timestamp, i int) tags(j int);" % + self.stb2) + tdSql.query("describe `%s` ; " % self.stb2) + tdSql.checkRows(3) + + tdSql.query("select count(*) from `%s` ; " % self.stb2) + tdSql.checkRows(0) + + tdSql.query("show create stable `%s` ; " % self.stb2) + tdSql.checkData(0, 0, self.stb2) + tdSql.checkData( + 0, + 1, + "CREATE TABLE `%s` (`ts` TIMESTAMP,`i` INT) TAGS (`j` INT)" % + self.stb2) + + tdSql.execute("create table `table!2` using `%s` tags(1)" % self.stb2) + tdSql.query("describe `table!2` ; ") + tdSql.checkRows(3) + + time.sleep(10) + + tdSql.query("show create table `table!2` ; ") + tdSql.checkData(0, 0, "table!2") + tdSql.checkData( + 0, + 1, + "CREATE TABLE `table!2` USING `%s` TAGS (1)" % + self.stb2) + tdSql.execute("insert into `table!2` values(now, 1)") + tdSql.query("select * from `table!2`; ") + tdSql.checkRows(1) + tdSql.query("select count(*) from `table!2`; ") + tdSql.checkData(0, 0, 1) + tdSql.query("select count(*) from `%s` ; " % self.stb2) + tdSql.checkRows(1) + + tdSql.execute( + "create table `%s` using `%s` tags(1)" % + (self.tb2, self.stb2)) + tdSql.query("describe `%s` ; " % self.tb2) + tdSql.checkRows(3) + tdSql.query("show create table `%s` ; " % self.tb2) + tdSql.checkData(0, 0, self.tb2) + tdSql.checkData( + 0, 1, "CREATE TABLE `%s` USING `%s` TAGS (1)" % + (self.tb2, self.stb2)) + tdSql.execute("insert into `%s` values(now, 1)" % self.tb2) + tdSql.query("select * from `%s` ; " % self.tb2) + tdSql.checkRows(1) + tdSql.query("select count(*) from `%s`; " % self.tb2) + tdSql.checkData(0, 0, 1) + tdSql.query("select * from `%s` ; " % self.stb2) + tdSql.checkRows(2) + tdSql.query("select count(*) from `%s`; " % self.stb2) + tdSql.checkData(0, 0, 2) + + tdSql.query("select * from (select * from `%s`) ; " % self.stb2) + tdSql.checkRows(2) + tdSql.query("select count(*) from (select * from `%s` ); " % self.stb2) + tdSql.checkData(0, 0, 2) + + tdSql.query("show stables like 'stable_2%' ") + tdSql.checkRows(1) + tdSql.query("show tables like 'table%' ") + tdSql.checkRows(2) + + # TD-10536 + self.cr_tb2 = "create_table_2~!@#$%^&*()-_+=[]{}';:,<.>/?stST24680~!@#$%^&*()-_+=[]{}" + tdSql.execute( + "create table `%s` as select * from `%s` ;" % + (self.cr_tb2, self.stb2)) + tdSql.query("show db.tables like 'create_table_%' ") + tdSql.checkRows(1) + + print("==============step3,#create regular_table; insert regular_table; show regular_table; select regular_table; drop regular_table") + self.regular_table = "regular_table~!@#$%^&*()-_+=[]{}';:,<.>/?stST24680~!@#$%^&*()-_+=[]{}" + + self.regular_col_base = "123@#$%^&*()-_+=[]{};:,<.>/?~!$%^" + + self.col_int = "regular_table_col_int%s" % self.regular_col_base + print(self.col_int) + self.col_bigint = "regular_table_col_bigint%s" % self.regular_col_base + self.col_smallint = "regular_table_col_smallint%s" % self.regular_col_base + self.col_tinyint = "regular_table_col_tinyint%s" % self.regular_col_base + self.col_bool = "regular_table_col_bool%s" % self.regular_col_base + self.col_binary = "regular_table_col_binary%s" % self.regular_col_base + self.col_nchar = "regular_table_col_nchar%s" % self.regular_col_base + self.col_float = "regular_table_col_float%s" % self.regular_col_base + self.col_double = "regular_table_col_double%s" % self.regular_col_base + self.col_ts = "regular_table_col_ts%s" % self.regular_col_base + + tdSql.execute("create table `%s` (ts timestamp,`%s` int , `%s` bigint , `%s` smallint , `%s` tinyint, `%s` bool , \ + `%s` binary(20) , `%s` nchar(20) ,`%s` float , `%s` double , `%s` timestamp) ;" + % (self.regular_table, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, + self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts)) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(11) + + tdSql.query("select count(*) from `%s` ; " % self.regular_table) + tdSql.checkRows(1) + + tdSql.query("show create table `%s` ; " % self.regular_table) + tdSql.checkData(0, 0, self.regular_table) + tdSql.checkData(0, 1, "CREATE TABLE `%s` (`ts` TIMESTAMP,`%s` INT,`%s` BIGINT,`%s` SMALLINT,`%s` TINYINT,`%s` BOOL,`%s` BINARY(20),`%s` NCHAR(20),`%s` FLOAT,`%s` DOUBLE,`%s` TIMESTAMP)" + % (self.regular_table, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, + self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts)) + + tdSql.execute( + "insert into `%s` values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)" % + self.regular_table) + sql = "select * from `%s` ; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.checkRows(1) + sql = '''select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from db2.`%s`; '''\ + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, self.regular_table) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(1) + + time.sleep(1) + tdSql.execute('''insert into db2.`%s` (ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`) values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)''' + % (self.regular_table, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts)) + sql = " select * from db2.`%s`; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.checkRows(2) + + sql = " select * from db2.`%s` where `%s`=1 and `%s`=2 and `%s`=3 and `%s`=4 and `%s`='True' and `%s`=6 and `%s`=7 and `%s`=8 and `%s`=9 and `%s`=10; " \ + % (self.regular_table, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(2) + + tdSql.query("select count(*) from `%s`; " % self.regular_table) + tdSql.checkData(0, 0, 2) + tdSql.query("select count(*) from `%s` ; " % self.regular_table) + tdSql.checkRows(1) + + sql = "select * from (select * from `%s`) ; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.checkRows(2) + + sql = "select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from (select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from db2.`%s`\ + where `%s`=1 and `%s`=2 and `%s`=3 and `%s`=4 and `%s`='True' and `%s`=6 and `%s`=7 and `%s`=8 and `%s`=9 and `%s`=10 ) ; " \ + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, + self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, self.regular_table, + self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(2) + + tdSql.query( + "select count(*) from (select * from `%s` ); " % + self.regular_table) + tdSql.checkData(0, 0, 2) + + tdSql.query("show tables like 'regular_table%' ") + tdSql.checkRows(1) + + self.crr_tb = "create_r_table~!@#$%^&*()-_+=[]{}';:,<.>/?stST24680~!@#$%^&*()-_+=[]{}" + tdSql.execute( + "create table `%s` as select * from `%s` ;" % + (self.crr_tb, self.regular_table)) + tdSql.query("show db2.tables like 'create_r_table%' ") + tdSql.checkRows(1) + + print(r"==============drop\ add\ change\ modify column ") + print("==============drop==============") + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_ts)) + sql = " select * from db2.`%s`; " % self.regular_table + datacheck = self.table1_checkall_9(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(10) + tdSql.execute( + "ALTER TABLE `%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_double)) + sql = " select * from `%s`; " % self.regular_table + datacheck = self.table1_checkall_8(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(9) + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_float)) + sql = " select * from db2.`%s`; " % self.regular_table + datacheck = self.table1_checkall_7(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(8) + tdSql.execute( + "ALTER TABLE `%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_nchar)) + sql = " select * from `%s`; " % self.regular_table + datacheck = self.table1_checkall_6(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(7) + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_binary)) + sql = " select * from db2.`%s`; " % self.regular_table + datacheck = self.table1_checkall_5(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(6) + tdSql.execute( + "ALTER TABLE `%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_bool)) + sql = " select * from `%s`; " % self.regular_table + datacheck = self.table1_checkall_4(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(5) + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_tinyint)) + sql = " select * from db2.`%s`; " % self.regular_table + datacheck = self.table1_checkall_3(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(4) + tdSql.execute("ALTER TABLE `%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_smallint)) + sql = " select * from `%s`; " % self.regular_table + datacheck = self.table1_checkall_2(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(3) + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_bigint)) + sql = " select * from db2.`%s`; " % self.regular_table + datacheck = self.table1_checkall_1(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(2) + tdSql.error( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_int)) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(2) + + print("==============add==============") + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` bigint; " % + (self.regular_table, self.col_bigint)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(3) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` smallint; " % + (self.regular_table, self.col_smallint)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(4) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` tinyint; " % + (self.regular_table, self.col_tinyint)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(5) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` bool; " % + (self.regular_table, self.col_bool)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(6) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` binary(20); " % + (self.regular_table, self.col_binary)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(7) + + tdSql.execute( + "insert into db2.`%s` values(now, 1 , 2, 3, 4, 5, 6)" % + self.regular_table) + sql = "select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_5(sql) + + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` nchar(20); " % + (self.regular_table, self.col_nchar)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(8) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` float; " % + (self.regular_table, self.col_float)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(9) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` double; " % + (self.regular_table, self.col_double)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(10) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` timestamp; " % + (self.regular_table, self.col_ts)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(11) + + tdSql.execute( + "insert into db2.`%s` values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)" % + self.regular_table) + sql = "select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall(sql) + + print("==============change, regular not support==============") + + print("==============modify==============") + # TD-10810 + tdSql.execute( + "ALTER TABLE db2.`%s` MODIFY COLUMN `%s` binary(30); ; " % + (self.regular_table, self.col_binary)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(11) + tdSql.execute( + "ALTER TABLE `%s` MODIFY COLUMN `%s` nchar(30); ; " % + (self.regular_table, self.col_nchar)) + sql = " select * from `%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(11) + + buildPath = self.getBuildPath() + if (buildPath == ""): + tdLog.exit("taosdump not found!") + else: + tdLog.info("taosdump found in %s" % buildPath) + binPath = buildPath + "/build/bin/" + + if not os.path.exists(self.tmpdir): + os.makedirs(self.tmpdir) + else: + print("directory exists") + os.system("rm -rf %s" % self.tmpdir) + os.makedirs(self.tmpdir) + + print("==============step4,#taosdump out ; drop db ; taosdumo in") + assert os.system( + "%staosdump -D db2 -o %s" % + (binPath, self.tmpdir)) == 0 + + tdSql.execute('''drop database if exists db2 ;''') + + assert os.system("%staosdump -i %s -g" % (binPath, self.tmpdir)) == 0 + + print("==============step5,#create regular_table; insert regular_table; show regular_table; select regular_table; drop regular_table") + self.regular_table = "regular_table~!@#$%^&*()-_+=[]{}';:,<.>/?stST24680~!@#$%^&*()-_+=[]{}" + + self.regular_col_base = "123@#$%^&*()-_+=[]{};:,<.>/?~!$%^" + + self.col_int = "regular_table_col_int%s" % self.regular_col_base + print(self.col_int) + self.col_bigint = "regular_table_col_bigint%s" % self.regular_col_base + self.col_smallint = "regular_table_col_smallint%s" % self.regular_col_base + self.col_tinyint = "regular_table_col_tinyint%s" % self.regular_col_base + self.col_bool = "regular_table_col_bool%s" % self.regular_col_base + self.col_binary = "regular_table_col_binary%s" % self.regular_col_base + self.col_nchar = "regular_table_col_nchar%s" % self.regular_col_base + self.col_float = "regular_table_col_float%s" % self.regular_col_base + self.col_double = "regular_table_col_double%s" % self.regular_col_base + self.col_ts = "regular_table_col_ts%s" % self.regular_col_base + + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(11) + + tdSql.query("select count(*) from `%s` ; " % self.regular_table) + tdSql.checkRows(1) + + tdSql.query("show create table `%s` ; " % self.regular_table) + tdSql.checkData(0, 0, self.regular_table) + tdSql.checkData(0, 1, "CREATE TABLE `%s` (`ts` TIMESTAMP,`%s` INT,`%s` BIGINT,`%s` SMALLINT,`%s` TINYINT,`%s` BOOL,`%s` BINARY(30),`%s` NCHAR(30),`%s` FLOAT,`%s` DOUBLE,`%s` TIMESTAMP)" + % (self.regular_table, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, + self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts)) + + tdSql.execute( + "insert into `%s` values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)" % + self.regular_table) + sql = "select * from `%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.checkRows(5) + sql = '''select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from db2.`%s` order by ts desc; '''\ + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, self.regular_table) + datacheck = self.table1_checkall(sql) + tdSql.checkRows(5) + + time.sleep(1) + tdSql.execute('''insert into db2.`%s` (ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`) values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)''' + % (self.regular_table, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.checkRows(6) + + sql = " select * from db2.`%s` where `%s`=1 and `%s`=2 and `%s`=3 and `%s`=4 and `%s`='True' and `%s`=6 and `%s`=7 and `%s`=8 and `%s`=9 and `%s`=10; " \ + % (self.regular_table, self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts) + datacheck = self.table1_checkall(sql) +# CBD tdSql.checkRows(3) + + tdSql.query( + "select count(*) from `%s` order by ts desc; " % + self.regular_table) + tdSql.checkData(0, 0, 6) + tdSql.query("select count(*) from `%s` ; " % self.regular_table) + tdSql.checkRows(1) + + sql = "select * from (select * from `%s` order by ts desc) ; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.checkRows(6) + + sql = "select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from (select ts ,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s`,`%s` from db2.`%s`\ + where `%s`=1 and `%s`=2 and `%s`=3 and `%s`=4 and `%s`='True' and `%s`=6 and `%s`=7 and `%s`=8 and `%s`=9 and `%s`=10 ) ; " \ + % (self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, + self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts, self.regular_table, + self.col_int, self.col_bigint, self.col_smallint, self.col_tinyint, self.col_bool, self.col_binary, self.col_nchar, self.col_float, self.col_double, self.col_ts) + datacheck = self.table1_checkall(sql) +# CBD tdSql.checkRows(3) + + tdSql.query( + "select count(*) from (select * from `%s` ); " % + self.regular_table) + tdSql.checkData(0, 0, 6) + + tdSql.query("show tables like 'regular_table%' ") + tdSql.checkRows(1) + + tdSql.query("show db2.tables like 'create_r_table%' ") + tdSql.checkRows(1) + + print(r"==============drop\ add\ change\ modify column ") + print("==============drop==============") + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_ts)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_9(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(10) + tdSql.execute( + "ALTER TABLE `%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_double)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_8(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(9) + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_float)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_7(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(8) + tdSql.execute( + "ALTER TABLE `%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_nchar)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_6(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(7) + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_binary)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_5(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(6) + tdSql.execute( + "ALTER TABLE `%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_bool)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_4(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(5) + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_tinyint)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_3(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(4) + tdSql.execute("ALTER TABLE `%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_smallint)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_2(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(3) + tdSql.execute( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_bigint)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_1(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(2) + tdSql.error( + "ALTER TABLE db2.`%s` DROP COLUMN `%s`; " % + (self.regular_table, self.col_int)) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(2) + + print("==============add==============") + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` bigint; " % + (self.regular_table, self.col_bigint)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(3) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` smallint; " % + (self.regular_table, self.col_smallint)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(4) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` tinyint; " % + (self.regular_table, self.col_tinyint)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(5) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` bool; " % + (self.regular_table, self.col_bool)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(6) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` binary(20); " % + (self.regular_table, self.col_binary)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(7) + + tdSql.execute( + "insert into db2.`%s` values(now, 1 , 2, 3, 4, 5, 6)" % + self.regular_table) + sql = "select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall_5(sql) + + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` nchar(20); " % + (self.regular_table, self.col_nchar)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(8) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` float; " % + (self.regular_table, self.col_float)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(9) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` double; " % + (self.regular_table, self.col_double)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(10) + tdSql.execute( + "ALTER TABLE db2.`%s` ADD COLUMN `%s` timestamp; " % + (self.regular_table, self.col_ts)) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(11) + + tdSql.execute( + "insert into db2.`%s` values(now, 1 , 2, 3, 4, 5, 6 ,7 ,8 ,9 ,10)" % + self.regular_table) + sql = "select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall(sql) + + print("==============change, regular not support==============") + + print("==============modify==============") + # TD-10810 + tdSql.execute( + "ALTER TABLE db2.`%s` MODIFY COLUMN `%s` binary(40); ; " % + (self.regular_table, self.col_binary)) + sql = " select * from db2.`%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.query("describe db2.`%s` ; " % self.regular_table) + tdSql.checkRows(11) + tdSql.execute( + "ALTER TABLE `%s` MODIFY COLUMN `%s` nchar(40); ; " % + (self.regular_table, self.col_nchar)) + sql = " select * from `%s` order by ts desc; " % self.regular_table + datacheck = self.table1_checkall(sql) + tdSql.query("describe `%s` ; " % self.regular_table) + tdSql.checkRows(11) + + os.system("rm %s/db*" % self.tmpdir) + os.system("rm dump_result.txt*") + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py index e9b032c003..3736166a83 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py +++ b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py @@ -68,7 +68,7 @@ class TDTestCase: def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole): tdLog.printNoPrefix("======== test case 1: ") paraDict = {'dbName': 'db', - 'dbNumbers': 8, + 'dbNumbers': 6, 'dropFlag': 1, 'event': '', 'vgroups': 2, @@ -98,10 +98,10 @@ class TDTestCase: # fisr add three mnodes; tdLog.info("fisr add three mnodes and check mnode status") - tdSql.info("create mnode on dnode 2") + tdLog.info("create mnode on dnode 2") tdSql.execute("create mnode on dnode 2") clusterComCheck.checkMnodeStatus(2) - tdSql.info("create mnode on dnode 3") + tdLog.info("create mnode on dnode 3") tdSql.execute("create mnode on dnode 3") clusterComCheck.checkMnodeStatus(3) @@ -161,7 +161,7 @@ class TDTestCase: tdLog.info("check dnode number:") clusterComCheck.checkDnodes(dnodeNumbers) tdSql.query("show databases") - tdLog.debug("we find %d databases but exepect to create %d databases "%(tdSql.queryRows-2,allDbNumbers-2)) + tdLog.debug("we find %d databases but exepect to create %d databases "%(tdSql.queryRows-2,allDbNumbers)) # tdLog.info("check DB Rows:") # clusterComCheck.checkDbRows(allDbNumbers) @@ -172,7 +172,7 @@ class TDTestCase: def run(self): # print(self.master_dnode.cfgDict) - self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=10,stopRole='mnode') + self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=5,stopRole='mnode') def stop(self): tdSql.close() diff --git a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDbRep3.py b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDbRep3.py index 99efabd8ea..ea8e9612a2 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDbRep3.py +++ b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDbRep3.py @@ -159,7 +159,7 @@ class TDTestCase: tdLog.info("check dnode number:") clusterComCheck.checkDnodes(dnodeNumbers) tdSql.query("show databases") - tdLog.debug("we find %d databases but exepect to create %d databases "%(tdSql.queryRows-2,allDbNumbers-2)) + tdLog.debug("we find %d databases but exepect to create %d databases "%(tdSql.queryRows-2,allDbNumbers)) # tdLog.info("check DB Rows:") # clusterComCheck.checkDbRows(allDbNumbers) @@ -170,7 +170,7 @@ class TDTestCase: def run(self): # print(self.master_dnode.cfgDict) - self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=2,stopRole='mnode') + self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=3,stopRole='mnode') def stop(self): tdSql.close() diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 3fc38ac898..77484e7156 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -34,7 +34,7 @@ python3 ./test.py -f 1-insert/table_param_ttl.py python3 ./test.py -f 1-insert/mutil_stage.py python3 ./test.py -f 1-insert/update_data_muti_rows.py - +python3 ./test.py -f 1-insert/db_tb_name_check.py python3 ./test.py -f 2-query/abs.py python3 ./test.py -f 2-query/abs.py -R @@ -60,8 +60,8 @@ python3 ./test.py -f 2-query/ceil.py python3 ./test.py -f 2-query/ceil.py -R python3 ./test.py -f 2-query/char_length.py python3 ./test.py -f 2-query/char_length.py -R -# python3 ./test.py -f 2-query/check_tsdb.py -# python3 ./test.py -f 2-query/check_tsdb.py -R +python3 ./test.py -f 2-query/check_tsdb.py +python3 ./test.py -f 2-query/check_tsdb.py -R python3 ./test.py -f 2-query/concat.py python3 ./test.py -f 2-query/concat.py -R python3 ./test.py -f 2-query/concat_ws.py @@ -173,8 +173,9 @@ python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3 python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3 python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDbRep3.py -N 5 -M 3 python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3 python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3 diff --git a/tools/shell/src/shellCommand.c b/tools/shell/src/shellCommand.c index 1af6ee4c06..d87e10fd08 100644 --- a/tools/shell/src/shellCommand.c +++ b/tools/shell/src/shellCommand.c @@ -525,7 +525,11 @@ int32_t shellReadCommand(char *command) { switch (c) { case 'A': // Up arrow hist_counter = (hist_counter + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE; - shellResetCommand(&cmd, (pHistory->hist[hist_counter] == NULL) ? "" : pHistory->hist[hist_counter]); + if (pHistory->hist[hist_counter] == NULL) { + hist_counter = (hist_counter + SHELL_MAX_HISTORY_SIZE + 1) % SHELL_MAX_HISTORY_SIZE; + } else { + shellResetCommand(&cmd, pHistory->hist[hist_counter]); + } break; case 'B': // Down arrow if (hist_counter != pHistory->hend) {