fix: fix ut case issue and crash issue
This commit is contained in:
parent
d146769b19
commit
617cd40541
|
@ -239,6 +239,7 @@ _return:
|
||||||
int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const char *tbName, SCtgDBCache **pDb, SCtgTbCache **pTb) {
|
int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const char *tbName, SCtgDBCache **pDb, SCtgTbCache **pTb) {
|
||||||
SCtgDBCache *dbCache = NULL;
|
SCtgDBCache *dbCache = NULL;
|
||||||
SCtgTbCache *tbCache = NULL;
|
SCtgTbCache *tbCache = NULL;
|
||||||
|
bool vgInCache = false;
|
||||||
|
|
||||||
ctgAcquireDBCache(pCtg, dbFName, &dbCache);
|
ctgAcquireDBCache(pCtg, dbFName, &dbCache);
|
||||||
if (NULL == dbCache) {
|
if (NULL == dbCache) {
|
||||||
|
@ -247,7 +248,6 @@ int32_t ctgAcquireVgMetaFromCache(SCatalog *pCtg, const char *dbFName, const cha
|
||||||
goto _return;
|
goto _return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool vgInCache = false;
|
|
||||||
ctgRLockVgInfo(pCtg, dbCache, &vgInCache);
|
ctgRLockVgInfo(pCtg, dbCache, &vgInCache);
|
||||||
if (!vgInCache) {
|
if (!vgInCache) {
|
||||||
ctgDebug("vgInfo of db %s not in cache", dbFName);
|
ctgDebug("vgInfo of db %s not in cache", dbFName);
|
||||||
|
|
|
@ -248,6 +248,13 @@ int32_t __catalogGetCachedTableHashVgroup(SCatalog* pCtg, const SName* pTableNam
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t __catalogGetCachedTableVgMeta(SCatalog* pCtg, const SName* pTableName, SVgroupInfo* pVgroup, STableMeta** pTableMeta) {
|
||||||
|
int32_t code = g_mockCatalogService->catalogGetTableMeta(pTableName, pTableMeta, true);
|
||||||
|
if (code) return code;
|
||||||
|
code = g_mockCatalogService->catalogGetTableHashVgroup(pTableName, pVgroup, true);
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t __catalogGetTableDistVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const SName* pTableName,
|
int32_t __catalogGetTableDistVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const SName* pTableName,
|
||||||
SArray** pVgList) {
|
SArray** pVgList) {
|
||||||
return g_mockCatalogService->catalogGetTableDistVgInfo(pTableName, pVgList);
|
return g_mockCatalogService->catalogGetTableDistVgInfo(pTableName, pVgList);
|
||||||
|
@ -316,6 +323,7 @@ void initMetaDataEnv() {
|
||||||
stub.set(catalogGetCachedSTableMeta, __catalogGetCachedTableMeta);
|
stub.set(catalogGetCachedSTableMeta, __catalogGetCachedTableMeta);
|
||||||
stub.set(catalogGetTableHashVgroup, __catalogGetTableHashVgroup);
|
stub.set(catalogGetTableHashVgroup, __catalogGetTableHashVgroup);
|
||||||
stub.set(catalogGetCachedTableHashVgroup, __catalogGetCachedTableHashVgroup);
|
stub.set(catalogGetCachedTableHashVgroup, __catalogGetCachedTableHashVgroup);
|
||||||
|
stub.set(catalogGetCachedTableVgMeta, __catalogGetCachedTableVgMeta);
|
||||||
stub.set(catalogGetTableDistVgInfo, __catalogGetTableDistVgInfo);
|
stub.set(catalogGetTableDistVgInfo, __catalogGetTableDistVgInfo);
|
||||||
stub.set(catalogGetDBVgVersion, __catalogGetDBVgVersion);
|
stub.set(catalogGetDBVgVersion, __catalogGetDBVgVersion);
|
||||||
stub.set(catalogGetDBVgList, __catalogGetDBVgList);
|
stub.set(catalogGetDBVgList, __catalogGetDBVgList);
|
||||||
|
|
Loading…
Reference in New Issue