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 735d6a4be0 Collect query info when 'ExecCheckXactReadOnly' reports
error
735d6a4be0 is described below
commit 735d6a4be0ec01f8ad1be1fd26da7162a9c24e90
Author: wangxiaoran <[email protected]>
AuthorDate: Wed Dec 4 17:02:14 2024 +0800
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]