Преглед на файлове

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 години
родител
ревизия
102f90c850
променени са 1 файла, в които са добавени 7 реда и са изтрити 4 реда
  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(");");