This is an automated email from the ASF dual-hosted git repository.

oppenheimer01 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 2b449c060edff3db2470e07d4ee1452c1e5d0112
Author: Jianghua Yang <[email protected]>
AuthorDate: Sat Apr 25 04:50:37 2026 +0800

    Fix: init missing PlannedStmt fields in orca
    
    Those fields are missed by orca which are needed by the
    pg_stat_statements to identify the query. Without initialization of
    those fields, pg_stat_statements won't track those queries.
---
 src/backend/optimizer/plan/orca.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/backend/optimizer/plan/orca.c 
b/src/backend/optimizer/plan/orca.c
index 9315cb0ffdc..cc5a70639cf 100644
--- a/src/backend/optimizer/plan/orca.c
+++ b/src/backend/optimizer/plan/orca.c
@@ -405,6 +405,10 @@ optimize_query(Query *parse, int cursorOptions, 
ParamListInfo boundParams, Optim
        result->oneoffPlan = glob->oneoffPlan;
        result->transientPlan = glob->transientPlan;
 
+       result->queryId = parse->queryId;
+       result->stmt_location = parse->stmt_location;
+       result->stmt_len = parse->stmt_len;
+
        return result;
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to