summaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorMichael Paquier2024-10-04 03:51:17 +0000
committerMichael Paquier2024-10-04 03:51:17 +0000
commit4dd308730029f5d90bd188f181c2dd9d7630ea69 (patch)
tree2a190f2504e2bb9b82a30092ce8a31913bae816b /src/backend/executor/execMain.c
parent259a0a99fe3d45dcf624788c1724d9989f3382dc (diff)
Remove assertion checking query ID in execMain.c
This assertion has been added by 24f520594809, but Alexander Lakhin has proved that the ExecutorRun() one can be broken by using a PL function that manipulates compute_query_id and track_activities, while the ones in ExecutorFinish() and ExecutorEnd() could be triggered when cleaning up portals at the beginning of a new query execution. Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r--src/backend/executor/execMain.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index b5fbd8af97e..cc9a594cba5 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -71,18 +71,6 @@ ExecutorEnd_hook_type ExecutorEnd_hook = NULL;
/* Hook for plugin to get control in ExecCheckPermissions() */
ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook = NULL;
-/*
- * Check that the query ID is set, which is something that happens only
- * if compute_query_id is enabled (or a module forced it), if track_activities
- * is enabled, and if a client provided a query string to map with the query
- * ID computed from it.
- */
-#define EXEC_CHECK_QUERY_ID \
-do { \
- Assert(!IsQueryIdEnabled() || !pgstat_track_activities || \
- !debug_query_string || pgstat_get_my_query_id() != 0); \
-} while(0)
-
/* decls for local routines only used within this module */
static void InitPlan(QueryDesc *queryDesc, int eflags);
static void CheckValidRowMarkRel(Relation rel, RowMarkType markType);
@@ -308,9 +296,6 @@ ExecutorRun(QueryDesc *queryDesc,
ScanDirection direction, uint64 count,
bool execute_once)
{
- /* If enabled, the query ID should be set. */
- EXEC_CHECK_QUERY_ID;
-
if (ExecutorRun_hook)
(*ExecutorRun_hook) (queryDesc, direction, count, execute_once);
else
@@ -419,9 +404,6 @@ standard_ExecutorRun(QueryDesc *queryDesc,
void
ExecutorFinish(QueryDesc *queryDesc)
{
- /* If enabled, the query ID should be set. */
- EXEC_CHECK_QUERY_ID;
-
if (ExecutorFinish_hook)
(*ExecutorFinish_hook) (queryDesc);
else
@@ -482,9 +464,6 @@ standard_ExecutorFinish(QueryDesc *queryDesc)
void
ExecutorEnd(QueryDesc *queryDesc)
{
- /* If enabled, the query ID should be set. */
- EXEC_CHECK_QUERY_ID;
-
if (ExecutorEnd_hook)
(*ExecutorEnd_hook) (queryDesc);
else