瀏覽代碼

Merge pull request #14332 from richardkchapman/hpcc-22306

HPCC-22306 Input activities for an If action are not stopped if if is unexecuted

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Merged-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 4 年之前
父節點
當前提交
08a66ae5fb
共有 3 個文件被更改,包括 33 次插入1 次删除
  1. 14 1
      roxie/ccd/ccdserver.cpp
  2. 16 0
      testing/regress/ecl/ifaction2.ecl
  3. 3 0
      testing/regress/ecl/key/ifaction2.xml

+ 14 - 1
roxie/ccd/ccdserver.cpp

@@ -21010,7 +21010,7 @@ public:
     {
     }
 
-    virtual void doExecuteAction(unsigned parentExtractSize, const byte * parentExtract) 
+    virtual void doExecuteAction(unsigned parentExtractSize, const byte * parentExtract) override
     {
         bool cond;
         {
@@ -21021,6 +21021,19 @@ public:
         executeDependencies(parentExtractSize, parentExtract, cond ? 1 : 2);
     }
 
+    virtual void stop() override
+    {
+        if (state != STATEstopped)
+        {
+            ForEachItemIn(idx, dependencies)
+            {
+                if (dependencyControlIds.item(idx) != 0)
+                    dependencies.item(idx).stop();
+            }
+        }
+        CRoxieServerActionBaseActivity::stop();
+    }
+
 };
 
 class CRoxieServerIfActionActivityFactory : public CRoxieServerActivityFactory

+ 16 - 0
testing/regress/ecl/ifaction2.ecl

@@ -0,0 +1,16 @@
+#option ('resourceConditionalActions', true);
+
+d := NOFOLD(DATASET([{1},{2},{3}], { unsigned v; }));
+
+spl1 := NOFOLD(d);
+spl2 := NOFOLD(d(v=1));
+spl3 := NOFOLD(d(v=2));
+
+s2 := NOFOLD(true) : STORED('s2');
+s3 := NOFOLD(false) : stored('s3');
+
+unstopped := IF(s2, OUTPUT(spl1), OUTPUT(spl2));
+
+stopped := IF(s3, unstopped, OUTPUT(spl3));
+
+stopped;

+ 3 - 0
testing/regress/ecl/key/ifaction2.xml

@@ -0,0 +1,3 @@
+<Dataset name='Result 3'>
+ <Row><v>2</v></Row>
+</Dataset>