瀏覽代碼

Merge branch 'candidate-8.0.x' into candidate-8.2.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 年之前
父節點
當前提交
3c1920eb8b
共有 4 個文件被更改,包括 40 次插入27 次删除
  1. 32 26
      common/thorhelper/thorcommon.cpp
  2. 6 0
      dali/base/dacsds.cpp
  3. 1 0
      dali/base/dacsds.ipp
  4. 1 1
      system/jlib/jptree.ipp

+ 32 - 26
common/thorhelper/thorcommon.cpp

@@ -2013,14 +2013,17 @@ static IOutputMetaData *_getDaliLayoutInfo(MemoryBuffer &layoutBin, IPropertyTre
         if (props.hasProp("_rtlType"))
         {
             props.getPropBin("_rtlType", layoutBin);
-            try
-            {
-                return createTypeInfoOutputMetaData(layoutBin, isGrouped);
-            }
-            catch (IException *E)
+            if (layoutBin.length())
             {
-                EXCLOG(E);
-                error.setown(E); // Save to throw later if we can't recover via ECL
+                try
+                {
+                    return createTypeInfoOutputMetaData(layoutBin, isGrouped);
+                }
+                catch (IException *E)
+                {
+                    EXCLOG(E);
+                    error.setown(E); // Save to throw later if we can't recover via ECL
+                }
             }
         }
         if (props.hasProp("meta"))
@@ -2041,28 +2044,31 @@ static IOutputMetaData *_getDaliLayoutInfo(MemoryBuffer &layoutBin, IPropertyTre
             layoutECL = props.queryProp("@ecl");
         if (layoutECL)
         {
-            const char *kind = props.queryProp("@kind");
-            bool isIndex = (kind && streq(kind, "key"));
-            MultiErrorReceiver errs;
-            Owned<IHqlExpression> expr = parseQuery(layoutECL, &errs);
-            if (expr && (errs.errCount() == 0))
+            if (layoutECL.length())
             {
-                if (props.hasProp("_record_layout"))  // Some old indexes need the payload count patched in from here
-                {
-                    MemoryBuffer mb;
-                    props.getPropBin("_record_layout", mb);
-                    expr.setown(patchEclRecordDefinitionFromRecordLayout(expr, mb));
-                }
-                else if (!expr->hasAttribute(_payload_Atom))
+                const char *kind = props.queryProp("@kind");
+                bool isIndex = (kind && streq(kind, "key"));
+                MultiErrorReceiver errs;
+                Owned<IHqlExpression> expr = parseQuery(layoutECL, &errs);
+                if (expr && (errs.errCount() == 0))
                 {
-                    //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 (props.hasProp("_record_layout"))  // Some old indexes need the payload count patched in from here
+                    {
+                        MemoryBuffer mb;
+                        props.getPropBin("_record_layout", 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))
-                    return createTypeInfoOutputMetaData(layoutBin, isGrouped);
+                    if (exportBinaryType(layoutBin, expr, isIndex))
+                        return createTypeInfoOutputMetaData(layoutBin, isGrouped);
+                }
             }
         }
         if (error)

+ 6 - 0
dali/base/dacsds.cpp

@@ -878,6 +878,12 @@ bool CClientRemoteTree::removeAttribute(const char *attr)
         return false;
 }
 
+void CClientRemoteTree::serializeSelf(MemoryBuffer &tgt)
+{
+    checkExt();
+    PARENT::serializeSelf(tgt);
+}
+
 void CClientRemoteTree::registerRenamed(const char *newName, const char *oldName, unsigned pos, __int64 id)
 {
     mergeState(CPS_Renames);

+ 1 - 0
dali/base/dacsds.ipp

@@ -335,6 +335,7 @@ public:
     virtual void removingElement(IPropertyTree *tree, unsigned pos) override;
     virtual void setAttribute(const char *attr, const char *val) override;
     virtual bool removeAttribute(const char *attr) override;
+    virtual void serializeSelf(MemoryBuffer &tgt) override;
 
 // IPropertyTree
     virtual bool renameTree(IPropertyTree *tree, const char *newName) override;

+ 1 - 1
system/jlib/jptree.ipp

@@ -598,7 +598,6 @@ public:
     aindex_t findChild(IPropertyTree *child, bool remove=false);
     inline bool isnocase() const { return IptFlagTst(flags, ipt_caseInsensitive); }
     ipt_flags queryFlags() const { return (ipt_flags) flags; }
-    void serializeSelf(MemoryBuffer &tgt);
     void serializeCutOff(MemoryBuffer &tgt, int cutoff=-1, int depth=0);
     void deserializeSelf(MemoryBuffer &src);
     void serializeAttributes(MemoryBuffer &tgt);
@@ -626,6 +625,7 @@ public:
     }
     virtual void createChildMap() { children = isnocase()?new ChildMapNC():new ChildMap(); }
     virtual void setName(const char *name) = 0;
+    virtual void serializeSelf(MemoryBuffer &tgt);
 
 // IPropertyTree impl.
     virtual bool hasProp(const char * xpath) const override;