提交 a721d0d2 编写于 作者: S slguan

fix the issue #504

上级 cd7e59cf
...@@ -457,7 +457,7 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) { ...@@ -457,7 +457,7 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
// projection query on metric, pipeline retrieve data from vnode list, instead // projection query on metric, pipeline retrieve data from vnode list, instead
// of two-stage mergevnodeProcessMsgFromShell free qhandle // of two-stage mergevnodeProcessMsgFromShell free qhandle
nRows = taos_fetch_block_impl(res, rows); nRows = taos_fetch_block_impl(res, rows);
if (*rows == NULL && tscProjectionQueryOnMetric(pSql)) { while (*rows == NULL && tscProjectionQueryOnMetric(pSql)) {
/* reach the maximum number of output rows, abort */ /* reach the maximum number of output rows, abort */
if (pCmd->globalLimit > 0 && pRes->numOfTotal >= pCmd->globalLimit) { if (pCmd->globalLimit > 0 && pRes->numOfTotal >= pCmd->globalLimit) {
return 0; return 0;
...@@ -465,6 +465,7 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) { ...@@ -465,6 +465,7 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
/* update the limit value according to current retrieval results */ /* update the limit value according to current retrieval results */
pCmd->limit.limit = pSql->cmd.globalLimit - pRes->numOfTotal; pCmd->limit.limit = pSql->cmd.globalLimit - pRes->numOfTotal;
pCmd->limit.offset = pRes->offset;
if ((++pSql->cmd.vnodeIdx) <= pSql->cmd.pMetricMeta->numOfVnodes) { if ((++pSql->cmd.vnodeIdx) <= pSql->cmd.pMetricMeta->numOfVnodes) {
pSql->cmd.command = TSDB_SQL_SELECT; pSql->cmd.command = TSDB_SQL_SELECT;
...@@ -472,6 +473,11 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) { ...@@ -472,6 +473,11 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
tscProcessSql(pSql); tscProcessSql(pSql);
nRows = taos_fetch_block_impl(res, rows); nRows = taos_fetch_block_impl(res, rows);
} }
// check!!!
if (*rows != NULL || pCmd->vnodeIdx >= pCmd->pMetricMeta->numOfVnodes) {
break;
}
} }
return nRows; return nRows;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册