提交 97cd5890 编写于 作者: S shenglian zhou

(query,insert,other):add subscription to data length

上级 bbafe35f
...@@ -2782,6 +2782,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) { ...@@ -2782,6 +2782,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) {
tscSetResRawPtr(pRes, pQueryInfo, pRes->dataConverted); tscSetResRawPtr(pRes, pQueryInfo, pRes->dataConverted);
} }
int32_t subDataLen = 0;
if (pSql->pSubscription != NULL) { if (pSql->pSubscription != NULL) {
int32_t numOfCols = pQueryInfo->fieldsInfo.numOfOutput; int32_t numOfCols = pQueryInfo->fieldsInfo.numOfOutput;
...@@ -2800,6 +2801,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) { ...@@ -2800,6 +2801,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) {
p += sizeof(TSKEY); p += sizeof(TSKEY);
tscUpdateSubscriptionProgress(pSql->pSubscription, uid, key); tscUpdateSubscriptionProgress(pSql->pSubscription, uid, key);
} }
subDataLen = sizeof(int32_t) + numOfTables * sizeof(STableIdInfo);
} }
pRes->row = 0; pRes->row = 0;
...@@ -2807,13 +2809,11 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) { ...@@ -2807,13 +2809,11 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) {
pRes->completed, pRes->qId); pRes->completed, pRes->qId);
int32_t numOfCols = pQueryInfo->fieldsInfo.numOfOutput; int32_t numOfCols = pQueryInfo->fieldsInfo.numOfOutput;
int32_t rowBytes = 0; TAOS_FIELD *pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, numOfCols - 1);
for (int i = 0; i < numOfCols; ++i) { int16_t offset = tscFieldInfoGetOffset(pQueryInfo, numOfCols - 1);
SInternalField* internalField = tscFieldInfoGetInternalField(&pQueryInfo->fieldsInfo, i); int32_t rowBytes = offset + pField->bytes;
rowBytes += internalField->field.bytes; int32_t origSize = rowBytes * pRes->numOfRows + subDataLen;
} int32_t compSize = htonl(pRetrieve->compLen) + numOfCols * sizeof(int32_t) + subDataLen;
int32_t origSize = rowBytes * pRes->numOfRows;
int32_t compSize = htonl(pRetrieve->compLen) + numOfCols * sizeof(int32_t);
int32_t dataLen = (pRetrieve->compressed) ? compSize : origSize; int32_t dataLen = (pRetrieve->compressed) ? compSize : origSize;
if (pRetrieve->extend == 1) { if (pRetrieve->extend == 1) {
STLV* tlv = (STLV*)(pRetrieve->data + dataLen); STLV* tlv = (STLV*)(pRetrieve->data + dataLen);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册