fix:add json test case
This commit is contained in:
parent
125c0fa575
commit
70312ba0b3
|
@ -605,8 +605,15 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
if (iCol == 0) {
|
if (iCol == 0) {
|
||||||
// TODO : need to update tag index
|
// TODO : need to update tag index
|
||||||
}
|
}
|
||||||
|
|
||||||
ctbEntry.version = version;
|
ctbEntry.version = version;
|
||||||
|
if(pTagSchema->nCols == 1 && pTagSchema->pSchema[0].type == TSDB_DATA_TYPE_JSON){
|
||||||
|
ctbEntry.ctbEntry.pTags = taosMemoryMalloc(pAlterTbReq->nTagVal);
|
||||||
|
if(ctbEntry.ctbEntry.pTags == NULL){
|
||||||
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
goto _err;
|
||||||
|
}
|
||||||
|
memcpy((void*)ctbEntry.ctbEntry.pTags, pAlterTbReq->pTagVal, pAlterTbReq->nTagVal);
|
||||||
|
}else{
|
||||||
SKVRowBuilder kvrb = {0};
|
SKVRowBuilder kvrb = {0};
|
||||||
const SKVRow pOldTag = (const SKVRow)ctbEntry.ctbEntry.pTags;
|
const SKVRow pOldTag = (const SKVRow)ctbEntry.ctbEntry.pTags;
|
||||||
SKVRow pNewTag = NULL;
|
SKVRow pNewTag = NULL;
|
||||||
|
@ -630,6 +637,7 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
|
|
||||||
ctbEntry.ctbEntry.pTags = tdGetKVRowFromBuilder(&kvrb);
|
ctbEntry.ctbEntry.pTags = tdGetKVRowFromBuilder(&kvrb);
|
||||||
tdDestroyKVRowBuilder(&kvrb);
|
tdDestroyKVRowBuilder(&kvrb);
|
||||||
|
}
|
||||||
|
|
||||||
// save to table.db
|
// save to table.db
|
||||||
metaSaveToTbDb(pMeta, &ctbEntry);
|
metaSaveToTbDb(pMeta, &ctbEntry);
|
||||||
|
@ -639,6 +647,7 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
|
|
||||||
tDecoderClear(&dc1);
|
tDecoderClear(&dc1);
|
||||||
tDecoderClear(&dc2);
|
tDecoderClear(&dc2);
|
||||||
|
if (ctbEntry.ctbEntry.pTags) taosMemoryFree((void*)ctbEntry.ctbEntry.pTags);
|
||||||
if (ctbEntry.pBuf) taosMemoryFree(ctbEntry.pBuf);
|
if (ctbEntry.pBuf) taosMemoryFree(ctbEntry.pBuf);
|
||||||
if (stbEntry.pBuf) tdbFree(stbEntry.pBuf);
|
if (stbEntry.pBuf) tdbFree(stbEntry.pBuf);
|
||||||
tdbTbcClose(pTbDbc);
|
tdbTbcClose(pTbDbc);
|
||||||
|
|
Loading…
Reference in New Issue