提交 1c08688d 编写于 作者: H Haojun Liao

fix(query): return object instead of free it when error happens.

上级 7c6bc107
......@@ -365,9 +365,8 @@ SRequestObj* launchQuery(STscObj* pTscObj, const char* sql, int sqlLen) {
code = parseSql(pRequest, false, &pQuery, NULL);
if (code != TSDB_CODE_SUCCESS) {
destroyRequest(pRequest);
terrno = code;
return NULL;
pRequest->code = code;
return pRequest;
}
return launchQueryImpl(pRequest, pQuery, code, false);
......@@ -418,7 +417,7 @@ SRequestObj* execQuery(STscObj* pTscObj, const char* sql, int sqlLen) {
while (retryNum++ < REQUEST_MAX_TRY_TIMES) {
pRequest = launchQuery(pTscObj, sql, sqlLen);
if (TSDB_CODE_SUCCESS == pRequest->code || !NEED_CLIENT_HANDLE_ERROR(pRequest->code)) {
if (pRequest == NULL || TSDB_CODE_SUCCESS == pRequest->code || !NEED_CLIENT_HANDLE_ERROR(pRequest->code)) {
break;
}
......
......@@ -4997,6 +4997,7 @@ static int32_t handleLimitOffset(SOperatorInfo* pOperator, SSDataBlock* pBlock)
// check for the limitation in each group
if (pProjectInfo->limit.limit > 0 && pProjectInfo->curOutput + pRes->info.rows >= pProjectInfo->limit.limit) {
pRes->info.rows = (int32_t)(pProjectInfo->limit.limit - pProjectInfo->curOutput);
return PROJECT_RETRIEVE_DONE;
}
if (pRes->info.rows >= pOperator->resultInfo.threshold) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册