Skip to content

Commit

Permalink
Remove unused function get_vacuum_options
Browse files Browse the repository at this point in the history
The last caller for this was removed as part of multinode removal.
  • Loading branch information
svenklemm committed Feb 12, 2024
1 parent ba3ccc4 commit 00f2f01
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 37 deletions.
30 changes: 1 addition & 29 deletions src/compat/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <postgres.h>
#include <commands/cluster.h>
#include <commands/defrem.h>
#include <commands/explain.h>
#include <commands/trigger.h>
#include <executor/executor.h>
Expand Down Expand Up @@ -268,35 +269,6 @@

#define ts_tuptableslot_set_table_oid(slot, table_oid) (slot)->tts_tableOid = table_oid

#include <commands/vacuum.h>
#include <commands/defrem.h>

static inline int
get_vacuum_options(const VacuumStmt *stmt)
{
/* The vacuum options is a list of DefElems and require parsing. Here
* we only parse the options we might be interested in since PostgreSQL
* itself will parse the options fully when it executes the vacuum. */
ListCell *lc;
bool analyze = false;
bool verbose = false;

foreach (lc, stmt->options)
{
DefElem *opt = (DefElem *) lfirst(lc);

/* Parse common options for VACUUM and ANALYZE */
if (strcmp(opt->defname, "verbose") == 0)
verbose = defGetBoolean(opt);
/* Parse options available on VACUUM */
else if (strcmp(opt->defname, "analyze") == 0)
analyze = defGetBoolean(opt);
}

return (stmt->is_vacuumcmd ? VACOPT_VACUUM : VACOPT_ANALYZE) | (verbose ? VACOPT_VERBOSE : 0) |
(analyze ? VACOPT_ANALYZE : 0);
}

/*
* The number of arguments of pg_md5_hash() has changed in PG 15.
*
Expand Down
1 change: 1 addition & 0 deletions src/event_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <catalog/pg_trigger.h>
#include <commands/event_trigger.h>
#include <executor/executor.h>
#include <utils/array.h>
#include <utils/builtins.h>

#include "compat/compat.h"
Expand Down
8 changes: 0 additions & 8 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@
/* find the length of a statically sized array */
#define TS_ARRAY_LEN(array) (sizeof(array) / sizeof(*array))

/* Use condition to check if out of memory */
#define TS_OOM_CHECK(COND, FMT, ...) \
do \
{ \
if (!(COND)) \
ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg(FMT, ##__VA_ARGS__))); \
} while (0)

extern TSDLLEXPORT bool ts_type_is_int8_binary_compatible(Oid sourcetype);

typedef enum TimevalInfinity
Expand Down
1 change: 1 addition & 0 deletions tsl/src/bgw_policy/job.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <access/xact.h>
#include <catalog/namespace.h>
#include <catalog/pg_type.h>
#include <commands/defrem.h>
#include <funcapi.h>
#include <hypertable_cache.h>
#include <nodes/makefuncs.h>
Expand Down
1 change: 1 addition & 0 deletions tsl/src/partialize_finalize.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <fmgr.h>
#include <parser/parse_agg.h>
#include <parser/parse_coerce.h>
#include <utils/array.h>
#include <utils/builtins.h>
#include <utils/datum.h>
#include <utils/fmgroids.h>
Expand Down

0 comments on commit 00f2f01

Please sign in to comment.