diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index f98b195039..74d5f03dc1 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -866,13 +866,15 @@ STableCfg* tableCfgDup(STableCfg* pCfg) { memcpy(pNew, pCfg, sizeof(*pNew)); if (NULL != pNew->pComment) { - pNew->pComment = strdup(pNew->pComment); + pNew->pComment = taosMemoryCalloc(pNew->commentLen + 1, 1); + memcpy(pNew->pComment, pCfg->pComment, pNew->commentLen); } if (NULL != pNew->pFuncs) { pNew->pFuncs = taosArrayDup(pNew->pFuncs); } if (NULL != pNew->pTags) { - pNew->pTags = strdup(pNew->pTags); + pNew->pTags = taosMemoryCalloc(pNew->tagsLen + 1, 1); + memcpy(pNew->pTags, pCfg->pTags, pNew->tagsLen); } int32_t schemaSize = (pCfg->numOfColumns + pCfg->numOfTags) * sizeof(SSchema); diff --git a/tests/script/api/batchprepare.c b/tests/script/api/batchprepare.c index e1aa1991a4..ada2039460 100644 --- a/tests/script/api/batchprepare.c +++ b/tests/script/api/batchprepare.c @@ -250,7 +250,7 @@ CaseCtrl gCaseCtrl = { #endif -#if 0 +#if 1 CaseCtrl gCaseCtrl = { // default .precision = TIME_PRECISION_MILLI, .bindNullNum = 0, @@ -282,7 +282,7 @@ CaseCtrl gCaseCtrl = { // default }; #endif -#if 1 +#if 0 CaseCtrl gCaseCtrl = { // query case with specified col&oper .bindNullNum = 1, .printCreateTblSql = false,