Kaynağa Gözat

HPCC-13821 Ensure owner activity initialized on child query init

If a child query initialization is dependent on an owner activity
and that owner is in a higher child activity, need to ensure it
too is initialized.

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Jake Smith 10 yıl önce
ebeveyn
işleme
4dc29331f0
1 değiştirilmiş dosya ile 7 ekleme ve 1 silme
  1. 7 1
      thorlcr/graph/thgraph.cpp

+ 7 - 1
thorlcr/graph/thgraph.cpp

@@ -554,7 +554,13 @@ void CGraphElementBase::onCreate()
     if (!nullAct)
     {
         CGraphElementBase *ownerActivity = owner->queryOwner() ? owner->queryOwner()->queryElement(ownerId) : NULL;
-        baseHelper->onCreate(queryCodeContext(), ownerActivity ? ownerActivity->queryHelper() : NULL, haveCreateCtx?&createCtxMb:NULL);
+        if (ownerActivity)
+        {
+            ownerActivity->onCreate(); // ensure owner created, might not be if this is child query inside another child query.
+            baseHelper->onCreate(queryCodeContext(), ownerActivity->queryHelper(), haveCreateCtx?&createCtxMb:NULL);
+        }
+        else
+            baseHelper->onCreate(queryCodeContext(), NULL, haveCreateCtx?&createCtxMb:NULL);
     }
 }