diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 4d4ac6c1e4..621ea7b7fc 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -27,9 +27,14 @@ static int32_t getSchemaBytes(const SSchema* pSchema) { } } +// todo : to convert data according to SSDatablock static void buildRspData(const STableMeta* pMeta, char* pData) { - int32_t* pColSizes = (int32_t*)pData; - pData += DESCRIBE_RESULT_COLS * sizeof(int32_t); + int32_t* payloadLen = (int32_t*) pData; + uint64_t* groupId = (uint64_t*)(pData + sizeof(int32_t)); + + int32_t* pColSizes = (int32_t*)(pData + sizeof(int32_t) + sizeof(uint64_t)); + pData = (char*) pColSizes + DESCRIBE_RESULT_COLS * sizeof(int32_t); + int32_t numOfRows = TABLE_TOTAL_COL_NUM(pMeta); // Field @@ -79,6 +84,9 @@ static void buildRspData(const STableMeta* pMeta, char* pData) { for (int32_t i = 0; i < DESCRIBE_RESULT_COLS; ++i) { pColSizes[i] = htonl(pColSizes[i]); } + + + *payloadLen = (int32_t)(pData - (char*)payloadLen); } static int32_t calcRspSize(const STableMeta* pMeta) { @@ -87,7 +95,8 @@ static int32_t calcRspSize(const STableMeta* pMeta) { (numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_FIELD_LEN) + (numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_TYPE_LEN) + (BitmapLen(numOfRows) + numOfRows * sizeof(int32_t)) + - (numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_NOTE_LEN); + (numOfRows * sizeof(int32_t) + numOfRows * DESCRIBE_RESULT_NOTE_LEN) + + sizeof(int32_t) + sizeof(uint64_t); } static int32_t execDescribe(SNode* pStmt, SRetrieveTableRsp** pRsp) { diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index fd3d6df640..beee11ec18 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -361,7 +361,7 @@ SOperatorInfo* createGroupOperatorInfo(SOperatorInfo* downstream, SExprInfo* pEx pOperator->info = pInfo; pOperator->pTaskInfo = pTaskInfo; - createOperatorFpSet(operatorDummyOpenFn, hashGroupbyAggregate, NULL, NULL, destroyGroupOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL); + pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, hashGroupbyAggregate, NULL, NULL, destroyGroupOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL); code = appendDownstream(pOperator, &downstream, 1); return pOperator; diff --git a/source/libs/executor/test/executorTests.cpp b/source/libs/executor/test/executorTests.cpp index 543df30686..de8df7b916 100644 --- a/source/libs/executor/test/executorTests.cpp +++ b/source/libs/executor/test/executorTests.cpp @@ -199,9 +199,9 @@ SOperatorInfo* createDummyOperator(int32_t startVal, int32_t numOfBlocks, int32_ pOperator->name = "dummyInputOpertor4Test"; if (numOfCols == 1) { - pOperator->getNextFn = getDummyBlock; + pOperator->fpSet.getNextFn = getDummyBlock; } else { - pOperator->getNextFn = get2ColsDummyBlock; + pOperator->fpSet.getNextFn = get2ColsDummyBlock; } SDummyInputInfo *pInfo = (SDummyInputInfo*) taosMemoryCalloc(1, sizeof(SDummyInputInfo));