提交 d53d9eae 编写于 作者: S shenglian zhou

use compLen as data size when the data is not compressed

上级 c9495a63
...@@ -2782,7 +2782,12 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) { ...@@ -2782,7 +2782,12 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) {
tscSetResRawPtr(pRes, pQueryInfo, pRes->dataConverted); tscSetResRawPtr(pRes, pQueryInfo, pRes->dataConverted);
} }
char* p = pRes->data + (ntohl(pRetrieve->resultRowSize)) * pRes->numOfRows; char* p = NULL;
if (pRetrieve->compressed) {
p = pRetrieve->data + ntohl(pRetrieve->compLen) + pQueryInfo->fieldsInfo.numOfOutput * sizeof(int32_t);
} else {
p = pRetrieve->data + ntohl(pRetrieve->compLen);
}
int32_t numOfTables = htonl(*(int32_t*)p); int32_t numOfTables = htonl(*(int32_t*)p);
p += sizeof(int32_t); p += sizeof(int32_t);
......
...@@ -543,7 +543,6 @@ typedef struct { ...@@ -543,7 +543,6 @@ typedef struct {
typedef struct SRetrieveTableRsp { typedef struct SRetrieveTableRsp {
int8_t extend; int8_t extend;
int32_t numOfRows; int32_t numOfRows;
int32_t resultRowSize;
int8_t completed; // all results are returned to client int8_t completed; // all results are returned to client
int16_t precision; int16_t precision;
int64_t offset; // updated offset value for multi-vnode projection query int64_t offset; // updated offset value for multi-vnode projection query
......
...@@ -402,7 +402,6 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co ...@@ -402,7 +402,6 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co
} }
(*pRsp)->numOfRows = htonl((int32_t)s); (*pRsp)->numOfRows = htonl((int32_t)s);
(*pRsp)->resultRowSize = htonl(pQueryAttr->resultRowSize);
if (pQInfo->code == TSDB_CODE_SUCCESS) { if (pQInfo->code == TSDB_CODE_SUCCESS) {
(*pRsp)->offset = htobe64(pQInfo->runtimeEnv.currentOffset); (*pRsp)->offset = htobe64(pQInfo->runtimeEnv.currentOffset);
(*pRsp)->useconds = htobe64(pQInfo->summary.elapsedTime); (*pRsp)->useconds = htobe64(pQInfo->summary.elapsedTime);
...@@ -434,7 +433,11 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co ...@@ -434,7 +433,11 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co
qDebug("QInfo:0x%"PRIx64" compress col data, uncompressed size:%d, compressed size:%d, ratio:%.2f", qDebug("QInfo:0x%"PRIx64" compress col data, uncompressed size:%d, compressed size:%d, ratio:%.2f",
pQInfo->qId, origSize, compSize, (float)origSize / (float)compSize); pQInfo->qId, origSize, compSize, (float)origSize / (float)compSize);
} }
if ((*pRsp)->compressed) {
(*pRsp)->compLen = htonl(compLen); (*pRsp)->compLen = htonl(compLen);
} else {
(*pRsp)->compLen = htonl(origSize);
}
pQInfo->rspContext = NULL; pQInfo->rspContext = NULL;
pQInfo->dataReady = QUERY_RESULT_NOT_READY; pQInfo->dataReady = QUERY_RESULT_NOT_READY;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册