fix:remove htonl length in block encode
This commit is contained in:
parent
2ad5869659
commit
936b15629f
|
@ -1771,8 +1771,10 @@ static int32_t doConvertJson(SReqResultInfo* pResultInfo, int32_t numOfCols, int
|
||||||
char* pStart = p;
|
char* pStart = p;
|
||||||
char* pStart1 = p1;
|
char* pStart1 = p1;
|
||||||
for (int32_t i = 0; i < numOfCols; ++i) {
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
int32_t colLen = htonl(colLength[i]);
|
// int32_t colLen = htonl(colLength[i]);
|
||||||
int32_t colLen1 = htonl(colLength1[i]);
|
// int32_t colLen1 = htonl(colLength1[i]);
|
||||||
|
int32_t colLen = colLength[i];
|
||||||
|
int32_t colLen1 = colLength1[i];
|
||||||
if(ASSERT(colLen < dataLen)){
|
if(ASSERT(colLen < dataLen)){
|
||||||
tscError("doConvertJson error: colLen:%d >= dataLen:%d", colLen, dataLen);
|
tscError("doConvertJson error: colLen:%d >= dataLen:%d", colLen, dataLen);
|
||||||
return TSDB_CODE_TSC_INTERNAL_ERROR;
|
return TSDB_CODE_TSC_INTERNAL_ERROR;
|
||||||
|
@ -1831,7 +1833,8 @@ static int32_t doConvertJson(SReqResultInfo* pResultInfo, int32_t numOfCols, int
|
||||||
}
|
}
|
||||||
colLen1 = len;
|
colLen1 = len;
|
||||||
totalLen += colLen1;
|
totalLen += colLen1;
|
||||||
colLength1[i] = htonl(len);
|
// colLength1[i] = htonl(len);
|
||||||
|
colLength1[i] = len;
|
||||||
} else if (IS_VAR_DATA_TYPE(pResultInfo->fields[i].type)) {
|
} else if (IS_VAR_DATA_TYPE(pResultInfo->fields[i].type)) {
|
||||||
len = numOfRows * sizeof(int32_t);
|
len = numOfRows * sizeof(int32_t);
|
||||||
memcpy(pStart1, pStart, len);
|
memcpy(pStart1, pStart, len);
|
||||||
|
@ -1919,7 +1922,7 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32
|
||||||
|
|
||||||
char* pStart = p;
|
char* pStart = p;
|
||||||
for (int32_t i = 0; i < numOfCols; ++i) {
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
colLength[i] = htonl(colLength[i]);
|
// colLength[i] = htonl(colLength[i]);
|
||||||
if (colLength[i] >= dataLen) {
|
if (colLength[i] >= dataLen) {
|
||||||
tscError("invalid colLength %d, dataLen %d", colLength[i], dataLen);
|
tscError("invalid colLength %d, dataLen %d", colLength[i], dataLen);
|
||||||
return TSDB_CODE_TSC_INTERNAL_ERROR;
|
return TSDB_CODE_TSC_INTERNAL_ERROR;
|
||||||
|
|
|
@ -2482,8 +2482,8 @@ int32_t blockEncode(const SSDataBlock* pBlock, char* data, int32_t numOfCols) {
|
||||||
}
|
}
|
||||||
data += colSizes[col];
|
data += colSizes[col];
|
||||||
|
|
||||||
colSizes[col] = htonl(colSizes[col]);
|
// colSizes[col] = htonl(colSizes[col]);
|
||||||
uError("blockEncode col bytes:%d, type:%d, size:%d, htonl size:%d", pColRes->info.bytes, pColRes->info.type, htonl(colSizes[col]), colSizes[col]);
|
// uError("blockEncode col bytes:%d, type:%d, size:%d, htonl size:%d", pColRes->info.bytes, pColRes->info.type, htonl(colSizes[col]), colSizes[col]);
|
||||||
}
|
}
|
||||||
|
|
||||||
*actualLen = dataLen;
|
*actualLen = dataLen;
|
||||||
|
@ -2547,7 +2547,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) {
|
||||||
pStart += sizeof(int32_t) * numOfCols;
|
pStart += sizeof(int32_t) * numOfCols;
|
||||||
|
|
||||||
for (int32_t i = 0; i < numOfCols; ++i) {
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
colLen[i] = htonl(colLen[i]);
|
// colLen[i] = htonl(colLen[i]);
|
||||||
ASSERT(colLen[i] >= 0);
|
ASSERT(colLen[i] >= 0);
|
||||||
|
|
||||||
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i);
|
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i);
|
||||||
|
|
|
@ -678,11 +678,12 @@ int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreate
|
||||||
pStart += BitmapLen(numOfRows);
|
pStart += BitmapLen(numOfRows);
|
||||||
}
|
}
|
||||||
char* pData = pStart;
|
char* pData = pStart;
|
||||||
uError("rawBlockBindData col bytes:%d, type:%d, size:%d, htonl size:%d", pColSchema->bytes, pColSchema->type, colLength[c], htonl(colLength[c]));
|
// uError("rawBlockBindData col bytes:%d, type:%d, size:%d, htonl size:%d", pColSchema->bytes, pColSchema->type, colLength[c], htonl(colLength[c]));
|
||||||
|
|
||||||
tColDataAddValueByDataBlock(pCol, pColSchema->type, pColSchema->bytes, numOfRows, offset, pData);
|
tColDataAddValueByDataBlock(pCol, pColSchema->type, pColSchema->bytes, numOfRows, offset, pData);
|
||||||
fields += sizeof(int8_t) + sizeof(int32_t);
|
fields += sizeof(int8_t) + sizeof(int32_t);
|
||||||
pStart += htonl(colLength[c]);
|
pStart += colLength[c];
|
||||||
|
// pStart += htonl(colLength[c]);
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
Loading…
Reference in New Issue