Skip to content

Commit

Permalink
Check that db is selected before loading babelfishpg_tsql (#223)
Browse files Browse the repository at this point in the history
* Check that db is selected before loading babelfishpg_tsql

Signed-off-by: Alex Kasko <[email protected]>
  • Loading branch information
staticlibs authored Oct 26, 2023
1 parent 4493423 commit 6268fe5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/backend/tcop/postgres.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6268fe5

Please sign in to comment.