From f46710c718d980eee2674c29065e05f481543789 Mon Sep 17 00:00:00 2001 From: zhouxiongjia <719216473@qq.com> Date: Fri, 30 Jul 2021 17:32:21 +0800 Subject: [PATCH] fix a bug about ROWNUM in partition table --- src/gausskernel/runtime/executor/nodePartIterator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gausskernel/runtime/executor/nodePartIterator.cpp b/src/gausskernel/runtime/executor/nodePartIterator.cpp index a0660b42d..143c5ca05 100644 --- a/src/gausskernel/runtime/executor/nodePartIterator.cpp +++ b/src/gausskernel/runtime/executor/nodePartIterator.cpp @@ -141,9 +141,11 @@ TupleTableSlot* ExecPartIterator(PartIteratorState* node) if (!TupIsNull(slot)) return slot; - node->ps.lefttree->ps_rownum--; /* switch to next partition until we get a unempty tuple */ for (;;) { + /* minus wrong rownum */ + node->ps.lefttree->ps_rownum--; + if (node->currentItr + 1 >= partitionScan) /* have scanned all partitions */ return NULL;