Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused function get_vacuum_options #6631

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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