Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4dd3087

Browse files
committed
Remove assertion checking query ID in execMain.c
This assertion has been added by 24f5205, 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/b37d8e6c-e83d-e157-8865-1b2460a6aef2@gmail.com
1 parent 259a0a9 commit 4dd3087

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/backend/executor/execMain.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,6 @@ ExecutorEnd_hook_type ExecutorEnd_hook = NULL;
7171
/* Hook for plugin to get control in ExecCheckPermissions() */
7272
ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook = NULL;
7373

74-
/*
75-
* Check that the query ID is set, which is something that happens only
76-
* if compute_query_id is enabled (or a module forced it), if track_activities
77-
* is enabled, and if a client provided a query string to map with the query
78-
* ID computed from it.
79-
*/
80-
#define EXEC_CHECK_QUERY_ID \
81-
do { \
82-
Assert(!IsQueryIdEnabled() || !pgstat_track_activities || \
83-
!debug_query_string || pgstat_get_my_query_id() != 0); \
84-
} while(0)
85-
8674
/* decls for local routines only used within this module */
8775
static void InitPlan(QueryDesc *queryDesc, int eflags);
8876
static void CheckValidRowMarkRel(Relation rel, RowMarkType markType);
@@ -308,9 +296,6 @@ ExecutorRun(QueryDesc *queryDesc,
308296
ScanDirection direction, uint64 count,
309297
bool execute_once)
310298
{
311-
/* If enabled, the query ID should be set. */
312-
EXEC_CHECK_QUERY_ID;
313-
314299
if (ExecutorRun_hook)
315300
(*ExecutorRun_hook) (queryDesc, direction, count, execute_once);
316301
else
@@ -419,9 +404,6 @@ standard_ExecutorRun(QueryDesc *queryDesc,
419404
void
420405
ExecutorFinish(QueryDesc *queryDesc)
421406
{
422-
/* If enabled, the query ID should be set. */
423-
EXEC_CHECK_QUERY_ID;
424-
425407
if (ExecutorFinish_hook)
426408
(*ExecutorFinish_hook) (queryDesc);
427409
else
@@ -482,9 +464,6 @@ standard_ExecutorFinish(QueryDesc *queryDesc)
482464
void
483465
ExecutorEnd(QueryDesc *queryDesc)
484466
{
485-
/* If enabled, the query ID should be set. */
486-
EXEC_CHECK_QUERY_ID;
487-
488467
if (ExecutorEnd_hook)
489468
(*ExecutorEnd_hook) (queryDesc);
490469
else

0 commit comments

Comments
 (0)