This is an automated email from the ASF dual-hosted git repository. fanfuxiaoran pushed a commit to branch query_info in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 64b0866d0c45cb05a117af0bbe7923c0e3ba4546 Author: wangxiaoran <[email protected]> AuthorDate: Wed Dec 4 17:02:14 2024 +0800 [CLOUD] Collect query info when 'ExecCheckXactReadOnly' reports error --- src/backend/executor/execMain.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 6f85dc0a8b..430ed0ab27 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -323,7 +323,20 @@ standard_ExecutorStart(QueryDesc *queryDesc, int eflags) */ if ((XactReadOnly || IsInParallelMode() || Gp_role == GP_ROLE_DISPATCH) && !(eflags & EXEC_FLAG_EXPLAIN_ONLY)) - ExecCheckXactReadOnly(queryDesc->plannedstmt); + { + PG_TRY(); + { + ExecCheckXactReadOnly(queryDesc->plannedstmt); + } + PG_CATCH(); + { + /* GPDB hook for collecting query info */ + if (query_info_collect_hook) + (*query_info_collect_hook)(QueryCancelCleanup ? METRICS_QUERY_CANCELED : METRICS_QUERY_ERROR, queryDesc); + PG_RE_THROW(); + } + PG_END_TRY(); + } /* * Build EState, switch into per-query memory context for startup. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
