Skip to content

Fixed CASE statement to work correctly when branch expression is of Numeric and Decimal type #18350

Fixed CASE statement to work correctly when branch expression is of Numeric and Decimal type

Fixed CASE statement to work correctly when branch expression is of Numeric and Decimal type #18350

name: Minor Version Upgrade Tests for empty database
on: [push, pull_request]
jobs:
extension-tests:
env:
ENGINE_VER_FROM: BABEL_4_0_STABLE__PG_16_1
EXTENSION_VER_FROM: BABEL_4_0_STABLE
INSTALL_DIR: psql
name: Build and test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
id: install-dependencies
if: always()
uses: ./.github/composite-actions/install-dependencies
- name: Clone, build, and run tests for Postgres engine using ${{env.ENGINE_VER_FROM}}
id: build-modified-postgres-older
if: always() && steps.install-dependencies.outcome == 'success'
uses: ./.github/composite-actions/build-modified-postgres
with:
engine_branch: ${{env.ENGINE_VER_FROM}}
- name: Compile ANTLR
id: compile-antlr
if: always() && steps.build-modified-postgres-older.outcome == 'success'
uses: ./.github/composite-actions/compile-antlr
with:
version: 4.9.3
- uses: actions/checkout@v2
with:
repository: babelfish-for-postgresql/babelfish_extensions
ref: ${{env.EXTENSION_VER_FROM}}
- name: Build PostGIS Extension using ${{env.EXTENSION_VER_FROM}}
id: build-postgis-extension-old
if: always() && steps.compile-antlr.outcome == 'success'
run: |
cd ..
export CC='ccache gcc'
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
sudo apt-get install wget
max_retries=20
retries=0
until [ $retries -ge $max_retries ]
do
wget http://postgis.net/stuff/postgis-3.4.0.tar.gz && break
retries=$((retries+1))
done
tar -xvzf postgis-3.4.0.tar.gz
retries1=0
until [ $retries1 -ge $max_retries ]
do
wget https://download.osgeo.org/proj/proj-9.2.1.tar.gz && break
retries1=$((retries1+1))
done
tar -xvzf proj-9.2.1.tar.gz
cd proj-9.2.1
if [ ! -d "build" ]; then
mkdir build
fi
cd build
cmake -DCMAKE_INSTALL_LIBDIR="lib/x86_64-linux-gnu" -DCMAKE_INSTALL_PREFIX="/usr" ..
cmake --build .
sudo cmake --build . --target install
cd ../../postgis-3.4.0
./configure --without-protobuf --without-raster --with-pgconfig=$HOME/psql/bin/pg_config
make USE_PGXS=1 PG_CONFIG=~/psql/bin/pg_config
sudo make USE_PGXS=1 PG_CONFIG=~/psql/bin/pg_config install
shell: bash
- name: Set env variables and build extensions using ${{env.EXTENSION_VER_FROM}}
id: build-extensions-older
if: always() && steps.build-postgis-extension-old.outcome == 'success'
uses: ./.github/composite-actions/build-extensions
- name: Build tds_fdw Extension
id: build-tds_fdw-extension
if: always() && steps.build-extensions-older.outcome == 'success'
run: |
cd ..
export TDS_FDW_VERSION="2.0.3"
sudo apt-get install wget
wget https://github.com/tds-fdw/tds_fdw/archive/v${TDS_FDW_VERSION}.tar.gz
tar -xvzf v${TDS_FDW_VERSION}.tar.gz
cd tds_fdw-${TDS_FDW_VERSION}/
make USE_PGXS=1 PG_CONFIG=~/psql/bin/pg_config
sudo make USE_PGXS=1 PG_CONFIG=~/psql/bin/pg_config install
shell: bash
- name: Build vector Extension
run: |
cd ..
export VECTOR_VERSION="0.7.2"
sudo apt-get install wget
wget https://github.com/pgvector/pgvector/archive/refs/tags/v${VECTOR_VERSION}.tar.gz
tar -xvzf v${VECTOR_VERSION}.tar.gz
cd pgvector-${VECTOR_VERSION}/
make USE_PGXS=1 PG_CONFIG=~/psql/bin/pg_config
sudo make USE_PGXS=1 PG_CONFIG=~/psql/bin/pg_config install
shell: bash
- uses: actions/checkout@v2
- name: Install extensions
id: install-extensions-older
if: always() && steps.build-tds_fdw-extension.outcome == 'success'
uses: ./.github/composite-actions/install-extensions
- name: Build and run tests for Postgres engine using latest engine
id: build-modified-postgres-newer
if: always() && steps.install-extensions-older.outcome == 'success'
uses: ./.github/composite-actions/build-modified-postgres
- name: Compile new ANTLR
id: compile-new-antlr
if: always() && steps.build-modified-postgres-newer.outcome == 'success'
uses: ./.github/composite-actions/compile-antlr
- name: Set env variables and build extensions
id: build-extensions-newer
if: always() && steps.compile-new-antlr.outcome == 'success'
uses: ./.github/composite-actions/build-extensions
- name: Build PostGIS Extension
id: build-postgis-extension
if: always() && steps.build-extensions-newer.outcome == 'success'
uses: ./.github/composite-actions/build-postgis-extension
- name: Update extensions
if: always() && steps.build-postgis-extension.outcome == 'success'
run: |
ulimit -c unlimited
cd ~
~/psql/bin/pg_ctl -c -D ~/psql/data/ -l logfile restart
sudo ~/psql/bin/psql -v ON_ERROR_STOP=1 -d babelfish_db -U runner -c "\dx"
sudo ~/psql/bin/psql -v ON_ERROR_STOP=1 -d babelfish_db -U runner -c "ALTER EXTENSION "babelfishpg_common" UPDATE; ALTER EXTENSION "babelfishpg_tsql" UPDATE;"
sudo ~/psql/bin/psql -v ON_ERROR_STOP=1 -d babelfish_db -U runner -c "ALTER SYSTEM SET track_functions = 'pl';"
sudo ~/psql/bin/psql -v ON_ERROR_STOP=1 -d babelfish_db -U runner -c "ALTER SYSTEM SET babelfishpg_tsql.migration_mode = 'multi-db';"
sudo ~/psql/bin/psql -v ON_ERROR_STOP=1 -d babelfish_db -U runner -c "SELECT pg_reload_conf();"
sudo ~/psql/bin/psql -v ON_ERROR_STOP=1 -d babelfish_db -U runner -c "\dx"
sqlcmd -S localhost -U jdbc_user -P 12345678 -Q "SELECT @@version GO"
- name: Run JDBC Tests
id: jdbc
timeout-minutes: 60
run: |
export PATH=~/${{env.INSTALL_DIR}}/bin:$PATH
export PG_SRC=~/work/babelfish_extensions/postgresql_modified_for_babelfish
cd test/JDBC/
mvn -B -ntp test
- name: Upload Log
if: always() && steps.jdbc.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: postgres-log
path: ~/psql/data/logfile
# The test summary files contain paths with ':' characters, which is not allowed with the upload-artifact actions
- name: Rename Test Summary Files
id: test-file-rename
if: always() && steps.jdbc.outcome == 'failure'
run: |
cd test/JDBC/Info
timestamp=`ls -Art | tail -n 1`
cd $timestamp
mv $timestamp.diff ../upgrade-output-diff.diff
mv "$timestamp"_runSummary.log ../upgrade-run-summary.log
- name: Upload Run Summary
if: always() && steps.test-file-rename == 'success'
uses: actions/upload-artifact@v4
with:
name: upgrade-run-summary.log
path: test/JDBC/Info/upgrade-run-summary.log
- name: Upload Output Diff
if: always() && steps.jdbc.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: upgrade-output-diff.diff
path: test/JDBC/Info/upgrade-output-diff.diff
- name: Check and upload coredumps
if: always() && steps.jdbc.outcome == 'failure'
uses: ./.github/composite-actions/upload-coredump