Skip to content

Commit

Permalink
Force preloading of extension during tests
Browse files Browse the repository at this point in the history
Exercised an arcane bug wherein we'd begin a PL/pgSQL trigger without
pg_shard loaded, load it partway through, and crash because we have a
PL/pgSQL plugin that expects to be called during function entry and
exit being called only on exit.
  • Loading branch information
jasonmp85 committed Jul 2, 2015
1 parent f7213a0 commit 54767fd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -34,7 +34,8 @@ REGRESS = init connection distribution_metadata extend_ddl_commands \

# The launcher regression flag lets us specify a special wrapper to handle
# testing rather than psql directly. Our wrapper swaps in a known worker list.
REGRESS_OPTS = --launcher=./launcher.sh
# We also want pg_shard preloaded for all the tests.
REGRESS_OPTS = --launcher=./launcher.sh --load-extension=pg_shard

EXTRA_CLEAN += ${REGRESS_PREP}

Expand Down
1 change: 0 additions & 1 deletion expected/init.out
@@ -1,7 +1,6 @@
-- ===================================================================
-- create extension
-- ===================================================================
CREATE EXTENSION pg_shard;
-- create fake fdw for use in tests
CREATE FUNCTION fake_fdw_handler()
RETURNS fdw_handler
Expand Down
2 changes: 0 additions & 2 deletions sql/init.sql
Expand Up @@ -2,8 +2,6 @@
-- create extension
-- ===================================================================

CREATE EXTENSION pg_shard;

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

0 comments on commit 54767fd

Please sign in to comment.