Parcourir la source

HPCC-10784 Keyed limits on stepped indexreads can be miscalculated

Fix other issues spotted in code review (which might review in spurious LIMITs
being reported in ,LOCAL files).

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman il y a 11 ans
Parent
commit
89acc2785b
1 fichiers modifiés avec 5 ajouts et 7 suppressions
  1. 5 7
      system/jhtree/jhtree.cpp

+ 5 - 7
system/jhtree/jhtree.cpp

@@ -2791,13 +2791,11 @@ public:
             unsigned key = mergeheap[i];
             keyBuffer = buffers[key];
             keyCursor = cursors[key];
-            ret += CKeyLevelManager::checkCount(max);
-            if (max)
-            {
-                if (ret > max)
-                    return ret;
-                max -= ret;
-            }
+            unsigned __int64 thisKeyCount = CKeyLevelManager::checkCount(max);
+            ret += thisKeyCount;
+            if (thisKeyCount > max)
+                return ret;
+            max -= thisKeyCount;
         }
         return ret;
     }