Parcourir la source

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

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday il y a 7 ans
Parent
commit
3d469ea395

+ 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)

Fichier diff supprimé car celui-ci est trop grand
+ 23 - 9
testing/regress/ecl/key/serializetypes.xml