From 63b40fb29c8b0566e5223abffcb75db0f9c064cd Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Tue, 14 Jun 2022 14:03:51 +0800 Subject: [PATCH 01/15] enh: backup source code if case fails --- tests/parallel_test/collect_cases.sh | 11 +++++++++++ tests/parallel_test/run.sh | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/tests/parallel_test/collect_cases.sh b/tests/parallel_test/collect_cases.sh index c560598c81..8ae83f5618 100755 --- a/tests/parallel_test/collect_cases.sh +++ b/tests/parallel_test/collect_cases.sh @@ -41,5 +41,16 @@ fi cat ../script/jenkins/basic.txt |grep -v "^#"|grep -v "^$"|sed "s/^/,,script,/" >>$case_file grep "^python" ../system-test/fulltest.sh |sed "s/^/,,system-test,/" >>$case_file +# tar source code for run.sh to use +if [ $ent -eq 0 ]; then + cd ../../../ + rm -rf TDengine.tar.gz + tar czf TDengine.tar.gz TDengine taos-connector-python --exclude=TDengine/debug +else + cd ../../../../ + rm -rf TDinternal.tar.gz + tar czf TDinternal.tar.gz TDinternal taos-connector-python --exclude=TDinternal/debug --exclude=TDinternal/community/debug +fi + exit 0 diff --git a/tests/parallel_test/run.sh b/tests/parallel_test/run.sh index 6417f41fd4..3b0c0da8cd 100755 --- a/tests/parallel_test/run.sh +++ b/tests/parallel_test/run.sh @@ -291,6 +291,19 @@ function run_thread() { fi cmd="$scpcmd:${remote_sim_tar} $log_dir/${case_file}.sim.tar.gz" $cmd + # backup source code + source_tar_dir=$log_dir/TDengine_${hosts[index]} + source_tar_file=TDengine.tar.gz + if [ $ent -ne 0 ]; then + source_tar_dir=$log_dir/TDinternal_${hosts[index]} + source_tar_file=TDinternal.tar.gz + fi + mkdir $source_tar_dir 2>/dev/null + if [ $? -eq 0 ]; then + cmd="$scpcmd:${workdirs[index]}/$source_tar_file $source_tar_dir" + echo "$cmd" + $cmd + fi fi done } From c77e7d521afba79c625ffa0bb25eef51ad8d17a5 Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Tue, 14 Jun 2022 15:01:45 +0800 Subject: [PATCH 02/15] enh: exclude some more directories when tar source files --- tests/parallel_test/collect_cases.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/collect_cases.sh b/tests/parallel_test/collect_cases.sh index 8ae83f5618..2c8c61b0b7 100755 --- a/tests/parallel_test/collect_cases.sh +++ b/tests/parallel_test/collect_cases.sh @@ -45,11 +45,11 @@ grep "^python" ../system-test/fulltest.sh |sed "s/^/,,system-test,/" >>$case_fil if [ $ent -eq 0 ]; then cd ../../../ rm -rf TDengine.tar.gz - tar czf TDengine.tar.gz TDengine taos-connector-python --exclude=TDengine/debug + tar --exclude=TDengine/debug --exclude=TDengine/sim --exclude=TDengine/release -czf TDengine.tar.gz TDengine taos-connector-python else cd ../../../../ rm -rf TDinternal.tar.gz - tar czf TDinternal.tar.gz TDinternal taos-connector-python --exclude=TDinternal/debug --exclude=TDinternal/community/debug + tar --exclude=TDinternal/debug --exclude=TDinternal/sim --exclude=TDinternal/community/debug --exclude=TDinternal/community/release -czf TDinternal.tar.gz TDinternal taos-connector-python fi exit 0 From 3c8fcc7c794723509cdf15fb1230ace631810baf Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Tue, 14 Jun 2022 16:00:05 +0800 Subject: [PATCH 03/15] enh: exclude some more directories --- tests/parallel_test/collect_cases.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/collect_cases.sh b/tests/parallel_test/collect_cases.sh index 2c8c61b0b7..c12413b981 100755 --- a/tests/parallel_test/collect_cases.sh +++ b/tests/parallel_test/collect_cases.sh @@ -49,7 +49,7 @@ if [ $ent -eq 0 ]; then else cd ../../../../ rm -rf TDinternal.tar.gz - tar --exclude=TDinternal/debug --exclude=TDinternal/sim --exclude=TDinternal/community/debug --exclude=TDinternal/community/release -czf TDinternal.tar.gz TDinternal taos-connector-python + tar --exclude=TDinternal/debug --exclude=TDinternal/sim --exclude=TDinternal/community/debug --exclude=TDinternal/community/release --exclude=TDinternal/community/sim -czf TDinternal.tar.gz TDinternal taos-connector-python fi exit 0 From 3acacf163ac29b648d13470ef6cba749013bea7b Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Tue, 14 Jun 2022 16:32:17 +0800 Subject: [PATCH 04/15] enh: show commit id of target branch --- Jenkinsfile2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 950b316bab..a29169eece 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -82,6 +82,7 @@ def pre_test(){ sh ''' cd ${WKC} git pull >/dev/null + git log -5 git fetch origin +refs/pull/${CHANGE_ID}/merge git checkout -qf FETCH_HEAD git log -5 @@ -93,6 +94,7 @@ def pre_test(){ sh ''' cd ${WK} git pull >/dev/null + git log -5 git fetch origin +refs/pull/${CHANGE_ID}/merge git checkout -qf FETCH_HEAD git log -5 From aa5efe5cbe43faf47b465d74410132062b45dce0 Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Tue, 14 Jun 2022 18:18:59 +0800 Subject: [PATCH 05/15] enh: show commit id of python connector --- Jenkinsfile2 | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile2 b/Jenkinsfile2 index a29169eece..79a7bab0c3 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -115,6 +115,7 @@ def pre_test(){ cd ${WKPY} git reset --hard git pull + git log -5 ''' return 1 } From c9caaeea38e248b6a3a15cfd5986c255e059b718 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 15 Jun 2022 10:18:05 +0800 Subject: [PATCH 06/15] fix tb index issue --- source/libs/catalog/src/ctgAsync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/catalog/src/ctgAsync.c b/source/libs/catalog/src/ctgAsync.c index 159c120dde..77de4409ee 100644 --- a/source/libs/catalog/src/ctgAsync.c +++ b/source/libs/catalog/src/ctgAsync.c @@ -870,7 +870,7 @@ _return: int32_t ctgHandleGetTbIndexRsp(SCtgTask* pTask, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) { int32_t code = 0; - CTG_ERR_JRET(ctgProcessRspMsg(&pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target)); + CTG_ERR_JRET(ctgProcessRspMsg(pTask->msgCtx.out, reqType, pMsg->pData, pMsg->len, rspCode, pTask->msgCtx.target)); STableIndex* pOut = (STableIndex*)pTask->msgCtx.out; SArray* pInfo = NULL; From afe3171edc21aee32c59fab156a2538e0b930052 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 15 Jun 2022 10:40:39 +0800 Subject: [PATCH 07/15] fix free issue --- source/libs/catalog/src/ctgUtil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/catalog/src/ctgUtil.c b/source/libs/catalog/src/ctgUtil.c index 1cb2b99a67..e97c34dc26 100644 --- a/source/libs/catalog/src/ctgUtil.c +++ b/source/libs/catalog/src/ctgUtil.c @@ -675,7 +675,8 @@ int32_t ctgCloneTableIndex(SArray* pIndex, SArray** pRes) { for (int32_t i = 0; i < num; ++i) { STableIndexInfo *pInfo = taosArrayGet(pIndex, i); - taosArrayPush(*pRes, pInfo); + pInfo = taosArrayPush(*pRes, pInfo); + pInfo->expr = strdup(pInfo->expr); } return TSDB_CODE_SUCCESS; From 7de08aaadcb1c7c4027b14e85e123e44a120d3f8 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 15 Jun 2022 13:26:12 +0800 Subject: [PATCH 08/15] add db vg refresh --- include/common/systable.h | 1 + source/libs/catalog/src/ctgAsync.c | 90 ++++++++++++-------------- source/libs/parser/src/parTranslater.c | 8 +++ 3 files changed, 51 insertions(+), 48 deletions(-) diff --git a/include/common/systable.h b/include/common/systable.h index 8b0bb4a3fb..d2c28941c7 100644 --- a/include/common/systable.h +++ b/include/common/systable.h @@ -52,6 +52,7 @@ extern "C" { #define TSDB_PERFS_TABLE_OFFSETS "offsets" #define TSDB_PERFS_TABLE_TRANS "trans" #define TSDB_PERFS_TABLE_STREAMS "streams" +#define TSDB_PERFS_TABLE_APPS "apps" typedef struct SSysDbTableSchema { const char* name; diff --git a/source/libs/catalog/src/ctgAsync.c b/source/libs/catalog/src/ctgAsync.c index 77de4409ee..6e24d632e2 100644 --- a/source/libs/catalog/src/ctgAsync.c +++ b/source/libs/catalog/src/ctgAsync.c @@ -261,54 +261,48 @@ int32_t ctgInitGetTbIndexTask(SCtgJob *pJob, int32_t taskIdx, SName *name) { } -int32_t ctgHandleForceUpdate(SCatalog* pCtg, SCtgJob *pJob, const SCatalogReq* pReq) { - int32_t dbNum = pJob->dbCfgNum + pJob->dbVgNum + pJob->dbInfoNum; - if (dbNum > 0) { - if (dbNum > pJob->dbCfgNum && dbNum > pJob->dbVgNum && dbNum > pJob->dbInfoNum) { - SHashObj* pDb = taosHashInit(dbNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); - if (NULL == pDb) { - CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); - } - - for (int32_t i = 0; i < pJob->dbVgNum; ++i) { - char* dbFName = taosArrayGet(pReq->pDbVgroup, i); - taosHashPut(pDb, dbFName, strlen(dbFName), dbFName, TSDB_DB_FNAME_LEN); - } - - for (int32_t i = 0; i < pJob->dbCfgNum; ++i) { - char* dbFName = taosArrayGet(pReq->pDbCfg, i); - taosHashPut(pDb, dbFName, strlen(dbFName), dbFName, TSDB_DB_FNAME_LEN); - } - - for (int32_t i = 0; i < pJob->dbInfoNum; ++i) { - char* dbFName = taosArrayGet(pReq->pDbInfo, i); - taosHashPut(pDb, dbFName, strlen(dbFName), dbFName, TSDB_DB_FNAME_LEN); - } - - char* dbFName = taosHashIterate(pDb, NULL); - while (dbFName) { - ctgDropDbVgroupEnqueue(pCtg, dbFName, true); - dbFName = taosHashIterate(pDb, dbFName); - } - - taosHashCleanup(pDb); - } else { - for (int32_t i = 0; i < pJob->dbVgNum; ++i) { - char* dbFName = taosArrayGet(pReq->pDbVgroup, i); - CTG_ERR_RET(ctgDropDbVgroupEnqueue(pCtg, dbFName, true)); - } - - for (int32_t i = 0; i < pJob->dbCfgNum; ++i) { - char* dbFName = taosArrayGet(pReq->pDbCfg, i); - CTG_ERR_RET(ctgDropDbVgroupEnqueue(pCtg, dbFName, true)); - } - - for (int32_t i = 0; i < pJob->dbInfoNum; ++i) { - char* dbFName = taosArrayGet(pReq->pDbInfo, i); - CTG_ERR_RET(ctgDropDbVgroupEnqueue(pCtg, dbFName, true)); - } - } +int32_t ctgHandleForceUpdate(SCatalog* pCtg, int32_t taskNum, SCtgJob *pJob, const SCatalogReq* pReq) { + SHashObj* pDb = taosHashInit(taskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); + if (NULL == pDb) { + CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); } + + for (int32_t i = 0; i < pJob->dbVgNum; ++i) { + char* dbFName = taosArrayGet(pReq->pDbVgroup, i); + taosHashPut(pDb, dbFName, strlen(dbFName), dbFName, TSDB_DB_FNAME_LEN); + } + + for (int32_t i = 0; i < pJob->dbCfgNum; ++i) { + char* dbFName = taosArrayGet(pReq->pDbCfg, i); + taosHashPut(pDb, dbFName, strlen(dbFName), dbFName, TSDB_DB_FNAME_LEN); + } + + for (int32_t i = 0; i < pJob->dbInfoNum; ++i) { + char* dbFName = taosArrayGet(pReq->pDbInfo, i); + taosHashPut(pDb, dbFName, strlen(dbFName), dbFName, TSDB_DB_FNAME_LEN); + } + + for (int32_t i = 0; i < pJob->tbMetaNum; ++i) { + SName* name = taosArrayGet(pReq->pTableMeta, i); + char dbFName[TSDB_DB_FNAME_LEN]; + tNameGetFullDbName(name, dbFName); + taosHashPut(pDb, dbFName, strlen(dbFName), dbFName, TSDB_DB_FNAME_LEN); + } + + for (int32_t i = 0; i < pJob->tbHashNum; ++i) { + SName* name = taosArrayGet(pReq->pTableHash, i); + char dbFName[TSDB_DB_FNAME_LEN]; + tNameGetFullDbName(name, dbFName); + taosHashPut(pDb, dbFName, strlen(dbFName), dbFName, TSDB_DB_FNAME_LEN); + } + + char* dbFName = taosHashIterate(pDb, NULL); + while (dbFName) { + ctgDropDbVgroupEnqueue(pCtg, dbFName, true); + dbFName = taosHashIterate(pDb, dbFName); + } + + taosHashCleanup(pDb); int32_t tbNum = pJob->tbMetaNum + pJob->tbHashNum; if (tbNum > 0) { @@ -404,7 +398,7 @@ int32_t ctgInitJob(SCatalog* pCtg, SRequestConnInfo *pConn, SCtgJob** job, uint6 } if (pReq->forceUpdate) { - CTG_ERR_JRET(ctgHandleForceUpdate(pCtg, pJob, pReq)); + CTG_ERR_JRET(ctgHandleForceUpdate(pCtg, *taskNum, pJob, pReq)); } int32_t taskIdx = 0; diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 52abeadac9..b94a3d200e 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -4124,12 +4124,14 @@ static const char* getSysDbName(ENodeType type) { case QUERY_NODE_SHOW_SNODES_STMT: case QUERY_NODE_SHOW_LICENCE_STMT: case QUERY_NODE_SHOW_CLUSTER_STMT: + case QUERY_NODE_SHOW_VARIABLE_STMT: return TSDB_INFORMATION_SCHEMA_DB; case QUERY_NODE_SHOW_CONNECTIONS_STMT: case QUERY_NODE_SHOW_QUERIES_STMT: case QUERY_NODE_SHOW_TOPICS_STMT: case QUERY_NODE_SHOW_STREAMS_STMT: case QUERY_NODE_SHOW_TRANSACTIONS_STMT: + case QUERY_NODE_SHOW_APPS_STMT: return TSDB_PERFORMANCE_SCHEMA_DB; default: break; @@ -4179,6 +4181,10 @@ static const char* getSysTableName(ENodeType type) { return TSDB_PERFS_TABLE_TOPICS; case QUERY_NODE_SHOW_TRANSACTIONS_STMT: return TSDB_PERFS_TABLE_TRANS; + case QUERY_NODE_SHOW_VARIABLE_STMT: + return TSDB_INS_TABLE_CONFIGS; + case QUERY_NODE_SHOW_APPS_STMT: + return TSDB_PERFS_TABLE_APPS; default: break; } @@ -5233,6 +5239,8 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_CLUSTER_STMT: case QUERY_NODE_SHOW_TOPICS_STMT: case QUERY_NODE_SHOW_TRANSACTIONS_STMT: + case QUERY_NODE_SHOW_VARIABLE_STMT: + case QUERY_NODE_SHOW_APPS_STMT: code = rewriteShow(pCxt, pQuery); break; case QUERY_NODE_CREATE_TABLE_STMT: From 19ab15b19ffe735a3a1163fb427724c1403e2382 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Wed, 15 Jun 2022 13:49:29 +0800 Subject: [PATCH 09/15] feat: super table join --- include/common/tmsg.h | 11 ++++--- include/common/ttokendef.h | 2 +- include/libs/nodes/cmdnodes.h | 6 ++++ include/libs/nodes/nodes.h | 1 + include/libs/nodes/plannodes.h | 9 +++++- include/util/tdef.h | 5 +++ source/common/src/tmsg.c | 6 ++-- source/libs/nodes/src/nodesCodeFuncs.c | 16 +++------- source/libs/nodes/src/nodesUtilFuncs.c | 5 ++- source/libs/parser/inc/parAst.h | 2 ++ source/libs/parser/inc/sql.y | 25 ++++++++------- source/libs/parser/src/parAstCreater.c | 25 ++++++++++----- source/libs/parser/src/parTokenizer.c | 3 +- source/libs/parser/src/parTranslater.c | 11 +++++-- source/libs/parser/src/sql.c | 28 ++++++++--------- source/libs/parser/test/parInitialCTest.cpp | 8 ++--- source/libs/planner/src/planPhysiCreater.c | 34 +++++++++++++++------ source/libs/planner/src/planSpliter.c | 7 +++-- tests/script/tsim/db/alter_option.sim | 2 +- tests/script/tsim/db/create_all_options.sim | 18 +++++------ 20 files changed, 137 insertions(+), 87 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 7501c8fce0..4b624e333f 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1134,11 +1134,11 @@ void tFreeSMAlterStbRsp(SMAlterStbRsp* pRsp); int32_t tSerializeSTableMetaRsp(void* buf, int32_t bufLen, STableMetaRsp* pRsp); int32_t tDeserializeSTableMetaRsp(void* buf, int32_t bufLen, STableMetaRsp* pRsp); void tFreeSTableMetaRsp(STableMetaRsp* pRsp); -void tFreeSTableIndexRsp(void *info); +void tFreeSTableIndexRsp(void* info); typedef struct { - SArray* pMetaRsp; // Array of STableMetaRsp - SArray* pIndexRsp; // Array of STableIndexRsp; + SArray* pMetaRsp; // Array of STableMetaRsp + SArray* pIndexRsp; // Array of STableIndexRsp; } SSTbHbRsp; int32_t tSerializeSSTbHbRsp(void* buf, int32_t bufLen, SSTbHbRsp* pRsp); @@ -1305,8 +1305,9 @@ int32_t tSerializeSSetStandbyReq(void* buf, int32_t bufLen, SSetStandbyReq* pReq int32_t tDeserializeSSetStandbyReq(void* buf, int32_t bufLen, SSetStandbyReq* pReq); typedef struct { - int32_t connId; - int32_t queryId; + int32_t connId; // todo remove + int32_t queryId; // todo remove + char queryStrId[TSDB_QUERY_ID_LEN]; } SKillQueryReq; int32_t tSerializeSKillQueryReq(void* buf, int32_t bufLen, SKillQueryReq* pReq); diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index f5495db5ae..061c734484 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -78,7 +78,7 @@ #define TK_BUFFER 60 #define TK_CACHELAST 61 #define TK_COMP 62 -#define TK_DAYS 63 +#define TK_DURATION 63 #define TK_NK_VARIABLE 64 #define TK_FSYNC 65 #define TK_MAXROWS 66 diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 8d4e94663f..1282836425 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -89,6 +89,7 @@ typedef struct STableOptions { ENodeType type; char comment[TSDB_TB_COMMENT_LEN]; double filesFactor; + int32_t delay; SNodeList* pRollupFuncs; int32_t ttl; SNodeList* pSma; @@ -286,6 +287,11 @@ typedef struct SKillStmt { int32_t targetId; } SKillStmt; +typedef struct SKillQueryStmt { + ENodeType type; + char queryId[TSDB_QUERY_ID_LEN]; +} SKillQueryStmt; + typedef struct SStreamOptions { ENodeType type; int8_t triggerType; diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 3937fc13f4..3c25d8add4 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -204,6 +204,7 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN, QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN, QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN, + QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN, QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN, QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN, QUERY_NODE_PHYSICAL_PLAN_PROJECT, diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 1a3bfdbb04..5d3e0cd142 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -34,7 +34,13 @@ typedef struct SLogicNode { uint8_t precision; } SLogicNode; -typedef enum EScanType { SCAN_TYPE_TAG = 1, SCAN_TYPE_TABLE, SCAN_TYPE_SYSTEM_TABLE, SCAN_TYPE_STREAM } EScanType; +typedef enum EScanType { + SCAN_TYPE_TAG = 1, + SCAN_TYPE_TABLE, + SCAN_TYPE_SYSTEM_TABLE, + SCAN_TYPE_STREAM, + SCAN_TYPE_TABLE_MERGE +} EScanType; typedef struct SScanLogicNode { SLogicNode node; @@ -262,6 +268,7 @@ typedef struct STableScanPhysiNode { } STableScanPhysiNode; typedef STableScanPhysiNode STableSeqScanPhysiNode; +typedef STableScanPhysiNode STableMergeScanPhysiNode; typedef STableScanPhysiNode SStreamScanPhysiNode; typedef struct SProjectPhysiNode { diff --git a/include/util/tdef.h b/include/util/tdef.h index 1fa8ad1912..1a8ba6a620 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -222,6 +222,8 @@ typedef enum ELogicConditionType { #define TSDB_APP_NAME_LEN TSDB_UNI_LEN #define TSDB_TB_COMMENT_LEN 1025 +#define TSDB_QUERY_ID_LEN 26 + /** * In some scenarios uint16_t (0~65535) is used to store the row len. * - Firstly, we use 65531(65535 - 4), as the SDataRow/SKVRow contains 4 bits header. @@ -341,6 +343,9 @@ typedef enum ELogicConditionType { #define TSDB_DB_SCHEMALESS_OFF 0 #define TSDB_DEFAULT_DB_SCHEMALESS TSDB_DB_SCHEMALESS_OFF +// #define TSDB_MIN_ROLLUP_DELAY 1 +// #define TSDB_MAX_ROLLUP_DELAY 10 +// #define TSDB_DEFAULT_ROLLUP_DELAY 1 #define TSDB_MIN_ROLLUP_FILE_FACTOR 0 #define TSDB_MAX_ROLLUP_FILE_FACTOR 10 #define TSDB_DEFAULT_ROLLUP_FILE_FACTOR 0.1 diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index aafeca0b39..420ed8dcb2 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3369,8 +3369,7 @@ int32_t tSerializeSKillQueryReq(void *buf, int32_t bufLen, SKillQueryReq *pReq) tEncoderInit(&encoder, buf, bufLen); if (tStartEncode(&encoder) < 0) return -1; - if (tEncodeI32(&encoder, pReq->connId) < 0) return -1; - if (tEncodeI32(&encoder, pReq->queryId) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->queryStrId) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -3383,8 +3382,7 @@ int32_t tDeserializeSKillQueryReq(void *buf, int32_t bufLen, SKillQueryReq *pReq tDecoderInit(&decoder, buf, bufLen); if (tStartDecode(&decoder) < 0) return -1; - if (tDecodeI32(&decoder, &pReq->connId) < 0) return -1; - if (tDecodeI32(&decoder, &pReq->queryId) < 0) return -1; + if (tDecodeCStrTo(&decoder, pReq->queryStrId) < 0) return -1; tEndDecode(&decoder); tDecoderClear(&decoder); diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index be1929d554..d73434f3f0 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -1480,14 +1480,6 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) { return code; } -static int32_t physiStreamScanNodeToJson(const void* pObj, SJson* pJson) { - return physiTableScanNodeToJson(pObj, pJson); -} - -static int32_t jsonToPhysiStreamScanNode(const SJson* pJson, void* pObj) { - return jsonToPhysiTableScanNode(pJson, pObj); -} - static const char* jkSysTableScanPhysiPlanMnodeEpSet = "MnodeEpSet"; static const char* jkSysTableScanPhysiPlanShowRewrite = "ShowRewrite"; static const char* jkSysTableScanPhysiPlanAccountId = "AccountId"; @@ -3964,9 +3956,9 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: return physiTagScanNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN: - return physiTableScanNodeToJson(pObj, pJson); + case QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN: case QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN: - return physiStreamScanNodeToJson(pObj, pJson); + return physiTableScanNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: return physiSysTableScanNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_PROJECT: @@ -4097,9 +4089,9 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: return jsonToPhysiTagScanNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN: - return jsonToPhysiTableScanNode(pJson, pObj); + case QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN: case QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN: - return jsonToPhysiStreamScanNode(pJson, pObj); + return jsonToPhysiTableScanNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: return jsonToPhysiSysTableScanNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_PROJECT: diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 72666f833d..3bff010d43 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -209,9 +209,10 @@ SNode* nodesMakeNode(ENodeType type) { case QUERY_NODE_SHOW_CREATE_STABLE_STMT: case QUERY_NODE_SHOW_TRANSACTIONS_STMT: return makeNode(type, sizeof(SShowStmt)); - case QUERY_NODE_KILL_CONNECTION_STMT: case QUERY_NODE_KILL_QUERY_STMT: + return makeNode(type, sizeof(SKillQueryStmt)); case QUERY_NODE_KILL_TRANSACTION_STMT: + case QUERY_NODE_KILL_CONNECTION_STMT: return makeNode(type, sizeof(SKillStmt)); case QUERY_NODE_DELETE_STMT: return makeNode(type, sizeof(SDeleteStmt)); @@ -251,6 +252,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(STableScanPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN: return makeNode(type, sizeof(STableSeqScanPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN: + return makeNode(type, sizeof(STableMergeScanPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN: return makeNode(type, sizeof(SStreamScanPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 0c6663d29a..b8c6ffc843 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -60,6 +60,7 @@ typedef enum EDatabaseOptionType { typedef enum ETableOptionType { TABLE_OPTION_COMMENT = 1, TABLE_OPTION_FILE_FACTOR, + TABLE_OPTION_DELAY, TABLE_OPTION_ROLLUP, TABLE_OPTION_TTL, TABLE_OPTION_SMA @@ -187,6 +188,7 @@ SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, const SNode* pOptions, SNode* pQuery); SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pStreamName); SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId); +SNode* createKillQueryStmt(SAstCreateContext* pCxt, const SToken* pQueryId); SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt); SNode* createMergeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId1, const SToken* pVgId2); SNode* createRedistributeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId, SNodeList* pDnodes); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 83ad41aac0..0d9e6e4a73 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -168,8 +168,8 @@ db_options(A) ::= . db_options(A) ::= db_options(B) BUFFER NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_BUFFER, &C); } db_options(A) ::= db_options(B) CACHELAST NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_CACHELAST, &C); } db_options(A) ::= db_options(B) COMP NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_COMP, &C); } -db_options(A) ::= db_options(B) DAYS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); } -db_options(A) ::= db_options(B) DAYS NK_VARIABLE(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); } +db_options(A) ::= db_options(B) DURATION NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); } +db_options(A) ::= db_options(B) DURATION NK_VARIABLE(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_DAYS, &C); } db_options(A) ::= db_options(B) FSYNC NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_FSYNC, &C); } db_options(A) ::= db_options(B) MAXROWS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_MAXROWS, &C); } db_options(A) ::= db_options(B) MINROWS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_MINROWS, &C); } @@ -317,8 +317,9 @@ tags_def(A) ::= TAGS NK_LP column_def_list(B) NK_RP. table_options(A) ::= . { A = createDefaultTableOptions(pCxt); } table_options(A) ::= table_options(B) COMMENT NK_STRING(C). { A = setTableOption(pCxt, B, TABLE_OPTION_COMMENT, &C); } +//table_options(A) ::= table_options(B) DELAY NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_DELAY, &C); } table_options(A) ::= table_options(B) FILE_FACTOR NK_FLOAT(C). { A = setTableOption(pCxt, B, TABLE_OPTION_FILE_FACTOR, &C); } -table_options(A) ::= table_options(B) ROLLUP NK_LP func_name_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_ROLLUP, C); } +table_options(A) ::= table_options(B) ROLLUP NK_LP rollup_func_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_ROLLUP, C); } table_options(A) ::= table_options(B) TTL NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_TTL, &C); } table_options(A) ::= table_options(B) SMA NK_LP col_name_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_SMA, C); } @@ -330,6 +331,15 @@ alter_table_options(A) ::= alter_table_options(B) alter_table_option(C). alter_table_option(A) ::= COMMENT NK_STRING(B). { A.type = TABLE_OPTION_COMMENT; A.val = B; } alter_table_option(A) ::= TTL NK_INTEGER(B). { A.type = TABLE_OPTION_TTL; A.val = B; } +%type rollup_func_list { SNodeList* } +%destructor rollup_func_list { nodesDestroyList($$); } +rollup_func_list(A) ::= rollup_func_name(B). { A = createNodeList(pCxt, B); } +rollup_func_list(A) ::= rollup_func_list(B) NK_COMMA rollup_func_name(C). { A = addNodeToList(pCxt, B, C); } + +rollup_func_name(A) ::= function_name(B). { A = createFunctionNode(pCxt, &B, NULL); } +rollup_func_name(A) ::= FIRST(B). { A = createFunctionNode(pCxt, &B, NULL); } +rollup_func_name(A) ::= LAST(B). { A = createFunctionNode(pCxt, &B, NULL); } + %type col_name_list { SNodeList* } %destructor col_name_list { nodesDestroyList($$); } col_name_list(A) ::= col_name(B). { A = createNodeList(pCxt, B); } @@ -378,13 +388,6 @@ table_name_cond(A) ::= table_name(B). from_db_opt(A) ::= . { A = createDefaultDatabaseCondValue(pCxt); } from_db_opt(A) ::= FROM db_name(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); } -%type func_name_list { SNodeList* } -%destructor func_name_list { nodesDestroyList($$); } -func_name_list(A) ::= func_name(B). { A = createNodeList(pCxt, B); } -func_name_list(A) ::= func_name_list(B) NK_COMMA func_name(C). { A = addNodeToList(pCxt, B, C); } - -func_name(A) ::= function_name(B). { A = createFunctionNode(pCxt, &B, NULL); } - /************************************************ create index ********************************************************/ cmd ::= CREATE SMA INDEX not_exists_opt(D) index_name(A) ON table_name(B) index_options(C). { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, D, &A, &B, NULL, C); } @@ -466,7 +469,7 @@ stream_options(A) ::= stream_options(B) WATERMARK duration_literal(C). /************************************************ kill connection/query ***********************************************/ cmd ::= KILL CONNECTION NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &A); } -cmd ::= KILL QUERY NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_QUERY_STMT, &A); } +cmd ::= KILL QUERY NK_STRING(A). { pCxt->pRootNode = createKillQueryStmt(pCxt, &A); } cmd ::= KILL TRANSACTION NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &A); } /************************************************ merge/redistribute/ vgroup ******************************************/ diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index c75696cede..8a7987e4ec 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -804,10 +804,10 @@ SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOpti case DB_OPTION_RETENTIONS: ((SDatabaseOptions*)pOptions)->pRetentions = pVal; break; -// case DB_OPTION_SCHEMALESS: -// ((SDatabaseOptions*)pOptions)->schemaless = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); -// ((SDatabaseOptions*)pOptions)->schemaless = 0; -// break; + // case DB_OPTION_SCHEMALESS: + // ((SDatabaseOptions*)pOptions)->schemaless = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); + // ((SDatabaseOptions*)pOptions)->schemaless = 0; + // break; default: break; } @@ -867,6 +867,7 @@ SNode* createDefaultTableOptions(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); STableOptions* pOptions = (STableOptions*)nodesMakeNode(QUERY_NODE_TABLE_OPTIONS); CHECK_OUT_OF_MEM(pOptions); + // pOptions->delay = TSDB_DEFAULT_ROLLUP_DELAY; pOptions->filesFactor = TSDB_DEFAULT_ROLLUP_FILE_FACTOR; pOptions->ttl = TSDB_DEFAULT_TABLE_TTL; return (SNode*)pOptions; @@ -876,7 +877,7 @@ SNode* createAlterTableOptions(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); STableOptions* pOptions = (STableOptions*)nodesMakeNode(QUERY_NODE_TABLE_OPTIONS); CHECK_OUT_OF_MEM(pOptions); - pOptions->filesFactor = -1; + pOptions->delay = -1; pOptions->ttl = -1; return (SNode*)pOptions; } @@ -890,8 +891,8 @@ SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType sizeof(((STableOptions*)pOptions)->comment)); } break; - case TABLE_OPTION_FILE_FACTOR: - ((STableOptions*)pOptions)->filesFactor = taosStr2Double(((SToken*)pVal)->z, NULL); + case TABLE_OPTION_DELAY: + ((STableOptions*)pOptions)->delay = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; case TABLE_OPTION_ROLLUP: ((STableOptions*)pOptions)->pRollupFuncs = pVal; @@ -1431,7 +1432,7 @@ SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const CHECK_PARSER_STATUS(pCxt); SDropStreamStmt* pStmt = (SDropStreamStmt*)nodesMakeNode(QUERY_NODE_DROP_STREAM_STMT); CHECK_OUT_OF_MEM(pStmt); - strncpy(pStmt->streamName, pStreamName->z, pStreamName->n); + strncpy(pStmt->streamName, pStreamName->z, TMIN(pStreamName->n, sizeof(pStmt->streamName) - 1)); pStmt->ignoreNotExists = ignoreNotExists; return (SNode*)pStmt; } @@ -1444,6 +1445,14 @@ SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId return (SNode*)pStmt; } +SNode* createKillQueryStmt(SAstCreateContext* pCxt, const SToken* pQueryId) { + CHECK_PARSER_STATUS(pCxt); + SKillQueryStmt* pStmt = (SKillQueryStmt*)nodesMakeNode(QUERY_NODE_KILL_QUERY_STMT); + CHECK_OUT_OF_MEM(pStmt); + strncpy(pStmt->queryId, pQueryId->z, TMIN(pQueryId->n, sizeof(pStmt->queryId) - 1)); + return (SNode*)pStmt; +} + SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); SBalanceVgroupStmt* pStmt = (SBalanceVgroupStmt*)nodesMakeNode(QUERY_NODE_BALANCE_VGROUP_STMT); diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index a9d730e1ad..55ea7171fa 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -68,7 +68,7 @@ static SKeyword keywordTable[] = { {"CONTAINS", TK_CONTAINS}, {"DATABASE", TK_DATABASE}, {"DATABASES", TK_DATABASES}, - {"DAYS", TK_DAYS}, + // {"DAYS", TK_DAYS}, {"DBS", TK_DBS}, {"DELETE", TK_DELETE}, {"DESC", TK_DESC}, @@ -78,6 +78,7 @@ static SKeyword keywordTable[] = { {"DNODES", TK_DNODES}, {"DOUBLE", TK_DOUBLE}, {"DROP", TK_DROP}, + {"DURATION", TK_DURATION}, {"EXISTS", TK_EXISTS}, {"EXPLAIN", TK_EXPLAIN}, {"FILE_FACTOR", TK_FILE_FACTOR}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 52abeadac9..bfb58d2cd1 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -2839,6 +2839,9 @@ static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt if (TSDB_CODE_SUCCESS == code) { code = checTableFactorOption(pCxt, pStmt->pOptions->filesFactor); } + // if (TSDB_CODE_SUCCESS == code) { + // code = checkRangeOption(pCxt, "delay", pStmt->pOptions->delay, TSDB_MIN_ROLLUP_DELAY, TSDB_MAX_ROLLUP_DELAY); + // } if (TSDB_CODE_SUCCESS == code) { code = checkTableRollupOption(pCxt, pStmt->pOptions->pRollupFuncs); } @@ -3081,6 +3084,7 @@ static int32_t buildRollupAst(STranslateContext* pCxt, SCreateTableStmt* pStmt, static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStmt, SMCreateStbReq* pReq) { pReq->igExists = pStmt->ignoreExists; + // pReq->delay = pStmt->pOptions->delay; pReq->xFilesFactor = pStmt->pOptions->filesFactor; pReq->ttl = pStmt->pOptions->ttl; columnDefNodeToField(pStmt->pCols, &pReq->pColumns); @@ -3626,9 +3630,9 @@ static int32_t translateKillConnection(STranslateContext* pCxt, SKillStmt* pStmt return buildCmdMsg(pCxt, TDMT_MND_KILL_CONN, (FSerializeFunc)tSerializeSKillQueryReq, &killReq); } -static int32_t translateKillQuery(STranslateContext* pCxt, SKillStmt* pStmt) { +static int32_t translateKillQuery(STranslateContext* pCxt, SKillQueryStmt* pStmt) { SKillQueryReq killReq = {0}; - killReq.queryId = pStmt->targetId; + strcpy(killReq.queryStrId, pStmt->queryId); return buildCmdMsg(pCxt, TDMT_MND_KILL_QUERY, (FSerializeFunc)tSerializeSKillQueryReq, &killReq); } @@ -3970,7 +3974,7 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { code = translateKillConnection(pCxt, (SKillStmt*)pNode); break; case QUERY_NODE_KILL_QUERY_STMT: - code = translateKillQuery(pCxt, (SKillStmt*)pNode); + code = translateKillQuery(pCxt, (SKillQueryStmt*)pNode); break; case QUERY_NODE_KILL_TRANSACTION_STMT: code = translateKillTransaction(pCxt, (SKillStmt*)pNode); @@ -4793,6 +4797,7 @@ static int32_t buildDropTableVgroupHashmap(STranslateContext* pCxt, SDropTableCl if (TSDB_CODE_PAR_TABLE_NOT_EXIST == code && pClause->ignoreNotExists) { code = TSDB_CODE_SUCCESS; + goto over; } *pIsSuperTable = false; diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index b2de892f30..e81610c1b4 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -564,7 +564,7 @@ static const YYCODETYPE yy_lookahead[] = { /* 1260 */ 0, 0, 40, 0, 271, 72, 0, 47, 175, 175, /* 1270 */ 47, 47, 279, 310, 47, 0, 313, 314, 315, 316, /* 1280 */ 317, 318, 289, 320, 47, 47, 293, 243, 175, 0, - /* 1290 */ 175, 0, 47, 0, 47, 0, 243, 47, 0, 81, + /* 1290 */ 175, 0, 47, 0, 22, 0, 243, 47, 0, 81, /* 1300 */ 113, 160, 156, 310, 159, 0, 313, 314, 315, 316, /* 1310 */ 317, 318, 0, 320, 152, 271, 323, 151, 0, 356, /* 1320 */ 357, 328, 0, 279, 271, 44, 0, 0, 0, 0, @@ -693,7 +693,7 @@ static const unsigned short int yy_shift_ofst[] = { /* 310 */ 929, 931, 826, 875, 934, 952, 962, 965, 974, 976, /* 320 */ 859, 935, 1260, 1261, 1222, 1263, 1193, 1266, 1220, 1093, /* 330 */ 1223, 1224, 1227, 1094, 1275, 1237, 1238, 1113, 1289, 1115, - /* 340 */ 1291, 1245, 1293, 1247, 1295, 1250, 1298, 1218, 1141, 1145, + /* 340 */ 1291, 1245, 1293, 1272, 1295, 1250, 1298, 1218, 1141, 1145, /* 350 */ 1187, 1146, 1305, 1312, 1162, 1166, 1318, 1322, 1281, 1326, /* 360 */ 1327, 1328, 1329, 1330, 1331, 1334, 1335, 1336, 1338, 1339, /* 370 */ 1340, 1341, 1343, 1344, 1345, 1347, 1348, 1309, 1351, 1352, @@ -898,7 +898,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* BUFFER => nothing */ 0, /* CACHELAST => nothing */ 0, /* COMP => nothing */ - 0, /* DAYS => nothing */ + 0, /* DURATION => nothing */ 0, /* NK_VARIABLE => nothing */ 0, /* FSYNC => nothing */ 0, /* MAXROWS => nothing */ @@ -1225,7 +1225,7 @@ static const char *const yyTokenName[] = { /* 60 */ "BUFFER", /* 61 */ "CACHELAST", /* 62 */ "COMP", - /* 63 */ "DAYS", + /* 63 */ "DURATION", /* 64 */ "NK_VARIABLE", /* 65 */ "FSYNC", /* 66 */ "MAXROWS", @@ -1600,8 +1600,8 @@ static const char *const yyRuleName[] = { /* 68 */ "db_options ::= db_options BUFFER NK_INTEGER", /* 69 */ "db_options ::= db_options CACHELAST NK_INTEGER", /* 70 */ "db_options ::= db_options COMP NK_INTEGER", - /* 71 */ "db_options ::= db_options DAYS NK_INTEGER", - /* 72 */ "db_options ::= db_options DAYS NK_VARIABLE", + /* 71 */ "db_options ::= db_options DURATION NK_INTEGER", + /* 72 */ "db_options ::= db_options DURATION NK_VARIABLE", /* 73 */ "db_options ::= db_options FSYNC NK_INTEGER", /* 74 */ "db_options ::= db_options MAXROWS NK_INTEGER", /* 75 */ "db_options ::= db_options MINROWS NK_INTEGER", @@ -1783,7 +1783,7 @@ static const char *const yyRuleName[] = { /* 251 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", /* 252 */ "stream_options ::= stream_options WATERMARK duration_literal", /* 253 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 254 */ "cmd ::= KILL QUERY NK_INTEGER", + /* 254 */ "cmd ::= KILL QUERY NK_STRING", /* 255 */ "cmd ::= KILL TRANSACTION NK_INTEGER", /* 256 */ "cmd ::= BALANCE VGROUP", /* 257 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", @@ -2646,8 +2646,8 @@ static const struct { { 254, -3 }, /* (68) db_options ::= db_options BUFFER NK_INTEGER */ { 254, -3 }, /* (69) db_options ::= db_options CACHELAST NK_INTEGER */ { 254, -3 }, /* (70) db_options ::= db_options COMP NK_INTEGER */ - { 254, -3 }, /* (71) db_options ::= db_options DAYS NK_INTEGER */ - { 254, -3 }, /* (72) db_options ::= db_options DAYS NK_VARIABLE */ + { 254, -3 }, /* (71) db_options ::= db_options DURATION NK_INTEGER */ + { 254, -3 }, /* (72) db_options ::= db_options DURATION NK_VARIABLE */ { 254, -3 }, /* (73) db_options ::= db_options FSYNC NK_INTEGER */ { 254, -3 }, /* (74) db_options ::= db_options MAXROWS NK_INTEGER */ { 254, -3 }, /* (75) db_options ::= db_options MINROWS NK_INTEGER */ @@ -2829,7 +2829,7 @@ static const struct { { 305, -4 }, /* (251) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ { 305, -3 }, /* (252) stream_options ::= stream_options WATERMARK duration_literal */ { 240, -3 }, /* (253) cmd ::= KILL CONNECTION NK_INTEGER */ - { 240, -3 }, /* (254) cmd ::= KILL QUERY NK_INTEGER */ + { 240, -3 }, /* (254) cmd ::= KILL QUERY NK_STRING */ { 240, -3 }, /* (255) cmd ::= KILL TRANSACTION NK_INTEGER */ { 240, -2 }, /* (256) cmd ::= BALANCE VGROUP */ { 240, -4 }, /* (257) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ @@ -3326,8 +3326,8 @@ static YYACTIONTYPE yy_reduce( { yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_COMP, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 71: /* db_options ::= db_options DAYS NK_INTEGER */ - case 72: /* db_options ::= db_options DAYS NK_VARIABLE */ yytestcase(yyruleno==72); + case 71: /* db_options ::= db_options DURATION NK_INTEGER */ + case 72: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==72); { yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy632 = yylhsminor.yy632; break; @@ -3907,8 +3907,8 @@ static YYACTIONTYPE yy_reduce( case 253: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 254: /* cmd ::= KILL QUERY NK_INTEGER */ -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_QUERY_STMT, &yymsp[0].minor.yy0); } + case 254: /* cmd ::= KILL QUERY NK_STRING */ +{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; case 255: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 3a6c78d808..8b2c2aade7 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -46,7 +46,7 @@ TEST_F(ParserInitialCTest, createBnode) { * BUFFER value * | CACHELAST value * | COMP {0 | 1 | 2} - * | DAYS value + * | DURATION value * | FSYNC value * | MAXROWS value * | MINROWS value @@ -155,7 +155,7 @@ TEST_F(ParserInitialCTest, createDatabase) { ASSERT_EQ(req.replications, expect.replications); ASSERT_EQ(req.strict, expect.strict); ASSERT_EQ(req.cacheLastRow, expect.cacheLastRow); - //ASSERT_EQ(req.schemaless, expect.schemaless); + // ASSERT_EQ(req.schemaless, expect.schemaless); ASSERT_EQ(req.ignoreExist, expect.ignoreExist); ASSERT_EQ(req.numOfRetensions, expect.numOfRetensions); if (expect.numOfRetensions > 0) { @@ -202,7 +202,7 @@ TEST_F(ParserInitialCTest, createDatabase) { "BUFFER 64 " "CACHELAST 2 " "COMP 1 " - "DAYS 100 " + "DURATION 100 " "FSYNC 100 " "MAXROWS 1000 " "MINROWS 100 " @@ -223,7 +223,7 @@ TEST_F(ParserInitialCTest, createDatabase) { setDbDaysFunc(100); setDbKeepFunc(1440, 300 * 60, 400 * 1440); run("CREATE DATABASE IF NOT EXISTS wxy_db " - "DAYS 100m " + "DURATION 100m " "KEEP 1440m,300h,400d "); clearCreateDbReq(); } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 8502ffc04a..618ff9acc6 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -181,7 +181,7 @@ static int16_t getUnsetSlotId(const SArray* pSlotIdsInfo) { } static int32_t addDataBlockSlotsImpl(SPhysiPlanContext* pCxt, SNodeList* pList, SDataBlockDescNode* pDataBlockDesc, - const char* pStmtName, bool output, bool reserve) { + const char* pStmtName, bool output, bool reserve) { if (NULL == pList) { return TSDB_CODE_SUCCESS; } @@ -463,10 +463,24 @@ static int32_t createTagScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubpla return createScanPhysiNodeFinalize(pCxt, pSubplan, pScanLogicNode, (SScanPhysiNode*)pTagScan, pPhyNode); } +static ENodeType getScanOperatorType(EScanType scanType) { + switch (scanType) { + case SCAN_TYPE_TABLE: + return QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN; + case SCAN_TYPE_STREAM: + return QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN; + case SCAN_TYPE_TABLE_MERGE: + return QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN; + default: + break; + } + return QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN; +} + static int32_t createTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SScanLogicNode* pScanLogicNode, SPhysiNode** pPhyNode) { - STableScanPhysiNode* pTableScan = - (STableScanPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pScanLogicNode, QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN); + STableScanPhysiNode* pTableScan = (STableScanPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pScanLogicNode, + getScanOperatorType(pScanLogicNode->scanType)); if (NULL == pTableScan) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -528,12 +542,12 @@ static int32_t createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* static int32_t createStreamScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SScanLogicNode* pScanLogicNode, SPhysiNode** pPhyNode) { - int32_t res = createTableScanPhysiNode(pCxt, pSubplan, pScanLogicNode, pPhyNode); - if (res == TSDB_CODE_SUCCESS) { - ENodeType type = QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN; - setNodeType(*pPhyNode, type); - } - return res; + return createTableScanPhysiNode(pCxt, pSubplan, pScanLogicNode, pPhyNode); +} + +static int32_t createTableMergeScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, + SScanLogicNode* pScanLogicNode, SPhysiNode** pPhyNode) { + return createTableScanPhysiNode(pCxt, pSubplan, pScanLogicNode, pPhyNode); } static int32_t createScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SScanLogicNode* pScanLogicNode, @@ -547,6 +561,8 @@ static int32_t createScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, return createSystemTableScanPhysiNode(pCxt, pSubplan, pScanLogicNode, pPhyNode); case SCAN_TYPE_STREAM: return createStreamScanPhysiNode(pCxt, pSubplan, pScanLogicNode, pPhyNode); + case SCAN_TYPE_TABLE_MERGE: + return createTableMergeScanPhysiNode(pCxt, pSubplan, pScanLogicNode, pPhyNode); default: break; } diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index 4b372bb7d4..4c202d457f 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -170,8 +170,8 @@ static bool stbSplNeedSplit(bool streamQuery, SLogicNode* pNode) { switch (nodeType(pNode)) { case QUERY_NODE_LOGIC_PLAN_SCAN: return stbSplIsMultiTbScan(streamQuery, (SScanLogicNode*)pNode); - // case QUERY_NODE_LOGIC_PLAN_JOIN: - // return !(((SJoinLogicNode*)pNode)->isSingleTableJoin); + case QUERY_NODE_LOGIC_PLAN_JOIN: + return !(((SJoinLogicNode*)pNode)->isSingleTableJoin); case QUERY_NODE_LOGIC_PLAN_AGG: return !stbSplHasGatherExecFunc(((SAggLogicNode*)pNode)->pAggFuncs) && stbSplHasMultiTbScan(streamQuery, pNode); case QUERY_NODE_LOGIC_PLAN_WINDOW: { @@ -642,6 +642,8 @@ static int32_t stbSplSplitScanNodeForJoin(SSplitContext* pCxt, SLogicSubplan* pS code = nodesListMakeStrictAppend(&pSubplan->pChildren, (SNode*)splCreateScanSubplan(pCxt, (SLogicNode*)pScan, SPLIT_FLAG_STABLE_SPLIT)); } + pScan->scanType = SCAN_TYPE_TABLE_MERGE; + ++(pCxt->groupId); return code; } @@ -703,7 +705,6 @@ static int32_t stableSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan) { break; } - ++(pCxt->groupId); pCxt->split = true; return code; } diff --git a/tests/script/tsim/db/alter_option.sim b/tests/script/tsim/db/alter_option.sim index 12babea097..4692b9d91b 100644 --- a/tests/script/tsim/db/alter_option.sim +++ b/tests/script/tsim/db/alter_option.sim @@ -66,7 +66,7 @@ print ============= create database # | REPLICA value [1 | 3] # | WAL value [1 | 2] -sql create database db CACHELAST 3 COMP 0 DAYS 240 FSYNC 1000 MAXROWS 8000 MINROWS 10 KEEP 1000 PRECISION 'ns' REPLICA 3 WAL 2 VGROUPS 6 SINGLE_STABLE 1 +sql create database db CACHELAST 3 COMP 0 DURATION 240 FSYNC 1000 MAXROWS 8000 MINROWS 10 KEEP 1000 PRECISION 'ns' REPLICA 3 WAL 2 VGROUPS 6 SINGLE_STABLE 1 sql show databases print rows: $rows print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 diff --git a/tests/script/tsim/db/create_all_options.sim b/tests/script/tsim/db/create_all_options.sim index fac385a9a6..03068698e2 100644 --- a/tests/script/tsim/db/create_all_options.sim +++ b/tests/script/tsim/db/create_all_options.sim @@ -63,7 +63,7 @@ print ============= create database with all options # | PAGESIZE value [1~16384, default: 4] # | CACHELAST value [0, 1, 2, 3, default: 0] # | COMP [0 | 1 | 2, default: 2] -# | DAYS value [60m ~ min(3650d,keep), default: 10d, unit may be minut/hour/day] +# | DURATION value [60m ~ min(3650d,keep), default: 10d, unit may be minut/hour/day] # | FSYNC value [0 ~ 180000 ms, default: 3000] # | MAXROWS value [200~10000, default: 4096] # | MINROWS value [10~1000, default: 100] @@ -234,9 +234,9 @@ sql drop database db sql_error create database db COMP 3 sql_error create database db COMP -1 -#print ====> DAYS value [60m ~ min(3650d,keep), default: 10d, unit may be minut/hour/day] +#print ====> DURATION value [60m ~ min(3650d,keep), default: 10d, unit may be minut/hour/day] #print ====> KEEP value [max(1d ~ 365000d), default: 1d, unit may be minut/hour/day] -#sql create database db DAYS 60m KEEP 60m +#sql create database db DURATION 60m KEEP 60m #sql show databases #print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db #if $data6_db != 60 then @@ -246,7 +246,7 @@ sql_error create database db COMP -1 # return -1 #endi #sql drop database db -#sql create database db DAYS 60m KEEP 1d +#sql create database db DURATION 60m KEEP 1d #sql show databases #print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db #if $data6_db != 60 then @@ -255,7 +255,7 @@ sql_error create database db COMP -1 #if $data7_db != 1440,1440,1440 then # return -1 #endi -#sql create database db DAYS 3650d KEEP 365000d +#sql create database db DURATION 3650d KEEP 365000d #sql show databases #print $data0_db $data1_db $data2_db $data3_db $data4_db $data5_db $data6_db $data7_db $data8_db $data9_db $data10_db $data11_db $data12_db $data13_db $data14_db $data15_db $data16_db $data17_db #if $data6_db != 5256000 then @@ -265,10 +265,10 @@ sql_error create database db COMP -1 # return -1 #endi #sql drop database db -#sql_error create database db DAYS -59m -#sql_error create database db DAYS 59m -#sql_error create database db DAYS 5256001m -#sql_error create database db DAYS 3651d +#sql_error create database db DURATION -59m +#sql_error create database db DURATION 59m +#sql_error create database db DURATION 5256001m +#sql_error create database db DURATION 3651d #sql_error create database db KEEP -59m #sql_error create database db KEEP 14399m #sql_error create database db KEEP 525600001m From 893019d1062a96988fdc4d4b5be44ccdcab898d5 Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Wed, 15 Jun 2022 13:50:13 +0800 Subject: [PATCH 10/15] enh: record git commit id in log file; disable source code backup --- Jenkinsfile2 | 11 +++++++++++ tests/parallel_test/collect_cases.sh | 18 +++++++++--------- tests/parallel_test/run.sh | 6 +++--- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 79a7bab0c3..94af11868a 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -38,6 +38,7 @@ def pre_test(){ sh ''' hostname date + env ''' sh ''' cd ${WK} @@ -83,24 +84,32 @@ def pre_test(){ cd ${WKC} git pull >/dev/null git log -5 + echo "`date "+%Y%m%d-%H%M%S"` ${JOB_NAME}:${BRANCH_NAME}:${BUILD_ID}:${CHANGE_TARGET}" >>${WKDIR}/jenkins.log + echo "community log: `git log -5`" >>${WKDIR}/jenkins.log git fetch origin +refs/pull/${CHANGE_ID}/merge git checkout -qf FETCH_HEAD git log -5 + echo "community log merged: `git log -5`" >>${WKDIR}/jenkins.log cd ${WK} git pull >/dev/null git log -5 + echo "tdinternal log: `git log -5`" >>${WKDIR}/jenkins.log ''' } else if (env.CHANGE_URL =~ /\/TDinternal\//) { sh ''' cd ${WK} git pull >/dev/null git log -5 + echo "`date "+%Y%m%d-%H%M%S"` ${JOB_NAME}:${BRANCH_NAME}:${BUILD_ID}:${CHANGE_TARGET}" >>${WKDIR}/jenkins.log + echo "tdinternal log: `git log -5`" >>${WKDIR}/jenkins.log git fetch origin +refs/pull/${CHANGE_ID}/merge git checkout -qf FETCH_HEAD git log -5 + echo "tdinternal log merged: `git log -5`" >>${WKDIR}/jenkins.log cd ${WKC} git pull >/dev/null git log -5 + echo "community log: `git log -5`" >>${WKDIR}/jenkins.log ''' } else { sh ''' @@ -116,6 +125,8 @@ def pre_test(){ git reset --hard git pull git log -5 + echo "python connector log: `git log -5`" >>${WKDIR}/jenkins.log + echo >>${WKDIR}/jenkins.log ''' return 1 } diff --git a/tests/parallel_test/collect_cases.sh b/tests/parallel_test/collect_cases.sh index c12413b981..bc942263d0 100755 --- a/tests/parallel_test/collect_cases.sh +++ b/tests/parallel_test/collect_cases.sh @@ -42,15 +42,15 @@ cat ../script/jenkins/basic.txt |grep -v "^#"|grep -v "^$"|sed "s/^/,,script,/" grep "^python" ../system-test/fulltest.sh |sed "s/^/,,system-test,/" >>$case_file # tar source code for run.sh to use -if [ $ent -eq 0 ]; then - cd ../../../ - rm -rf TDengine.tar.gz - tar --exclude=TDengine/debug --exclude=TDengine/sim --exclude=TDengine/release -czf TDengine.tar.gz TDengine taos-connector-python -else - cd ../../../../ - rm -rf TDinternal.tar.gz - tar --exclude=TDinternal/debug --exclude=TDinternal/sim --exclude=TDinternal/community/debug --exclude=TDinternal/community/release --exclude=TDinternal/community/sim -czf TDinternal.tar.gz TDinternal taos-connector-python -fi +# if [ $ent -eq 0 ]; then +# cd ../../../ +# rm -rf TDengine.tar.gz +# tar --exclude=TDengine/debug --exclude=TDengine/sim --exclude=TDengine/release -czf TDengine.tar.gz TDengine taos-connector-python +# else +# cd ../../../../ +# rm -rf TDinternal.tar.gz +# tar --exclude=TDinternal/debug --exclude=TDinternal/sim --exclude=TDinternal/community/debug --exclude=TDinternal/community/release --exclude=TDinternal/community/sim -czf TDinternal.tar.gz TDinternal taos-connector-python +# fi exit 0 diff --git a/tests/parallel_test/run.sh b/tests/parallel_test/run.sh index 3b0c0da8cd..1b54dc338e 100755 --- a/tests/parallel_test/run.sh +++ b/tests/parallel_test/run.sh @@ -291,7 +291,7 @@ function run_thread() { fi cmd="$scpcmd:${remote_sim_tar} $log_dir/${case_file}.sim.tar.gz" $cmd - # backup source code + # backup source code (disabled) source_tar_dir=$log_dir/TDengine_${hosts[index]} source_tar_file=TDengine.tar.gz if [ $ent -ne 0 ]; then @@ -301,8 +301,8 @@ function run_thread() { mkdir $source_tar_dir 2>/dev/null if [ $? -eq 0 ]; then cmd="$scpcmd:${workdirs[index]}/$source_tar_file $source_tar_dir" - echo "$cmd" - $cmd + # echo "$cmd" + # $cmd fi fi done From f740fd61c673d44e663e336e883486ce55a4a1c3 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Wed, 15 Jun 2022 14:23:05 +0800 Subject: [PATCH 11/15] fix: use 'duration' instead of 'days' for create database --- tests/pytest/alter/alter_replica.py | 2 +- tests/pytest/functions/function_max.py | 2 +- tests/pytest/functions/function_min.py | 2 +- tests/pytest/functions/queryTestCases.py | 2 +- tests/pytest/insert/before_1970.py | 2 +- tests/pytest/insert/retentionpolicy.py | 2 +- .../multilevel/fileDistributionSameLevel.py | 4 +-- tests/pytest/multilevel/retentionTest.py | 2 +- tests/pytest/perfbenchmark/bug3433.py | 2 +- tests/pytest/perfbenchmark/joinPerformance.py | 2 +- tests/pytest/perfbenchmark/taosdemoInsert.py | 2 +- tests/pytest/query/query1970YearsAf.py | 2 +- .../taosdemoTestSupportNanoInsert.py | 2 +- .../taosdemoTestSupportNanoInsert.py | 2 +- tests/pytest/tools/taosdumpTest.py | 6 ++-- tests/pytest/tools/taosdumpTestNanoSupport.py | 2 +- tests/pytest/update/merge_commit_data-0.py | 2 +- tests/pytest/update/merge_commit_data.py | 2 +- tests/pytest/update/merge_commit_data2.py | 2 +- .../update/merge_commit_data2_update0.py | 2 +- tests/pytest/update/merge_commit_last.py | 2 +- tests/pytest/util/sql.py | 2 +- tests/pytest/util/taosdemoCfg.py | 2 +- tests/script/general/db/alter_option.sim | 16 +++++----- tests/script/general/db/backup/keep.sim | 4 +-- tests/script/general/db/topic1.sim | 30 +++++++++---------- tests/script/general/import/commit.sim | 4 +-- tests/script/general/import/replica1.sim | 2 +- tests/script/general/parser/alter.sim | 2 +- .../parser/alter__for_community_version.sim | 2 +- tests/script/general/parser/create_db.sim | 6 ++-- .../create_db__for_community_version.sim | 6 ++-- tests/script/tsim/db/alter_option.sim | 14 ++++----- tests/script/tsim/db/basic6.sim | 4 +-- tests/script/tsim/db/create_all_options.sim | 4 +-- tests/script/tsim/insert/commit-merge0.sim | 2 +- tests/script/tsim/query/interval-offset.sim | 2 +- tests/script/tsim/stable/alter_count.sim | 2 +- tests/script/tsim/stable/alter_import.sim | 2 +- tests/script/unique/db/commit.sim | 2 +- tests/script/unique/import/replica2.sim | 2 +- tests/script/unique/import/replica3.sim | 2 +- tests/script/windows/db/basic.sim | 4 +-- tests/system-test/0-others/udfTest.py | 2 +- tests/system-test/0-others/udf_cluster.py | 2 +- tests/system-test/0-others/udf_create.py | 2 +- .../system-test/0-others/udf_restart_taosd.py | 2 +- tests/system-test/2-query/abs.py | 2 +- tests/system-test/2-query/sample.py | 2 +- tests/system-test/6-cluster/5dnode1mnode.py | 2 +- tests/system-test/6-cluster/5dnode2mnode.py | 4 +-- .../system-test/6-cluster/5dnode3mnodeDrop.py | 2 +- .../system-test/6-cluster/5dnode3mnodeStop.py | 2 +- .../6-cluster/5dnode3mnodeStopInsert.py | 2 +- 54 files changed, 94 insertions(+), 94 deletions(-) diff --git a/tests/pytest/alter/alter_replica.py b/tests/pytest/alter/alter_replica.py index 6cf0f65825..10047362db 100644 --- a/tests/pytest/alter/alter_replica.py +++ b/tests/pytest/alter/alter_replica.py @@ -42,7 +42,7 @@ class TDTestCase: tdDnodes.start(3) def run(self): - tdSql.execute('create database db replica 3 days 7') + tdSql.execute('create database db replica 3 duration 7') tdSql.execute('use db') for tid in range(1, 11): tdSql.execute('create table tb%d(ts timestamp, i int)' % tid) diff --git a/tests/pytest/functions/function_max.py b/tests/pytest/functions/function_max.py index c322b6af26..a53daa11d6 100644 --- a/tests/pytest/functions/function_max.py +++ b/tests/pytest/functions/function_max.py @@ -83,7 +83,7 @@ class TDTestCase: tdSql.checkData(0, 0, np.max(floatData)) # test case: https://jira.taosdata.com:18080/browse/TD-2583 - tdSql.execute("create database test days 2") + tdSql.execute("create database test duration 2") tdSql.execute("create table car(ts timestamp, speed int)") tdSql.execute("insert into car values(now, -1)") tdSql.execute("insert into car values(now-10d, null)") diff --git a/tests/pytest/functions/function_min.py b/tests/pytest/functions/function_min.py index b4d6d58f7c..db865e5ac7 100644 --- a/tests/pytest/functions/function_min.py +++ b/tests/pytest/functions/function_min.py @@ -83,7 +83,7 @@ class TDTestCase: tdSql.checkData(0, 0, np.min(floatData)) # test case: https://jira.taosdata.com:18080/browse/TD-2583 - tdSql.execute("create database test days 2") + tdSql.execute("create database test duration 2") tdSql.execute("create table car(ts timestamp, speed int)") tdSql.execute("insert into car values(now, 1)") tdSql.execute("insert into car values(now-10d, null)") diff --git a/tests/pytest/functions/queryTestCases.py b/tests/pytest/functions/queryTestCases.py index 1311ad6b3c..96de8f064c 100644 --- a/tests/pytest/functions/queryTestCases.py +++ b/tests/pytest/functions/queryTestCases.py @@ -264,7 +264,7 @@ class TDTestCase: def td4288(self): tdLog.printNoPrefix("==========TD-4288==========") - # keep ~ [days,365000] + # keep ~ [duration,365000] tdSql.execute("drop database if exists db") tdSql.execute("create database if not exists db") tdSql.query("show variables") diff --git a/tests/pytest/insert/before_1970.py b/tests/pytest/insert/before_1970.py index b2c4dc57c7..ca2b4f165f 100644 --- a/tests/pytest/insert/before_1970.py +++ b/tests/pytest/insert/before_1970.py @@ -32,7 +32,7 @@ class TDTestCase: print("==============step1") tdSql.execute("create database if not exists demo keep 36500;"); - print("==============create db demo keep 365000 days") + print("==============create db demo keep 365000 duration") tdSql.execute("use demo;") tdSql.execute("CREATE table if not exists test (ts timestamp, f1 int);") print("==============create table test") diff --git a/tests/pytest/insert/retentionpolicy.py b/tests/pytest/insert/retentionpolicy.py index 607ee26a59..78e5c08c8b 100644 --- a/tests/pytest/insert/retentionpolicy.py +++ b/tests/pytest/insert/retentionpolicy.py @@ -51,7 +51,7 @@ class TDTestRetetion: def run(self): tdLog.info("=============== step1") - tdSql.execute('create database test keep 3 days 1;') + tdSql.execute('create database test keep 3 duration 1;') tdSql.execute('use test;') tdSql.execute('create table test(ts timestamp,i int);') diff --git a/tests/pytest/multilevel/fileDistributionSameLevel.py b/tests/pytest/multilevel/fileDistributionSameLevel.py index 83ce856717..64b29914b7 100644 --- a/tests/pytest/multilevel/fileDistributionSameLevel.py +++ b/tests/pytest/multilevel/fileDistributionSameLevel.py @@ -66,7 +66,7 @@ class TDTestCase: tdDnodes.deploy(1,cfg) tdDnodes.startWithoutSleep(1) - tdSql.execute("create database test days 1") + tdSql.execute("create database test duration 1") tdSql.execute("use test") tdSql.execute("create table stb(ts timestamp, c int) tags(t int)") @@ -85,7 +85,7 @@ class TDTestCase: tdLog.info("================= step3") tdSql.execute('drop database test') for i in range(50): - tdSql.execute("create database test%d days 1" %(i)) + tdSql.execute("create database test%d duration 1" %(i)) tdSql.execute("use test%d" %(i)) tdSql.execute("create table tb (ts timestamp,i int)") for j in range(10): diff --git a/tests/pytest/multilevel/retentionTest.py b/tests/pytest/multilevel/retentionTest.py index 9ea59d9d59..94d268f257 100644 --- a/tests/pytest/multilevel/retentionTest.py +++ b/tests/pytest/multilevel/retentionTest.py @@ -56,7 +56,7 @@ class TDTestCase: tdDnodes.deploy(1,cfg) tdDnodes.startWithoutSleep(1) - tdSql.execute("create database test days 1 keep 15,5,10") + tdSql.execute("create database test duration 1 keep 15,5,10") tdSql.execute("use test") tdSql.execute("create table tb(ts timestamp, c int)") diff --git a/tests/pytest/perfbenchmark/bug3433.py b/tests/pytest/perfbenchmark/bug3433.py index e4480df6b6..d688dd0310 100644 --- a/tests/pytest/perfbenchmark/bug3433.py +++ b/tests/pytest/perfbenchmark/bug3433.py @@ -66,7 +66,7 @@ class TDTestCase: "name": "db", "drop": "yes", "replica": 1, - "days": 10, + "duration": 10, "cache": 16, "blocks": 8, "precision": "ms", diff --git a/tests/pytest/perfbenchmark/joinPerformance.py b/tests/pytest/perfbenchmark/joinPerformance.py index acd4f88c9b..2de5818c59 100644 --- a/tests/pytest/perfbenchmark/joinPerformance.py +++ b/tests/pytest/perfbenchmark/joinPerformance.py @@ -81,7 +81,7 @@ class JoinPerf: "name": self.dbname, "drop": self.drop, "replica": 1, - "days": 10, + "duration": 10, "cache": 16, "blocks": 8, "precision": "ms", diff --git a/tests/pytest/perfbenchmark/taosdemoInsert.py b/tests/pytest/perfbenchmark/taosdemoInsert.py index 59a8143d5a..37191b2624 100644 --- a/tests/pytest/perfbenchmark/taosdemoInsert.py +++ b/tests/pytest/perfbenchmark/taosdemoInsert.py @@ -75,7 +75,7 @@ class Taosdemo: "name": self.dbname, "drop": self.drop, "replica": 1, - "days": 10, + "duration": 10, "cache": 16, "blocks": 8, "precision": "ms", diff --git a/tests/pytest/query/query1970YearsAf.py b/tests/pytest/query/query1970YearsAf.py index a365369b21..c78324ff5c 100644 --- a/tests/pytest/query/query1970YearsAf.py +++ b/tests/pytest/query/query1970YearsAf.py @@ -57,7 +57,7 @@ class TDTestCase: "name": "db", "drop": "yes", "replica": 1, - "days": 10, + "duration": 10, "cache": 16, "blocks": 8, "precision": "ms", diff --git a/tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py b/tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py index f069bb8f70..518f46b5e6 100644 --- a/tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py +++ b/tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py @@ -138,7 +138,7 @@ class TDTestCase: sqls_ls = [ 'drop database if exists nsdbsql;', - 'create database nsdbsql precision "ns" keep 3600 days 6 update 1;', + 'create database nsdbsql precision "ns" keep 3600 duration 6 update 1;', 'use nsdbsql;', 'CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);', 'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);', diff --git a/tests/pytest/tools/taosdemoAllTest/taosdemoTestSupportNanoInsert.py b/tests/pytest/tools/taosdemoAllTest/taosdemoTestSupportNanoInsert.py index c3fdff00ec..7781a3d3d4 100644 --- a/tests/pytest/tools/taosdemoAllTest/taosdemoTestSupportNanoInsert.py +++ b/tests/pytest/tools/taosdemoAllTest/taosdemoTestSupportNanoInsert.py @@ -125,7 +125,7 @@ class TDTestCase: tdSql.checkData(0, 0, 600) # check taosdemo -s - sqls_ls = ['drop database if exists nsdbsql;','create database nsdbsql precision "ns" keep 36 days 6 update 1;', + sqls_ls = ['drop database if exists nsdbsql;','create database nsdbsql precision "ns" keep 36 duration 6 update 1;', 'use nsdbsql;','CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);', 'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);', 'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 10.2, 219, 0.32);', diff --git a/tests/pytest/tools/taosdumpTest.py b/tests/pytest/tools/taosdumpTest.py index 0dfc42f331..bc31b9fbcc 100644 --- a/tests/pytest/tools/taosdumpTest.py +++ b/tests/pytest/tools/taosdumpTest.py @@ -60,8 +60,8 @@ class TDTestCase: if not os.path.exists("./taosdumptest/tmp2"): os.makedirs("./taosdumptest/tmp2") tdSql.execute("drop database if exists db") - tdSql.execute("create database db days 11 keep 3649 blocks 8 ") - tdSql.execute("create database db1 days 12 keep 3640 blocks 7 ") + tdSql.execute("create database db duration 11 keep 3649 blocks 8 ") + tdSql.execute("create database db1 duration 12 keep 3640 blocks 7 ") tdSql.execute("use db") tdSql.execute( "create table st(ts timestamp, c1 int, c2 nchar(10)) tags(t1 int, t2 binary(10))") @@ -102,7 +102,7 @@ class TDTestCase: tdSql.query("show databases") tdSql.checkRows(2) dbresult = tdSql.queryResult - # 6--days,7--keep0,keep1,keep, 12--block, + # 6--duration,7--keep0,keep1,keep, 12--block, isCommunity = self.checkCommunity() print("iscommunity: %d" % isCommunity) diff --git a/tests/pytest/tools/taosdumpTestNanoSupport.py b/tests/pytest/tools/taosdumpTestNanoSupport.py index 55f1671daa..0101a65407 100644 --- a/tests/pytest/tools/taosdumpTestNanoSupport.py +++ b/tests/pytest/tools/taosdumpTestNanoSupport.py @@ -60,7 +60,7 @@ class TDTestCase: def build_db(precision, start_time): tdSql.execute("drop database if exists timedb1") tdSql.execute( - "create database timedb1 days 10 keep 365 blocks 8 precision "+"\""+precision+"\"") + "create database timedb1 duration 10 keep 365 blocks 8 precision "+"\""+precision+"\"") tdSql.execute("use timedb1") tdSql.execute( diff --git a/tests/pytest/update/merge_commit_data-0.py b/tests/pytest/update/merge_commit_data-0.py index 14d435f7f2..6f7951b16a 100644 --- a/tests/pytest/update/merge_commit_data-0.py +++ b/tests/pytest/update/merge_commit_data-0.py @@ -30,7 +30,7 @@ class TDTestCase: tdSql.execute(s) s = 'drop database if exists db' tdSql.execute(s) - s = 'create database db days 30' + s = 'create database db duration 30' tdSql.execute(s) s = 'use db' tdSql.execute(s) diff --git a/tests/pytest/update/merge_commit_data.py b/tests/pytest/update/merge_commit_data.py index 4fb6765361..0b18071179 100644 --- a/tests/pytest/update/merge_commit_data.py +++ b/tests/pytest/update/merge_commit_data.py @@ -30,7 +30,7 @@ class TDTestCase: tdSql.execute(s) s = 'drop database if exists db' tdSql.execute(s) - s = 'create database db update 1 days 30' + s = 'create database db update 1 duration 30' tdSql.execute(s) s = 'use db' tdSql.execute(s) diff --git a/tests/pytest/update/merge_commit_data2.py b/tests/pytest/update/merge_commit_data2.py index a334f39e86..034d9b9913 100644 --- a/tests/pytest/update/merge_commit_data2.py +++ b/tests/pytest/update/merge_commit_data2.py @@ -50,7 +50,7 @@ class TDTestCase: tdSql.execute(sql) sql = 'drop database if exists db' tdSql.execute(sql) - sql = 'create database db update 1 days 30;' + sql = 'create database db update 1 duration 30;' tdSql.execute(sql) sql = 'use db;' tdSql.execute(sql) diff --git a/tests/pytest/update/merge_commit_data2_update0.py b/tests/pytest/update/merge_commit_data2_update0.py index def50e0466..824f085630 100644 --- a/tests/pytest/update/merge_commit_data2_update0.py +++ b/tests/pytest/update/merge_commit_data2_update0.py @@ -49,7 +49,7 @@ class TDTestCase: tdSql.execute(sql) sql = 'drop database if exists db' tdSql.execute(sql) - sql = 'create database db update 0 days 30;' + sql = 'create database db update 0 duration 30;' tdSql.execute(sql) sql = 'use db;' tdSql.execute(sql) diff --git a/tests/pytest/update/merge_commit_last.py b/tests/pytest/update/merge_commit_last.py index 183cca0a1e..2e268e4e9e 100644 --- a/tests/pytest/update/merge_commit_last.py +++ b/tests/pytest/update/merge_commit_last.py @@ -34,7 +34,7 @@ class TDTestCase: def run(self): tdSql.prepare() - tdSql.execute("create database udb update 1 days 30") + tdSql.execute("create database udb update 1 duration 30") tdSql.execute("use udb") print("==============step 1: UPDATE THE LAST RECORD REPEATEDLY") diff --git a/tests/pytest/util/sql.py b/tests/pytest/util/sql.py index bdda7c453b..79983f97d0 100644 --- a/tests/pytest/util/sql.py +++ b/tests/pytest/util/sql.py @@ -57,7 +57,7 @@ class TDSql: tdLog.notice("'reset query cache' is not supported") s = 'drop database if exists db' self.cursor.execute(s) - s = 'create database db days 300' + s = 'create database db duration 300' self.cursor.execute(s) s = 'use db' self.cursor.execute(s) diff --git a/tests/pytest/util/taosdemoCfg.py b/tests/pytest/util/taosdemoCfg.py index d211f86b81..7523a80898 100644 --- a/tests/pytest/util/taosdemoCfg.py +++ b/tests/pytest/util/taosdemoCfg.py @@ -63,7 +63,7 @@ class TDTaosdemoCfg: "name": 'db', "drop": 'yes', "replica": 1, - "days": 10, + "duration": 10, "cache": 16, "blocks": 6, "precision": "ms", diff --git a/tests/script/general/db/alter_option.sim b/tests/script/general/db/alter_option.sim index 36f4c0e7dc..89a32b5a5c 100644 --- a/tests/script/general/db/alter_option.sim +++ b/tests/script/general/db/alter_option.sim @@ -9,7 +9,7 @@ sleep 2000 sql connect print ============= create database -sql create database db cache 2 blocks 4 days 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1 +sql create database db cache 2 blocks 4 duration 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1 sql show databases if $data00 != db then return -1 @@ -87,13 +87,13 @@ sql_error alter database db quorum 4 sql_error alter database db quorum 5 sql_error alter database db quorum -1 -print ============== step days -sql_error alter database db days 0 -sql_error alter database db days 1 -sql_error alter database db days 2 -sql_error alter database db days 10 -sql_error alter database db days 50 -sql_error alter database db days 100 +print ============== step duration +sql_error alter database db duration 0 +sql_error alter database db duration 1 +sql_error alter database db duration 2 +sql_error alter database db duration 10 +sql_error alter database db duration 50 +sql_error alter database db duration 100 print ============== step keep sql show databases diff --git a/tests/script/general/db/backup/keep.sim b/tests/script/general/db/backup/keep.sim index 4d157b3985..626040e347 100644 --- a/tests/script/general/db/backup/keep.sim +++ b/tests/script/general/db/backup/keep.sim @@ -26,7 +26,7 @@ system sh/exec.sh -n dnode2 -s start sleep 2000 print ======== step1 create db -sql create database keepdb replica 1 keep 30 days 7 +sql create database keepdb replica 1 keep 30 duration 7 sql use keepdb sql create table tb (ts timestamp, i int) @@ -201,7 +201,7 @@ sql alter database keepdb keep 0 -x error2 return -1 error2: -sql alter database keepdb days 1 -x error3 +sql alter database keepdb duration 1 -x error3 return -1 error3: diff --git a/tests/script/general/db/topic1.sim b/tests/script/general/db/topic1.sim index 1639973120..b5058e8f9b 100644 --- a/tests/script/general/db/topic1.sim +++ b/tests/script/general/db/topic1.sim @@ -171,7 +171,7 @@ sql_error create topic t1 partitions -1; sql_error create topic t1 partitions 10001; print =============step3 create with db para -sql create topic db cache 2 blocks 4 days 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1 +sql create topic db cache 2 blocks 4 duration 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1 sql show databases if $data00 != db then return -1 @@ -199,7 +199,7 @@ if $data09 != 4 then endi sql drop topic db; -sql create topic db cache 2 blocks 4 days 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1 partitions 7 +sql create topic db cache 2 blocks 4 duration 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1 partitions 7 sql show databases if $data00 != db then return -1 @@ -334,19 +334,19 @@ sql_error alter topic db quorum 4 sql_error alter topic db quorum 5 sql_error alter topic db quorum -1 -print ============== step days -sql_error alter database db days 0 -sql_error alter database db days 1 -sql_error alter database db days 2 -sql_error alter database db days 10 -sql_error alter database db days 50 -sql_error alter database db days 100 -sql_error alter topic db days 0 -sql_error alter topic db days 1 -sql_error alter topic db days 2 -sql_error alter topic db days 10 -sql_error alter topic db days 50 -sql_error alter topic db days 100 +print ============== step duration +sql_error alter database db duration 0 +sql_error alter database db duration 1 +sql_error alter database db duration 2 +sql_error alter database db duration 10 +sql_error alter database db duration 50 +sql_error alter database db duration 100 +sql_error alter topic db duration 0 +sql_error alter topic db duration 1 +sql_error alter topic db duration 2 +sql_error alter topic db duration 10 +sql_error alter topic db duration 50 +sql_error alter topic db duration 100 print ============== step keep sql show databases diff --git a/tests/script/general/import/commit.sim b/tests/script/general/import/commit.sim index 3b4055d712..aefc724fdb 100644 --- a/tests/script/general/import/commit.sim +++ b/tests/script/general/import/commit.sim @@ -30,7 +30,7 @@ sleep 2000 sql connect print ========= step1 -sql create database ic1db days 7; +sql create database ic1db duration 7; sql create table ic1db.tb(ts timestamp, s int); sql insert into ic1db.tb values(now-30d, -30); sql insert into ic1db.tb values(now-20d, -20); @@ -50,7 +50,7 @@ if $rows != 12 then endi print ========= step2 -sql create database ic2db days 7; +sql create database ic2db duration 7; sql create table ic2db.tb(ts timestamp, s int); sql insert into ic2db.tb values(now, 0); sql import into ic2db.tb values(now-30d, -30); diff --git a/tests/script/general/import/replica1.sim b/tests/script/general/import/replica1.sim index 48d5455b79..1e8eabb798 100644 --- a/tests/script/general/import/replica1.sim +++ b/tests/script/general/import/replica1.sim @@ -30,7 +30,7 @@ system sh/exec.sh -n dnode1 -s start sleep 2000 sql connect -sql create database ir1db days 7 +sql create database ir1db duration 7 sql use ir1db sql create table tb(ts timestamp, i bigint) diff --git a/tests/script/general/parser/alter.sim b/tests/script/general/parser/alter.sim index d1a4702a69..78c1a3029a 100644 --- a/tests/script/general/parser/alter.sim +++ b/tests/script/general/parser/alter.sim @@ -20,7 +20,7 @@ $db = $dbPrefix . $i $mt = $mtPrefix . $i sql drop database if exists $db -sql create database $db days 10 keep 20,20,20 +sql create database $db duration 10 keep 20,20,20 sql use $db sql_error alter database $db keep "20" diff --git a/tests/script/general/parser/alter__for_community_version.sim b/tests/script/general/parser/alter__for_community_version.sim index f55fb812a7..7a9a970822 100644 --- a/tests/script/general/parser/alter__for_community_version.sim +++ b/tests/script/general/parser/alter__for_community_version.sim @@ -20,7 +20,7 @@ $db = $dbPrefix . $i $mt = $mtPrefix . $i sql drop database if exists $db -sql create database $db days 10 keep 20 +sql create database $db duration 10 keep 20 sql use $db sql show databases if $rows != 1 then diff --git a/tests/script/general/parser/create_db.sim b/tests/script/general/parser/create_db.sim index a62a45e023..040331ec4f 100644 --- a/tests/script/general/parser/create_db.sim +++ b/tests/script/general/parser/create_db.sim @@ -101,7 +101,7 @@ print db_already_exists test passed print create_db.sim case5: db_meta_data test # cfg params $replica = 1 # max=3 -$days = 10 +$duration = 10 $keep = 365,365,365 $rows_db = 1000 $cache = 16 # 16MB @@ -111,7 +111,7 @@ $ctime = 36000 # 10 hours $wal = 1 # valid value is 1, 2 $comp = 1 # max=32, automatically trimmed when exceeding -sql create database $db replica $replica days $days keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp +sql create database $db replica $replica duration $duration keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp sql show databases if $rows != 1 then return -1 @@ -122,7 +122,7 @@ endi if $data04 != $replica then return -1 endi -if $data06 != $days then +if $data06 != $duration then return -1 endi if $data07 != 365,365,365 then diff --git a/tests/script/general/parser/create_db__for_community_version.sim b/tests/script/general/parser/create_db__for_community_version.sim index 406e69b0e6..5dc4263d5d 100644 --- a/tests/script/general/parser/create_db__for_community_version.sim +++ b/tests/script/general/parser/create_db__for_community_version.sim @@ -101,7 +101,7 @@ print db_already_exists test passed print create_db.sim case5: db_meta_data test # cfg params $replica = 1 # max=3 -$days = 10 +$duration = 10 $keep = 365 $rows_db = 1000 $cache = 16 # 16MB @@ -111,7 +111,7 @@ $ctime = 36000 # 10 hours $wal = 1 # valid value is 1, 2 $comp = 1 # max=32, automatically trimmed when exceeding -sql create database $db replica $replica days $days keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp +sql create database $db replica $replica duration $duration keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp sql show databases if $rows != 1 then return -1 @@ -122,7 +122,7 @@ endi if $data04 != $replica then return -1 endi -if $data06 != $days then +if $data06 != $duration then return -1 endi if $data07 != 365 then diff --git a/tests/script/tsim/db/alter_option.sim b/tests/script/tsim/db/alter_option.sim index 4692b9d91b..4351ee5cb1 100644 --- a/tests/script/tsim/db/alter_option.sim +++ b/tests/script/tsim/db/alter_option.sim @@ -62,7 +62,7 @@ print ============= create database # | PAGES value [64~16384, default: 256] # | CACHELAST value [0, 1, 2, 3] # | FSYNC value [0 ~ 180000 ms] -# | KEEP value [days, 365000] +# | KEEP value [duration, 365000] # | REPLICA value [1 | 3] # | WAL value [1 | 2] @@ -92,7 +92,7 @@ endi if $data5_db != no_strict then # strict return -1 endi -if $data6_db != 345600 then # days +if $data6_db != 345600 then # duration return -1 endi if $data7_db != 1440000m,1440000m,1440000m then # keep @@ -222,11 +222,11 @@ sql_error alter database db replica 0 #sql_error alter database db quorum 4 #sql_error alter database db quorum 5 -#print ============== modify days -sql_error alter database db days 480 -sql_error alter database db days 360 -sql_error alter database db days 0 -sql_error alter database db days 14400 # set over than keep +#print ============== modify duration +sql_error alter database db duration 480 +sql_error alter database db duration 360 +sql_error alter database db duration 0 +sql_error alter database db duration 14400 # set over than keep print ============== modify keep sql alter database db keep 2400 diff --git a/tests/script/tsim/db/basic6.sim b/tests/script/tsim/db/basic6.sim index 142460f214..64103b5dac 100644 --- a/tests/script/tsim/db/basic6.sim +++ b/tests/script/tsim/db/basic6.sim @@ -15,7 +15,7 @@ $tb = $tbPrefix . $i print =============== step1 # quorum presicion -sql create database $db vgroups 8 replica 1 days 2 keep 10 minrows 80 maxrows 10000 wal 2 fsync 1000 comp 0 cachelast 2 precision 'us' +sql create database $db vgroups 8 replica 1 duration 2 keep 10 minrows 80 maxrows 10000 wal 2 fsync 1000 comp 0 cachelast 2 precision 'us' sql show databases print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 @@ -66,7 +66,7 @@ print =============== step4 sql_error drop database $db print =============== step5 -sql create database $db replica 1 days 15 keep 1500 +sql create database $db replica 1 duration 15 keep 1500 sql show databases print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 if $data20 != $db then diff --git a/tests/script/tsim/db/create_all_options.sim b/tests/script/tsim/db/create_all_options.sim index 03068698e2..284875ee08 100644 --- a/tests/script/tsim/db/create_all_options.sim +++ b/tests/script/tsim/db/create_all_options.sim @@ -79,7 +79,7 @@ print ============= create database with all options #$data2_db : vgroups #$data3_db : ntables #$data4_db : replica -#$data6_db : days +#$data6_db : duration #$data7_db : keep #$data10_db : minrows #$data11_db : maxrows @@ -113,7 +113,7 @@ endi if $data5_db != no_strict then # strict return -1 endi -if $data6_db != 14400 then # days +if $data6_db != 14400 then # duration return -1 endi if $data7_db != 5256000m,5256000m,5256000m then # keep diff --git a/tests/script/tsim/insert/commit-merge0.sim b/tests/script/tsim/insert/commit-merge0.sim index adbd1904b2..56e818654f 100644 --- a/tests/script/tsim/insert/commit-merge0.sim +++ b/tests/script/tsim/insert/commit-merge0.sim @@ -5,7 +5,7 @@ sleep 50 sql connect print =============== create database -sql create database db days 300 keep 365000d,365000d,365000d +sql create database db duration 300 keep 365000d,365000d,365000d sql show databases if $rows != 3 then return -1 diff --git a/tests/script/tsim/query/interval-offset.sim b/tests/script/tsim/query/interval-offset.sim index dcd88e5a0c..ab6ee79d6e 100644 --- a/tests/script/tsim/query/interval-offset.sim +++ b/tests/script/tsim/query/interval-offset.sim @@ -5,7 +5,7 @@ sleep 500 sql connect print =============== create database -sql create database d0 days 300 +sql create database d0 duration 300 sql use d0 print =============== create super table and child table diff --git a/tests/script/tsim/stable/alter_count.sim b/tests/script/tsim/stable/alter_count.sim index e5af9a5735..eca8ca1559 100644 --- a/tests/script/tsim/stable/alter_count.sim +++ b/tests/script/tsim/stable/alter_count.sim @@ -6,7 +6,7 @@ system sh/exec.sh -n dnode1 -s start sql connect print ======== step1 -sql create database d1 replica 1 days 7 keep 50 +sql create database d1 replica 1 duration 7 keep 50 sql use d1 sql create table tb (ts timestamp, a int) sql insert into tb values(now-28d, -28) diff --git a/tests/script/tsim/stable/alter_import.sim b/tests/script/tsim/stable/alter_import.sim index cdd7b60e14..b968eb6a12 100644 --- a/tests/script/tsim/stable/alter_import.sim +++ b/tests/script/tsim/stable/alter_import.sim @@ -6,7 +6,7 @@ system sh/exec.sh -n dnode1 -s start sql connect print ======== step1 -sql create database d1 replica 1 days 7 keep 50 +sql create database d1 replica 1 duration 7 keep 50 sql use d1 sql create table tb (ts timestamp, a int) sql insert into tb values(now-30d, -28) diff --git a/tests/script/unique/db/commit.sim b/tests/script/unique/db/commit.sim index 661dd4505f..74c1366afb 100644 --- a/tests/script/unique/db/commit.sim +++ b/tests/script/unique/db/commit.sim @@ -24,7 +24,7 @@ system sh/exec.sh -n dnode2 -s start sleep 2000 print ======== step1 create db -sql create database commitdb replica 1 days 7 keep 30 +sql create database commitdb replica 1 duration 7 keep 30 sql use commitdb sql create table tb (ts timestamp, i int) diff --git a/tests/script/unique/import/replica2.sim b/tests/script/unique/import/replica2.sim index 54ce28543e..387567fc82 100644 --- a/tests/script/unique/import/replica2.sim +++ b/tests/script/unique/import/replica2.sim @@ -52,7 +52,7 @@ if $data4_2 != ready then goto step1 endi -sql create database ir2db replica 2 days 7 +sql create database ir2db replica 2 duration 7 sql use ir2db sql create table tb(ts timestamp, i bigint) diff --git a/tests/script/unique/import/replica3.sim b/tests/script/unique/import/replica3.sim index 5da9e141a5..5c1b8b8932 100644 --- a/tests/script/unique/import/replica3.sim +++ b/tests/script/unique/import/replica3.sim @@ -58,7 +58,7 @@ if $data4_3 != ready then goto step1 endi -sql create database ir3db replica 3 days 7 +sql create database ir3db replica 3 duration 7 sql use ir3db sql create table tb(ts timestamp, i bigint) diff --git a/tests/script/windows/db/basic.sim b/tests/script/windows/db/basic.sim index 914e456fe1..1f0fc31a6b 100644 --- a/tests/script/windows/db/basic.sim +++ b/tests/script/windows/db/basic.sim @@ -17,7 +17,7 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i print =============== step1 -sql create database $db replica 1 days 20 keep 2000 cache 16 +sql create database $db replica 1 duration 20 keep 2000 cache 16 sql show databases print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 if $data00 != $db then @@ -57,7 +57,7 @@ print =============== step4 sql_error drop database $db print =============== step5 -sql create database $db replica 1 days 15 keep 1500 +sql create database $db replica 1 duration 15 keep 1500 sql show databases print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 if $data00 != $db then diff --git a/tests/system-test/0-others/udfTest.py b/tests/system-test/0-others/udfTest.py index 57ae1c1490..9b145e9093 100644 --- a/tests/system-test/0-others/udfTest.py +++ b/tests/system-test/0-others/udfTest.py @@ -60,7 +60,7 @@ class TDTestCase: def prepare_data(self): tdSql.execute("drop database if exists db ") - tdSql.execute("create database if not exists db days 300") + tdSql.execute("create database if not exists db duration 300") tdSql.execute("use db") tdSql.execute( '''create table stb1 diff --git a/tests/system-test/0-others/udf_cluster.py b/tests/system-test/0-others/udf_cluster.py index c5c0c7b8f2..9ef3137a7e 100644 --- a/tests/system-test/0-others/udf_cluster.py +++ b/tests/system-test/0-others/udf_cluster.py @@ -63,7 +63,7 @@ class TDTestCase: def prepare_data(self): tdSql.execute("drop database if exists db") - tdSql.execute("create database if not exists db replica 1 days 300") + tdSql.execute("create database if not exists db replica 1 duration 300") tdSql.execute("use db") tdSql.execute( '''create table stb1 diff --git a/tests/system-test/0-others/udf_create.py b/tests/system-test/0-others/udf_create.py index 170d9b1421..11ad8e1584 100644 --- a/tests/system-test/0-others/udf_create.py +++ b/tests/system-test/0-others/udf_create.py @@ -62,7 +62,7 @@ class TDTestCase: def prepare_data(self): tdSql.execute("drop database if exists db ") - tdSql.execute("create database if not exists db days 300") + tdSql.execute("create database if not exists db duration 300") tdSql.execute("use db") tdSql.execute( '''create table stb1 diff --git a/tests/system-test/0-others/udf_restart_taosd.py b/tests/system-test/0-others/udf_restart_taosd.py index 94b14f01ba..c9eb22cf15 100644 --- a/tests/system-test/0-others/udf_restart_taosd.py +++ b/tests/system-test/0-others/udf_restart_taosd.py @@ -59,7 +59,7 @@ class TDTestCase: def prepare_data(self): tdSql.execute("drop database if exists db ") - tdSql.execute("create database if not exists db days 300") + tdSql.execute("create database if not exists db duration 300") tdSql.execute("use db") tdSql.execute( '''create table stb1 diff --git a/tests/system-test/2-query/abs.py b/tests/system-test/2-query/abs.py index d9c37be996..d779cc26cd 100644 --- a/tests/system-test/2-query/abs.py +++ b/tests/system-test/2-query/abs.py @@ -68,7 +68,7 @@ class TDTestCase: def prepare_tag_datas(self): # prepare datas - tdSql.execute("create database if not exists testdb keep 3650 days 1000") + tdSql.execute("create database if not exists testdb keep 3650 duration 1000") tdSql.execute(" use testdb ") tdSql.execute( '''create table stb1 diff --git a/tests/system-test/2-query/sample.py b/tests/system-test/2-query/sample.py index 8c0cd83d4f..a84d93404a 100644 --- a/tests/system-test/2-query/sample.py +++ b/tests/system-test/2-query/sample.py @@ -628,7 +628,7 @@ class TDTestCase: def basic_sample_query(self): tdSql.execute(" drop database if exists db ") - tdSql.execute(" create database if not exists db days 300 ") + tdSql.execute(" create database if not exists db duration 300 ") tdSql.execute(" use db ") tdSql.execute( '''create table stb1 diff --git a/tests/system-test/6-cluster/5dnode1mnode.py b/tests/system-test/6-cluster/5dnode1mnode.py index 7c3715cd0b..75134224db 100644 --- a/tests/system-test/6-cluster/5dnode1mnode.py +++ b/tests/system-test/6-cluster/5dnode1mnode.py @@ -104,7 +104,7 @@ class TDTestCase: tdSql.error("drop mnode on dnode 1;") tdSql.execute("drop database if exists db") - tdSql.execute("create database if not exists db replica 1 days 300") + tdSql.execute("create database if not exists db replica 1 duration 300") tdSql.execute("use db") tdSql.execute( '''create table stb1 diff --git a/tests/system-test/6-cluster/5dnode2mnode.py b/tests/system-test/6-cluster/5dnode2mnode.py index 9d9cc9c0d6..04d9c9b3b4 100644 --- a/tests/system-test/6-cluster/5dnode2mnode.py +++ b/tests/system-test/6-cluster/5dnode2mnode.py @@ -104,7 +104,7 @@ class TDTestCase: tdSql.error("drop mnode on dnode 1;") tdSql.execute("drop database if exists db") - tdSql.execute("create database if not exists db replica 1 days 300") + tdSql.execute("create database if not exists db replica 1 duration 300") tdSql.execute("use db") tdSql.execute( '''create table stb1 @@ -163,7 +163,7 @@ class TDTestCase: # fisrt add data : db\stable\childtable\general table tdSql.execute("drop database if exists db2") - tdSql.execute("create database if not exists db2 replica 1 days 300") + tdSql.execute("create database if not exists db2 replica 1 duration 300") tdSql.execute("use db2") tdSql.execute( '''create table stb1 diff --git a/tests/system-test/6-cluster/5dnode3mnodeDrop.py b/tests/system-test/6-cluster/5dnode3mnodeDrop.py index 1512fc9897..9c18c63b85 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeDrop.py +++ b/tests/system-test/6-cluster/5dnode3mnodeDrop.py @@ -53,7 +53,7 @@ class TDTestCase: # fisrt add data : db\stable\childtable\general table for couti in count: tdSql.execute("drop database if exists db%d" %couti) - tdSql.execute("create database if not exists db%d replica 1 days 300" %couti) + tdSql.execute("create database if not exists db%d replica 1 duration 300" %couti) tdSql.execute("use db%d" %couti) tdSql.execute( '''create table stb1 diff --git a/tests/system-test/6-cluster/5dnode3mnodeStop.py b/tests/system-test/6-cluster/5dnode3mnodeStop.py index a9784f2d0f..08da7f9101 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeStop.py +++ b/tests/system-test/6-cluster/5dnode3mnodeStop.py @@ -53,7 +53,7 @@ class TDTestCase: # fisrt add data : db\stable\childtable\general table for couti in count: tdSql.execute("drop database if exists db%d" %couti) - tdSql.execute("create database if not exists db%d replica 1 days 300" %couti) + tdSql.execute("create database if not exists db%d replica 1 duration 300" %couti) tdSql.execute("use db%d" %couti) tdSql.execute( '''create table stb1 diff --git a/tests/system-test/6-cluster/5dnode3mnodeStopInsert.py b/tests/system-test/6-cluster/5dnode3mnodeStopInsert.py index 95cd26dedc..bdb6cf28e1 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeStopInsert.py +++ b/tests/system-test/6-cluster/5dnode3mnodeStopInsert.py @@ -54,7 +54,7 @@ class TDTestCase: # fisrt add data : db\stable\childtable\general table for couti in count: tdSql.execute("drop database if exists db%d" %couti) - tdSql.execute("create database if not exists db%d replica 1 days 300" %couti) + tdSql.execute("create database if not exists db%d replica 1 duration 300" %couti) tdSql.execute("use db%d" %couti) tdSql.execute( '''create table stb1 From ac9917a39bcd3dbd560479d09e17cf52754e1795 Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Wed, 15 Jun 2022 14:26:57 +0800 Subject: [PATCH 12/15] fix: adapt to different coredump configurations --- tests/parallel_test/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/run.sh b/tests/parallel_test/run.sh index 1b54dc338e..f6f09d2823 100755 --- a/tests/parallel_test/run.sh +++ b/tests/parallel_test/run.sh @@ -255,7 +255,7 @@ function run_thread() { $cmd # 2>/dev/null local case_info=`echo "$line"|cut -d, -f 3,4` local corefile=`ls $log_dir/${case_file}.coredump/` - corefile=`find $log_dir/${case_file}.coredump/ -name "core.*"` + corefile=`find $log_dir/${case_file}.coredump/ -name "*"` echo -e "$case_info \e[31m failed\e[0m" echo "=========================log============================" cat $log_dir/$case_file.log From 6d1ff4c18b719a58c88d30f0ccfc89a6bf7b544d Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 15 Jun 2022 14:33:45 +0800 Subject: [PATCH 13/15] fix dead lock issue --- source/libs/catalog/src/ctgAsync.c | 15 +++++++++++---- source/libs/catalog/src/ctgDbg.c | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/libs/catalog/src/ctgAsync.c b/source/libs/catalog/src/ctgAsync.c index 6e24d632e2..8dabd56934 100644 --- a/source/libs/catalog/src/ctgAsync.c +++ b/source/libs/catalog/src/ctgAsync.c @@ -784,8 +784,7 @@ int32_t ctgHandleGetTbMetaRsp(SCtgTask* pTask, int32_t reqType, const SDataBuf * _return: if (dbCache) { - ctgRUnlockVgInfo(dbCache); - ctgReleaseDBCache(pCtg, dbCache); + ctgReleaseVgInfoToCache(pCtg, dbCache); } ctgHandleTaskEnd(pTask, code); @@ -943,7 +942,6 @@ _return: int32_t ctgHandleGetUserRsp(SCtgTask* pTask, int32_t reqType, const SDataBuf *pMsg, int32_t rspCode) { int32_t code = 0; - SCtgDBCache *dbCache = NULL; SCtgUserCtx* ctx = (SCtgUserCtx*)pTask->taskCtx; SCatalog* pCtg = pTask->pJob->pCtg; bool pass = false; @@ -1012,7 +1010,7 @@ int32_t ctgAsyncRefreshTbMeta(SCtgTask *pTask) { CTG_ERR_RET(ctgAcquireVgInfoFromCache(pCtg, dbFName, &dbCache)); if (dbCache) { SVgroupInfo vgInfo = {0}; - CTG_ERR_RET(ctgGetVgInfoFromHashValue(pCtg, dbCache->vgCache.vgInfo, ctx->pName, &vgInfo)); + CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, dbCache->vgCache.vgInfo, ctx->pName, &vgInfo)); ctgDebug("will refresh tbmeta, not supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(ctx->pName), ctx->flag); @@ -1061,6 +1059,9 @@ int32_t ctgLaunchGetDbVgTask(SCtgTask *pTask) { CTG_ERR_RET(ctgAcquireVgInfoFromCache(pCtg, pCtx->dbFName, &dbCache)); if (NULL != dbCache) { CTG_ERR_JRET(ctgGenerateVgList(pCtg, dbCache->vgCache.vgInfo->vgHash, (SArray**)&pTask->res)); + + ctgReleaseVgInfoToCache(pCtg, dbCache); + dbCache = NULL; CTG_ERR_JRET(ctgHandleTaskEnd(pTask, 0)); } else { @@ -1095,6 +1096,9 @@ int32_t ctgLaunchGetTbHashTask(SCtgTask *pTask) { CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY); } CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, dbCache->vgCache.vgInfo, pCtx->pName, (SVgroupInfo*)pTask->res)); + + ctgReleaseVgInfoToCache(pCtg, dbCache); + dbCache = NULL; CTG_ERR_JRET(ctgHandleTaskEnd(pTask, 0)); } else { @@ -1170,6 +1174,9 @@ int32_t ctgLaunchGetDbInfoTask(SCtgTask *pTask) { pInfo->vgVer = dbCache->vgCache.vgInfo->vgVersion; pInfo->dbId = dbCache->dbId; pInfo->tbNum = dbCache->vgCache.vgInfo->numOfTable; + + ctgReleaseVgInfoToCache(pCtg, dbCache); + dbCache = NULL; } else { pInfo->vgVer = CTG_DEFAULT_INVALID_VERSION; } diff --git a/source/libs/catalog/src/ctgDbg.c b/source/libs/catalog/src/ctgDbg.c index 9de1ea22be..ff93bedb21 100644 --- a/source/libs/catalog/src/ctgDbg.c +++ b/source/libs/catalog/src/ctgDbg.c @@ -19,7 +19,7 @@ #include "catalogInt.h" extern SCatalogMgmt gCtgMgmt; -SCtgDebug gCTGDebug = {0}; +SCtgDebug gCTGDebug = {.lockEnable = true, .apiEnable = true}; void ctgdUserCallback(SMetaData* pResult, void* param, int32_t code) { ASSERT(*(int32_t*)param == 1); From 055d2dd15551fe86c4fbff008d38cc7823a67ece Mon Sep 17 00:00:00 2001 From: tangfangzhi Date: Wed, 15 Jun 2022 15:06:12 +0800 Subject: [PATCH 14/15] fix: incorrect coredump file check --- tests/parallel_test/run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/parallel_test/run.sh b/tests/parallel_test/run.sh index f6f09d2823..e9871637bd 100755 --- a/tests/parallel_test/run.sh +++ b/tests/parallel_test/run.sh @@ -255,7 +255,6 @@ function run_thread() { $cmd # 2>/dev/null local case_info=`echo "$line"|cut -d, -f 3,4` local corefile=`ls $log_dir/${case_file}.coredump/` - corefile=`find $log_dir/${case_file}.coredump/ -name "*"` echo -e "$case_info \e[31m failed\e[0m" echo "=========================log============================" cat $log_dir/$case_file.log From 11564a3dc79edfea55be0c1a2c7a7b790f0b716c Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Wed, 15 Jun 2022 15:24:22 +0800 Subject: [PATCH 15/15] fix: use 'duration' instead of 'days' for create database --- source/libs/parser/src/parTranslater.c | 1 - source/libs/planner/src/planPhysiCreater.c | 3 ++- source/libs/planner/src/planSpliter.c | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index bfb58d2cd1..9e0de48420 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -4797,7 +4797,6 @@ static int32_t buildDropTableVgroupHashmap(STranslateContext* pCxt, SDropTableCl if (TSDB_CODE_PAR_TABLE_NOT_EXIST == code && pClause->ignoreNotExists) { code = TSDB_CODE_SUCCESS; - goto over; } *pIsSuperTable = false; diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 618ff9acc6..4a0348151b 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -470,7 +470,8 @@ static ENodeType getScanOperatorType(EScanType scanType) { case SCAN_TYPE_STREAM: return QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN; case SCAN_TYPE_TABLE_MERGE: - return QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN; + return QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN; + // return QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN; default: break; } diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index 4c202d457f..82f6b7fe14 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -392,6 +392,7 @@ static int32_t stbSplSplitIntervalForBatch(SSplitContext* pCxt, SStableSplitInfo (SNode*)splCreateScanSubplan(pCxt, pPartWindow, SPLIT_FLAG_STABLE_SPLIT)); } pInfo->pSubplan->subplanType = SUBPLAN_TYPE_MERGE; + ++(pCxt->groupId); return code; } @@ -408,6 +409,7 @@ static int32_t stbSplSplitIntervalForStream(SSplitContext* pCxt, SStableSplitInf (SNode*)splCreateScanSubplan(pCxt, pPartWindow, SPLIT_FLAG_STABLE_SPLIT)); } pInfo->pSubplan->subplanType = SUBPLAN_TYPE_MERGE; + ++(pCxt->groupId); return code; } @@ -496,6 +498,7 @@ static int32_t stbSplSplitAggNode(SSplitContext* pCxt, SStableSplitInfo* pInfo) (SNode*)splCreateScanSubplan(pCxt, pPartAgg, SPLIT_FLAG_STABLE_SPLIT)); } pInfo->pSubplan->subplanType = SUBPLAN_TYPE_MERGE; + ++(pCxt->groupId); return code; } @@ -610,6 +613,7 @@ static int32_t stbSplSplitSortNode(SSplitContext* pCxt, SStableSplitInfo* pInfo) (SNode*)splCreateScanSubplan(pCxt, pPartSort, SPLIT_FLAG_STABLE_SPLIT)); } pInfo->pSubplan->subplanType = SUBPLAN_TYPE_MERGE; + ++(pCxt->groupId); return code; } @@ -619,6 +623,7 @@ static int32_t stbSplSplitScanNode(SSplitContext* pCxt, SStableSplitInfo* pInfo) code = nodesListMakeStrictAppend(&pInfo->pSubplan->pChildren, (SNode*)splCreateScanSubplan(pCxt, pInfo->pSplitNode, SPLIT_FLAG_STABLE_SPLIT)); } + ++(pCxt->groupId); return code; }