Remove obsolete function definitions and macros

During refactoring continuous aggregates some function defintions
for functions that got removed were not removed from the header
file. Additionally a few other header files had function definitions
that no longer had an implementation or macros that were not used.
This commit is contained in:
Sven Klemm 2020-09-20 23:36:20 +02:00 committed by Sven Klemm
parent c85a0c4c33
commit e1a00eb517
10 changed files with 3 additions and 48 deletions

View File

@ -136,10 +136,6 @@ typedef struct FormData_hypertable
typedef FormData_hypertable *Form_hypertable; typedef FormData_hypertable *Form_hypertable;
/* replication_factor can be NULL, thus it should not be used through the struct from the tuple */
#define HYPERTABLE_TUPLE_SIZE(isnull) \
(offsetof(FormData_hypertable, replication_factor) + (isnull ? 0 : sizeof(int16)))
/* Hypertable primary index attribute numbers */ /* Hypertable primary index attribute numbers */
enum Anum_hypertable_pkey_idx enum Anum_hypertable_pkey_idx
{ {

View File

@ -31,11 +31,5 @@ extern int ts_chunk_data_node_delete_by_node_name(const char *node_name);
extern TSDLLEXPORT List * extern TSDLLEXPORT List *
ts_chunk_data_node_scan_by_node_name_and_hypertable_id(const char *node_name, int32 hypertable_id, ts_chunk_data_node_scan_by_node_name_and_hypertable_id(const char *node_name, int32 hypertable_id,
MemoryContext mctx); MemoryContext mctx);
extern TSDLLEXPORT bool ts_chunk_data_node_contains_non_replicated_chunks(List *chunk_data_nodes);
extern TSDLLEXPORT void ts_chunk_data_node_update_foreign_table_server(Oid relid,
Oid new_server_id);
extern TSDLLEXPORT void
ts_chunk_data_node_update_foreign_table_server_if_needed(int32 chunk_id, Oid existing_server_id);
#endif /* TIMESCALEDB_CHUNK_DATA_NODE_H */ #endif /* TIMESCALEDB_CHUNK_DATA_NODE_H */

View File

@ -404,15 +404,6 @@ ts_chunk_index_create_from_adjusted_index_info(int32 hypertable_id, Relation hyp
get_rel_name(RelationGetRelid(hypertable_idxrel))); get_rel_name(RelationGetRelid(hypertable_idxrel)));
} }
static inline Oid
chunk_index_get_schemaid(Form_chunk_index chunk_index, bool missing_ok)
{
return ts_chunk_get_schema_id(chunk_index->chunk_id, missing_ok);
}
#define chunk_index_tuple_get_schema(tuple) \
chunk_index_get_schema((FormData_chunk_index *) GETSTRUCT(tuple));
/* /*
* Create all indexes on a chunk, given the indexes that exists on the chunk's * Create all indexes on a chunk, given the indexes that exists on the chunk's
* hypertable. * hypertable.
@ -626,7 +617,7 @@ chunk_index_tuple_delete(TupleInfo *ti, void *data)
bool should_free; bool should_free;
HeapTuple tuple = ts_scanner_fetch_heap_tuple(ti, false, &should_free); HeapTuple tuple = ts_scanner_fetch_heap_tuple(ti, false, &should_free);
FormData_chunk_index *chunk_index = (FormData_chunk_index *) GETSTRUCT(tuple); FormData_chunk_index *chunk_index = (FormData_chunk_index *) GETSTRUCT(tuple);
Oid schemaid = chunk_index_get_schemaid(chunk_index, true); Oid schemaid = ts_chunk_get_schema_id(chunk_index->chunk_id, true);
ChunkIndexDeleteData *cid = data; ChunkIndexDeleteData *cid = data;
ts_catalog_delete_tid(ti->scanrel, ts_scanner_get_tuple_tid(ti)); ts_catalog_delete_tid(ti->scanrel, ts_scanner_get_tuple_tid(ti));
@ -1041,7 +1032,7 @@ chunk_index_tuple_set_tablespace(TupleInfo *ti, void *data)
bool should_free; bool should_free;
HeapTuple tuple = ts_scanner_fetch_heap_tuple(ti, false, &should_free); HeapTuple tuple = ts_scanner_fetch_heap_tuple(ti, false, &should_free);
FormData_chunk_index *chunk_index = (FormData_chunk_index *) GETSTRUCT(tuple); FormData_chunk_index *chunk_index = (FormData_chunk_index *) GETSTRUCT(tuple);
Oid schemaoid = chunk_index_get_schemaid(chunk_index, false); Oid schemaoid = ts_chunk_get_schema_id(chunk_index->chunk_id, false);
Oid indexrelid = get_relname_relid(NameStr(chunk_index->index_name), schemaoid); Oid indexrelid = get_relname_relid(NameStr(chunk_index->index_name), schemaoid);
AlterTableCmd *cmd = makeNode(AlterTableCmd); AlterTableCmd *cmd = makeNode(AlterTableCmd);
List *cmds = NIL; List *cmds = NIL;

View File

@ -29,7 +29,6 @@ typedef struct ChunkIndexMapping
extern void ts_chunk_index_create(Relation hypertable_rel, int32 hypertable_id, extern void ts_chunk_index_create(Relation hypertable_rel, int32 hypertable_id,
Relation hypertable_idxrel, int32 chunk_id, Relation chunkrel); Relation hypertable_idxrel, int32 chunk_id, Relation chunkrel);
extern List *ts_get_expr_index_attnames(IndexInfo *ii, Relation htrel);
void ts_adjust_indexinfo_attnos(IndexInfo *indexinfo, Oid ht_relid, Relation template_indexrel, void ts_adjust_indexinfo_attnos(IndexInfo *indexinfo, Oid ht_relid, Relation template_indexrel,
Relation chunkrel); Relation chunkrel);
extern void ts_chunk_index_create_from_adjusted_index_info(int32 hypertable_id, extern void ts_chunk_index_create_from_adjusted_index_info(int32 hypertable_id,

View File

@ -40,8 +40,4 @@ extern void ts_connection_destroy(Connection *conn);
extern int ts_connection_set_timeout_millis(Connection *conn, unsigned long millis); extern int ts_connection_set_timeout_millis(Connection *conn, unsigned long millis);
extern const char *ts_connection_get_and_clear_error(Connection *conn); extern const char *ts_connection_get_and_clear_error(Connection *conn);
/* Called in init.c */
extern void ts_connection_init(void);
extern void ts_connection_fini(void);
#endif /* TIMESCALEDB_NET_CONN_H */ #endif /* TIMESCALEDB_NET_CONN_H */

View File

@ -19,10 +19,5 @@
* */ * */
extern void ts_plan_add_hashagg(PlannerInfo *root, RelOptInfo *input_rel, RelOptInfo *output_rel); extern void ts_plan_add_hashagg(PlannerInfo *root, RelOptInfo *input_rel, RelOptInfo *output_rel);
extern double ts_custom_group_estimate_time_bucket(PlannerInfo *root, FuncExpr *expr,
double path_rows);
extern double ts_custom_group_estimate_date_trunc(PlannerInfo *root, FuncExpr *expr,
double path_rows);
extern double ts_custom_group_estimate_expr(PlannerInfo *root, Node *expr, double path_rows);
#endif /* TIMESCALEDB_PLAN_ADD_HASHAGG_H */ #endif /* TIMESCALEDB_PLAN_ADD_HASHAGG_H */

View File

@ -110,8 +110,6 @@ extern TSDLLEXPORT List *ts_get_reloptions(Oid relid);
#define is_inheritance_table(relid) (is_inheritance_child(relid) || is_inheritance_parent(relid)) #define is_inheritance_table(relid) (is_inheritance_child(relid) || is_inheritance_parent(relid))
#define DATUM_GET(values, attno) values[attno - 1]
static inline int64 static inline int64
int64_min(int64 a, int64 b) int64_min(int64 a, int64 b)
{ {

View File

@ -6,22 +6,11 @@
#ifndef TIMESCALEDB_TSL_CONTINUOUS_AGGS_OPTIONS_H #ifndef TIMESCALEDB_TSL_CONTINUOUS_AGGS_OPTIONS_H
#define TIMESCALEDB_TSL_CONTINUOUS_AGGS_OPTIONS_H #define TIMESCALEDB_TSL_CONTINUOUS_AGGS_OPTIONS_H
#include <postgres.h> #include <postgres.h>
#include <c.h>
#include "with_clause_parser.h" #include "with_clause_parser.h"
#include "continuous_agg.h" #include "continuous_agg.h"
extern int64 continuous_agg_parse_refresh_lag(Oid column_type,
WithClauseResult *with_clause_options);
extern int64
continuous_agg_parse_ignore_invalidation_older_than(Oid column_type,
WithClauseResult *with_clause_options);
extern int64 continuous_agg_parse_max_interval_per_job(Oid column_type,
WithClauseResult *with_clause_options,
int64 bucket_width);
extern void continuous_agg_update_options(ContinuousAgg *cagg, extern void continuous_agg_update_options(ContinuousAgg *cagg,
WithClauseResult *with_clause_options); WithClauseResult *with_clause_options);
#endif #endif /* TIMESCALEDB_TSL_CONTINUOUS_AGGS_OPTIONS_H */

View File

@ -38,7 +38,6 @@ extern List *data_node_array_to_node_name_list(ArrayType *nodearr);
extern List *data_node_oids_to_node_name_list(List *data_node_oids, AclMode mode); extern List *data_node_oids_to_node_name_list(List *data_node_oids, AclMode mode);
extern void data_node_name_list_check_acl(List *data_node_names, AclMode mode); extern void data_node_name_list_check_acl(List *data_node_names, AclMode mode);
extern Datum data_node_ping(PG_FUNCTION_ARGS); extern Datum data_node_ping(PG_FUNCTION_ARGS);
extern Datum data_node_set_chunk_default_data_node(PG_FUNCTION_ARGS);
/* This should only be used for testing */ /* This should only be used for testing */
extern Datum data_node_add_without_dist_id(PG_FUNCTION_ARGS); extern Datum data_node_add_without_dist_id(PG_FUNCTION_ARGS);

View File

@ -34,6 +34,4 @@ extern void remote_txn_store_destroy(RemoteTxnStore *store);
for (hash_seq_init(&store->scan, store->hashtable); \ for (hash_seq_init(&store->scan, store->hashtable); \
NULL != (remote_txn = (RemoteTxn *) hash_seq_search(&store->scan));) NULL != (remote_txn = (RemoteTxn *) hash_seq_search(&store->scan));)
#define remote_txn_store_foreach_break(store) (hash_seq_term(&ums->scan); break)
#endif /* TIMESCALEDB_TSL_REMOTE_TXN_STORE_H */ #endif /* TIMESCALEDB_TSL_REMOTE_TXN_STORE_H */