Skip to content

Commit

Permalink
Merge 7beef28 into 2b221d9
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmp85 committed Aug 19, 2015
2 parents 2b221d9 + 7beef28 commit 74a4376
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions include/pg_shard.h
Expand Up @@ -15,13 +15,21 @@
#include "c.h"

#include "access/tupdesc.h"
#include "catalog/indexing.h"
#include "nodes/parsenodes.h"
#include "nodes/pg_list.h"
#include "nodes/plannodes.h"
#include "lib/stringinfo.h"
#include "utils/tuplestore.h"


/* detect when building against CitusDB */
#ifdef DistPartitionLogicalRelidIndexId
#define BUILT_AGAINST_CITUSDB true
#else
#define BUILT_AGAINST_CITUSDB false
#endif

/* prefix used for temporary tables created on the master node */
#define TEMPORARY_TABLE_PREFIX "pg_shard_temp_table"

Expand Down
4 changes: 2 additions & 2 deletions src/pg_shard.c
Expand Up @@ -197,8 +197,8 @@ _PG_init(void)

DefineCustomBoolVariable("pg_shard.use_citusdb_select_logic",
"Informs pg_shard to use CitusDB's select logic", NULL,
&UseCitusDBSelectLogic, false, PGC_USERSET, 0, NULL,
NULL, NULL);
&UseCitusDBSelectLogic, BUILT_AGAINST_CITUSDB, PGC_USERSET,
0, NULL, NULL, NULL);

DefineCustomBoolVariable("pg_shard.log_distributed_statements",
"Logs each statement used in a distributed plan", NULL,
Expand Down
2 changes: 2 additions & 0 deletions test/expected/00-init.out
Expand Up @@ -2,6 +2,8 @@
-- create extension
-- ===================================================================
CREATE EXTENSION pg_shard;
-- ensure the test DB defaults to pg_shard select logic
ALTER DATABASE :DBNAME SET pg_shard.use_citusdb_select_logic TO false;
-- create fake fdw for use in tests
CREATE FUNCTION fake_fdw_handler()
RETURNS fdw_handler
Expand Down
3 changes: 3 additions & 0 deletions test/sql/00-init.sql
Expand Up @@ -4,6 +4,9 @@

CREATE EXTENSION pg_shard;

-- ensure the test DB defaults to pg_shard select logic
ALTER DATABASE :DBNAME SET pg_shard.use_citusdb_select_logic TO false;

-- create fake fdw for use in tests
CREATE FUNCTION fake_fdw_handler()
RETURNS fdw_handler
Expand Down

0 comments on commit 74a4376

Please sign in to comment.