From fa72e4d79a93b7aa83ce2fbfa8e76f5f5bce3a64 Mon Sep 17 00:00:00 2001 From: slguan Date: Mon, 29 Jul 2019 11:28:26 +0800 Subject: [PATCH] Fix the #issue 217 --- CMakeLists.txt | 2 +- src/client/src/tscSql.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2e3116d91..308917f268 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Windows") SET(TD_WINDOWS TRUE) ADD_DEFINITIONS(-DWINDOWS) - SET(COMMON_FLAGS "/nologo /WX- /sdl /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-") + SET(COMMON_FLAGS "/nologo /WX- /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-") SET(DEBUG_FLAGS "/Zi /W3 /GL") SET(RELEASE_FLAGS "/W0 /GL") diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 60eae0b974..a58238624f 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -314,6 +314,11 @@ int taos_fetch_block_impl(TAOS_RES *res, TAOS_ROW *rows) { return 0; } + // secondary merge has handle this situation + if (pCmd->command != TSDB_SQL_RETRIEVE_METRIC) { + pRes->numOfTotal += pRes->numOfRows; + } + for (int i = 0; i < pCmd->fieldsInfo.numOfOutputCols; ++i) { pRes->tsrow[i] = TSC_GET_RESPTR_BASE(pRes, pCmd, i, pCmd->order) + pRes->bytes[i] * (1 - pCmd->order.order) * (pRes->numOfRows - 1); @@ -348,7 +353,7 @@ TAOS_ROW taos_fetch_row_impl(TAOS_RES *res) { return NULL; } - /* localreducer has handle this situation */ + // secondary merge has handle this situation if (pCmd->command != TSDB_SQL_RETRIEVE_METRIC) { pRes->numOfTotal += pRes->numOfRows; }