Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 5 additions & 37 deletions pg_show_plans.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,7 @@ static void pgsp_shmem_request(void);
#endif
static void pgsp_shmem_startup(void);
/* Saves query plans to the shared hash table. */
static
#if PG_VERSION_NUM < 180000
void
#else
bool
#endif
pgsp_ExecutorStart(QueryDesc *queryDesc, int eflags);
static void pgsp_ExecutorStart(QueryDesc *queryDesc, int eflags);
/* Keeps track of the nest level. */
static void pgsp_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction,
uint64 count
Expand Down Expand Up @@ -469,31 +463,17 @@ pgsp_shmem_startup(void)
LWLockRelease(AddinShmemInitLock);
}

static
#if PG_VERSION_NUM < 180000
void
#else
bool
#endif
static void
pgsp_ExecutorStart(QueryDesc *queryDesc, int eflags)
{
ExplainState *es;
#if PG_VERSION_NUM >= 180000
bool ret_val;
#endif

if (prev_ExecutorStart)
{
#if PG_VERSION_NUM >= 180000
ret_val =
#endif
prev_ExecutorStart(queryDesc, eflags);
}
else
{
#if PG_VERSION_NUM >= 180000
ret_val =
#endif
standard_ExecutorStart(queryDesc, eflags);
}

Expand All @@ -502,20 +482,12 @@ pgsp_ExecutorStart(QueryDesc *queryDesc, int eflags)
errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("not enough memory to append new query plans"),
errhint("Try increasing 'pg_show_plans.max_plan_length'."));
return
#if PG_VERSION_NUM >= 180000
ret_val
#endif
;
return;
}

if (!pgsp->is_enabled)
{
return
#if PG_VERSION_NUM >= 180000
ret_val
#endif
;
return;
}

es = NewExplainState();
Expand All @@ -527,11 +499,7 @@ pgsp_ExecutorStart(QueryDesc *queryDesc, int eflags)
append_query_plan(es);
pfree(es->str->data);

return
#if PG_VERSION_NUM >= 180000
ret_val
#endif
;
return;
}

static void
Expand Down