浏览代码

Merge pull request #7323 from ghalliday/issue13561

HPCC-13561 Fix core and problems with alias scope in transform

Reviewed-By: Jamie Noss <james.noss@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 年之前
父节点
当前提交
4153b66d65
共有 2 个文件被更改,包括 10 次插入2 次删除
  1. 8 2
      ecl/hql/hqlexpr.cpp
  2. 2 0
      ecl/hql/hqlutil.cpp

+ 8 - 2
ecl/hql/hqlexpr.cpp

@@ -1935,6 +1935,10 @@ childDatasetType getChildDatasetType(IHqlExpression * expr)
     case no_assertdistributed:
     case no_extractresult:
         return childdataset_dataset;
+    case no_alias_scope:
+        if (expr->isDataset())
+            return childdataset_dataset_noscope;
+        return childdataset_none;
     case no_keyedlimit:
     case no_preload:
     case no_limit:
@@ -1945,7 +1949,6 @@ childDatasetType getChildDatasetType(IHqlExpression * expr)
     case no_split:
     case no_spill:
     case no_activerow:
-    case no_alias_scope:
     case no_executewhen:  //second argument is independent of the other arguments
     case no_selectnth:
     case no_readspill:
@@ -2123,9 +2126,12 @@ inline unsigned doGetNumChildTables(IHqlExpression * dataset)
     case no_nwayjoin:
     case no_nwaymerge:
         return 0;       //??
+    case no_alias_scope:
+        if (dataset->isDataset())
+            return 1;
+        return 0;
     case no_selfjoin:
     case no_alias_project:
-    case no_alias_scope:
     case no_newaggregate:
     case no_apply:
     case no_cachealias:

+ 2 - 0
ecl/hql/hqlutil.cpp

@@ -8806,6 +8806,8 @@ IHqlExpression * queryTransformAssign(IHqlExpression * transform, IHqlExpression
     ForEachChild(i, transform)
     {
         IHqlExpression * cur = transform->queryChild(i);
+        if (cur->getOperator() == no_alias_scope)
+            cur = cur->queryChild(0);
         switch (cur->getOperator())
         {
         case no_assignall: