提交 a6801832 编写于 作者: A Alex Duan

[TS-1132]<fix>(query): V24->windows client query slowest fixed1

上级 52232cd2
......@@ -3682,6 +3682,37 @@ void setDefaultOutputBuf(SQueryRuntimeEnv *pRuntimeEnv, SOptrBasicInfo *pInfo, i
initCtxOutputBuffer(pCtx, pDataBlock->info.numOfCols);
}
bool extendColCapacity(SColumnInfoData* pColInfo, int32_t newSize, SQLFunctionCtx* pCtx, int32_t *bufCapacity, bool extendLarge) {
char* p = NULL;
int32_t newCapacity = 0;
if (extendLarge) {
// doulbe newSize
newCapacity = newSize * 2;
p = realloc(pColInfo->pData, (size_t)newCapacity * pColInfo->info.bytes);
}
if (p == NULL) {
// failed then newSize
newCapacity = newSize;
p = realloc(pColInfo->pData, (size_t)newCapacity * pColInfo->info.bytes);
if(p == NULL) {
taosMsleep(1000);
p = realloc(pColInfo->pData, (size_t)newCapacity * pColInfo->info.bytes);
qInfo("MEM realloc memory size %d failed, sleep 1s to try, p=%p", newSize * pColInfo->info.bytes, p);
}
}
if (p != NULL) {
// save new pointer
pColInfo->pData = p;
pCtx->pOutput = p;
(*bufCapacity) = newCapacity;
return true;
}
return false;
}
void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOfInputRows, SQueryRuntimeEnv* runtimeEnv, bool extendLarge) {
SSDataBlock* pDataBlock = pBInfo->pRes;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册