瀏覽代碼

Results with nested records not deserialized

Thor could core when saving a result that contains nested child records,
as the result was not properly deserialized before calling helper->sendResult().

Copied the code from aggregate case which seems to handle it correctly.

Fixes EE issue hpcc-systems/LN#399

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 年之前
父節點
當前提交
ad7391481d
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      thorlcr/activities/result/thresult.cpp

+ 5 - 1
thorlcr/activities/result/thresult.cpp

@@ -63,8 +63,12 @@ public:
             {
                 if (results)
                     throw MakeThorException(TE_UnexpectedMultipleSlaveResults, "Received greater than one result from slaves");
-                const void *result = (const void *)mb.readDirect(sz);
                 IHThorRemoteResultArg *helper = (IHThorRemoteResultArg *)queryHelper();
+                Owned<IRowInterfaces> resultRowIf = createRowInterfaces(helper->queryOutputMeta(), queryActivityId(), queryCodeContext());
+                CThorStreamDeserializerSource mds(sz, mb.readDirect(sz));
+                RtlDynamicRowBuilder rowBuilder(resultRowIf->queryRowAllocator());
+                size32_t sz = resultRowIf->queryRowDeserializer()->deserialize(rowBuilder, mds);
+                OwnedConstThorRow result = rowBuilder.finalizeRowClear(sz);
                 helper->sendResult(result);
                 results = true;
             }