Browse Source

HPCC-22675 Fix row translation for very old indexes (pre 2007)

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 5 years ago
parent
commit
d94caff41c
1 changed files with 8 additions and 0 deletions
  1. 8 0
      common/thorhelper/thorcommon.cpp

+ 8 - 0
common/thorhelper/thorcommon.cpp

@@ -2033,6 +2033,14 @@ static IOutputMetaData *_getDaliLayoutInfo(MemoryBuffer &layoutBin, IPropertyTre
                     props.getPropBin("_record_layout", mb);
                     props.getPropBin("_record_layout", mb);
                     expr.setown(patchEclRecordDefinitionFromRecordLayout(expr, mb));
                     expr.setown(patchEclRecordDefinitionFromRecordLayout(expr, mb));
                 }
                 }
+                else if (!expr->hasAttribute(_payload_Atom))
+                {
+                    //Very old records before _record_layout was added to the meta information (November 2006!)
+                    IHqlExpression * lastField = queryLastField(expr);
+                    if (lastField && lastField->queryType()->isInteger())
+                        expr.setown(prependOwnedOperand(expr, createAttribute(_payload_Atom, createConstant(1))));
+                }
+
                 if (exportBinaryType(layoutBin, expr, isIndex))
                 if (exportBinaryType(layoutBin, expr, isIndex))
                     return createTypeInfoOutputMetaData(layoutBin, isGrouped);
                     return createTypeInfoOutputMetaData(layoutBin, isGrouped);
             }
             }