Skip to content

Commit 323e6dd

Browse files
authored
enh: Code Optimization (#33283)
* enh: Code Optimization * enh: redundant code * fix: log error
1 parent 9f5f335 commit 323e6dd

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

source/client/src/clientSml.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
11181118
pName.tname[nameLen] = '\0';
11191119
taosMemoryFree(measure);
11201120

1121+
pTableMeta = NULL;
11211122
code = catalogGetSTableMeta(info->pCatalog, &conn, &pName, &pTableMeta);
11221123

11231124
if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST || code == TSDB_CODE_MND_STB_NOT_EXIST) {

source/libs/catalog/src/ctgCache.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,11 @@ int32_t ctgReadTbMetaFromCache(SCatalog *pCtg, SCtgTbMetaCtx *ctx, STableMeta **
655655
int32_t code = 0;
656656
SCtgDBCache *dbCache = NULL;
657657
SCtgTbCache *tbCache = NULL;
658-
// taosMemoryFreeClear(*pTableMeta);
659-
*pTableMeta = NULL;
658+
if(*pTableMeta) {
659+
ctgError("Expected pTableMeta to be NULL, uid:0x%" PRIx64 ", suid:0x%" PRIx64, (*pTableMeta)->uid,
660+
(*pTableMeta)->suid);
661+
return TSDB_CODE_INVALID_PARA;
662+
}
660663

661664
char dbFName[TSDB_DB_FNAME_LEN] = {0};
662665
if (CTG_FLAG_IS_SYS_DB(ctx->flag)) {

0 commit comments

Comments
 (0)