Jelajahi Sumber

Merge pull request #4495 from ghalliday/issue9442

HPCC-9442 Avoid ensureCapacity call on fixed size disk read

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 tahun lalu
induk
melakukan
102f90c850
1 mengubah file dengan 7 tambahan dan 4 penghapusan
  1. 7 4
      ecl/hqlcpp/hqlsource.cpp

+ 7 - 4
ecl/hqlcpp/hqlsource.cpp

@@ -1290,10 +1290,13 @@ void SourceBuilder::buildTransformElements(BuildCtx & ctx, IHqlExpression * expr
                 }
             }
 
-            OwnedHqlExpr ensureSize = adjustValue(bound.expr, virtualSize);
-            s.clear().append("crSelf.ensureCapacity(");
-            translator.generateExprCpp(s, ensureSize).append(", NULL);");
-            ctx.addQuoted(s);
+            if (!isFixedSizeRecord(record))
+            {
+                OwnedHqlExpr ensureSize = adjustValue(bound.expr, virtualSize);
+                s.clear().append("crSelf.ensureCapacity(");
+                translator.generateExprCpp(s, ensureSize).append(", NULL);");
+                ctx.addQuoted(s);
+            }
 
             s.clear().append("memcpy(crSelf.row(), left, ");
             translator.generateExprCpp(s, bound.expr).append(");");