Fix zero plan_node_id for BitmapOr/And in ORCA
According to plannode.h "plan_node_id" should be unique across
entire final plan tree. But ORCA DXL to PlanStatement translator
returns uninitialized zero values for BitmapOr and BitmapAnd nodes.
This behaviour differs from Postgres planner and from all other
node translations in this class. It was fixed.
@@ -5369,6 +5369,7 @@ CTranslatorDXLToPlStmt::TranslateDXLBitmapBoolOp
if (CDXLScalarBitmapBoolOp::EdxlbitmapAnd == sc_bitmap_boolop_dxlop->GetDXLBitmapOpType())
{
BitmapAnd *bitmapand = MakeNode(BitmapAnd);
+ bitmapand->plan.plan_node_id = m_dxl_to_plstmt_context->GetNextPlanId();
bitmapand->bitmapplans = child_plan_list;
bitmapand->plan.targetlist = NULL;
bitmapand->plan.qual = NULL;
@@ -5377,6 +5378,7 @@ CTranslatorDXLToPlStmt::TranslateDXLBitmapBoolOp
else
{
BitmapOr *bitmapor = MakeNode(BitmapOr);
+ bitmapor->plan.plan_node_id = m_dxl_to_plstmt_context->GetNextPlanId();
bitmapor->bitmapplans = child_plan_list;
bitmapor->plan.targetlist = NULL;
bitmapor->plan.qual = NULL;
