瀏覽代碼

HPCC-12122 Always pass allocator even for null records

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 10 年之前
父節點
當前提交
6d9d00fa88
共有 2 個文件被更改,包括 23 次插入1 次删除
  1. 1 1
      ecl/hqlcpp/hqlcpp.cpp
  2. 22 0
      ecl/regress/issue12122.ecl

+ 1 - 1
ecl/hqlcpp/hqlcpp.cpp

@@ -5868,7 +5868,7 @@ void HqlCppTranslator::doBuildCall(BuildCtx & ctx, const CHqlBoundTarget * tgt,
             if (curTarget->length)
                 args.append(*LINK(curTarget->length));
             args.append(*createValue(no_reference, curTarget->expr->getType(), LINK(curTarget->expr)));
-            if (hasLinkCountedModifier(retType) && hasNonNullRecord(retType) && getBoolAttribute(external, allocatorAtom, true))
+            if (hasLinkCountedModifier(retType) && getBoolAttribute(external, allocatorAtom, true))
                 args.append(*createRowAllocator(ctx, ::queryRecord(retType)));
 
             localBound.setFromTarget(*curTarget);

+ 22 - 0
ecl/regress/issue12122.ecl

@@ -0,0 +1,22 @@
+
+export MemCached := SERVICE
+  DATASET MGetDataset(CONST VARSTRING servers, CONST VARSTRING key, CONST VARSTRING partitionKey = 'root') : cpp,action,context,entrypoint='MGetData';
+END;
+
+STRING servers := '--SERVER=myIP:11211';
+
+myRec := RECORD
+      integer i1;
+      integer i2;
+      real r1;
+      string name;
+END;
+
+ds1 := DATASET([
+		{2, 3, 3.14, 'pi'},
+		{7, 11, 1.412, 'root2'}
+], myRec);
+
+output(ds1);
+
+MemCached.MGetDataset(servers, 'ds1');