From 6268fe5e03e64aeb1a91ca268c93ebdc47de930c Mon Sep 17 00:00:00 2001 From: staticlibs Date: Thu, 26 Oct 2023 21:46:41 +0100 Subject: [PATCH] Check that db is selected before loading babelfishpg_tsql (#223) * Check that db is selected before loading babelfishpg_tsql Signed-off-by: Alex Kasko --- .github/workflows/main.yml | 10 +++++++--- src/backend/tcop/postgres.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6f2a01fd98..71ed5dccb29 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,13 +11,17 @@ jobs: steps: - name: clone-repository uses: actions/checkout@v2 + - name: install-dependencies + run: | + sudo apt update --fix-missing -y + sudo apt install -y libipc-run-perl - name: build-postgres run: | - ./configure - make world-bin -j8 COPT='-Werror' + ./configure --with-icu --enable-cassert --enable-tap-tests + make world-bin -j8 COPT='-Werror -Wno-error=maybe-uninitialized' - name: run-tests run: | - make check -j8 + make check-world - name: upload-test-summary if: failure() uses: actions/upload-artifact@v2 diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 6b4fc771185..48f856ee11e 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -4270,7 +4270,7 @@ PostgresMain(const char *dbname, const char *username) */ start_xact_command(); PushActiveSnapshot(GetTransactionSnapshot()); - if (get_extension_oid(pgtsql_library_name, true) != InvalidOid) + if (OidIsValid(MyDatabaseId) && OidIsValid(get_extension_oid(pgtsql_library_name, true))) { /* * babelfishpg_tsql extension depends on babelfishpg_common, so