From 7fd0d024fc667ea4dc7207e9e5931e36f5e3f0bf Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 10 Dec 2024 09:15:15 +0800 Subject: [PATCH] fix: windows compile issue --- cmake/cmake.define | 2 +- source/common/src/tglobal.c | 2 +- source/libs/executor/src/executorInt.c | 3 +-- source/libs/qworker/src/qwUtil.c | 4 ++-- tests/script/api/asyncQuery.c | 2 ++ 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmake/cmake.define b/cmake/cmake.define index eb95feaf82..a794d927ad 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -131,7 +131,7 @@ IF(TD_WINDOWS) SET(COMMON_FLAGS "/w /D_WIN32 /DWIN32 /Zi /MTd") ENDIF() - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /FORCE:MULTIPLE") # IF (MSVC AND (MSVC_VERSION GREATER_EQUAL 1900)) # SET(COMMON_FLAGS "${COMMON_FLAGS} /Wv:18") diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 6338f75ec4..c5b644578f 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -56,7 +56,7 @@ int32_t tsShellActivityTimer = 3; // second // memory pool int8_t tsMemPoolFullFunc = 0; -int8_t tsQueryUseMemoryPool = 0; +int8_t tsQueryUseMemoryPool = 1; int32_t tsQueryBufferPoolSize = 0; //MB int32_t tsSingleQueryMaxMemorySize = 0; //MB int32_t tsMinReservedMemorySize = 0; //MB diff --git a/source/libs/executor/src/executorInt.c b/source/libs/executor/src/executorInt.c index 0fb6c98317..6ba74232c2 100644 --- a/source/libs/executor/src/executorInt.c +++ b/source/libs/executor/src/executorInt.c @@ -988,8 +988,7 @@ int32_t getBufferPgSize(int32_t rowSize, uint32_t* defaultPgsz, int64_t* default // The default buffer for each operator in query is 10MB. // at least four pages need to be in buffer // TODO: make this variable to be configurable. -// *defaultBufsz = 4096 * 2560; - *defaultBufsz = 4096UL * 2560000; + *defaultBufsz = 4096 * 2560; if ((*defaultBufsz) <= (*defaultPgsz)) { (*defaultBufsz) = (*defaultPgsz) * 4; if (*defaultBufsz < ((int64_t)(*defaultPgsz)) * 4) { diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index 5ea175f04c..f06b13e14a 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -870,7 +870,7 @@ void qwChkDropTimeoutQuery(SQWorker *mgmt, int32_t currTs) { void *pIter = taosHashIterate(mgmt->ctxHash, NULL); while (pIter) { SQWTaskCtx *ctx = (SQWTaskCtx *)pIter; - if (((ctx->lastAckTs <= 0) || (currTs - ctx->lastAckTs) < 60 /*tsQueryNoFetchTimeoutSec*/) && (!QW_EVENT_RECEIVED(ctx, QW_EVENT_DROP))) { + if (((ctx->lastAckTs <= 0) || (currTs - ctx->lastAckTs) < tsQueryNoFetchTimeoutSec) && (!QW_EVENT_RECEIVED(ctx, QW_EVENT_DROP))) { pIter = taosHashIterate(mgmt->ctxHash, pIter); continue; } @@ -880,7 +880,7 @@ void qwChkDropTimeoutQuery(SQWorker *mgmt, int32_t currTs) { sId = ctx->sId; - (void)qwStopTask(QW_FPARAMS(), ctx, true, TSDB_CODE_QRY_NO_FETCH_TIMEOUT); + (void)qwStopTask(QW_FPARAMS(), ctx, true, (QW_EVENT_RECEIVED(ctx, QW_EVENT_DROP)) ? ctx->rspCode : TSDB_CODE_QRY_NO_FETCH_TIMEOUT); pIter = taosHashIterate(mgmt->ctxHash, pIter); } diff --git a/tests/script/api/asyncQuery.c b/tests/script/api/asyncQuery.c index ef1218570b..50c8a227a4 100644 --- a/tests/script/api/asyncQuery.c +++ b/tests/script/api/asyncQuery.c @@ -96,6 +96,8 @@ int main(int argc, char* argv[]) { printf("************ prepare data *************\n"); + //create table tbx (ts timestamp, f1 int); insert into tbx values('2024-11-11 00:00:00', 1); + for (int64_t i = 0; i < 1000000000; ++i) { verifyQueryAsync(taos); printf("%llu queries launched, errTimes:%lld \n", i * 10, errTimes);