Browse Source

HPCC-14811 Avoid duplicating annotations on expressions

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 9 years ago
parent
commit
d3899ae2e9
1 changed files with 4 additions and 1 deletions
  1. 4 1
      ecl/hql/hqlexpr.cpp

+ 4 - 1
ecl/hql/hqlexpr.cpp

@@ -8809,7 +8809,10 @@ public:
             if (expr->queryChild(1) == searchModule)
             {
                 IIdAtom * id = expr->queryChild(3)->queryId();
-                return getVirtualReplacement(id);
+                OwnedHqlExpr replacement = getVirtualReplacement(id);
+                if (expr == replacement->queryBody())
+                    return LINK(expr);
+                return replacement.getClear();
             }
             break;
         }