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

V24 deal with clauseLimit to solve

上级 7edc53a8
...@@ -7547,7 +7547,6 @@ int32_t validateLimitNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlN ...@@ -7547,7 +7547,6 @@ int32_t validateLimitNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlN
pQueryInfo->vgroupLimit = pQueryInfo->limit.limit + pQueryInfo->limit.offset; pQueryInfo->vgroupLimit = pQueryInfo->limit.limit + pQueryInfo->limit.offset;
pQueryInfo->limit.limit += pQueryInfo->limit.offset; pQueryInfo->limit.limit += pQueryInfo->limit.offset;
} }
pQueryInfo->offsetAdd = pQueryInfo->limit.offset;
pQueryInfo->limit.offset = 0; pQueryInfo->limit.offset = 0;
} }
} else { } else {
......
...@@ -1871,11 +1871,9 @@ int tscProcessRetrieveGlobalMergeRsp(SSqlObj *pSql) { ...@@ -1871,11 +1871,9 @@ int tscProcessRetrieveGlobalMergeRsp(SSqlObj *pSql) {
// global aggregation may be the upstream for parent query // global aggregation may be the upstream for parent query
SQueryInfo *pQueryInfo = tscGetQueryInfo(pCmd); SQueryInfo *pQueryInfo = tscGetQueryInfo(pCmd);
// reset stable limit // reset stable limit
if (pQueryInfo->offsetAdd > 0){ if (tscOrderedProjectionQueryOnSTable(pQueryInfo, 0)) {
ASSERT(pQueryInfo->limit.limit > pQueryInfo->offsetAdd); pQueryInfo->limit.limit = pQueryInfo->clauseLimit;
pQueryInfo->limit.limit -= pQueryInfo->offsetAdd; pQueryInfo->limit.offset = pQueryInfo->prjOffset;
pQueryInfo->limit.offset = pQueryInfo->offsetAdd;
pQueryInfo->offsetAdd = 0;
} }
if (pQueryInfo->pQInfo == NULL) { if (pQueryInfo->pQInfo == NULL) {
......
...@@ -3371,7 +3371,6 @@ void tscInitQueryInfo(SQueryInfo* pQueryInfo) { ...@@ -3371,7 +3371,6 @@ void tscInitQueryInfo(SQueryInfo* pQueryInfo) {
pQueryInfo->slimit.limit = -1; pQueryInfo->slimit.limit = -1;
pQueryInfo->slimit.offset = 0; pQueryInfo->slimit.offset = 0;
pQueryInfo->offsetAdd = 0;
pQueryInfo->pUpstream = taosArrayInit(4, POINTER_BYTES); pQueryInfo->pUpstream = taosArrayInit(4, POINTER_BYTES);
pQueryInfo->window = TSWINDOW_INITIALIZER; pQueryInfo->window = TSWINDOW_INITIALIZER;
pQueryInfo->multigroupResult = true; pQueryInfo->multigroupResult = true;
...@@ -3862,7 +3861,6 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t ...@@ -3862,7 +3861,6 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t
pNewQueryInfo->window = pQueryInfo->window; pNewQueryInfo->window = pQueryInfo->window;
pNewQueryInfo->range = pQueryInfo->range; pNewQueryInfo->range = pQueryInfo->range;
pNewQueryInfo->limit = pQueryInfo->limit; pNewQueryInfo->limit = pQueryInfo->limit;
pNewQueryInfo->offsetAdd = pQueryInfo->offsetAdd;
pNewQueryInfo->slimit = pQueryInfo->slimit; pNewQueryInfo->slimit = pQueryInfo->slimit;
pNewQueryInfo->order = pQueryInfo->order; pNewQueryInfo->order = pQueryInfo->order;
pNewQueryInfo->tsBuf = NULL; pNewQueryInfo->tsBuf = NULL;
......
...@@ -167,8 +167,6 @@ typedef struct SQueryInfo { ...@@ -167,8 +167,6 @@ typedef struct SQueryInfo {
bool globalMerge; bool globalMerge;
bool multigroupResult; bool multigroupResult;
bool isStddev; bool isStddev;
int64_t offsetAdd; // addition add offset
} SQueryInfo; } SQueryInfo;
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册