diff --git a/include/common/systable.h b/include/common/systable.h index ca097cd8d29d59281ca1e2100eb9c7fda5e0b7cb..ed2e6a46c35006f8f9ffc189a98f3df5e2ac9ade 100644 --- a/include/common/systable.h +++ b/include/common/systable.h @@ -23,38 +23,38 @@ extern "C" { #define TDENGINE_SYSTABLE_H #define TSDB_INFORMATION_SCHEMA_DB "information_schema" -#define TSDB_INS_TABLE_DNODES "dnodes" -#define TSDB_INS_TABLE_MNODES "mnodes" -#define TSDB_INS_TABLE_MODULES "modules" -#define TSDB_INS_TABLE_QNODES "qnodes" -#define TSDB_INS_TABLE_BNODES "bnodes" -#define TSDB_INS_TABLE_SNODES "snodes" -#define TSDB_INS_TABLE_CLUSTER "cluster" -#define TSDB_INS_TABLE_USER_DATABASES "user_databases" -#define TSDB_INS_TABLE_USER_FUNCTIONS "user_functions" -#define TSDB_INS_TABLE_USER_INDEXES "user_indexes" -#define TSDB_INS_TABLE_USER_STABLES "user_stables" -#define TSDB_INS_TABLE_USER_TABLES "user_tables" -#define TSDB_INS_TABLE_USER_TAGS "user_tags" -#define TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED "user_table_distributed" -#define TSDB_INS_TABLE_USER_USERS "user_users" -#define TSDB_INS_TABLE_LICENCES "grants" -#define TSDB_INS_TABLE_VGROUPS "vgroups" -#define TSDB_INS_TABLE_VNODES "vnodes" -#define TSDB_INS_TABLE_CONFIGS "configs" -#define TSDB_INS_TABLE_DNODE_VARIABLES "dnode_variables" +#define TSDB_INS_TABLE_DNODES "ins_dnodes" +#define TSDB_INS_TABLE_MNODES "ins_mnodes" +#define TSDB_INS_TABLE_MODULES "ins_modules" +#define TSDB_INS_TABLE_QNODES "ins_qnodes" +#define TSDB_INS_TABLE_BNODES "ins_bnodes" +#define TSDB_INS_TABLE_SNODES "ins_snodes" +#define TSDB_INS_TABLE_CLUSTER "ins_cluster" +#define TSDB_INS_TABLE_DATABASES "ins_databases" +#define TSDB_INS_TABLE_FUNCTIONS "ins_functions" +#define TSDB_INS_TABLE_INDEXES "ins_indexes" +#define TSDB_INS_TABLE_STABLES "ins_stables" +#define TSDB_INS_TABLE_TABLES "ins_tables" +#define TSDB_INS_TABLE_TAGS "ins_tags" +#define TSDB_INS_TABLE_TABLE_DISTRIBUTED "ins_table_distributed" +#define TSDB_INS_TABLE_USERS "ins_users" +#define TSDB_INS_TABLE_LICENCES "ins_grants" +#define TSDB_INS_TABLE_VGROUPS "ins_vgroups" +#define TSDB_INS_TABLE_VNODES "ins_vnodes" +#define TSDB_INS_TABLE_CONFIGS "ins_configs" +#define TSDB_INS_TABLE_DNODE_VARIABLES "ins_dnode_variables" #define TSDB_PERFORMANCE_SCHEMA_DB "performance_schema" -#define TSDB_PERFS_TABLE_SMAS "smas" -#define TSDB_PERFS_TABLE_CONNECTIONS "connections" -#define TSDB_PERFS_TABLE_QUERIES "queries" -#define TSDB_PERFS_TABLE_TOPICS "topics" -#define TSDB_PERFS_TABLE_CONSUMERS "consumers" -#define TSDB_PERFS_TABLE_SUBSCRIPTIONS "subscriptions" -#define TSDB_PERFS_TABLE_OFFSETS "offsets" -#define TSDB_PERFS_TABLE_TRANS "trans" -#define TSDB_PERFS_TABLE_STREAMS "streams" -#define TSDB_PERFS_TABLE_APPS "apps" +#define TSDB_PERFS_TABLE_SMAS "perf_smas" +#define TSDB_PERFS_TABLE_CONNECTIONS "perf_connections" +#define TSDB_PERFS_TABLE_QUERIES "perf_queries" +#define TSDB_PERFS_TABLE_TOPICS "perf_topics" +#define TSDB_PERFS_TABLE_CONSUMERS "perf_consumers" +#define TSDB_PERFS_TABLE_SUBSCRIPTIONS "perf_subscriptions" +#define TSDB_PERFS_TABLE_OFFSETS "perf_offsets" +#define TSDB_PERFS_TABLE_TRANS "perf_trans" +#define TSDB_PERFS_TABLE_STREAMS "perf_streams" +#define TSDB_PERFS_TABLE_APPS "perf_apps" typedef struct SSysDbTableSchema { const char* name; diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 7eafc4c3d821d6012bc5f5705e85bb06d070888d..9bc2ae42687e4510765fee007badab1ba01cc9be 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2223,6 +2223,7 @@ typedef struct SAppClusterSummary { uint64_t insertBytes; // submit to tsdb since launched. uint64_t fetchBytes; + uint64_t numOfQueryReq; uint64_t queryElapsedTime; uint64_t numOfSlowQueries; uint64_t totalRequests; diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index b62f822313efee9968d1910cc7835e9181b72b50..34d870397f953e9a85a9a5b44b6a4fc57c0594c9 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -71,6 +71,7 @@ typedef struct SIndexMeta { typedef struct SExecResult { int32_t code; uint64_t numOfRows; + uint64_t numOfBytes; int32_t msgType; void* res; } SExecResult; diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h index 2831e7a904e7fca29667fc0cb057de78fc938ccf..e7a099cf23b5b67b090b54a141be920d7010c531 100644 --- a/source/client/inc/clientInt.h +++ b/source/client/inc/clientInt.h @@ -225,10 +225,12 @@ typedef struct SRequestObj { SArray* targetTableList; SQueryExecMetric metric; SRequestSendRecvBody body; + int32_t stmtType; bool syncQuery; // todo refactor: async query object bool stableQuery; // todo refactor bool validateOnly; // todo refactor bool killed; + bool inRetry; uint32_t prevCode; // previous error code: todo refactor, add update flag for catalog uint32_t retry; } SRequestObj; @@ -326,7 +328,7 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet); STscObj* taos_connect_internal(const char* ip, const char* user, const char* pass, const char* auth, const char* db, uint16_t port, int connType); -SRequestObj* launchQuery(uint64_t connId, const char* sql, int sqlLen, bool validateOnly); +SRequestObj* launchQuery(uint64_t connId, const char* sql, int sqlLen, bool validateOnly, bool inRetry); int32_t parseSql(SRequestObj* pRequest, bool topicQuery, SQuery** pQuery, SStmtCallback* pStmtCb); diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 95ce5c8338662c38e81fe4eb8d7422e05c36deba..d88a587f6ae49954c5e8213f2e3f4d765b32ea34 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -60,6 +60,7 @@ static int32_t registerRequest(SRequestObj *pRequest, STscObj *pTscObj) { } static void deregisterRequest(SRequestObj *pRequest) { + const static int64_t SLOW_QUERY_INTERVAL = 3000000L; // todo configurable assert(pRequest != NULL); STscObj *pTscObj = pRequest->pTscObj; @@ -72,6 +73,17 @@ static void deregisterRequest(SRequestObj *pRequest) { tscDebug("0x%" PRIx64 " free Request from connObj: 0x%" PRIx64 ", reqId:0x%" PRIx64 " elapsed:%" PRIu64 " ms, current:%d, app current:%d", pRequest->self, pTscObj->id, pRequest->requestId, duration / 1000, num, currentInst); + + if (QUERY_NODE_VNODE_MODIF_STMT == pRequest->stmtType) { + atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration); + } else if (QUERY_NODE_SELECT_STMT == pRequest->stmtType) { + atomic_add_fetch_64((int64_t *)&pActivity->queryElapsedTime, duration); + } + + if (duration >= SLOW_QUERY_INTERVAL) { + atomic_add_fetch_64((int64_t *)&pActivity->numOfSlowQueries, 1); + } + releaseTscObj(pTscObj->id); } diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 6f8e7d02373c2e8c56ff588c3f42cf03731079f1..d2c0a70731f51fb5da44aec3407a549f455fc4c5 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -688,7 +688,12 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList if (TDMT_VND_SUBMIT == pRequest->type || TDMT_VND_DELETE == pRequest->type || TDMT_VND_CREATE_TABLE == pRequest->type) { pRequest->body.resInfo.numOfRows = res.numOfRows; - + if (TDMT_VND_SUBMIT == pRequest->type) { + STscObj *pTscObj = pRequest->pTscObj; + SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary; + atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertRows, res.numOfRows); + } + schedulerFreeJob(&pRequest->body.queryJob, 0); } @@ -795,6 +800,8 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) { break; } case TDMT_VND_SUBMIT: { + atomic_add_fetch_64((int64_t *)&pAppInfo->summary.insertBytes, pRes->numOfBytes); + code = handleSubmitExecRes(pRequest, pRes->res, pCatalog, &epset); break; } @@ -824,6 +831,11 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) { TDMT_VND_CREATE_TABLE == pRequest->type) { if (pResult) { pRequest->body.resInfo.numOfRows = pResult->numOfRows; + if (TDMT_VND_SUBMIT == pRequest->type) { + STscObj *pTscObj = pRequest->pTscObj; + SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary; + atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertRows, pResult->numOfRows); + } } schedulerFreeJob(&pRequest->body.queryJob, 0); @@ -862,6 +874,18 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) { SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void** res) { int32_t code = 0; + pRequest->stmtType = pQuery->pRoot->type; + + if (!pRequest->inRetry) { + STscObj *pTscObj = pRequest->pTscObj; + SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary; + if (QUERY_NODE_VNODE_MODIF_STMT == pQuery->pRoot->type) { + atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertsReq, 1); + } else if (QUERY_NODE_SELECT_STMT == pQuery->pRoot->type) { + atomic_add_fetch_64((int64_t *)&pActivity->numOfQueryReq, 1); + } + } + switch (pQuery->execMode) { case QUERY_EXEC_MODE_LOCAL: if (!pRequest->validateOnly) { @@ -915,7 +939,7 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQue return pRequest; } -SRequestObj* launchQuery(uint64_t connId, const char* sql, int sqlLen, bool validateOnly) { +SRequestObj* launchQuery(uint64_t connId, const char* sql, int sqlLen, bool validateOnly, bool inRetry) { SRequestObj* pRequest = NULL; SQuery* pQuery = NULL; @@ -931,6 +955,7 @@ SRequestObj* launchQuery(uint64_t connId, const char* sql, int sqlLen, bool vali return pRequest; } + pRequest->inRetry = inRetry; pRequest->stableQuery = pQuery->stableQuery; return launchQueryImpl(pRequest, pQuery, false, NULL); @@ -1079,10 +1104,11 @@ SRequestObj* execQuery(uint64_t connId, const char* sql, int sqlLen, bool valida SRequestObj* pRequest = NULL; int32_t retryNum = 0; int32_t code = 0; + bool inRetry = false; do { destroyRequest(pRequest); - pRequest = launchQuery(connId, sql, sqlLen, validateOnly); + pRequest = launchQuery(connId, sql, sqlLen, validateOnly, inRetry); if (pRequest == NULL || TSDB_CODE_SUCCESS == pRequest->code || !NEED_CLIENT_HANDLE_ERROR(pRequest->code)) { break; } @@ -1092,6 +1118,8 @@ SRequestObj* execQuery(uint64_t connId, const char* sql, int sqlLen, bool valida pRequest->code = code; break; } + + inRetry = true; } while (retryNum++ < REQUEST_TOTAL_EXEC_TIMES); if (NEED_CLIENT_RM_TBLMETA_REQ(pRequest->type)) { @@ -1437,6 +1465,10 @@ void* doFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4) tscDebug("0x%" PRIx64 " fetch results, numOfRows:%d total Rows:%" PRId64 ", complete:%d, reqId:0x%" PRIx64, pRequest->self, pResInfo->numOfRows, pResInfo->totalRows, pResInfo->completed, pRequest->requestId); + STscObj *pTscObj = pRequest->pTscObj; + SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary; + atomic_add_fetch_64((int64_t *)&pActivity->fetchBytes, pRequest->body.resInfo.payloadLen); + if (pResultInfo->numOfRows == 0) { return NULL; } diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index a4eaf057d12ba3e2a57190de0f76a9489ae8fc61..c2d621b3114d9ce38971f7dc58f88a16e3062941 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -679,6 +679,9 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) { if (code == TSDB_CODE_SUCCESS) { code = qAnalyseSqlSemantic(pWrapper->pCtx, &pWrapper->catalogReq, pResultMeta, pQuery); pRequest->stableQuery = pQuery->stableQuery; + if (pQuery->pRoot) { + pRequest->stmtType = pQuery->pRoot->type; + } } if (code == TSDB_CODE_SUCCESS) { @@ -778,6 +781,16 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) { goto _error; } + if (!updateMetaForce) { + STscObj *pTscObj = pRequest->pTscObj; + SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary; + if (NULL == pQuery->pRoot) { + atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertsReq, 1); + } else if (QUERY_NODE_SELECT_STMT == pQuery->pRoot->type) { + atomic_add_fetch_64((int64_t *)&pActivity->numOfQueryReq, 1); + } + } + SqlParseWrapper *pWrapper = taosMemoryCalloc(1, sizeof(SqlParseWrapper)); if (pWrapper == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; @@ -841,6 +854,10 @@ static void fetchCallback(void *pResult, void *param, int32_t code) { tscDebug("0x%" PRIx64 " fetch results, numOfRows:%d total Rows:%" PRId64 ", complete:%d, reqId:0x%" PRIx64, pRequest->self, pResultInfo->numOfRows, pResultInfo->totalRows, pResultInfo->completed, pRequest->requestId); + + STscObj *pTscObj = pRequest->pTscObj; + SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary; + atomic_add_fetch_64((int64_t *)&pActivity->fetchBytes, pRequest->body.resInfo.payloadLen); } pRequest->body.fetchFp(pRequest->body.param, pRequest, pResultInfo->numOfRows); diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 7d07946dc96632d32447228aa196fcd2829d0514..679e0dbb8a5b67db9fa0fbc27d2f8e8ba643cb4b 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -260,14 +260,14 @@ static const SSysTableMeta infosMeta[] = { // {TSDB_INS_TABLE_SNODES, snodesSchema, tListLen(snodesSchema)}, // {TSDB_INS_TABLE_BNODES, bnodesSchema, tListLen(bnodesSchema)}, {TSDB_INS_TABLE_CLUSTER, clusterSchema, tListLen(clusterSchema)}, - {TSDB_INS_TABLE_USER_DATABASES, userDBSchema, tListLen(userDBSchema)}, - {TSDB_INS_TABLE_USER_FUNCTIONS, userFuncSchema, tListLen(userFuncSchema)}, - {TSDB_INS_TABLE_USER_INDEXES, userIdxSchema, tListLen(userIdxSchema)}, - {TSDB_INS_TABLE_USER_STABLES, userStbsSchema, tListLen(userStbsSchema)}, - {TSDB_INS_TABLE_USER_TABLES, userTblsSchema, tListLen(userTblsSchema)}, - {TSDB_INS_TABLE_USER_TAGS, userTagsSchema, tListLen(userTagsSchema)}, - // {TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED, userTblDistSchema, tListLen(userTblDistSchema)}, - {TSDB_INS_TABLE_USER_USERS, userUsersSchema, tListLen(userUsersSchema)}, + {TSDB_INS_TABLE_DATABASES, userDBSchema, tListLen(userDBSchema)}, + {TSDB_INS_TABLE_FUNCTIONS, userFuncSchema, tListLen(userFuncSchema)}, + {TSDB_INS_TABLE_INDEXES, userIdxSchema, tListLen(userIdxSchema)}, + {TSDB_INS_TABLE_STABLES, userStbsSchema, tListLen(userStbsSchema)}, + {TSDB_INS_TABLE_TABLES, userTblsSchema, tListLen(userTblsSchema)}, + {TSDB_INS_TABLE_TAGS, userTagsSchema, tListLen(userTagsSchema)}, + // {TSDB_INS_TABLE_TABLE_DISTRIBUTED, userTblDistSchema, tListLen(userTblDistSchema)}, + {TSDB_INS_TABLE_USERS, userUsersSchema, tListLen(userUsersSchema)}, {TSDB_INS_TABLE_LICENCES, grantsSchema, tListLen(grantsSchema)}, {TSDB_INS_TABLE_VGROUPS, vgroupsSchema, tListLen(vgroupsSchema)}, {TSDB_INS_TABLE_CONFIGS, configSchema, tListLen(configSchema)}, @@ -349,7 +349,7 @@ static const SSysDbTableSchema appSchema[] = { {.name = "insert_bytes", .bytes = 8, .type = TSDB_DATA_TYPE_UBIGINT}, {.name = "fetch_bytes", .bytes = 8, .type = TSDB_DATA_TYPE_UBIGINT}, {.name = "query_time", .bytes = 8, .type = TSDB_DATA_TYPE_UBIGINT}, - {.name = "show_query", .bytes = 8, .type = TSDB_DATA_TYPE_UBIGINT}, + {.name = "slow_query", .bytes = 8, .type = TSDB_DATA_TYPE_UBIGINT}, {.name = "total_req", .bytes = 8, .type = TSDB_DATA_TYPE_UBIGINT}, {.name = "current_req", .bytes = 8, .type = TSDB_DATA_TYPE_UBIGINT}, {.name = "last_access", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP}, diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index 0711f7e06da8563f1d3920b1a3de6484aba09048..05d0fe66c3a010677017007953c5c4c639364808 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -66,21 +66,21 @@ static int32_t convertToRetrieveType(char *name, int32_t len) { type = TSDB_MGMT_TABLE_SNODE; } else if (strncasecmp(name, TSDB_INS_TABLE_CLUSTER, len) == 0) { type = TSDB_MGMT_TABLE_CLUSTER; - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_DATABASES, len) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_DATABASES, len) == 0) { type = TSDB_MGMT_TABLE_DB; - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_FUNCTIONS, len) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_FUNCTIONS, len) == 0) { type = TSDB_MGMT_TABLE_FUNC; - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_INDEXES, len) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_INDEXES, len) == 0) { type = TSDB_MGMT_TABLE_INDEX; - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_STABLES, len) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_STABLES, len) == 0) { type = TSDB_MGMT_TABLE_STB; - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_TABLES, len) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_TABLES, len) == 0) { type = TSDB_MGMT_TABLE_TABLE; - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_TAGS, len) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_TAGS, len) == 0) { type = TSDB_MGMT_TABLE_TAG; - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED, len) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_TABLE_DISTRIBUTED, len) == 0) { // type = TSDB_MGMT_TABLE_DIST; - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_USERS, len) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_USERS, len) == 0) { type = TSDB_MGMT_TABLE_USER; } else if (strncasecmp(name, TSDB_INS_TABLE_LICENCES, len) == 0) { type = TSDB_MGMT_TABLE_GRANTS; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index e38034f4aa6665d26eca875c66d36c13bd96024b..b0d08f72e753da561973d240fba49684abc6bbc9 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1622,8 +1622,8 @@ static void destroySysScanOperator(void* param, int32_t numOfOutput) { blockDataDestroy(pInfo->pRes); const char* name = tNameGetTableName(&pInfo->name); - if (strncasecmp(name, TSDB_INS_TABLE_USER_TABLES, TSDB_TABLE_FNAME_LEN) == 0 || - strncasecmp(name, TSDB_INS_TABLE_USER_TAGS, TSDB_TABLE_FNAME_LEN) == 0 || pInfo->pCur != NULL) { + if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0 || + strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0 || pInfo->pCur != NULL) { metaCloseTbCursor(pInfo->pCur); pInfo->pCur = NULL; } @@ -1635,7 +1635,7 @@ static void destroySysScanOperator(void* param, int32_t numOfOutput) { } static int32_t getSysTableDbNameColId(const char* pTable) { - // if (0 == strcmp(TSDB_INS_TABLE_USER_INDEXES, pTable)) { + // if (0 == strcmp(TSDB_INS_TABLE_INDEXES, pTable)) { // return 1; // } return TSDB_INS_USER_STABLES_DBNAME_COLID; @@ -1851,7 +1851,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { tNameGetDbName(&sn, varDataVal(dbname)); varDataSetLen(dbname, strlen(varDataVal(dbname))); - SSDataBlock* p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_USER_TAGS); + SSDataBlock* p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TAGS); blockDataEnsureCapacity(p, pOperator->resultInfo.capacity); int32_t ret = 0; @@ -2022,7 +2022,7 @@ static SSDataBlock* sysTableScanUserTables(SOperatorInfo* pOperator) { tNameGetDbName(&sn, varDataVal(dbname)); varDataSetLen(dbname, strlen(varDataVal(dbname))); - SSDataBlock* p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_USER_TABLES); + SSDataBlock* p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TABLES); blockDataEnsureCapacity(p, pOperator->resultInfo.capacity); char n[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; @@ -2189,11 +2189,11 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName); } - if (strncasecmp(name, TSDB_INS_TABLE_USER_TABLES, TSDB_TABLE_FNAME_LEN) == 0) { + if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0) { return sysTableScanUserTables(pOperator); - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_TAGS, TSDB_TABLE_FNAME_LEN) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0) { return sysTableScanUserTags(pOperator); - } else if (strncasecmp(name, TSDB_INS_TABLE_USER_STABLES, TSDB_TABLE_FNAME_LEN) == 0 && + } else if (strncasecmp(name, TSDB_INS_TABLE_STABLES, TSDB_TABLE_FNAME_LEN) == 0 && IS_SYS_DBNAME(pInfo->req.db)) { return sysTableScanUserSTables(pOperator); } else { // load the meta from mnode of the given epset @@ -2269,7 +2269,7 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { } int32_t buildSysDbTableInfo(const SSysTableScanInfo* pInfo, int32_t capacity) { - SSDataBlock* p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_USER_TABLES); + SSDataBlock* p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TABLES); blockDataEnsureCapacity(p, capacity); size_t size = 0; @@ -2358,8 +2358,8 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan tNameAssign(&pInfo->name, &pScanNode->tableName); const char* name = tNameGetTableName(&pInfo->name); - if (strncasecmp(name, TSDB_INS_TABLE_USER_TABLES, TSDB_TABLE_FNAME_LEN) == 0 || - strncasecmp(name, TSDB_INS_TABLE_USER_TAGS, TSDB_TABLE_FNAME_LEN) == 0) { + if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0 || + strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0) { pInfo->readHandle = *(SReadHandle*)readHandle; blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); } else { diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index a93091707aaa933c61a32840e70e54112fbc9327..01d8d1f3066e51017ba21ca74fae7a246dabd6e6 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -334,22 +334,22 @@ static int32_t collectMetaKeyFromShowBnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* } static int32_t collectMetaKeyFromShowDatabases(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_DATABASES, + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DATABASES, pCxt->pMetaCache); } static int32_t collectMetaKeyFromShowFunctions(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_FUNCTIONS, + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_FUNCTIONS, pCxt->pMetaCache); } static int32_t collectMetaKeyFromShowIndexes(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_INDEXES, + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_INDEXES, pCxt->pMetaCache); } static int32_t collectMetaKeyFromShowStables(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_STABLES, + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_STABLES, pCxt->pMetaCache); } @@ -360,7 +360,7 @@ static int32_t collectMetaKeyFromShowStreams(SCollectMetaKeyCxt* pCxt, SShowStmt static int32_t collectMetaKeyFromShowTables(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, - TSDB_INS_TABLE_USER_TABLES, pCxt->pMetaCache); + TSDB_INS_TABLE_TABLES, pCxt->pMetaCache); if (TSDB_CODE_SUCCESS == code) { if (NULL != pStmt->pDbName) { code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); @@ -372,7 +372,7 @@ static int32_t collectMetaKeyFromShowTables(SCollectMetaKeyCxt* pCxt, SShowStmt* } static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_TAGS, + int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TAGS, pCxt->pMetaCache); if (TSDB_CODE_SUCCESS == code) { if (NULL != pStmt->pDbName) { @@ -385,7 +385,7 @@ static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* p } static int32_t collectMetaKeyFromShowUsers(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_USERS, + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USERS, pCxt->pMetaCache); } diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 7066907250d64922008df8eebacf2b138d525fb6..97910249ebe236c6691cd2dfc91475b72e013bcc 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -21,6 +21,7 @@ #include "tglobal.h" #include "ttime.h" #include "ttypes.h" +#include "query.h" #define NEXT_TOKEN(pSql, sToken) \ do { \ @@ -1488,6 +1489,8 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) { return buildSyntaxErrMsg(&pCxt->msg, "keyword VALUES or FILE is expected", sToken.z); } + qDebug("0x%" PRIx64 " insert input rows: %d", pCxt->pComCxt->requestId, pCxt->totalNum); + if (TSDB_QUERY_HAS_TYPE(pCxt->pOutput->insertType, TSDB_QUERY_TYPE_STMT_INSERT)) { SParsedDataColInfo* tags = taosMemoryMalloc(sizeof(pCxt->tags)); if (NULL == tags) { diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 5d1889194eed2d1a8bd29206c503fb265edca60e..d9041aafd54845bfd097ae730071a1b9719a21aa 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1731,9 +1731,9 @@ static int32_t dnodeToVgroupsInfo(SArray* pDnodes, SVgroupsInfo** pVgsInfo) { } static bool sysTableFromVnode(const char* pTable) { - return (0 == strcmp(pTable, TSDB_INS_TABLE_USER_TABLES)) || - (0 == strcmp(pTable, TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED) || - (0 == strcmp(pTable, TSDB_INS_TABLE_USER_TAGS))); + return (0 == strcmp(pTable, TSDB_INS_TABLE_TABLES)) || + (0 == strcmp(pTable, TSDB_INS_TABLE_TABLE_DISTRIBUTED) || + (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS))); } static bool sysTableFromDnode(const char* pTable) { return 0 == strcmp(pTable, TSDB_INS_TABLE_DNODE_VARIABLES); } @@ -1749,7 +1749,7 @@ static int32_t setVnodeSysTableVgroupList(STranslateContext* pCxt, SName* pName, code = getDBVgInfoImpl(pCxt, pName, &vgroupList); } - if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_USER_TABLES)) { + if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES)) { code = addMnodeToVgroupList(&pCxt->pParseCxt->mgmtEpSet, &vgroupList); } @@ -1837,9 +1837,9 @@ static bool joinTableIsSingleTable(SJoinTableNode* pJoinTable) { static bool isSingleTable(SRealTableNode* pRealTable) { int8_t tableType = pRealTable->pMeta->tableType; if (TSDB_SYSTEM_TABLE == tableType) { - return 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_USER_TABLES) && - 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED) && - 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_USER_TAGS); + return 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES) && + 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLE_DISTRIBUTED) && + 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS); } return (TSDB_CHILD_TABLE == tableType || TSDB_NORMAL_TABLE == tableType); } @@ -5229,15 +5229,15 @@ static const char* getSysDbName(ENodeType type) { static const char* getSysTableName(ENodeType type) { switch (type) { case QUERY_NODE_SHOW_DATABASES_STMT: - return TSDB_INS_TABLE_USER_DATABASES; + return TSDB_INS_TABLE_DATABASES; case QUERY_NODE_SHOW_TABLES_STMT: - return TSDB_INS_TABLE_USER_TABLES; + return TSDB_INS_TABLE_TABLES; case QUERY_NODE_SHOW_TAGS_STMT: - return TSDB_INS_TABLE_USER_TAGS; + return TSDB_INS_TABLE_TAGS; case QUERY_NODE_SHOW_STABLES_STMT: - return TSDB_INS_TABLE_USER_STABLES; + return TSDB_INS_TABLE_STABLES; case QUERY_NODE_SHOW_USERS_STMT: - return TSDB_INS_TABLE_USER_USERS; + return TSDB_INS_TABLE_USERS; case QUERY_NODE_SHOW_DNODES_STMT: return TSDB_INS_TABLE_DNODES; case QUERY_NODE_SHOW_VGROUPS_STMT: @@ -5249,9 +5249,9 @@ static const char* getSysTableName(ENodeType type) { case QUERY_NODE_SHOW_QNODES_STMT: return TSDB_INS_TABLE_QNODES; case QUERY_NODE_SHOW_FUNCTIONS_STMT: - return TSDB_INS_TABLE_USER_FUNCTIONS; + return TSDB_INS_TABLE_FUNCTIONS; case QUERY_NODE_SHOW_INDEXES_STMT: - return TSDB_INS_TABLE_USER_INDEXES; + return TSDB_INS_TABLE_INDEXES; case QUERY_NODE_SHOW_STREAMS_STMT: return TSDB_PERFS_TABLE_STREAMS; case QUERY_NODE_SHOW_BNODES_STMT: diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp index f064566d5fc7bccc923f879d0a0e26e52439ebca..6834f9ccca2c30bbb9506c9c44130aea867372b5 100644 --- a/source/libs/parser/test/mockCatalog.cpp +++ b/source/libs/parser/test/mockCatalog.cpp @@ -58,46 +58,46 @@ void generateInformationSchema(MockCatalogService* mcs) { } { ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_DATABASES, TSDB_SYSTEM_TABLE, 1) + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DATABASES, TSDB_SYSTEM_TABLE, 1) .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN); builder.done(); } { ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_FUNCTIONS, TSDB_SYSTEM_TABLE, 1) + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_FUNCTIONS, TSDB_SYSTEM_TABLE, 1) .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_FUNC_NAME_LEN); builder.done(); } { ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_INDEXES, TSDB_SYSTEM_TABLE, 2) + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_INDEXES, TSDB_SYSTEM_TABLE, 2) .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) .addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); builder.done(); } { ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_STABLES, TSDB_SYSTEM_TABLE, 2) + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_STABLES, TSDB_SYSTEM_TABLE, 2) .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) .addColumn("stable_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); builder.done(); } { ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_TABLES, TSDB_SYSTEM_TABLE, 2) + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TABLES, TSDB_SYSTEM_TABLE, 2) .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) .addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); builder.done(); } { ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED, TSDB_SYSTEM_TABLE, 1) + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TABLE_DISTRIBUTED, TSDB_SYSTEM_TABLE, 1) .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN); builder.done(); } { ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_USERS, TSDB_SYSTEM_TABLE, 1) + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USERS, TSDB_SYSTEM_TABLE, 1) .addColumn("user_name", TSDB_DATA_TYPE_BINARY, TSDB_USER_LEN); builder.done(); } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 3771586b34d6bc8db093fd38b1692997069ce39b..6d70aa60d5d07fed21685ab657ea582393677b89 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -568,9 +568,9 @@ static int32_t createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pScan->showRewrite = pScanLogicNode->showRewrite; pScan->accountId = pCxt->pPlanCxt->acctId; - if (0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_USER_TABLES) || - 0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED) || - 0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_USER_TAGS)) { + if (0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_TABLES) || + 0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_TABLE_DISTRIBUTED) || + 0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_TAGS)) { vgroupInfoToNodeAddr(pScanLogicNode->pVgroupList->vgroups, &pSubplan->execNode); } else { pSubplan->execNode.nodeId = MNODE_HANDLE; diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 82146c374185d7569c7fe6ac2344e95e302e1391..98501427ab7b006daa78bc5d1c6c7c8d377572a0 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -380,6 +380,7 @@ int32_t schDumpJobExecRes(SSchJob* pJob, SExecResult* pRes) { pRes->numOfRows = pJob->resNumOfRows; pRes->res = pJob->execRes.res; pRes->msgType = pJob->execRes.msgType; + pRes->numOfBytes = pJob->execRes.numOfBytes; pJob->execRes.res = NULL; SCH_JOB_DLOG("execRes dumped, code: %s", tstrerror(pRes->code)); diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index 544ecce175bec5b3ccbd2654210db6d51e3e46e9..8c9003a9b2af371ebdb50620f53d382c04609a03 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -213,6 +213,7 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa pJob->execRes.res = rsp; pJob->execRes.msgType = TDMT_VND_SUBMIT; } + pJob->execRes.numOfBytes += pTask->msgLen; SCH_UNLOCK(SCH_WRITE, &pJob->resLock); } diff --git a/tests/script/tsim/query/explain.sim b/tests/script/tsim/query/explain.sim index fcf91c45da500589c5cd0abdf98072feca1b72ac..7cc145865773d39ba3a817b96580f56f65781539 100644 --- a/tests/script/tsim/query/explain.sim +++ b/tests/script/tsim/query/explain.sim @@ -35,7 +35,7 @@ sql explain select * from st1 where -2; sql explain select ts from tb1; sql explain select * from st1; sql explain select * from st1 order by ts; -sql explain select * from information_schema.user_stables; +sql explain select * from information_schema.ins_stables; sql explain select count(*),sum(f1) from tb1; sql explain select count(*),sum(f1) from st1; sql explain select count(*),sum(f1) from st1 group by f1; @@ -46,7 +46,7 @@ sql explain verbose true select * from st1 where -2; sql explain verbose true select ts from tb1 where f1 > 0; sql explain verbose true select * from st1 where f1 > 0 and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00'; sql explain verbose true select count(*) from st1 partition by tbname slimit 1 soffset 2 limit 2 offset 1; -sql explain verbose true select * from information_schema.user_stables where db_name='db2'; +sql explain verbose true select * from information_schema.ins_stables where db_name='db2'; print ======== step4 sql explain analyze select ts from st1 where -2; @@ -54,7 +54,7 @@ sql explain analyze select ts from tb1; sql explain analyze select ts from st1; sql explain analyze select ts from st1; sql explain analyze select ts from st1 order by ts; -sql explain analyze select * from information_schema.user_stables; +sql explain analyze select * from information_schema.ins_stables; sql explain analyze select count(*),sum(f1) from tb1; sql explain analyze select count(*),sum(f1) from st1; sql explain analyze select count(*),sum(f1) from st1 group by f1; @@ -65,14 +65,14 @@ sql explain analyze verbose true select ts from tb1; sql explain analyze verbose true select ts from st1; sql explain analyze verbose true select ts from st1; sql explain analyze verbose true select ts from st1 order by ts; -sql explain analyze verbose true select * from information_schema.user_stables; +sql explain analyze verbose true select * from information_schema.ins_stables; sql explain analyze verbose true select count(*),sum(f1) from tb1; sql explain analyze verbose true select count(*),sum(f1) from st1; sql explain analyze verbose true select count(*),sum(f1) from st1 group by f1; #sql explain analyze verbose true select count(f1) from tb1 interval(10s, 2s) sliding(3s) fill(prev); sql explain analyze verbose true select ts from tb1 where f1 > 0; sql explain analyze verbose true select f1 from st1 where f1 > 0 and ts > '2020-10-31 00:00:00' and ts < '2021-10-31 00:00:00'; -sql explain analyze verbose true select * from information_schema.user_stables where db_name='db2'; +sql explain analyze verbose true select * from information_schema.ins_stables where db_name='db2'; sql explain analyze verbose true select * from (select min(f1),count(*) a from st1 where f1 > 0) where a < 0; #not pass case diff --git a/tests/script/tsim/show/basic.sim b/tests/script/tsim/show/basic.sim index c4af7f3f3c4dc4c05157ab3462562f1c969e049a..cc2b847d1ac31c75f18f7a244373dd11a69c220e 100644 --- a/tests/script/tsim/show/basic.sim +++ b/tests/script/tsim/show/basic.sim @@ -77,37 +77,37 @@ if $rows != 3 then endi print =============== run select * from information_schema.xxxx -sql select * from information_schema.`dnodes` +sql select * from information_schema.ins_dnodes if $rows != 2 then return -1 endi -sql select * from information_schema.`mnodes` +sql select * from information_schema.ins_mnodes if $rows != 1 then return -1 endi -#sql select * from information_schema.`modules` -#sql select * from information_schema.`qnodes` -sql select * from information_schema.user_databases +#sql select * from information_schema.ins_modules +#sql select * from information_schema.ins_qnodes +sql select * from information_schema.ins_databases if $rows != 3 then return -1 endi -#sql select * from information_schema.user_functions -#sql select * from information_schema.user_indexes -sql select * from information_schema.user_stables +#sql select * from information_schema.ins_functions +#sql select * from information_schema.ins_indexes +sql select * from information_schema.ins_stables if $rows != 1 then return -1 endi -#sql select * from information_schema.`streams` -sql select * from information_schema.user_tables +#sql select * from information_schema.ins_streams +sql select * from information_schema.ins_tables if $rows <= 0 then return -1 endi -#sql select * from information_schema.user_table_distributed -sql select * from information_schema.user_users +#sql select * from information_schema.ins_table_distributed +sql select * from information_schema.ins_users if $rows != 1 then return -1 endi -sql select * from information_schema.`vgroups` +sql select * from information_schema.ins_vgroups if $rows != 3 then return -1 endi @@ -175,37 +175,37 @@ if $rows != 3 then endi print =============== run select * from information_schema.xxxx -sql select * from information_schema.`dnodes` +sql select * from information_schema.ins_dnodes if $rows != 2 then return -1 endi -sql select * from information_schema.`mnodes` +sql select * from information_schema.ins_mnodes if $rows != 1 then return -1 endi -#sql select * from information_schema.`modules` -#sql select * from information_schema.`qnodes` -sql select * from information_schema.user_databases +#sql select * from information_schema.ins_modules +#sql select * from information_schema.ins_qnodes +sql select * from information_schema.ins_databases if $rows != 3 then return -1 endi -#sql select * from information_schema.user_functions -#sql select * from information_schema.user_indexes -sql select * from information_schema.user_stables +#sql select * from information_schema.ins_functions +#sql select * from information_schema.ins_indexes +sql select * from information_schema.ins_stables if $rows != 1 then return -1 endi -#sql select * from performance_schema.`streams` -sql select * from information_schema.user_tables +#sql select * from performance_schema.perf_streams +sql select * from information_schema.ins_tables if $rows <= 0 then return -1 endi -#sql select * from information_schema.user_table_distributed -sql select * from information_schema.user_users +#sql select * from information_schema.ins_table_distributed +sql select * from information_schema.ins_users if $rows != 1 then return -1 endi -sql select * from information_schema.`vgroups` +sql select * from information_schema.ins_vgroups if $rows != 3 then return -1 endi diff --git a/tests/script/tsim/tmq/basic2Of2ConsOverlap.sim b/tests/script/tsim/tmq/basic2Of2ConsOverlap.sim index d9c6b195d22a52671a125f7f69d1dbe1cd899390..dda5e0059e5c760925e7944b13089b1d3897c0f8 100644 --- a/tests/script/tsim/tmq/basic2Of2ConsOverlap.sim +++ b/tests/script/tsim/tmq/basic2Of2ConsOverlap.sim @@ -342,12 +342,12 @@ endi return -1 check_ok_3: -sql select * from performance_schema.`consumers` +sql select * from performance_schema.perf_consumers if $rows != 0 then return -1 endi -#sql select * from performance_schema.`subscriptions` +#sql select * from performance_schema.perf_subscriptions #if $rows != 0 then # return -1 #endi diff --git a/tests/script/tsim/tmq/snapshot1.sim b/tests/script/tsim/tmq/snapshot1.sim index 58541b725d2bb91d2be26b12c03efb92f00f3530..e586719db2fa7646d487658d09e71693ff557c7a 100644 --- a/tests/script/tsim/tmq/snapshot1.sim +++ b/tests/script/tsim/tmq/snapshot1.sim @@ -294,12 +294,12 @@ endi return -1 check_ok_3: -sql select * from performance_schema.`consumers` +sql select * from performance_schema.perf_consumers if $rows != 0 then return -1 endi -#sql select * from performance_schema.`subscriptions` +#sql select * from performance_schema.perf_subscriptions #if $rows != 0 then # return -1 #endi diff --git a/tests/script/tsim/valgrind/checkError1.sim b/tests/script/tsim/valgrind/checkError1.sim index 059808e4be1d67242382e00dead2c77e5affe5f5..f06a26aec65490e9a53d1a1a9291141d616afbfc 100644 --- a/tests/script/tsim/valgrind/checkError1.sim +++ b/tests/script/tsim/valgrind/checkError1.sim @@ -84,37 +84,37 @@ if $rows != 1 then endi print =============== run select * from information_schema.xxxx -sql select * from information_schema.`dnodes` +sql select * from information_schema.ins_dnodes if $rows != 2 then return -1 endi -sql select * from information_schema.`mnodes` +sql select * from information_schema.ins_mnodes if $rows != 1 then return -1 endi -sql select * from information_schema.user_databases +sql select * from information_schema.ins_databases if $rows != 3 then return -1 endi -sql select * from information_schema.user_stables +sql select * from information_schema.ins_stables if $rows != 1 then return -1 endi -sql select * from information_schema.user_tables +sql select * from information_schema.ins_tables if $rows <= 0 then return -1 endi -sql select * from information_schema.user_users +sql select * from information_schema.ins_users if $rows != 1 then return -1 endi -sql select * from information_schema.`vgroups` +sql select * from information_schema.ins_vgroups if $rows != 3 then return -1 endi diff --git a/tests/script/tsim/valgrind/checkError6.sim b/tests/script/tsim/valgrind/checkError6.sim index eccf5b31f33d675ad815f505f0c17b8a46ab9171..5f67dddee1d2fdfabcdc3fab81467323ffca6bf1 100644 --- a/tests/script/tsim/valgrind/checkError6.sim +++ b/tests/script/tsim/valgrind/checkError6.sim @@ -109,12 +109,12 @@ print =============== step5: explain sql explain analyze select ts from stb where -2; sql explain analyze select ts from tb1; sql explain analyze select ts from stb order by ts; -sql explain analyze select * from information_schema.user_stables; +sql explain analyze select * from information_schema.ins_stables; sql explain analyze select count(*),sum(tbcol) from tb1; sql explain analyze select count(*),sum(tbcol) from stb; sql explain analyze select count(*),sum(tbcol) from stb group by tbcol; -sql explain analyze select * from information_schema.user_stables; -sql explain analyze verbose true select * from information_schema.user_stables where db_name='db2'; +sql explain analyze select * from information_schema.ins_stables; +sql explain analyze verbose true select * from information_schema.ins_stables where db_name='db2'; sql explain analyze verbose true select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from stb where ts <= 1601481840000 and ts >= 1601481800000 partition by tgcol interval(1m) fill(value, 0) sql explain select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from stb where ts <= 1601481840000 and ts >= 1601481800000 partition by tgcol interval(1m) fill(value, 0)