From b2fdaf9b5fc9a7842966960adccf82533cda9414 Mon Sep 17 00:00:00 2001 From: Jemish Patel and Jesse Zhang Date: Tue, 2 May 2017 15:42:34 -0700 Subject: [PATCH] More consistent ref-counting [#144468913] We ensure all three cases of PdxlnCorrelatedNLJoin take ownership of the DXLProperties object --- libgpopt/src/translate/CTranslatorExprToDXL.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libgpopt/src/translate/CTranslatorExprToDXL.cpp b/libgpopt/src/translate/CTranslatorExprToDXL.cpp index 805232e0cb..9cf351a3e9 100644 --- a/libgpopt/src/translate/CTranslatorExprToDXL.cpp +++ b/libgpopt/src/translate/CTranslatorExprToDXL.cpp @@ -3256,6 +3256,7 @@ CTranslatorExprToDXL::PdxlnCorrelatedNLJoin { case COperator::EopPhysicalTableScan: { + pdxlprop->AddRef(); // create and return a table scan node pdxln = PdxlnTblScanFromNLJoinOuter(pexprOuterChild, pdxlnCond, pdrgpcr, pdrgpdsBaseTables, pulNonGatherMotions, pdxlprop); break; @@ -3263,6 +3264,7 @@ CTranslatorExprToDXL::PdxlnCorrelatedNLJoin case COperator::EopPhysicalFilter: { + pdxlprop->AddRef(); pdxln = PdxlnResultFromNLJoinOuter(pexprOuterChild, pdxlnCond, pdrgpcr, pdrgpdsBaseTables, pulNonGatherMotions, pfDML, pdxlprop); break; } @@ -3411,7 +3413,6 @@ CTranslatorExprToDXL::PdxlnTblScanFromNLJoinOuter ) { // create a table scan over the input expression, without a filter - pdxlprop->AddRef(); CDXLNode *pdxlnTblScan = PdxlnTblScan ( pexprRelational, @@ -3486,6 +3487,7 @@ CTranslatorExprToDXL::PdxlnResultFromNLJoinOuter { // create a result node from the input expression CDXLNode *pdxlnResult = PdxlnResult(pexprRelational, pdrgpcr, pdrgpdsBaseTables, pulNonGatherMotions, pfDML, pdxlprop); + pdxlprop->Release(); // In case the OuterChild is a physical sequence, it will already have the filter in the partition selector and // dynamic scan, thus we should not replace the filter. -- GitLab