fix(query): load the null data in nchar/binary columns.
This commit is contained in:
parent
cf890f6e10
commit
9899a5e6b0
|
@ -740,7 +740,7 @@ static int32_t doConvertUCS4(SReqResultInfo* pResultInfo, int32_t numOfRows, int
|
|||
int32_t type = pResultInfo->fields[i].type;
|
||||
int32_t bytes = pResultInfo->fields[i].bytes;
|
||||
|
||||
if (type == TSDB_DATA_TYPE_NCHAR) {
|
||||
if (type == TSDB_DATA_TYPE_NCHAR && colLength[i] > 0) {
|
||||
char* p = taosMemoryRealloc(pResultInfo->convertBuf[i], colLength[i]);
|
||||
if (p == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
|
|
@ -1406,7 +1406,7 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
|
|||
}
|
||||
|
||||
if (sVal.valType == TD_VTYPE_NULL) {
|
||||
colDataAppend(pColInfo, k, NULL, true);
|
||||
colDataAppendNULL(pColInfo, k);
|
||||
} else {
|
||||
colDataAppend(pColInfo, k, sVal.val, false);
|
||||
}
|
||||
|
@ -1419,7 +1419,11 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
|
|||
TASSERT(0);
|
||||
}
|
||||
|
||||
colDataAppend(pColInfo, k, sVal.val, false);
|
||||
if (sVal.valType == TD_VTYPE_NULL) {
|
||||
colDataAppendNULL(pColInfo, k);
|
||||
} else {
|
||||
colDataAppend(pColInfo, k, sVal.val, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6646,38 +6646,6 @@ bool validateExprColumnInfo(SQueriedTableInfo* pTableInfo, SExprBasicInfo* pExpr
|
|||
return j != INT32_MIN;
|
||||
}
|
||||
|
||||
static int32_t deserializeColFilterInfo(SColumnFilterInfo* pColFilters, int16_t numOfFilters, char** pMsg) {
|
||||
for (int32_t f = 0; f < numOfFilters; ++f) {
|
||||
SColumnFilterInfo* pFilterMsg = (SColumnFilterInfo*)(*pMsg);
|
||||
|
||||
SColumnFilterInfo* pColFilter = &pColFilters[f];
|
||||
pColFilter->filterstr = htons(pFilterMsg->filterstr);
|
||||
|
||||
(*pMsg) += sizeof(SColumnFilterInfo);
|
||||
|
||||
if (pColFilter->filterstr) {
|
||||
pColFilter->len = htobe64(pFilterMsg->len);
|
||||
|
||||
pColFilter->pz =
|
||||
(int64_t)taosMemoryCalloc(1, (size_t)(pColFilter->len + 1 * TSDB_NCHAR_SIZE)); // note: null-terminator
|
||||
if (pColFilter->pz == 0) {
|
||||
return TSDB_CODE_QRY_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
memcpy((void*)pColFilter->pz, (*pMsg), (size_t)pColFilter->len);
|
||||
(*pMsg) += (pColFilter->len + 1);
|
||||
} else {
|
||||
pColFilter->lowerBndi = htobe64(pFilterMsg->lowerBndi);
|
||||
pColFilter->upperBndi = htobe64(pFilterMsg->upperBndi);
|
||||
}
|
||||
|
||||
pColFilter->lowerRelOptr = htons(pFilterMsg->lowerRelOptr);
|
||||
pColFilter->upperRelOptr = htons(pFilterMsg->upperRelOptr);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
static SResSchema createResSchema(int32_t type, int32_t bytes, int32_t slotId, int32_t scale, int32_t precision,
|
||||
const char* name) {
|
||||
SResSchema s = {0};
|
||||
|
|
Loading…
Reference in New Issue