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

my-ship-it 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 c0a03cc5af8 Fix: init missing PlannedStmt fields in orca
c0a03cc5af8 is described below

commit c0a03cc5af8ffc33c54d906b4b1609fc8b68a417
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 514385cc2e9..a083fcda6c7 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