未验证 提交 ad5edec2 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #16736 from taosdata/fix/mnode

fix: information_schema and performance_schema creation time error
......@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "mndDb.h"
#include "mndCluster.h"
#include "mndDnode.h"
#include "mndOffset.h"
#include "mndPrivilege.h"
......@@ -1714,18 +1715,18 @@ static void mndDumpDbInfoData(SMnode *pMnode, SSDataBlock *pBlock, SDbObj *pDb,
taosMemoryFree(buf);
}
static void setInformationSchemaDbCfg(SDbObj *pDbObj) {
static void setInformationSchemaDbCfg(SMnode *pMnode, SDbObj *pDbObj) {
tstrncpy(pDbObj->name, TSDB_INFORMATION_SCHEMA_DB, tListLen(pDbObj->name));
pDbObj->createdTime = 0;
pDbObj->createdTime = mndGetClusterCreateTime(pMnode);
pDbObj->cfg.numOfVgroups = 0;
pDbObj->cfg.strict = 1;
pDbObj->cfg.replications = 1;
pDbObj->cfg.precision = TSDB_TIME_PRECISION_MILLI;
}
static void setPerfSchemaDbCfg(SDbObj *pDbObj) {
static void setPerfSchemaDbCfg(SMnode *pMnode, SDbObj *pDbObj) {
tstrncpy(pDbObj->name, TSDB_PERFORMANCE_SCHEMA_DB, tListLen(pDbObj->name));
pDbObj->createdTime = 0;
pDbObj->createdTime = mndGetClusterCreateTime(pMnode);
pDbObj->cfg.numOfVgroups = 0;
pDbObj->cfg.strict = 1;
pDbObj->cfg.replications = 1;
......@@ -1756,7 +1757,7 @@ static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc
// Append the information_schema database into the result.
if (!pShow->sysDbRsp) {
SDbObj infoschemaDb = {0};
setInformationSchemaDbCfg(&infoschemaDb);
setInformationSchemaDbCfg(pMnode, &infoschemaDb);
size_t numOfTables = 0;
getVisibleInfosTablesNum(sysinfo, &numOfTables);
mndDumpDbInfoData(pMnode, pBlock, &infoschemaDb, pShow, numOfRows, numOfTables, true, 0, 1);
......@@ -1764,7 +1765,7 @@ static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc
numOfRows += 1;
SDbObj perfschemaDb = {0};
setPerfSchemaDbCfg(&perfschemaDb);
setPerfSchemaDbCfg(pMnode, &perfschemaDb);
numOfTables = 0;
getPerfDbMeta(NULL, &numOfTables);
mndDumpDbInfoData(pMnode, pBlock, &perfschemaDb, pShow, numOfRows, numOfTables, true, 0, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册