greenplum-db/gporca

Is a bug of CExpression.cpp:505?

tom-tangjp opened this issue · 0 comments

CExpression.cpp:505 Is a bug of 'Pdp(ept)->Derive(m_mp, exprhdl, pdpctxt);' ?

if (NULL == Pdp(ept))
{
GPOS_ASSERT(CDrvdProp::EptRelational != ept);
GPOS_ASSERT(CDrvdProp::EptScalar != ept);

const ULONG arity = Arity();
for (ULONG ul = 0; ul < arity; ul++)
{
	CExpression *pexprChild = (*m_pdrgpexpr)[ul];
	CDrvdProp *pdp = pexprChild->PdpDerive(pdpctxt);

	// add child props to derivation context
	CDrvdPropCtxt::AddDerivedProps(pdp, pdpctxt);
}

exprhdl.CopyStats();

switch (ept)
{
	case CDrvdProp::EptPlan:
		m_pdpplan = GPOS_NEW(m_mp) CDrvdPropPlan();
		break;
	default:
		break;
}

Pdp(ept)->Derive(m_mp, exprhdl, pdpctxt);
}