提交 6a204ca4 编写于 作者: H Hongze Cheng

more

上级 fa1d7082
......@@ -504,19 +504,38 @@ static void tTSRowNewImpl(SArray *pArray, STSchema *pTSchema, STSRow2 *pRowT, ST
int32_t tTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow2 **ppRow) {
int32_t code = 0;
STSRow2 rowT = {0};
STSRow2 rowM = {0};
STSRow2 rowK = {0};
uint32_t nData = 0;
// try
tTupleTSRowNew(pArray, pTSchema, &rowT);
tMapTSRowNew(pArray, pTSchema, &rowM, 0);
tTSRowNewImpl(pArray, pTSchema, &rowT, &rowK);
// decide & build
if (rowT.nData <= rowM.nData) {
tTupleTSRowNew(pArray, pTSchema, &rowT);
nData = TMIN(rowT.nData, rowK.nData);
*ppRow = (STSRow2 *)taosMemoryMalloc(sizeof(STSRow2));
if (*ppRow == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY;
goto _exit;
}
(*ppRow)->nData = 0;
(*ppRow)->pData = NULL;
if (nData) {
(*ppRow)->pData = taosMemoryMalloc(nData);
if ((*ppRow)->pData == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY;
goto _exit;
}
}
if (rowT.nData <= rowK.nData) {
(*ppRow)->flags = rowT.flags;
tTSRowNewImpl(pArray, pTSchema, *ppRow, NULL);
} else {
tMapTSRowNew(pArray, pTSchema, &rowM, rowM.flags);
(*ppRow)->flags = rowK.flags;
tTSRowNewImpl(pArray, pTSchema, NULL, *ppRow);
}
_exit:
return code;
}
......@@ -1117,9 +1136,7 @@ int32_t tEncodeTag(SEncoder *pEncoder, const STag *pTag) {
return tEncodeBinary(pEncoder, (const uint8_t *)pTag, pTag->len);
}
int32_t tDecodeTag(SDecoder *pDecoder, STag **ppTag) {
return tDecodeBinary(pDecoder, (uint8_t **)ppTag, NULL);
}
int32_t tDecodeTag(SDecoder *pDecoder, STag **ppTag) { return tDecodeBinary(pDecoder, (uint8_t **)ppTag, NULL); }
int32_t tTagToValArray(const STag *pTag, SArray **ppArray) {
int32_t code = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册