Explorar o código

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 %!s(int64=11) %!d(string=hai) anos
pai
achega
89acc2785b
Modificáronse 1 ficheiros con 5 adicións e 7 borrados
  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;
     }