浏览代码

HPCC-18918 Ensure computed ifblock keys last as long as the deserializer

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 7 年之前
父节点
当前提交
3d469ea395
共有 4 个文件被更改,包括 26 次插入11 次删除
  1. 0 1
      ecl/hql/hqlexpr.cpp
  2. 1 1
      ecl/hqlcpp/hqlcfilter.cpp
  3. 2 0
      rtl/eclrtl/rtldynfield.cpp
  4. 23 9
      testing/regress/ecl/key/serializetypes.xml

+ 0 - 1
ecl/hql/hqlexpr.cpp

@@ -4371,7 +4371,6 @@ void CHqlRealExpression::updateFlagsAfterOperands()
             }
             break;
         }
-
     }
 
 #ifdef VERIFY_EXPR_INTEGRITY

+ 1 - 1
ecl/hqlcpp/hqlcfilter.cpp

@@ -584,7 +584,7 @@ void CppFilterExtractor::buildKeySegmentExpr(BuildFilterState & buildState, KeyS
     if (targetSet && !requiredSet)
     {
         if (createValueSets)
-            createMonitorText.appendf("createFieldFilter(%u, %s.getClear())", selectorInfo.fieldIdx, targetSet);
+            createMonitorText.appendf("createFieldFilter(%u, %s)", selectorInfo.fieldIdx, targetSet);
         else
             createMonitorText.appendf("createKeySegmentMonitor(%s, %s.getClear(), %u, %u, %u)",
                                       boolToText(selectorInfo.keyedKind != KeyedYes), targetSet, selectorInfo.fieldIdx, selectorInfo.offset, selectorInfo.size);

+ 2 - 0
rtl/eclrtl/rtldynfield.cpp

@@ -608,6 +608,7 @@ public:
         const RtlTypeInfo ** found = types.getValue(name);
         if (found)
             return *found;
+        savedTypes.append(LINK(typeOrIfblock));
         info.locale = keep(info.locale);
         const RtlTypeInfo * ret = info.createRtlTypeInfo(callback);
         types.setValue(name, ret);
@@ -637,6 +638,7 @@ private:
     MapStringTo<const RtlTypeInfo *> types;  // Ensures structures only generated once
     const RtlTypeInfo *base = nullptr;       // Holds the resulting type
     IThorIndexCallback *callback = nullptr;
+    IConstPointerArray savedTypes; // ensure types remain alive for subsequent lookups
     void deleteType(const RtlTypeInfo *type)
     {
         if (type)

文件差异内容过多而无法显示
+ 23 - 9
testing/regress/ecl/key/serializetypes.xml