Просмотр исходного кода

HPCC-14744 Use the correct row type for some generated expressions

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 9 лет назад
Родитель
Сommit
fb64e8f68d
3 измененных файлов с 4 добавлено и 6 удалено
  1. 1 1
      ecl/hql/hqlexpr.cpp
  2. 1 2
      ecl/hqlcpp/hqlhtcpp.cpp
  3. 2 3
      ecl/hqlcpp/hqlsource.cpp

+ 1 - 1
ecl/hql/hqlexpr.cpp

@@ -232,9 +232,9 @@ MODULE_INIT(INIT_PRIORITY_HQLINTERNAL)
     sourcePaths = new KeptAtomTable;
     blank = createStringValue("",(unsigned)0);
     cachedActiveTableExpr = createValue(no_activetable);
-    cachedSelfExpr = createValue(no_self, makeRowType(NULL));
     cachedSelfReferenceExpr = createValue(no_selfref);
     cachedNullRecord = createRecord()->closeExpr();
+    cachedSelfExpr = createValue(no_self, makeRowType(cachedNullRecord->getType()));
     OwnedHqlExpr nonEmptyAttr = createAttribute(_nonEmpty_Atom);
     cachedNullRowRecord = createRecord(nonEmptyAttr);
     cachedOne = createConstant(1);

+ 1 - 2
ecl/hqlcpp/hqlhtcpp.cpp

@@ -6941,12 +6941,11 @@ BoundRow * HqlCppTranslator::bindTableCursor(BuildCtx & ctx, IHqlExpression * da
 
 BoundRow * HqlCppTranslator::bindTableCursor(BuildCtx & ctx, IHqlExpression * dataset, const char * name, bool isLinkCounted, node_operator side, IHqlExpression * selSeq)
 {
-    Owned<ITypeInfo> type = makeRowReferenceType(NULL);
+    Owned<ITypeInfo> type = makeRowReferenceType(dataset);
     if (isLinkCounted)
         type.setown(makeAttributeModifier(type.getClear(), getLinkCountedAttr()));
 
     Owned<IHqlExpression> bound = createVariable(name, type.getClear());
-//  Owned<IHqlExpression> bound = createVariable(name, makeRowReferenceType(dataset));
     return bindTableCursor(ctx, dataset, bound, side, selSeq);
 }
 

+ 2 - 3
ecl/hqlcpp/hqlsource.cpp

@@ -1184,9 +1184,8 @@ void SourceBuilder::buildTransformBody(BuildCtx & transformCtx, IHqlExpression *
         }
         else
         {
-            OwnedHqlExpr boundSrc = createVariable("left", makeRowReferenceType(NULL));
-        //  OwnedHqlExpr boundSrc = createVariable("left", makeRowReferenceType(tableExpr));
-            //slightly different because may have virtuals removed.
+            //NOTE: The source is not link counted - it comes from a prefetched row, and does not include any virtual file position field.
+            OwnedHqlExpr boundSrc = createVariable("left", makeRowReferenceType(physicalRecord));
             transformCtx.associateOwn(*new BoundRow(tableExpr->queryNormalizedSelector(), boundSrc, translator.queryRecordOffsetMap(physicalRecord), no_none, NULL));
         }
     }