Explorar o código

Merge pull request #10968 from ghalliday/issue19308

HPCC-19308 Cleanly report an error if a child query is called too early

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=7) %!d(string=hai) anos
pai
achega
92b7b7cc60
Modificáronse 2 ficheiros con 9 adicións e 1 borrados
  1. 1 1
      ecl/eclagent/eclagent.ipp
  2. 8 0
      ecl/eclagent/eclgraph.cpp

+ 1 - 1
ecl/eclagent/eclagent.ipp

@@ -740,7 +740,7 @@ public:
     void updateProgress(IAgentContext & agent);
     void updateProgress(IStatisticGatherer &progress);
 
-    void ready() { if (!alreadyUpdated) activity->ready(); }
+    void ready();
     void execute() { if (!alreadyUpdated) activity->execute(); }
     void stop() { if (!alreadyUpdated) activity->stop(); }
 

+ 8 - 0
ecl/eclagent/eclgraph.cpp

@@ -725,6 +725,14 @@ void EclGraphElement::updateProgress(IStatisticGatherer &progress)
         activity->updateProgress(progress);
 }
 
+void EclGraphElement::ready()
+{
+    if (!activity)
+        throw makeHThorException(kind, id, subgraph->id, 99, "Attempt to execute an activity that has not been created");
+    if (!alreadyUpdated)
+        activity->ready();
+}
+
 IHThorException * EclGraphElement::makeWrappedException(IException * e)
 {
     throw makeHThorException(kind, id, subgraph->id, e);