Fix up includes with pg12 changes

pull/2844/head
Philip Dubé 2019-08-08 21:34:05 +00:00
parent fbc3e346e8
commit 68c4b71f93
37 changed files with 130 additions and 58 deletions

View File

@ -15,6 +15,9 @@
#include "access/htup_details.h"
#include "catalog/namespace.h"
#include "catalog/pg_constraint.h"
#if (PG_VERSION_NUM >= 120000)
#include "access/genam.h"
#endif
#if (PG_VERSION_NUM < 110000)
#include "catalog/pg_constraint_fn.h"
#endif

View File

@ -10,6 +10,9 @@
#include "postgres.h"
#if PG_VERSION_NUM > 12000
#include "access/genam.h"
#endif
#include "access/htup_details.h"
#include "access/xact.h"
#include "catalog/catalog.h"

View File

@ -68,7 +68,6 @@ ErrorIfDistributedAlterSeqOwnedBy(AlterSeqStmt *alterSeqStmt)
return;
}
#if (PG_VERSION_NUM >= 100000)
sequenceOwned = sequenceIsOwned(sequenceId, DEPENDENCY_AUTO, &ownedByTableId,
&ownedByColumnId);
if (!sequenceOwned)
@ -76,9 +75,6 @@ ErrorIfDistributedAlterSeqOwnedBy(AlterSeqStmt *alterSeqStmt)
sequenceOwned = sequenceIsOwned(sequenceId, DEPENDENCY_INTERNAL, &ownedByTableId,
&ownedByColumnId);
}
#else
sequenceOwned = sequenceIsOwned(sequenceId, &ownedByTableId, &ownedByColumnId);
#endif
/* see whether the sequence is already owned by a distributed table */
if (sequenceOwned)

View File

@ -10,8 +10,6 @@
#include "postgres.h"
#if (PG_VERSION_NUM >= 100000)
#include "distributed/commands.h"
#include "nodes/parsenodes.h"
@ -22,6 +20,3 @@ ProcessCreateSubscriptionStmt(CreateSubscriptionStmt *createSubStmt)
{
return (Node *) createSubStmt;
}
#endif /* PG_VERSION_NUM >= 100000 */

View File

@ -10,6 +10,9 @@
#include "postgres.h"
#if PG_VERSION_NUM >= 120000
#include "access/genam.h"
#endif
#include "access/htup_details.h"
#include "access/xact.h"
#include "catalog/index.h"

View File

@ -1695,13 +1695,8 @@ RunDistributedExecution(DistributedExecution *execution)
}
/* wait for I/O events */
#if (PG_VERSION_NUM >= 100000)
eventCount = WaitEventSetWait(execution->waitEventSet, timeout, events,
eventSetSize, WAIT_EVENT_CLIENT_READ);
#else
eventCount = WaitEventSetWait(execution->waitEventSet, timeout, events,
eventSetSize);
#endif
/* process I/O events */
for (; eventIndex < eventCount; eventIndex++)

View File

@ -42,13 +42,21 @@
#include "distributed/worker_protocol.h"
#include "distributed/worker_transaction.h"
#include "lib/stringinfo.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/nodeFuncs.h"
#endif
#include "nodes/nodes.h"
#include "nodes/parsenodes.h"
#include "nodes/pg_list.h"
#include "nodes/primnodes.h"
#include "nodes/relation.h"
#include "optimizer/clauses.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/pathnodes.h"
#include "optimizer/optimizer.h"
#else
#include "nodes/relation.h"
#include "optimizer/predtest.h"
#endif
#include "optimizer/restrictinfo.h"
#include "storage/lock.h"
#include "storage/lmgr.h"

View File

@ -15,6 +15,9 @@
#include "libpq-fe.h"
#include "miscadmin.h"
#if PG_VERSION_NUM >= 120000
#include "access/genam.h"
#endif
#include "access/htup_details.h"
#include "access/sysattr.h"
#include "access/xact.h"
@ -53,7 +56,6 @@
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/syscache.h"
#include "utils/tqual.h"
/* Local functions forward declarations */

View File

@ -47,9 +47,13 @@
#include "distributed/worker_protocol.h"
#include "distributed/worker_transaction.h"
#include "optimizer/clauses.h"
#if PG_VERSION_NUM >= 120000
#include "optimizer/optimizer.h"
#else
#include "optimizer/predtest.h"
#include "optimizer/restrictinfo.h"
#include "optimizer/var.h"
#endif
#include "optimizer/restrictinfo.h"
#include "nodes/makefuncs.h"
#include "tcop/tcopprot.h"
#include "utils/builtins.h"

View File

@ -55,7 +55,6 @@
#include "utils/lsyscache.h"
#include "utils/syscache.h"
#include "utils/rel.h"
#include "utils/tqual.h"
/* Local functions forward declarations */

View File

@ -19,9 +19,7 @@
#include "distributed/metadata_cache.h"
#include "distributed/multi_client_executor.h"
#include "libpq/hba.h"
#if (PG_VERSION_NUM >= 100000)
#include "common/ip.h"
#endif
#include "libpq/libpq-be.h"
#include "postmaster/postmaster.h"
#include "storage/fd.h"

View File

@ -48,7 +48,6 @@
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/syscache.h"
#include "utils/tqual.h"
static char * LocalGroupIdUpdateCommand(int32 groupId);

View File

@ -14,7 +14,12 @@
#include "distributed/metadata_cache.h"
#include "distributed/multi_logical_optimizer.h"
#include "distributed/pg_dist_partition.h"
#if PG_VERSION_NUM >= 120000
#include "optimizer/optimizer.h"
#else
#include "optimizer/var.h"
#endif
#include "optimizer/restrictinfo.h"
#include "nodes/nodeFuncs.h"
#include "nodes/pg_list.h"

View File

@ -41,10 +41,17 @@
#include "distributed/pg_dist_partition.h"
#include "distributed/shardinterval_utils.h"
#include "distributed/shard_pruning.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/makefuncs.h"
#endif
#include "nodes/nodeFuncs.h"
#include "nodes/parsenodes.h"
#include "nodes/pg_list.h"
#if PG_VERSION_NUM >= 120000
#include "optimizer/optimizer.h"
#else
#include "optimizer/clauses.h"
#endif
bool EnableFastPathRouterPlanner = true;

View File

@ -33,7 +33,11 @@
#include "optimizer/planner.h"
#include "optimizer/restrictinfo.h"
#include "optimizer/tlist.h"
#if PG_VERSION_NUM >= 120000
#include "optimizer/optimizer.h"
#else
#include "optimizer/var.h"
#endif
#include "parser/parsetree.h"
#include "parser/parse_coerce.h"
#include "parser/parse_relation.h"

View File

@ -24,7 +24,12 @@
#include "distributed/pg_dist_partition.h"
#include "distributed/worker_protocol.h"
#include "lib/stringinfo.h"
#if PG_VERSION_NUM >= 120000
#include "optimizer/optimizer.h"
#else
#include "optimizer/var.h"
#endif
#include "utils/builtins.h"
#include "nodes/nodeFuncs.h"
#include "utils/builtins.h"
#include "utils/datum.h"

View File

@ -40,7 +40,11 @@
#include "nodes/print.h"
#include "optimizer/clauses.h"
#include "optimizer/tlist.h"
#if PG_VERSION_NUM >= 120000
#include "optimizer/optimizer.h"
#else
#include "optimizer/var.h"
#endif
#include "parser/parse_agg.h"
#include "parser/parse_coerce.h"
#include "parser/parse_oper.h"

View File

@ -33,11 +33,16 @@
#include "distributed/version_compat.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/pathnodes.h"
#include "optimizer/optimizer.h"
#else
#include "nodes/relation.h"
#include "optimizer/var.h"
#endif
#include "optimizer/clauses.h"
#include "optimizer/prep.h"
#include "optimizer/tlist.h"
#include "optimizer/var.h"
#include "parser/parsetree.h"
#include "utils/datum.h"
#include "utils/lsyscache.h"

View File

@ -29,7 +29,11 @@
#include "optimizer/cost.h"
#include "optimizer/planmain.h"
#include "optimizer/tlist.h"
#if PG_VERSION_NUM >= 120000
#include "optimizer/optimizer.h"
#else
#include "optimizer/var.h"
#endif
#include "utils/builtins.h"
#include "utils/guc.h"
#include "utils/memutils.h"

View File

@ -54,9 +54,14 @@
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/clauses.h"
#include "optimizer/predtest.h"
#include "optimizer/restrictinfo.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/pathnodes.h"
#include "optimizer/optimizer.h"
#else
#include "nodes/relation.h"
#include "optimizer/var.h"
#endif
#include "optimizer/restrictinfo.h"
#include "parser/parse_relation.h"
#include "parser/parsetree.h"
#include "utils/builtins.h"

View File

@ -11,7 +11,6 @@
*/
#include "postgres.h"
#include "c.h"
#include <stddef.h>
@ -57,9 +56,13 @@
#include "optimizer/joininfo.h"
#include "optimizer/pathnode.h"
#include "optimizer/paths.h"
#include "optimizer/predtest.h"
#include "optimizer/restrictinfo.h"
#if PG_VERSION_NUM >= 120000
#include "optimizer/optimizer.h"
#else
#include "optimizer/var.h"
#include "optimizer/predtest.h"
#endif
#include "optimizer/restrictinfo.h"
#include "parser/parsetree.h"
#include "parser/parse_oper.h"
#include "storage/lock.h"

View File

@ -32,9 +32,14 @@
#include "distributed/query_pushdown_planning.h"
#include "distributed/relation_restriction_equivalence.h"
#include "nodes/nodeFuncs.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/makefuncs.h"
#include "optimizer/optimizer.h"
#else
#include "optimizer/var.h"
#endif
#include "nodes/pg_list.h"
#include "optimizer/clauses.h"
#include "optimizer/var.h"
#include "parser/parsetree.h"

View File

@ -78,7 +78,11 @@
#include "nodes/nodes.h"
#include "nodes/pg_list.h"
#include "nodes/primnodes.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/pathnodes.h"
#else
#include "nodes/relation.h"
#endif
#include "utils/builtins.h"
#include "utils/guc.h"

View File

@ -19,7 +19,11 @@
#include "nodes/nodeFuncs.h"
#include "nodes/pg_list.h"
#include "nodes/primnodes.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/pathnodes.h"
#else
#include "nodes/relation.h"
#endif
#include "parser/parsetree.h"
#include "optimizer/pathnode.h"

View File

@ -22,7 +22,11 @@
#include "nodes/nodes.h"
#include "nodes/pg_list.h"
#include "nodes/plannodes.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/pathnodes.h"
#else
#include "nodes/relation.h"
#endif
#include "optimizer/pathnode.h"
#include "optimizer/planmain.h"
#include "optimizer/restrictinfo.h"

View File

@ -25,9 +25,13 @@
#include "distributed/multi_physical_planner.h"
#include "distributed/resource_lock.h"
#include "distributed/shard_pruning.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#endif
#include "nodes/nodes.h"
#include "nodes/pg_list.h"
#include "nodes/primnodes.h"
#include "nodes/nodes.h"
#include "optimizer/clauses.h"
#include "utils/array.h"
#include "utils/palloc.h"

View File

@ -19,6 +19,9 @@
#include <sys/stat.h>
#include <unistd.h>
#if PG_VERSION_NUM >= 120000
#include "access/genam.h"
#endif
#include "access/heapam.h"
#include "access/htup_details.h"
#include "access/relscan.h"

View File

@ -30,7 +30,11 @@
#include "distributed/master_metadata_utility.h"
#include "lib/stringinfo.h"
#include "nodes/plannodes.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/pathnodes.h"
#else
#include "nodes/relation.h"
#endif
#include "utils/datum.h"

View File

@ -12,8 +12,14 @@
#include "postgres.h"
#if PG_VERSION_NUM >= 120000
#include "access/genam.h"
#endif
#include "access/htup_details.h"
#include "access/stratnum.h"
#if PG_VERSION_NUM >= 120000
#include "access/table.h"
#endif
#include "catalog/pg_constraint.h"
#include "distributed/foreign_key_relationship.h"
#include "distributed/hash_helpers.h"

View File

@ -25,6 +25,9 @@
#include "lib/stringinfo.h"
#include "nodes/pg_list.h"
#include "pgstat.h"
#if PG_VERSION_NUM >= 120000
#include "partitioning/partdesc.h"
#endif
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/lsyscache.h"

View File

@ -93,11 +93,8 @@ extern void ErrorIfUnsupportedSeqStmt(CreateSeqStmt *createSeqStmt);
extern void ErrorIfDistributedAlterSeqOwnedBy(AlterSeqStmt *alterSeqStmt);
#if (PG_VERSION_NUM >= 100000)
/* subscription.c - forward declarations */
extern Node * ProcessCreateSubscriptionStmt(CreateSubscriptionStmt *createSubStmt);
#endif /* PG_VERSION_NUM >= 100000 */
/* table.c - forward declarations */

View File

@ -11,7 +11,12 @@
#define DISTRIBUTED_PLANNER_H
#include "nodes/plannodes.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/pathnodes.h"
#else
#include "nodes/relation.h"
#endif
#include "distributed/citus_nodes.h"
#include "distributed/errormessage.h"

View File

@ -11,6 +11,9 @@
#include "utils/hsearch.h"
/* pg12 includes this exact implementation of hash_combine */
#if PG_VERSION_NUM < 120000
/*
* Combine two hash values, resulting in another hash value, with decent bit
* mixing.
@ -25,6 +28,9 @@ hash_combine(uint32 a, uint32 b)
}
#endif
extern void hash_delete_all(HTAB *htab);
#endif

View File

@ -32,27 +32,6 @@
#define PG_TOTAL_RELATION_SIZE_FUNCTION "pg_total_relation_size(%s)"
#define CSTORE_TABLE_SIZE_FUNCTION "cstore_table_size(%s)"
#if (PG_VERSION_NUM < 100000)
static inline void
CatalogTupleUpdate(Relation heapRel, ItemPointer otid, HeapTuple tup)
{
simple_heap_update(heapRel, otid, tup);
CatalogUpdateIndexes(heapRel, tup);
}
static inline Oid
CatalogTupleInsert(Relation heapRel, HeapTuple tup)
{
Oid oid = simple_heap_insert(heapRel, tup);
CatalogUpdateIndexes(heapRel, tup);
return oid;
}
#endif
/* In-memory representation of a typed tuple in pg_dist_shard. */
typedef struct ShardInterval
{

View File

@ -51,13 +51,12 @@ typedef enum CitusRTEKind
CITUS_RTE_SUBQUERY = RTE_SUBQUERY, /* subquery in FROM */
CITUS_RTE_JOIN = RTE_JOIN, /* join */
CITUS_RTE_FUNCTION = RTE_FUNCTION, /* function in FROM */
#if (PG_VERSION_NUM >= 100000)
CITUS_RTE_TABLEFUNC = RTE_TABLEFUNC, /* TableFunc(.., column list) */
#endif
CITUS_RTE_VALUES = RTE_VALUES, /* VALUES (<exprlist>), (<exprlist>), ... */
CITUS_RTE_CTE = RTE_CTE, /* common table expr (WITH list element) */
#if (PG_VERSION_NUM >= 100000)
CITUS_RTE_NAMEDTUPLESTORE = RTE_NAMEDTUPLESTORE, /* tuplestore, e.g. for triggers */
#if (PG_VERSION_NUM >= 120000)
CITUS_RTE_RESULT = RTE_RESULT, /* RTE represents an empty FROM clause */
#endif
CITUS_RTE_SHARD,
CITUS_RTE_REMOTE_QUERY

View File

@ -15,7 +15,11 @@
#include "distributed/relation_restriction_equivalence.h"
#include "nodes/pg_list.h"
#include "nodes/primnodes.h"
#if PG_VERSION_NUM >= 120000
#include "nodes/pathnodes.h"
#else
#include "nodes/relation.h"
#endif
extern List * GenerateSubplansForSubqueriesAndCTEs(uint64 planId, Query *originalQuery,

View File

@ -103,9 +103,7 @@ typedef struct WorkerTasksSharedStateData
{
/* Lock protecting workerNodesHash */
int taskHashTrancheId;
#if (PG_VERSION_NUM >= 100000)
char *taskHashTrancheName;
#endif
LWLock taskHashLock;
bool conninfosValid;
} WorkerTasksSharedStateData;