Browse Source

Merge pull request #8026 from richardkchapman/roxie-keyed-join-corruption

HPCC-14692 Fixed size keyed joins may allocate too much memory

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 9 years ago
parent
commit
b4e9b0e4ad
2 changed files with 3 additions and 3 deletions
  1. 1 1
      common/thorhelper/thorcommon.ipp
  2. 2 2
      roxie/ccd/ccdactivities.cpp

+ 1 - 1
common/thorhelper/thorcommon.ipp

@@ -42,7 +42,7 @@
 class THORHELPER_API CachedOutputMetaData
 {
 public:
-    inline CachedOutputMetaData(IOutputMetaData * _rs = NULL) { set(_rs); }
+    explicit inline CachedOutputMetaData(IOutputMetaData * _rs = NULL) { set(_rs); }
 
     inline void set(IOutputMetaData * _meta)
     {

+ 2 - 2
roxie/ccd/ccdactivities.cpp

@@ -4760,7 +4760,7 @@ IMessagePacker *CRoxieKeyedJoinIndexActivity::process()
 {
     MTIME_SECTION(queryActiveTimer(), "CRoxieKeyedJoinIndexActivity::process");
     Owned<IMessagePacker> output = ROQ->createOutputStream(packet->queryHeader(), false, logctx);
-    IOutputMetaData *joinFieldsMeta = helper->queryJoinFieldsRecordSize();
+    CachedOutputMetaData joinFieldsMeta(helper->queryJoinFieldsRecordSize());
     Owned<IEngineRowAllocator> joinFieldsAllocator = getRowAllocator(joinFieldsMeta, basefactory->queryId());
     OptimizedKJRowBuilder rowBuilder(joinFieldsAllocator, joinFieldsMeta, output);
 
@@ -5055,7 +5055,7 @@ IMessagePacker *CRoxieKeyedJoinFetchActivity::process()
     Owned<IEngineRowAllocator> diskAllocator = getRowAllocator(helper->queryDiskRecordSize(), basefactory->queryId());
     RtlDynamicRowBuilder diskRowBuilder(diskAllocator);
 
-    IOutputMetaData *joinFieldsMeta = helper->queryJoinFieldsRecordSize();
+    CachedOutputMetaData joinFieldsMeta(helper->queryJoinFieldsRecordSize());
     Owned<IEngineRowAllocator> joinFieldsAllocator = getRowAllocator(joinFieldsMeta, basefactory->queryId());
     OptimizedKJRowBuilder jfRowBuilder(joinFieldsAllocator, joinFieldsMeta, output);
     CachedOutputMetaData inputFields(helper->queryFetchInputRecordSize());