Skip to content

Commit

Permalink
Initial commit for Babelfish v4.1
Browse files Browse the repository at this point in the history
This commit bring the following changes:
1. Bumped babelfishpg_tsql and babelfishpg_common versions to 4.1.0 and added
upgrade scripts for both.
2. Re-enabled github action run on `push`.
3. Added upgrade paths from 14.latest, 15.latest and 16.1 to current versions.
4. Updated version branch template to include new branches.

Signed-off-by: Rishabh Tanwar <[email protected]>
  • Loading branch information
ritanwar committed Jan 8, 2024
1 parent a53b1d1 commit cce11b5
Show file tree
Hide file tree
Showing 35 changed files with 1,999 additions and 24 deletions.
14 changes: 12 additions & 2 deletions .github/configuration/upgrade-test-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ upgrade-version: [[
],
[
{
version: '14.10',
version: '14.11',
upgrade-type: null
},
{
Expand All @@ -96,11 +96,21 @@ upgrade-version: [[
],
[
{
version: 15.4,
version: 15.5,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: major
}
],
[
{
version: 16.1,
upgrade-type: null
},
{
version: target.latest,
upgrade-type: minor
}
]]
12 changes: 12 additions & 0 deletions .github/template/version-branch-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
'14.10':
engine_branch: BABEL_2_7_STABLE__PG_14_10
extension_branch: BABEL_2_7_STABLE
'14.11':
engine_branch: BABEL_2_X_DEV__PG_14_X
extension_branch: BABEL_2_X_DEV
'15.2':
engine_branch: BABEL_3_1_STABLE__PG_15_2
extension_branch: BABEL_3_1_STABLE
Expand All @@ -46,6 +49,15 @@
'15.4':
engine_branch: BABEL_3_3_STABLE__PG_15_4
extension_branch: BABEL_3_3_STABLE
'15.5':
engine_branch: BABEL_3_4_STABLE__PG_15_5
extension_branch: BABEL_3_4_STABLE
'15.6':
engine_branch: BABEL_3_X_DEV__PG_15_X
extension_branch: BABEL_3_X_DEV
'16.1':
engine_branch: BABEL_4_0_STABLE__PG_16_1
extension_branch: BABEL_4_0_STABLE
'source.latest':
engine_branch: latest
extension_branch: latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Dotnet Framework Tests
on: [pull_request]
on: [push, pull_request]

jobs:
run-babelfish-dotnet-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/isolation-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Babelfish Smoke Tests
on: [pull_request]
on: [push, pull_request]

jobs:
isolation-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jdbc-tests-with-parallel-query.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: JDBC Tests With Parallel Query
on: [pull_request]
on: [push, pull_request]

jobs:
run-babelfish-jdbc-tests-with-parallel-query-mode:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jdbc-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: JDBC Tests
on: [pull_request]
on: [push, pull_request]

jobs:
run-babelfish-jdbc-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/major-version-upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Major Version Upgrade Tests for empty database
on: [pull_request]
on: [push, pull_request]

jobs:
run-babelfish-mvu-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/minor-version-upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Minor Version Upgrade Tests for empty database
on: []
on: [push, pull_request]

jobs:
extension-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/odbc-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: ODBC Tests
on: [pull_request]
on: [push, pull_request]

jobs:
run-babelfish-odbc-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pg_dump-restore-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pg_dump/restore Test Framework
on: [pull_request]
on: [push, pull_request]

jobs:
generate-dump-restore-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Python Tests
on: [pull_request]
on: [push, pull_request]

jobs:
run-babelfish-python-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/singledb-version-upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Major Version Upgrade Tests for singledb mode
on: [pull_request]
on: [push, pull_request]

jobs:
run-babelfish-mvu-tests-singledb:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sql-validation-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Validate Installation/Upgrade Scripts
on: [pull_request]
on: [push, pull_request]

jobs:
run-sql-validation-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-code-analyzer.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Static Code Analyzer
on: [pull_request]
on: [push, pull_request]

jobs:
run-static-code-analyzer:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tap-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: TAP Tests
on: [pull_request]
on: [push, pull_request]

jobs:
run-babelfish-tap-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Unit Tests
on: [pull_request]
on: [push, pull_request]

jobs:
run-babelfish-unit-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Version Upgrade Test Framework
on: [pull_request]
on: [push, pull_request]

jobs:
generate-version-upgrade-tests:
Expand Down
16 changes: 15 additions & 1 deletion contrib/babelfishpg_common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ MODULEPATH = $$libdir/$(EXTENSION)-$(BBFPGCMN_MAJOR_VERSION)
UPGRADES = $(patsubst sql/upgrades/babelfishpg_common--%.sql,sql/babelfishpg_common--%.sql,$(wildcard sql/upgrades/babelfishpg_common--*.sql))
GENERATED_UPGRADES = \
sql/$(EXTENSION)--3.2.0--3.3.0.sql \
sql/$(EXTENSION)--3.3.0--3.4.0.sql
sql/$(EXTENSION)--3.3.0--4.0.0.sql \
sql/$(EXTENSION)--3.3.0--3.4.0.sql \
sql/$(EXTENSION)--4.0.0--4.1.0.sql

ifdef PREV_EXTVERSION
DATA = sql/$(EXTENSION)--$(PREV_EXTVERSION).sql
Expand Down Expand Up @@ -103,8 +105,14 @@ ifeq (,$(filter $(FLAG_TO_CHECK),$(PG_CPPFLAGS)))
sql/$(EXTENSION)--3.2.0--3.3.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D PREV_VERSION=3.2.0 -D CUR_VERSION=3.3.0 $< | sed 's/^# /-- /g' > $@

sql/$(EXTENSION)--3.3.0--4.0.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D PREV_VERSION=3.3.0 -D CUR_VERSION=4.0.0 $< | sed 's/^# /-- /g' > $@

sql/$(EXTENSION)--3.3.0--3.4.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D PREV_VERSION=3.3.0 -D CUR_VERSION=3.4.0 $< | sed 's/^# /-- /g' > $@

sql/$(EXTENSION)--4.0.0--4.1.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D PREV_VERSION=4.0.0 -D CUR_VERSION=4.1.0 $< | sed 's/^# /-- /g' > $@
else
# The flag is present build the .in file including the spatial type files
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).in
Expand All @@ -113,8 +121,14 @@ else
sql/$(EXTENSION)--3.2.0--3.3.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D ENABLE_SPATIAL_TYPES=1 -D PREV_VERSION=3.2.0 -D CUR_VERSION=3.3.0 $< | sed 's/^# /-- /g' > $@

sql/$(EXTENSION)--3.3.0--4.0.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D ENABLE_SPATIAL_TYPES=1 -D PREV_VERSION=3.3.0 -D CUR_VERSION=4.0.0 $< | sed 's/^# /-- /g' > $@

sql/$(EXTENSION)--3.3.0--3.4.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D ENABLE_SPATIAL_TYPES=1 -D PREV_VERSION=3.3.0 -D CUR_VERSION=3.4.0 $< | sed 's/^# /-- /g' > $@

sql/$(EXTENSION)--4.0.0--4.1.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D ENABLE_SPATIAL_TYPES=1 -D PREV_VERSION=4.0.0 -D CUR_VERSION=4.1.0 $< | sed 's/^# /-- /g' > $@
endif

sql/babelfishpg_common--%.sql: sql/upgrades/babelfishpg_common--%.sql
Expand Down
4 changes: 2 additions & 2 deletions contrib/babelfishpg_common/Version.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BBFPGCMN_MAJOR_VERSION=3
BBFPGCMN_MINOR_VERSION=4
BBFPGCMN_MAJOR_VERSION=4
BBFPGCMN_MINOR_VERSION=1
BBFPGCMN_MICRO_VERSION=0

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
------------------------------------------------------------------------------
---- Include changes related to other datatypes except spatial types here ----
------------------------------------------------------------------------------

-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION ""babelfishpg_common"" UPDATE TO "4.0.0"" to load this file. \quit

SELECT set_config('search_path', 'sys, '||current_setting('search_path'), false);

CREATE OR REPLACE FUNCTION sys.varbinarybinary (sys.BBF_VARBINARY, integer, boolean)
RETURNS sys.BBF_BINARY
AS 'babelfishpg_common', 'binary'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

-- Reset search_path to not affect any subsequent scripts
SELECT set_config('search_path', trim(leading 'sys, ' from current_setting('search_path')), false);
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
------------------------------------------------------------------------------
---- Include changes related to other datatypes except spatial types here ----
------------------------------------------------------------------------------

-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION ""babelfishpg_common"" UPDATE TO "4.1.0"" to load this file. \quit

SELECT set_config('search_path', 'sys, '||current_setting('search_path'), false);

CREATE OR REPLACE FUNCTION sys.varbinarybinary (sys.BBF_VARBINARY, integer, boolean)
RETURNS sys.BBF_BINARY
AS 'babelfishpg_common', 'binary'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

-- Reset search_path to not affect any subsequent scripts
SELECT set_config('search_path', trim(leading 'sys, ' from current_setting('search_path')), false);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION ""babelfishpg_common"" UPDATE TO '4.0.0'" to load this file. \quit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-------------------------------------------------------
---- Include changes related to spatial types here ----
-------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-------------------------------------------------------
---- Include changes related to spatial types here ----
-------------------------------------------------------
2 changes: 1 addition & 1 deletion contrib/babelfishpg_tsql/Version.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# places during the build process

PGTSQL_MAJOR_VERSION=4
PGTSQL_MINOR_VERSION=0
PGTSQL_MINOR_VERSION=1
PGTSQL_MICRO_VERSION=0

Loading

0 comments on commit cce11b5

Please sign in to comment.