Exemple #1
0
//---------------------------------------------------------------------------
//	@function:
//		CScalarOp::PmdidType
//
//	@doc:
//		Expression type
//
//---------------------------------------------------------------------------
IMDId *
CScalarOp::PmdidType() const
{
	if (NULL != m_pmdidReturnType)
	{
		return m_pmdidReturnType;
	}
	
	CMDAccessor *pmda = COptCtxt::PoctxtFromTLS()->Pmda();
	return pmda->Pmdscop(m_pmdidOp)->PmdidTypeResult();
}
Exemple #2
0
//---------------------------------------------------------------------------
//	@function:
//		CStatsPredUtils::Estatscmpt
//
//	@doc:
//		For the purpose of statistics computation, what is the comparison
//		type of an operator. Note that this has different, looser semantics
//		than CUtils::Ecmpt
//
//---------------------------------------------------------------------------
CStatsPred::EStatsCmpType
CStatsPredUtils::Estatscmpt
	(
	IMDId *pmdid
	)
{
	CMDAccessor *pmda = COptCtxt::PoctxtFromTLS()->Pmda();
	const IMDScalarOp *pmdscop = pmda->Pmdscop(pmdid);

	// Simply go by operator name.
	// If the name of the operator is "<", then it is a LessThan etc.
	const CWStringConst *pstrOpName = pmdscop->Mdname().Pstr();

	return Estatscmpt(pstrOpName);
}