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 type = pResultInfo->fields[i].type;
|
||||||
int32_t bytes = pResultInfo->fields[i].bytes;
|
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]);
|
char* p = taosMemoryRealloc(pResultInfo->convertBuf[i], colLength[i]);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
|
|
@ -1406,7 +1406,7 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sVal.valType == TD_VTYPE_NULL) {
|
if (sVal.valType == TD_VTYPE_NULL) {
|
||||||
colDataAppend(pColInfo, k, NULL, true);
|
colDataAppendNULL(pColInfo, k);
|
||||||
} else {
|
} else {
|
||||||
colDataAppend(pColInfo, k, sVal.val, false);
|
colDataAppend(pColInfo, k, sVal.val, false);
|
||||||
}
|
}
|
||||||
|
@ -1419,9 +1419,13 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
|
||||||
TASSERT(0);
|
TASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sVal.valType == TD_VTYPE_NULL) {
|
||||||
|
colDataAppendNULL(pColInfo, k);
|
||||||
|
} else {
|
||||||
colDataAppend(pColInfo, k, sVal.val, false);
|
colDataAppend(pColInfo, k, sVal.val, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -6646,38 +6646,6 @@ bool validateExprColumnInfo(SQueriedTableInfo* pTableInfo, SExprBasicInfo* pExpr
|
||||||
return j != INT32_MIN;
|
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,
|
static SResSchema createResSchema(int32_t type, int32_t bytes, int32_t slotId, int32_t scale, int32_t precision,
|
||||||
const char* name) {
|
const char* name) {
|
||||||
SResSchema s = {0};
|
SResSchema s = {0};
|
||||||
|
|
Loading…
Reference in New Issue