This is an automated email from the ASF dual-hosted git repository. maxyang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/main by this push: new c962f925a6a Fix dangling pointer issue when mix data from diffrent ORCA caches c962f925a6a is described below commit c962f925a6a4e457d6a6564d61d5e3ec1c697d76 Author: hanwei <han...@hashdata.cn> AuthorDate: Fri Aug 29 09:56:47 2025 +0800 Fix dangling pointer issue when mix data from diffrent ORCA caches When execute many sql statements in a session, it maybe panic. Cause a kind of cache will refer another cache, but another cache's entries will be evicted over time and lead to dangling pointer. So deep copy is sometimes neccesary. --- src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp b/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp index 83afda566bf..7256409eb54 100644 --- a/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp +++ b/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp @@ -542,7 +542,7 @@ CTranslatorScalarToDXL::CreateScalarCmpFromOpExpr( const CWStringConst *str = GetDXLArrayCmpType(mdid); CDXLScalarComp *dxlop = GPOS_NEW(m_mp) CDXLScalarComp( - m_mp, mdid, GPOS_NEW(m_mp) CWStringConst(str->GetBuffer())); + m_mp, mdid, GPOS_NEW(m_mp) CWStringConst(m_mp, str->GetBuffer())); // create the DXL node holding the scalar comparison operator CDXLNode *dxlnode = GPOS_NEW(m_mp) CDXLNode(m_mp, dxlop); @@ -592,7 +592,7 @@ CTranslatorScalarToDXL::TranslateOpExprToDXL( CDXLScalarOpExpr *dxlop = GPOS_NEW(m_mp) CDXLScalarOpExpr(m_mp, mdid, return_type_mdid, - GPOS_NEW(m_mp) CWStringConst(str->GetBuffer())); + GPOS_NEW(m_mp) CWStringConst(m_mp, str->GetBuffer())); // create the DXL node holding the scalar opexpr CDXLNode *dxlnode = GPOS_NEW(m_mp) CDXLNode(m_mp, dxlop); @@ -702,7 +702,7 @@ CTranslatorScalarToDXL::CreateScalarArrayCompFromExpr( m_mp, GPOS_NEW(m_mp) CMDIdGPDB(IMDId::EmdidGeneral, scalar_array_op_expr->opno), - GPOS_NEW(m_mp) CWStringConst(op_name->GetBuffer()), type); + GPOS_NEW(m_mp) CWStringConst(m_mp, op_name->GetBuffer()), type); // create the DXL node holding the scalar opexpr CDXLNode *dxlnode = GPOS_NEW(m_mp) CDXLNode(m_mp, dxlop); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org For additional commands, e-mail: commits-h...@cloudberry.apache.org