Browse Source

HPCC-18657 Fix problem where import $.^.^ cannot access container

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 7 years ago
parent
commit
e248b62a5f
2 changed files with 20 additions and 1 deletions
  1. 1 1
      ecl/hql/hqlgram2.cpp
  2. 19 0
      ecl/regress/issue18657.eclxml

+ 1 - 1
ecl/hql/hqlgram2.cpp

@@ -10600,7 +10600,7 @@ IHqlExpression * HqlGram::resolveImportModule(const attribute & errpos, IHqlExpr
     const char * parentName = str(parent->queryId());
     if (name == _container_Atom)
     {
-        const char * containerName = str(parent->queryFullContainerId());
+        const char * containerName = str(parent->queryBody()->queryFullContainerId());
         //This is a bit ugly - remove the last qualified module, and resolve the name again.  A more "correct" method
         //saving container pointers hit problems because remote scopes within CHqlMergedScope containers have a remote
         //scope as the parent, rather than the merged scope...

+ 19 - 0
ecl/regress/issue18657.eclxml

@@ -0,0 +1,19 @@
+<Archive build="internal_6.4.8-rc1Debug"
+         eclVersion="6.4.8"
+         legacyImport="0"
+         legacyWhen="0">
+ <Query attributePath="TestX.Fred.Sue.Jo.BWR_Test"/>
+ <Module key="testx" name="TestX"/>
+ <Module key="testx.fred" name="TestX.Fred">
+  <Attribute key="testme" name="TestMe" sourcePath="/home/gavin/dev/issue18657/./TestX/Fred/TestMe.ecl">
+   export TestMe := 10;&#10;&#10;
+  </Attribute>
+ </Module>
+ <Module key="testx.fred.sue" name="TestX.Fred.Sue"/>
+ <Module key="testx.fred.sue.jo" name="TestX.Fred.Sue.Jo">
+  <Attribute key="bwr_test" name="BWR_Test" sourcePath="TestX/Fred/Sue/Jo/BWR_Test.ecl">
+   IMPORT $.^.^ AS M1;
+OUTPUT(M1.TestMe);&#10;
+  </Attribute>
+ </Module>
+</Archive>