Browse Source

Merge branch 'candidate-7.6.x' into candidate-7.8.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 years ago
parent
commit
86ff39a948

+ 17 - 6
common/workunit/workunit.cpp

@@ -15,6 +15,9 @@
     limitations under the License.
 ############################################################################## */
 
+#include <string>
+#include <unordered_set>
+
 #include "jlib.hpp"
 #include "workunit.hpp"
 #include "jprop.hpp"
@@ -5176,6 +5179,16 @@ IConstQuerySetQueryIterator* CWorkUnitFactory::getQuerySetQueriesSorted( WUQuery
         void populateQueryTree(const IPropertyTree* querySetTree, IPropertyTree* queryTree)
         {
             const char* querySetId = querySetTree->queryProp("@id");
+
+            std::unordered_set<std::string> aliasSet;
+            Owned<IPropertyTreeIterator> aliasIter = querySetTree->getElements("Alias");
+            ForEach(*aliasIter)
+            {
+                const char *id = aliasIter->query().queryProp("@id");
+                if (!isEmptyString(id))
+                    aliasSet.insert(id);
+            }
+
             VStringBuffer path("Query%s", xPath.get());
             Owned<IPropertyTreeIterator> iter = querySetTree->getElements(path.str());
             ForEach(*iter)
@@ -5192,9 +5205,7 @@ IConstQuerySetQueryIterator* CWorkUnitFactory::getQuerySetQueriesSorted( WUQuery
                         if (!subset->getValue(match))
                             continue;
                     }
-                    VStringBuffer aliasXPath("Alias[@id='%s']", queryId);
-                    IPropertyTree *alias = querySetTree->queryPropTree(aliasXPath.str());
-                    if (alias)
+                    if (aliasSet.find(queryId) != aliasSet.end())
                         activated = true;
                 }
                 if (activated && (postFilters.activatedFilter == WUQFSNo))
@@ -5219,15 +5230,15 @@ IConstQuerySetQueryIterator* CWorkUnitFactory::getQuerySetQueriesSorted( WUQuery
             Owned<IRemoteConnection> conn = querySDS().connect(querySetXPath.str(), myProcessSession(), 0, SDS_LOCK_TIMEOUT);
             if (!conn)
                 return NULL;
-
+            IPropertyTree *root = conn->queryRoot()->queryBranch(nullptr);
             if (querySet.isEmpty())
             {
-                Owned<IPropertyTreeIterator> querySetIter = conn->queryRoot()->getElements("*");
+                Owned<IPropertyTreeIterator> querySetIter = root->getElements("*");
                 ForEach(*querySetIter)
                     populateQueryTree(&querySetIter->query(), queryTree);
             }
             else
-                populateQueryTree(conn->queryRoot(), queryTree);
+                populateQueryTree(root, queryTree);
             return conn.getClear();
         }
     public:

+ 41 - 0
ecl/regress/issue24245a.ecl

@@ -0,0 +1,41 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+
+numberRecord :=
+            RECORD
+string20000   number;
+            END;
+
+number2Record :=
+            RECORD
+string20001   number;
+            END;
+
+numbersRecord := RECORD
+  EMBEDDED DATASET(number2Record) numbers;
+END;
+
+
+
+ds := DATASET(300000, transform(numberRecord, SELF.number := (string)COUNTER));
+
+r := ROLLUP(NOFOLD(GROUP(ds, number[50000], LOCAL)), GROUP,
+            transform(numbersRecord, SELF.numbers := project(ROWS(LEFT),
+                                                             transform(number2Record, SELF.number := LEFT.number))));
+
+output(count(nofold(r)));

+ 41 - 0
ecl/regress/issue24245b.ecl

@@ -0,0 +1,41 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+
+numberRecord :=
+            RECORD
+string2000000   number;
+            END;
+
+number2Record :=
+            RECORD
+string2000001   number;
+            END;
+
+numbersRecord := RECORD
+  EMBEDDED DATASET(number2Record) numbers;
+END;
+
+
+
+ds := DATASET(3000, transform(numberRecord, SELF.number := (string)COUNTER));
+
+r := ROLLUP(NOFOLD(GROUP(ds, number[50000], LOCAL)), GROUP,
+            transform(numbersRecord, SELF.numbers := project(ROWS(LEFT),
+                                                             transform(number2Record, SELF.number := LEFT.number))));
+
+output(count(nofold(r)));

+ 1 - 1
esp/src/src/ESPRequest.ts

@@ -20,7 +20,7 @@ class RequestHelper {
 
     constructor() {
         this.serverIP = (typeof debugConfig !== "undefined") ? debugConfig.IP : this.getParamFromURL("ServerIP");
-        this.timeOutSeconds = 60;
+        this.timeOutSeconds = 120;
     }
 
     getParamFromURL(key) {

+ 3 - 0
esp/src/src/WsWorkunits.ts

@@ -210,6 +210,9 @@ export function WUResult(params) {
 }
 
 export function WUQueryGetGraph(params) {
+    if (params.request) {
+        params.request.timeOutSeconds = 300;  // 5 minutes
+    }
     return ESPRequest.send("WsWorkunits", "WUQueryGetGraph", params);
 }
 

+ 8 - 3
rtl/eclrtl/rtlds.cpp

@@ -32,9 +32,10 @@ unsigned getNextSize(unsigned max, unsigned required)
 {
     if (required > DOUBLE_LIMIT)
     {
-        max = (required + DOUBLE_LIMIT) & ~(DOUBLE_LIMIT-1);
-        if (required >= max)
-            throw MakeStringException(-1, "getNextSize: Request for %d bytes oldMax = %d", required, max);
+        unsigned nextMax = (required + DOUBLE_LIMIT) & ~(DOUBLE_LIMIT-1);
+        if (required >= nextMax)
+            throw MakeStringException(-1, "Request to create an embedded dataset exceeded 4Gb.  [Old size = %u]", max);
+        max = nextMax;
     }
     else
     {
@@ -76,6 +77,10 @@ void RtlDatasetBuilder::ensure(size32_t required)
 
 byte * RtlDatasetBuilder::ensureCapacity(size32_t required, const char * fieldName)
 {
+    //Check if the required memory wraps within a size32_t type
+    if (totalSize + required < totalSize)
+        throw MakeStringException(-1, "Request to create an embedded dataset >= 4Gb.  [Old size = %u, extra = %u]", totalSize, required);
+
     ensure(totalSize + required);
     return self; // self is updated by ensure()
 }