diff --git a/.github/ubuntu/all-apt-prereqs.sh b/.github/ubuntu/all-apt-prereqs.sh index 4c8435e15..181aa1525 100755 --- a/.github/ubuntu/all-apt-prereqs.sh +++ b/.github/ubuntu/all-apt-prereqs.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e sudo apt-get update -qq @@ -8,5 +10,9 @@ sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq \ default-jre \ firebird-dev firebird3.0-utils \ mysql-client default-libmysqlclient-dev \ - libarchive-tools + libarchive-tools \ + libaio1t64 cat t/odbc/odbcinst.ini | sudo tee -a /etc/odbcinst.ini + +# instantclient still wants libaio.so.1. https://askubuntu.com/a/1514001 +sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 diff --git a/.github/ubuntu/exasol.sh b/.github/ubuntu/exasol.sh index ed304b3cd..403721276 100755 --- a/.github/ubuntu/exasol.sh +++ b/.github/ubuntu/exasol.sh @@ -13,13 +13,12 @@ fi mkdir -p /opt/exasol # Download and unpack Exasol ODBC Driver & EXAplus. -# https://www.exasol.com/portal/display/DOWNLOAD/ -curl -sSLO https://x-up.s3.amazonaws.com/7.x/7.1.17/EXASOL_ODBC-7.1.17.tar.gz -curl -sSLO https://x-up.s3.amazonaws.com/7.x/7.1.17/EXAplus-7.1.17.tar.gz -sudo tar -xzf EXASOL_ODBC-7.1.17.tar.gz -C /opt/exasol --strip-components 1 -sudo tar -xzf EXAplus-7.1.17.tar.gz -C /opt/exasol --strip-components 1 +curl -sSLO https://x-up.s3.amazonaws.com/7.x/24.2.0/Exasol_ODBC-24.2.0-Linux_x86_64.tar.gz +curl -sSLO https://x-up.s3.amazonaws.com/7.x/24.2.1/EXAplus-24.2.1.tar.gz +sudo tar -xzf Exasol_ODBC-24.2.0-Linux_x86_64.tar.gz -C /opt/exasol --strip-components 2 +sudo tar -xzf EXAplus-24.2.1.tar.gz -C /opt/exasol --strip-components 2 # Add to the path. -if [[ ! -z "$GITHUB_PATH" ]]; then - echo "/opt/exasol" >> $GITHUB_PATH +if [[ -n "$GITHUB_PATH" ]]; then + echo "/opt/exasol" >> "$GITHUB_PATH" fi diff --git a/.github/ubuntu/firebird.sh b/.github/ubuntu/firebird.sh index 90a968f2b..de1e7cd1d 100755 --- a/.github/ubuntu/firebird.sh +++ b/.github/ubuntu/firebird.sh @@ -9,6 +9,6 @@ if [ -z "$SKIP_DEPENDS" ]; then fi # Tell DBD::Firebird where to find the libraries. -if [[ ! -z "$GITHUB_ENV" ]]; then - echo "FIREBIRD_HOME=/usr" >> $GITHUB_ENV +if [[ -n "$GITHUB_ENV" ]]; then + echo "FIREBIRD_HOME=/usr" >> "$GITHUB_ENV" fi diff --git a/.github/ubuntu/oracle.sh b/.github/ubuntu/oracle.sh index 96d9dc37e..a258a06a6 100755 --- a/.github/ubuntu/oracle.sh +++ b/.github/ubuntu/oracle.sh @@ -2,13 +2,17 @@ set -e -version=21.9.0.0.0dbru -icdr=219000 +version=23.6.0.24.10 +icdr=2360000 -# Install bsdtar, required to get --strip-components for a zip file. +# Download dependencies. if [ -z "$SKIP_DEPENDS" ]; then + # Install libaio and bsdtar, required to get --strip-components for a zip file. sudo apt-get update -qq - sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq libarchive-tools + sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq libarchive-tools libaio1t64 + + # instantclient still wants libaio.so.1. https://askubuntu.com/a/1514001 + sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 fi # Download Instant Client. @@ -24,15 +28,15 @@ bsdtar -C /opt/instantclient --strip-components 1 -zxf "instantclient-basic-linu bsdtar -C /opt/instantclient --strip-components 1 -zxf "instantclient-sqlplus-linux.x64-${version}.zip" bsdtar -C /opt/instantclient --strip-components 1 -zxf "instantclient-sdk-linux.x64-${version}.zip" -if [[ ! -z "$GITHUB_PATH" ]]; then - echo "/opt/instantclient" >> $GITHUB_PATH +if [[ -n "$GITHUB_PATH" ]]; then + echo "/opt/instantclient" >> "$GITHUB_PATH" fi -if [[ ! -z "$GITHUB_ENV" ]]; then - echo "ORACLE_HOME=/opt/instantclient" >> $GITHUB_ENV +if [[ -n "$GITHUB_ENV" ]]; then + echo "ORACLE_HOME=/opt/instantclient" >> "$GITHUB_ENV" if [[ -z "$LD_LIBRARY_PATH" ]]; then - echo "LD_LIBRARY_PATH=/opt/instantclient" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=/opt/instantclient" >> "$GITHUB_ENV" else - echo "LD_LIBRARY_PATH=/opt/instantclient:$LD_LIBRARY_PATH" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=/opt/instantclient:$LD_LIBRARY_PATH" >> "$GITHUB_ENV" fi fi diff --git a/.github/ubuntu/pg.sh b/.github/ubuntu/pg.sh index 8f35bd05c..0b9d2f314 100755 --- a/.github/ubuntu/pg.sh +++ b/.github/ubuntu/pg.sh @@ -9,6 +9,6 @@ curl -O https://salsa.debian.org/postgresql/postgresql-common/-/raw/master/pgdg/ sudo sh apt.postgresql.org.sh -i -t -v $PGVERSION sudo pg_createcluster --start $PGVERSION test -p 5432 --locale=C -- -A trust -E UTF8 -if [[ ! -z "$GITHUB_PATH" ]]; then - echo "/usr/lib/postgresql/$POSTGRES/bin" >> $GITHUB_PATH +if [[ -n "$GITHUB_PATH" ]]; then + echo "/usr/lib/postgresql/$POSTGRES/bin" >> "$GITHUB_PATH" fi diff --git a/.github/ubuntu/snowflake.sh b/.github/ubuntu/snowflake.sh index a56e9f3eb..ff10a3ce6 100755 --- a/.github/ubuntu/snowflake.sh +++ b/.github/ubuntu/snowflake.sh @@ -11,8 +11,8 @@ fi # https://docs.snowflake.net/manuals/release-notes/client-change-log-snowsql.html # https://sfc-repo.snowflakecomputing.com/index.html -curl -sSLo snowsql.bash https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/snowsql-1.2.20-linux_x86_64.bash -curl -sSLo snowdbc.tgz https://sfc-repo.snowflakecomputing.com/odbc/linux/2.24.2/snowflake_linux_x8664_odbc-2.24.2.tgz +curl -sSLo snowsql.bash https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/snowsql-1.2.21-linux_x86_64.bash +curl -sSLo snowdbc.tgz https://sfc-repo.snowflakecomputing.com/odbc/linux/latest/snowflake_linux_x8664_odbc-3.5.0.tgz # Install and configure ODBC. mkdir -p /opt/snowflake @@ -22,14 +22,14 @@ sudo mv /opt/snowflake/ErrorMessages/en-US /opt/snowflake/lib/ # Install, update, and configure SnowSQL. sed -e '1,/^exit$/d' snowsql.bash | sudo tar -C /opt/snowflake -zxf - /opt/snowflake/snowsql -Uv -echo "[options]\nnoup = true" > /opt/snowflake/config +printf "[options]\nnoup = true\n" > /opt/snowflake/config # Add to the path. -if [[ ! -z "$GITHUB_PATH" ]]; then - echo "/opt/snowflake" >> $GITHUB_PATH +if [[ -n "$GITHUB_PATH" ]]; then + echo "/opt/snowflake" >> "$GITHUB_PATH" fi # Tell SnowSQL where to find the config. -if [[ ! -z "$GITHUB_ENV" ]]; then - echo "WORKSPACE=/opt/snowflake" >> $GITHUB_ENV +if [[ -n "$GITHUB_ENV" ]]; then + echo "WORKSPACE=/opt/snowflake" >> "$GITHUB_ENV" fi diff --git a/.github/ubuntu/sqlite.sh b/.github/ubuntu/sqlite.sh index 7b547134e..74ca18209 100755 --- a/.github/ubuntu/sqlite.sh +++ b/.github/ubuntu/sqlite.sh @@ -6,13 +6,14 @@ SQLITE=${SQLITE:=${1:-3.40.1}} echo "Instaling SQLite $SQLITE" # Convert to the SQLITE_VERSION_NUMBER format https://sqlite.org/c3ref/c_source_id.html -SQLITE=$(perl -e 'my @v = split /[.]/, shift; printf "%d%02d%02d%02d\n", @v[0..3]' $SQLITE) +SQLITE=$(perl -e 'my @v = split /[.]/, shift; printf "%d%02d%02d%02d\n", @v[0..3]' "$SQLITE") # Since 3.7.16.1, the URL includes the year in the path. # 3.18.2, 3.18.1, 3.9.3, and 3.7.11 missing. # https://sqlite.org/chronology.html # https://stackoverflow.com/a/37712117/79202 -if (( $SQLITE >= 3400200 )); then YEAR=2023 +if (( $SQLITE >= 3450000 )); then YEAR=2024 +elif (( $SQLITE >= 3400200 )); then YEAR=2023 elif (( $SQLITE >= 3370200 )); then YEAR=2022 elif (( $SQLITE >= 3340100 )); then YEAR=2021 elif (( $SQLITE >= 3310000 )); then YEAR=2020 @@ -41,20 +42,20 @@ gcc -shared -o libsqlite3.so -fPIC sqlite3.o -ldl -lpthread # Hand-build DBD::SQLite against the version of SQLite just installed. DIST=$(cpanm --info DBD::SQLite) # ISHIGAKI/DBD-SQLite-1.70.tar.gz URL=https://cpan.metacpan.org/authors/id/${DIST:0:1}/${DIST:0:2}/$DIST -curl -o dbd.tar.gz $URL +curl -o dbd.tar.gz "$URL" tar zxvf dbd.tar.gz --strip-components 1 perl -i -pe 's/^if\s*\(\s*0\s*\)\s\{/if (1) {/' Makefile.PL perl Makefile.PL SQLITE_INC=/opt/sqlite SQLITE_LIB=/opt/sqlite make && make install -if [[ ! -z "$GITHUB_PATH" ]]; then - echo "/opt/sqlite" >> $GITHUB_PATH +if [[ -n "$GITHUB_PATH" ]]; then + echo "/opt/sqlite" >> "$GITHUB_PATH" fi -if [[ ! -z "$GITHUB_ENV" ]]; then +if [[ -n "$GITHUB_ENV" ]]; then if [[ -z "$LD_LIBRARY_PATH" ]]; then - echo "LD_LIBRARY_PATH=/opt/sqlite" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=/opt/sqlite" >> "$GITHUB_ENV" else - echo "LD_LIBRARY_PATH=/opt/sqlite:$LD_LIBRARY_PATH" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=/opt/sqlite:$LD_LIBRARY_PATH" >> "$GITHUB_ENV" fi fi diff --git a/.github/ubuntu/vertica.sh b/.github/ubuntu/vertica.sh index caafa3803..fea50d54b 100755 --- a/.github/ubuntu/vertica.sh +++ b/.github/ubuntu/vertica.sh @@ -11,9 +11,9 @@ fi cat t/odbc/vertica.ini | sudo tee -a /etc/vertica.ini # https://www.vertica.com/download/vertica/client-drivers/ -curl -sSLO https://www.vertica.com/client_drivers/12.0.x/12.0.3-0/vertica-client-12.0.3-0.x86_64.tar.gz -sudo tar -xzf vertica-client-12.0.3-0.x86_64.tar.gz -C / +curl -sSLO https://www.vertica.com/client_drivers/24.2.x/24.2.0-1/vertica-client-24.2.0-1.x86_64.tar.gz +sudo tar -xzf vertica-client-24.2.0-1.x86_64.tar.gz -C / -if [[ ! -z "$GITHUB_PATH" ]]; then - echo "/opt/vertica/bin" >> $GITHUB_PATH +if [[ -n "$GITHUB_PATH" ]]; then + echo "/opt/vertica/bin" >> "$GITHUB_PATH" fi diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 042cc800c..d0cc7a27f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -18,10 +18,10 @@ jobs: ports: [ 8563 ] options: --privileged firebird: - image: jacobalberty/firebird:latest + image: ghcr.io/fdcastel/firebird:latest ports: [ 3050 ] env: - ISC_PASSWORD: nix + FIREBIRD_ROOT_PASSWORD: nix FIREBIRD_DATABASE: sqitchtest.db mysql: image: mysql:latest @@ -44,9 +44,9 @@ jobs: image: vertica/vertica-ce:latest ports: [ 5433 ] steps: - # https://github.com/orgs/community/discussions/25678#discussioncomment-5242449 + # https://github.com/orgs/community/discussions/25678#discussioncomment-9017167 - name: Free Disk Space - run: rm -rf /opt/hostedtoolcache + run: find /opt -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';' - name: Start CockroachDB run: docker run -d -p 26257:26257 cockroachdb/cockroach:latest start-single-node --insecure - uses: actions/checkout@v4 @@ -81,9 +81,9 @@ jobs: PERL5LIB: "${{ github.workspace }}/local/lib/perl5" HARNESS_PERL_SWITCHES: -MDevel::Cover=-ignore,^(?:x?t|inc|bin|local)/ LIVE_EXASOL_REQUIRED: true - SQITCH_TEST_EXASOL_URI: db:exasol://sys:exasol@127.0.0.1:${{ job.services.exasol.ports[8563] }}/?Driver=Exasol;SSLCertificate=SSL_VERIFY_NONE + SQITCH_TEST_EXASOL_URI: db:exasol://sys:exasol@127.0.0.1:${{ job.services.exasol.ports[8563] }}/?Driver=Exasol;SSLCERTIFICATE=SSL_VERIFY_NONE LIVE_FIREBIRD_REQUIRED: true - SQITCH_TEST_FIREBIRD_URI: db:firebird://sysdba:nix@127.0.0.1:${{ job.services.firebird.ports[3050] }}//firebird/data/sqitchtest.db + SQITCH_TEST_FIREBIRD_URI: db:firebird://sysdba:nix@127.0.0.1:${{ job.services.firebird.ports[3050] }}//var/lib/firebird/data/sqitchtest.db LIVE_MYSQL_REQUIRED: true SQITCH_TEST_MYSQL_URI: "db:mysql://root@127.0.0.1:${{ job.services.mysql.ports[3306] }}/information_schema" LIVE_ORACLE_REQUIRED: true diff --git a/.github/workflows/exasol.yml b/.github/workflows/exasol.yml index b372107b4..b608ac8cf 100644 --- a/.github/workflows/exasol.yml +++ b/.github/workflows/exasol.yml @@ -11,7 +11,7 @@ jobs: Exasol: strategy: matrix: - exasol: ['7.1', '7.0'] + exasol: ['8', '7.1', '7.0'] name: ☀️ Exasol ${{ matrix.exasol }} runs-on: ubuntu-latest services: @@ -38,5 +38,5 @@ jobs: env: PERL5LIB: "${{ github.workspace }}/local/lib/perl5" LIVE_EXASOL_REQUIRED: true - SQITCH_TEST_EXASOL_URI: db:exasol://sys:exasol@127.0.0.1:${{ job.services.exasol.ports[8563] }}/?Driver=Exasol;SSLCertificate=SSL_VERIFY_NONE + SQITCH_TEST_EXASOL_URI: db:exasol://sys:exasol@127.0.0.1:${{ job.services.exasol.ports[8563] }}/?Driver=Exasol;SSLCERTIFICATE=SSL_VERIFY_NONE run: prove -lvr t/exasol.t diff --git a/.github/workflows/firebird.yml b/.github/workflows/firebird.yml index 2ba7dd920..427cdf33b 100644 --- a/.github/workflows/firebird.yml +++ b/.github/workflows/firebird.yml @@ -12,10 +12,11 @@ jobs: strategy: matrix: include: - - { version: '4.0' } - - { version: '3.0' } - - { version: '2.5-ss' } - - { version: '2.5-sc' } + - { version: '5', image: ghcr.io/fdcastel/firebird, dir: /var/lib/firebird/data } + - { version: '4', image: ghcr.io/fdcastel/firebird, dir: /var/lib/firebird/data } + - { version: '3', image: ghcr.io/fdcastel/firebird, dir: /var/lib/firebird/data } + - { version: '2.5-ss', image: jacobalberty/firebird, dir: /firebird/data } # deprecated + - { version: '2.5-sc', image: jacobalberty/firebird, dir: /firebird/data } # deprecated name: 🔥 Firebird ${{ matrix.version }} runs-on: ubuntu-latest services: @@ -23,10 +24,11 @@ jobs: # CLI and libraries DBD::firebird use are static to the version on the runner # machine. firebird: - image: jacobalberty/firebird:${{ matrix.version }} + image: ${{ matrix.image }}:${{ matrix.version }} ports: [ 3050 ] env: - ISC_PASSWORD: nix + ISC_PASSWORD: nix # for jacobalberty/firebird only + FIREBIRD_ROOT_PASSWORD: nix FIREBIRD_DATABASE: sqitchtest.db steps: - uses: actions/checkout@v4 @@ -47,5 +49,5 @@ jobs: env: PERL5LIB: "${{ github.workspace }}/local/lib/perl5" LIVE_FIREBIRD_REQUIRED: true - SQITCH_TEST_FIREBIRD_URI: db:firebird://sysdba:nix@127.0.0.1:${{ job.services.firebird.ports[3050] }}//firebird/data/sqitchtest.db + SQITCH_TEST_FIREBIRD_URI: db:firebird://sysdba:nix@127.0.0.1:${{ job.services.firebird.ports[3050] }}/${{ matrix.dir }}/sqitchtest.db run: prove -lvr t/firebird.t diff --git a/.github/workflows/mysql.yml b/.github/workflows/mysql.yml index 4510babf7..f8e42c130 100644 --- a/.github/workflows/mysql.yml +++ b/.github/workflows/mysql.yml @@ -12,21 +12,32 @@ jobs: strategy: matrix: include: - # curl https://registry.hub.docker.com/v2/repositories/library/mysql/tags\?page_size\=10000 | jq '.results[].name - - { version: '8.0', icon: 🐬, name: MySQL, image: mysql } - - { version: '5.7', icon: 🐬, name: MySQL, image: mysql } - - { version: '5.6', icon: 🐬, name: MySQL, image: mysql } - - { version: '5.5', icon: 🐬, name: MySQL, image: mysql } - # https://registry.hub.docker.com/v2/repositories/library/mariadb/tags\?page_size\=10000 | jq '.results[].name' - - { version: '11.0', icon: 🦭, name: MariaDB, image: mariadb } - - { version: '10.9', icon: 🦭, name: MariaDB, image: mariadb } - - { version: '10.6', icon: 🦭, name: MariaDB, image: mariadb } - - { version: '10.5', icon: 🦭, name: MariaDB, image: mariadb } - - { version: '10.4', icon: 🦭, name: MariaDB, image: mariadb } - - { version: '10.3', icon: 🦭, name: MariaDB, image: mariadb } - - { version: '10.2', icon: 🦭, name: MariaDB, image: mariadb } - - { version: '10.1', icon: 🦭, name: MariaDB, image: mariadb } - - { version: '10.0', icon: 🦭, name: MariaDB, image: mariadb } + # curl -s https://registry.hub.docker.com/v2/repositories/library/mysql/tags\?page_size\=10000 | jq '.results[].name' + - { version: '9.1', icon: 🐬, name: MySQL, image: mysql } + - { version: '8.4', icon: 🐬, name: MySQL, image: mysql } + - { version: '5.7', icon: 🐬, name: MySQL, image: mysql } + - { version: '5.6', icon: 🐬, name: MySQL, image: mysql } + - { version: '5.5', icon: 🐬, name: MySQL, image: mysql } + # curl -s https://registry.hub.docker.com/v2/repositories/library/mariadb/tags\?page_size\=10000 | jq '.results[].name' + - { version: '11.6', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '11.5', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '11.4', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '11.3', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '11.2', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '11.1', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '11.0', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.11', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.10', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.9', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.8', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.7', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.6', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.5', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.4', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.3', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.2', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.1', icon: 🦭, name: MariaDB, image: mariadb } + - { version: '10.0', icon: 🦭, name: MariaDB, image: mariadb } name: ${{ matrix.icon }} ${{ matrix.name }} ${{ matrix.version }} runs-on: ubuntu-latest services: diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml index 9fbff57e9..6d9e249f6 100644 --- a/.github/workflows/oracle.yml +++ b/.github/workflows/oracle.yml @@ -20,8 +20,8 @@ jobs: # * Image Source: https://github.com/gvenzl/oci-oracle-xe/ # * Image Issue: https://github.com/gvenzl/oci-oracle-xe/issues/46 # * DBD::Oracle Issue: https://github.com/perl5-dbi/DBD-Oracle/issues/131 - # https://registry.hub.docker.com/v2/repositories/gvenzl/oracle-xe/tags\?page_size\=10000 | jq '.results[].name - - { version: 21c, tag: 21, service: XE, altUser: dbsnmp } + # https://registry.hub.docker.com/v2/repositories/gvenzl/oracle-xe/tags\?page_size\=10000 | jq '.results[].name' + - { version: 21c, tag: 21-slim, service: XE, altUser: dbsnmp } - { version: 18c, tag: 18-slim, service: XE, altUser: gsmuser } - { version: 11g, tag: 11-slim, service: XE, altuser: sqitchtest } name: "🔮 Oracle ${{ matrix.version }}" diff --git a/.github/workflows/perl.yml b/.github/workflows/perl.yml index ee95e0c54..e4f56d77e 100644 --- a/.github/workflows/perl.yml +++ b/.github/workflows/perl.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [[🐧, ubuntu], [🍎, macos], [🪟, windows]] - perl: [ '5.38', '5.36', '5.34', '5.32', '5.30', '5.28', '5.26', '5.24', '5.22', '5.20', '5.18', '5.16', '5.14', '5.12' ] + perl: [ '5.40', '5.38', '5.36', '5.34', '5.32', '5.30', '5.28', '5.26', '5.24', '5.22', '5.20', '5.18', '5.16', '5.14', '5.12' ] exclude: - { os: [🪟, windows], perl: '5.12' } # https://github.com/shogo82148/actions-setup-perl/issues/876 - { os: [🪟, windows], perl: '5.14' } # https://github.com/shogo82148/actions-setup-perl/issues/881 diff --git a/.github/workflows/pg.yml b/.github/workflows/pg.yml index b727a78be..facfa35e3 100644 --- a/.github/workflows/pg.yml +++ b/.github/workflows/pg.yml @@ -11,7 +11,7 @@ jobs: Postgres: strategy: matrix: - pg: [16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4, 9.3, 9.2, 9.1, '9.0', 8.4] + pg: [17, 16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4, 9.3, 9.2, 9.1, '9.0', 8.4] name: 🐘 Postgres ${{ matrix.pg }} runs-on: ubuntu-latest steps: diff --git a/.github/workflows/sqlite.yml b/.github/workflows/sqlite.yml index 161a660aa..02a15ddf5 100644 --- a/.github/workflows/sqlite.yml +++ b/.github/workflows/sqlite.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: # https://sqlite.org/chronology.html - sqlite: [3.42.0, 3.41.2, 3.40.1, 3.39.4, 3.38.5, 3.37.2, 3.36.0, 3.35.5, 3.34.1, 3.33.0, 3.32.3, 3.31.1, 3.30.1, 3.29.0, 3.28.0, 3.27.2, 3.26.0, 3.25.3, 3.24.0, 3.23.1, 3.22.0, 3.21.0, 3.20.1, 3.19.3, 3.18.0, 3.17.0, 3.16.2, 3.15.2, 3.14.2, 3.13.0, 3.12.2, 3.11.1, 3.10.2, 3.9.2, 3.8.11.1, 3.8.6] + sqlite: [3.47.2, 3.46.1, 3.45.3, 3.44.2, 3.43.2, 3.42.0, 3.41.2, 3.40.1, 3.39.4, 3.38.5, 3.37.2, 3.36.0, 3.35.5, 3.34.1, 3.33.0, 3.32.3, 3.31.1, 3.30.1, 3.29.0, 3.28.0, 3.27.2, 3.26.0, 3.25.3, 3.24.0, 3.23.1, 3.22.0, 3.21.0, 3.20.1, 3.19.3, 3.18.0, 3.17.0, 3.16.2, 3.15.2, 3.14.2, 3.13.0, 3.12.2, 3.11.1, 3.10.2, 3.9.2, 3.8.11.1, 3.8.6] name: 💡 SQLite ${{ matrix.sqlite }} runs-on: ubuntu-latest steps: diff --git a/.github/workflows/vertica.yml b/.github/workflows/vertica.yml index 1eab0d85e..f8195171a 100644 --- a/.github/workflows/vertica.yml +++ b/.github/workflows/vertica.yml @@ -12,6 +12,8 @@ jobs: strategy: matrix: include: + - { label: '24.1', version: 24.1.0-0, image: vertica/vertica-ce, db: VMart } + - { label: '23.4', version: 23.4.0-0, image: vertica/vertica-ce, db: VMart } - { label: '12.0', version: 12.0.4-0, image: vertica/vertica-ce, db: VMart } - { label: '11.0', version: 11.1.1-0, image: vertica/vertica-ce, db: VMart } - { label: '10.1', version: 10.1.1-0, image: vertica/vertica-ce, db: VMart } diff --git a/.github/workflows/yugabyte.yml b/.github/workflows/yugabyte.yml index 203a56db9..5a068cf31 100644 --- a/.github/workflows/yugabyte.yml +++ b/.github/workflows/yugabyte.yml @@ -13,17 +13,22 @@ jobs: matrix: include: # curl https://registry.hub.docker.com/v2/repositories/yugabytedb/yugabyte/tags\?page_size\=10000 | jq '.results[].name' | sort - - { version: '2.19', tag: 2.19.0.0-b190 } - - { version: '2.18', tag: 2.18.1.0-b84 } - - { version: '2.17', tag: 2.17.3.0-b152 } - - { version: '2.16', tag: 2.16.6.0-b43 } - - { version: '2.15', tag: 2.15.3.2-b1 } - - { version: '2.14', tag: 2.14.11.0-b35 } - - { version: '2.13', tag: 2.13.2.0-b135 } - - { version: '2.12', tag: 2.12.12.0-b12 } - - { version: '2.11', tag: 2.11.2.0-b89 } - - { version: '2.8', tag: 2.8.12.0-b5 } - - { version: '2.6', tag: 2.6.20.0-b10 } + - { version: '2024.2', tag: 2024.2.0.0-b145 } + - { version: '2024.1', tag: 2024.1.3.1-b8 } + - { version: '2.23', tag: 2.23.1.0-b220 } + - { version: '2.21', tag: 2.21.1.0-b271 } + - { version: '2.20', tag: 2.20.8.1-b2 } + - { version: '2.19', tag: 2.19.0.0-b190 } + - { version: '2.18', tag: 2.18.9.0-b17 } + - { version: '2.17', tag: 2.17.3.0-b152 } + - { version: '2.16', tag: 2.16.9.0-b67 } + - { version: '2.15', tag: 2.15.3.2-b1 } + - { version: '2.14', tag: 2.14.17.0-b6 } + - { version: '2.13', tag: 2.13.2.0-b135 } + - { version: '2.12', tag: 2.12.12.0-b12 } + - { version: '2.11', tag: 2.11.2.0-b89 } + - { version: '2.8', tag: 2.8.12.0-b5 } + - { version: '2.6', tag: 2.6.20.0-b10 } name: 💫 Yugabyte ${{ matrix.version }} runs-on: ubuntu-latest steps: diff --git a/Changes b/Changes index 74b08cc5c..94449a844 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,10 @@ Revision history for Perl extension App::Sqitch - Banned "[" and "]" in names (changes, tags, projects) because they muck with dependency parsing of the plan file. Thanks to Žiga Leber for the bug report (#829). + - Updated the IPC methods that interact with engine clients to raise + exception objects rather than strings, for more consistent error + handling throughout. + - Removed duplicate DBI error handling code from engines and tests. 1.4.1 2024-02-04T16:35:32Z - Removed the quoting of the role and warehouse identifiers that was diff --git a/README.md b/README.md index db6640df3..18a0772be 100644 --- a/README.md +++ b/README.md @@ -163,15 +163,15 @@ SOFTWARE. [OSes]: https://github.com/sqitchers/sqitch/actions/workflows/os.yml/badge.svg [💿]: https://github.com/sqitchers/sqitch/actions/workflows/os.yml "Tested on Linux, macOS, and Windows" [Exasol]: https://github.com/sqitchers/sqitch/actions/workflows/exasol.yml/badge.svg - [☀️]: https://github.com/sqitchers/sqitch/actions/workflows/exasol.yml "Tested with Exasol 7.0–7.1" + [☀️]: https://github.com/sqitchers/sqitch/actions/workflows/exasol.yml "Tested with Exasol 7.0–8.32" [Oracle]: https://github.com/sqitchers/sqitch/actions/workflows/oracle.yml/badge.svg [🔮]: https://github.com/sqitchers/sqitch/actions/workflows/oracle.yml "Tested with Oracle 11, 18, and 21" [Docker]: https://img.shields.io/docker/v/sqitch/sqitch?label=%F0%9F%90%B3%20Docker&sort=semver [🐳]: https://hub.docker.com/r/sqitch/sqitch "Latest version on Docker Hub" [Perl]: https://github.com/sqitchers/sqitch/actions/workflows/perl.yml/badge.svg - [🧅]: https://github.com/sqitchers/sqitch/actions/workflows/perl.yml "Tested with Perl 5.12–5.38" + [🧅]: https://github.com/sqitchers/sqitch/actions/workflows/perl.yml "Tested with Perl 5.12–5.40" [Firebird]: https://github.com/sqitchers/sqitch/actions/workflows/firebird.yml/badge.svg - [🔥]: https://github.com/sqitchers/sqitch/actions/workflows/firebird.yml "Tested with Firebird 2.5, 3, and 4" + [🔥]: https://github.com/sqitchers/sqitch/actions/workflows/firebird.yml "Tested with Firebird 2.5–5.0" [Snowflake]: https://github.com/sqitchers/sqitch/actions/workflows/snowflake.yml/badge.svg [❄️]: https://github.com/sqitchers/sqitch/actions/workflows/snowflake.yml "Tested with Snowflake" [Homebrew]: https://img.shields.io/github/v/tag/sqitchers/homebrew-sqitch?label=%F0%9F%8D%BA%20Homebrew&sort=semver @@ -179,15 +179,15 @@ SOFTWARE. [Coverage]: https://img.shields.io/coveralls/github/sqitchers/sqitch?label=%F0%9F%93%88%20Coverage [📈]: https://coveralls.io/r/sqitchers/sqitch "Test Coverage" [MySQL]: https://github.com/sqitchers/sqitch/actions/workflows/mysql.yml/badge.svg - [🐬]: https://github.com/sqitchers/sqitch/actions/workflows/mysql.yml "Tested with MySQL 5.5–8 and MariaDB 10.0–11.0" + [🐬]: https://github.com/sqitchers/sqitch/actions/workflows/mysql.yml "Tested with MySQL 5.5–9.1 and MariaDB 10.0–11.6" [SQLite]: https://github.com/sqitchers/sqitch/actions/workflows/sqlite.yml/badge.svg - [💡]: https://github.com/sqitchers/sqitch/actions/workflows/sqlite.yml "Tested with SQLite 3.8–3.42" + [💡]: https://github.com/sqitchers/sqitch/actions/workflows/sqlite.yml "Tested with SQLite 3.8–3.47" [Debian]: https://img.shields.io/debian/v/sqitch?label=%F0%9F%8D%A5%20Debian [🍥]: https://packages.debian.org/stable/sqitch "Latest version on Debian" [Postgres]: https://github.com/sqitchers/sqitch/actions/workflows/pg.yml/badge.svg - [🐘]: https://github.com/sqitchers/sqitch/actions/workflows/pg.yml "Tested with PostgreSQL 8.4–16" + [🐘]: https://github.com/sqitchers/sqitch/actions/workflows/pg.yml "Tested with PostgreSQL 8.4–17" [Yugabyte]: https://github.com/sqitchers/sqitch/actions/workflows/yugabyte.yml/badge.svg - [💫]: https://github.com/sqitchers/sqitch/actions/workflows/yugabyte.yml "Tested with YugabyteDB 2.6–2.19" + [💫]: https://github.com/sqitchers/sqitch/actions/workflows/yugabyte.yml "Tested with YugabyteDB 2.6–2024.2" [Vertica]: https://github.com/sqitchers/sqitch/actions/workflows/vertica.yml/badge.svg [🔺]: https://github.com/sqitchers/sqitch/actions/workflows/vertica.yml "Tested with Vertica 7.2–12.0" [Cockroach]: https://github.com/sqitchers/sqitch/actions/workflows/cockroach.yml/badge.svg diff --git a/lib/App/Sqitch.pm b/lib/App/Sqitch.pm index 95c977469..b8813fd3c 100644 --- a/lib/App/Sqitch.pm +++ b/lib/App/Sqitch.pm @@ -329,7 +329,7 @@ sub run { my $self = shift; local $SIG{__DIE__} = sub { ( my $msg = shift ) =~ s/\s+at\s+.+/\n/ms; - die $msg; + hurl ipc => $msg; }; if (ISWIN && IPC::System::Simple->VERSION < 1.28) { runx ( shift, $self->quote_shell(@_) ); @@ -343,7 +343,7 @@ sub shell { my ($self, $cmd) = @_; local $SIG{__DIE__} = sub { ( my $msg = shift ) =~ s/\s+at\s+.+/\n/ms; - die $msg; + hurl ipc => $msg; }; IPC::System::Simple::run $cmd; return $self; @@ -363,7 +363,7 @@ sub capture { my $self = shift; local $SIG{__DIE__} = sub { ( my $msg = shift ) =~ s/\s+at\s+.+/\n/ms; - die $msg; + hurl ipc => $msg; }; return capturex ( shift, $self->quote_shell(@_) ) if ISWIN && IPC::System::Simple->VERSION <= 1.25; diff --git a/lib/App/Sqitch/Engine.pm b/lib/App/Sqitch/Engine.pm index f6979ad49..32ba15a1a 100644 --- a/lib/App/Sqitch/Engine.pm +++ b/lib/App/Sqitch/Engine.pm @@ -1764,7 +1764,6 @@ L engine sets them via the C command and the L engine sets them via the SQL*Plus C command. - =head3 C $engine->deploy($to_change); diff --git a/lib/App/Sqitch/Engine/exasol.pm b/lib/App/Sqitch/Engine/exasol.pm index d8c14eabb..cb433bf45 100644 --- a/lib/App/Sqitch/Engine/exasol.pm +++ b/lib/App/Sqitch/Engine/exasol.pm @@ -131,12 +131,7 @@ has dbh => ( AutoCommit => 1, odbc_utf8_on => 1, FetchHashKeyName => 'NAME_lc', - HandleError => sub { - my ($err, $dbh) = @_; - $@ = $err; - @_ = ($dbh->state || 'DEV' => $dbh->errstr); - goto &hurl; - }, + HandleError => $self->_error_handler, Callbacks => { connected => sub { my $dbh = shift; diff --git a/lib/App/Sqitch/Engine/firebird.pm b/lib/App/Sqitch/Engine/firebird.pm index b0ec6bd9c..4841e16d6 100644 --- a/lib/App/Sqitch/Engine/firebird.pm +++ b/lib/App/Sqitch/Engine/firebird.pm @@ -79,12 +79,7 @@ has dbh => ( AutoCommit => 1, ib_enable_utf8 => 1, FetchHashKeyName => 'NAME_lc', - HandleError => sub { - my ($err, $dbh) = @_; - $@ = $err; - @_ = ($dbh->state || 'DEV' => $dbh->errstr); - goto &hurl; - }, + HandleError => $self->_error_handler, }); } ); diff --git a/lib/App/Sqitch/Engine/mysql.pm b/lib/App/Sqitch/Engine/mysql.pm index 50167326e..8b2f15899 100644 --- a/lib/App/Sqitch/Engine/mysql.pm +++ b/lib/App/Sqitch/Engine/mysql.pm @@ -79,12 +79,7 @@ has dbh => ( mysql_enable_utf8 => 1, mysql_auto_reconnect => 0, mysql_use_result => 0, # Prevent "Commands out of sync" error. - HandleError => sub { - my ($err, $dbh) = @_; - $@ = $err; - @_ = ($dbh->state || 'DEV' => $dbh->errstr); - goto &hurl; - }, + HandleError => $self->_error_handler, Callbacks => { connected => sub { my $dbh = shift; diff --git a/lib/App/Sqitch/Engine/oracle.pm b/lib/App/Sqitch/Engine/oracle.pm index 5cd82b8e5..8cd4af7ee 100644 --- a/lib/App/Sqitch/Engine/oracle.pm +++ b/lib/App/Sqitch/Engine/oracle.pm @@ -102,12 +102,7 @@ has dbh => ( RaiseError => 0, AutoCommit => 1, FetchHashKeyName => 'NAME_lc', - HandleError => sub { - my ($err, $dbh) = @_; - $@ = $err; - @_ = ($dbh->state || 'DEV' => $dbh->errstr); - goto &hurl; - }, + HandleError => $self->_error_handler, Callbacks => { connected => sub { my $dbh = shift; diff --git a/lib/App/Sqitch/Engine/pg.pm b/lib/App/Sqitch/Engine/pg.pm index 1317b83a7..62f4b1004 100644 --- a/lib/App/Sqitch/Engine/pg.pm +++ b/lib/App/Sqitch/Engine/pg.pm @@ -127,12 +127,7 @@ has dbh => ( AutoCommit => 1, pg_enable_utf8 => 1, pg_server_prepare => 1, - HandleError => sub { - my ($err, $dbh) = @_; - $@ = $err; - @_ = ($dbh->state || 'DEV' => $dbh->errstr); - goto &hurl; - }, + HandleError => $self->_error_handler, Callbacks => { connected => sub { my $dbh = shift; diff --git a/lib/App/Sqitch/Engine/snowflake.pm b/lib/App/Sqitch/Engine/snowflake.pm index ee8151ffc..8d476fcb2 100644 --- a/lib/App/Sqitch/Engine/snowflake.pm +++ b/lib/App/Sqitch/Engine/snowflake.pm @@ -200,12 +200,7 @@ has dbh => ( AutoCommit => 1, odbc_utf8_on => 1, FetchHashKeyName => 'NAME_lc', - HandleError => sub { - my ($err, $dbh) = @_; - $@ = $err; - @_ = ($dbh->state || 'DEV' => $dbh->errstr); - goto &hurl; - }, + HandleError => $self->_error_handler, Callbacks => { connected => sub { my $dbh = shift; diff --git a/lib/App/Sqitch/Engine/sqlite.pm b/lib/App/Sqitch/Engine/sqlite.pm index c5926ebba..fbb286c95 100644 --- a/lib/App/Sqitch/Engine/sqlite.pm +++ b/lib/App/Sqitch/Engine/sqlite.pm @@ -77,12 +77,7 @@ has dbh => ( AutoCommit => 1, sqlite_unicode => 1, sqlite_use_immediate_transaction => 1, - HandleError => sub { - my ($err, $dbh) = @_; - $@ = $err; - @_ = ($dbh->state || 'DEV' => $dbh->errstr); - goto &hurl; - }, + HandleError => $self->_error_handler, Callbacks => { connected => sub { my $dbh = shift; diff --git a/lib/App/Sqitch/Engine/vertica.pm b/lib/App/Sqitch/Engine/vertica.pm index 35bea7b35..b75e1ce43 100644 --- a/lib/App/Sqitch/Engine/vertica.pm +++ b/lib/App/Sqitch/Engine/vertica.pm @@ -89,12 +89,7 @@ has dbh => ( RaiseError => 0, AutoCommit => 1, odbc_utf8_on => 1, - HandleError => sub { - my ($err, $dbh) = @_; - $@ = $err; - @_ = ($dbh->state || 'DEV' => $dbh->errstr); - goto &hurl; - }, + HandleError => $self->_error_handler, Callbacks => { connected => sub { my $dbh = shift; diff --git a/lib/App/Sqitch/Role/DBIEngine.pm b/lib/App/Sqitch/Role/DBIEngine.pm index e09fc4df9..bf54c9713 100644 --- a/lib/App/Sqitch/Role/DBIEngine.pm +++ b/lib/App/Sqitch/Role/DBIEngine.pm @@ -1016,6 +1016,15 @@ sub rollback_work { return $self; } +sub _eh { + my ($err, $dbh) = @_; + $@ = $err; + @_ = ($dbh->state || 'DEV' => $dbh->errstr); + goto &hurl; +} + +sub _error_handler { \&_eh } + 1; __END__ diff --git a/t/base.t b/t/base.t index 9098e2bc6..87bc80b18 100644 --- a/t/base.t +++ b/t/base.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 208; +use Test::More tests => 214; # use Test::More 'no_plan'; use Test::MockModule 0.17; use Path::Class; @@ -420,7 +420,11 @@ is $stderr, '', 'Nothing should have gone to STDERR'; ($stdout, $stderr) = capture { throws_ok { $sqitch->run( $^X, 'die.pl', qw(hi there)) - } qr/unexpectedly returned/, 'run die should, well, die'; + } 'App::Sqitch::X', 'run die should, well, die'; + is $@->ident, 'ipc', 'Error ident should be "ipc"'; + like $@->message, + qr/unexpectedly returned/, + 'The error message should be from the exit error'; }; is $stdout, "hi there\n", 'The die script should have its STDOUT ummolested'; @@ -442,7 +446,11 @@ is $stderr, '', 'Nothing should have gone to STDERR'; ($stdout, $stderr) = capture { throws_ok { $sqitch->shell( "$pl die.pl hi there" ) - } qr/unexpectedly returned/, 'shell die should, well, die'; + } 'App::Sqitch::X', 'shell die should, well, die'; + is $@->ident, 'ipc', 'Error ident should be "ipc"'; + like $@->message, + qr/unexpectedly returned/, + 'The error message should be from the exit error'; }; is $stdout, "hi there\n", 'The die script should have its STDOUT ummolested'; @@ -470,8 +478,12 @@ is $sqitch->capture($^X, 'echo.pl', qw(hi there)), "hi there\n", 'The echo script output should have been returned'; like capture_stderr { throws_ok { $sqitch->capture($^X, 'die.pl', qw(hi there)) } - qr/unexpectedly returned/, + 'App::Sqitch::X', 'Should get an error if the command errors out'; + is $@->ident, 'ipc', 'Error ident should be "ipc"'; + like $@->message, + qr/unexpectedly returned/, + 'The error message should be from the exit error'; }, qr/OMGWTF/m, 'The die script STDERR should have passed through'; ############################################################################## diff --git a/t/cockroach.t b/t/cockroach.t index 2f6ef875a..181425a02 100644 --- a/t/cockroach.t +++ b/t/cockroach.t @@ -140,16 +140,17 @@ my $err = try { $cockroach->_capture('--version'); $cockroach->use_driver; $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { - PrintError => 0, - RaiseError => 1, - AutoCommit => 1, + PrintError => 0, + RaiseError => 0, + AutoCommit => 1, + HandleError => $cockroach->_error_handler, cockroach_lc_messages => 'C', }); $dbh->do("CREATE DATABASE $db"); $uri->dbname($db); undef; } catch { - eval { $_->message } || $_; + $_ }; DBIEngineTest->run( diff --git a/t/exasol.t b/t/exasol.t index a4df70e61..0e6cadbff 100644 --- a/t/exasol.t +++ b/t/exasol.t @@ -21,6 +21,7 @@ use Try::Tiny; use App::Sqitch; use App::Sqitch::Target; use App::Sqitch::Plan; +use App::Sqitch::Role::DBIEngine; use lib 't/lib'; use DBIEngineTest; use TestConfig; @@ -104,7 +105,7 @@ is $exa->_script, join( "\n" => ( # Make sure the URI query properly affect the client options. for my $spec ( { - qry => 'SSLCertificate=SSL_VERIFY_NONE', + qry => 'SSLCERTIFICATE=SSL_VERIFY_NONE', opt => [qw(-jdbcparam validateservercertificate=0)], }, { @@ -128,7 +129,7 @@ for my $spec ( opt => [qw(-jdbcparam authmethod=xyz)], }, { - qry => 'SSLCertificate=SSL_VERIFY_NONE&AUTHMETHOD=xyz', + qry => 'SSLCERTIFICATE=SSL_VERIFY_NONE&AUTHMETHOD=xyz', opt => [qw(-jdbcparam validateservercertificate=0 -jdbcparam authmethod=xyz)], }, ) { @@ -416,17 +417,26 @@ $uri = URI->new( $ENV{EXA_URI} || 'db:dbadmin:password@localhost/dbadmin' ); -my $err = try { - $exa->use_driver; - $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { - PrintError => 0, - RaiseError => 1, - AutoCommit => 1, - }); - undef; -} catch { - eval { $_->message } || $_; -}; +my $err; +for my $i (1..30) { + $err = try { + $exa->use_driver; + $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { + PrintError => 0, + RaiseError => 0, + AutoCommit => 1, + HandleError => $exa->_error_handler, + }); + undef; + } catch { + $_; + }; + + # Sleep if it failed but Exasol is still starting up. + last unless $err && ($DBI::state || '') eq 'HY000'; + sleep 1 if $i < 30; +} + DBIEngineTest->run( class => $CLASS, @@ -439,7 +449,7 @@ DBIEngineTest->run( $self->sqitch->probe( $self->client, '-version' ); $self->_capture('SELECT 1 FROM dual;'); }, - engine_err_regex => qr/\[EXASOL\]\[EXASolution driver\]syntax error/, + engine_err_regex => qr/\[Exasol\]\[Exasol(?:ution)? Driver\]syntax error/i, init_error => __x( 'Sqitch already initialized', schema => $reg2, diff --git a/t/firebird.t b/t/firebird.t index f0a04e891..9b3db3e82 100644 --- a/t/firebird.t +++ b/t/firebird.t @@ -416,9 +416,10 @@ my $err = try { # Try to connect. my $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { - PrintError => 0, - RaiseError => 1, - AutoCommit => 1, + PrintError => 0, + RaiseError => 0, + AutoCommit => 1, + HandleError => $fb->_error_handler, }); $fb_version = $dbh->selectcol_arrayref(q{ SELECT rdb$get_context('SYSTEM', 'ENGINE_VERSION') @@ -429,7 +430,7 @@ my $err = try { push @cleanup => map { catfile $data_dir, $_ } $reg1, $reg2; return undef; } catch { - eval { $_->message } || $_; + $_ }; END { diff --git a/t/lib/DBIEngineTest.pm b/t/lib/DBIEngineTest.pm index c6168e390..0b6a6e13e 100644 --- a/t/lib/DBIEngineTest.pm +++ b/t/lib/DBIEngineTest.pm @@ -90,14 +90,14 @@ sub run { try { $code->( $engine ) || die 'NO'; } catch { - (my $msg = eval { $_->message } || $_) =~ s/^/# /g; plan skip_all => sprintf( 'Unable to live-test %s engine: %s', $class->name, - substr($msg, 2), + $_->message, ) unless $ENV{'LIVE_' . uc $engine->key . '_REQUIRED'}; fail 'Connect to ' . $class->name; - diag substr $msg, 2; + diag $_->message; + diag $_->previous_exception; } or return; } if (my $q = $p{version_query}) { @@ -1774,9 +1774,10 @@ sub run { # Make a second connection to the database. my $dbh = DBI->connect($engine->uri->dbi_dsn, $engine->username, $engine->password, { - PrintError => 0, - RaiseError => 1, - AutoCommit => 1, + PrintError => 0, + RaiseError => 0, + AutoCommit => 1, + HandleError => $engine->_error_handler, }); ok !$dbh->selectcol_arrayref($sql->{try_lock})->[0], 'Should fail to get same lock in second connection'; diff --git a/t/lib/TestConfig.pm b/t/lib/TestConfig.pm index 1d396697a..133dfe83c 100644 --- a/t/lib/TestConfig.pm +++ b/t/lib/TestConfig.pm @@ -4,6 +4,21 @@ use warnings; use base 'App::Sqitch::Config'; use Path::Class; +BEGIN { + # Suppress warnings from Locale::Messages. + # https://github.com/gflohr/libintl-perl/issues/14 + use Locale::Messages; + if ($Locale::Messages::package eq 'gettext_pp') { + no warnings qw(redefine prototype); + no strict 'refs'; + my $orig = \&Locale::gettext_pp::__locale_category; + *{"Locale::gettext_pp::__locale_category"} = sub { + local $SIG{__WARN__} = sub {}; + $orig->(); + } + } +} + # Creates and returns a new TestConfig, which inherits from # App::Sqitch::Config. Sets nonexistent values for the file locations and # calls update() on remaining args. diff --git a/t/mysql.t b/t/mysql.t index 513542404..95419f700 100644 --- a/t/mysql.t +++ b/t/mysql.t @@ -599,9 +599,10 @@ $uri->dbname('information_schema') unless $uri->dbname; my $err = try { $mysql->use_driver; $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { - PrintError => 0, - RaiseError => 1, - AutoCommit => 1, + PrintError => 0, + RaiseError => 0, + AutoCommit => 1, + HandleError => $mysql->_error_handler, }); # Make sure we have a version we can use. @@ -618,7 +619,7 @@ my $err = try { $uri->dbname($db); undef; } catch { - eval { $_->message } || $_; + $_ }; DBIEngineTest->run( diff --git a/t/odbc/odbcinst.ini b/t/odbc/odbcinst.ini index ff2c86e74..fa2eed806 100644 --- a/t/odbc/odbcinst.ini +++ b/t/odbc/odbcinst.ini @@ -1,6 +1,6 @@ [Exasol] Description = ODBC for Exasol -Driver = /opt/exasol/lib/linux/x86_64/libexaodbc-uo2214lv2.so +Driver = /opt/exasol/lib/libexaodbc.so [Vertica] Description = ODBC for Vertica diff --git a/t/odbc/vertica.ini b/t/odbc/vertica.ini index c2520cfb6..727dcaf26 100644 --- a/t/odbc/vertica.ini +++ b/t/odbc/vertica.ini @@ -1,4 +1,4 @@ [Driver] DriverManagerEncoding=UTF-16 -ODBCInstLib=/usr/lib64/libodbcinst.so +ODBCInstLib=/usr/lib/x86_64-linux-gnu/libodbcinst.so ErrorMessagesPath=/opt/vertica/lib64 diff --git a/t/oracle.t b/t/oracle.t index 8cfece56a..7a4e0c043 100644 --- a/t/oracle.t +++ b/t/oracle.t @@ -16,7 +16,7 @@ # Client](https://www.oracle.com/database/technologies/instant-client/downloads.html), # specifically the Basic, SQL*Plus, and SDK packages. Unpack them into a # directory and set `ORACLE_HOME` and `LD_LIBRARY_PATH` to point to that -# director, and add it to the Path. Then install DBD::Oracle. +# directory, and add it to the Path. Then install DBD::Oracle. # # ## Oracle-XE Docker Image # @@ -675,13 +675,14 @@ my $uri = $ENV{SQITCH_TEST_ORACLE_URI} ? URI->new($ENV{SQITCH_TEST_ORACLE_URI}) my $err = try { $ora->use_driver; $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { - PrintError => 0, - RaiseError => 1, - AutoCommit => 1, + PrintError => 0, + RaiseError => 0, + AutoCommit => 1, + HandleError => $ora->_error_handler, }); undef; } catch { - eval { $_->message } || $_; + $_; }; DBIEngineTest->run( diff --git a/t/pg.t b/t/pg.t index 18ec94952..b1baf51bb 100644 --- a/t/pg.t +++ b/t/pg.t @@ -510,8 +510,9 @@ my $err = try { $pg->use_driver; $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { PrintError => 0, - RaiseError => 1, + RaiseError => 0, AutoCommit => 1, + HandleError => $pg->_error_handler, pg_lc_messages => 'C', }); unless ($ENV{SQITCH_TEST_PG_URI}) { @@ -520,7 +521,7 @@ my $err = try { } undef; } catch { - eval { $_->message } || $_; + $_ }; DBIEngineTest->run( diff --git a/t/snowflake.t b/t/snowflake.t index 0f957e04d..0f43fb10b 100644 --- a/t/snowflake.t +++ b/t/snowflake.t @@ -541,13 +541,14 @@ $uri->host($uri->host . ".snowflakecomputing.com") if $uri->host !~ /snoflakecom my $err = try { $snow->use_driver; $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { - PrintError => 0, - RaiseError => 1, - AutoCommit => 1, + PrintError => 0, + RaiseError => 0, + AutoCommit => 1, + HandleError => $snow->_error_handler, }); undef; } catch { - eval { $_->message } || $_; + $_ }; DBIEngineTest->run( diff --git a/t/vertica.t b/t/vertica.t index 3b42a582f..aac10b2d2 100644 --- a/t/vertica.t +++ b/t/vertica.t @@ -347,18 +347,19 @@ for my $i (1..30) { $err = try { $vta->use_driver; $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { - PrintError => 0, - RaiseError => 1, - AutoCommit => 1, + PrintError => 0, + RaiseError => 0, + AutoCommit => 1, + HandleError => $vta->_error_handler, }); undef; } catch { - eval { $_->message } || $_; + $_ }; # Sleep if it failed but Vertica is still starting up. # SQL-57V03: `failed: FATAL 4149: Node startup/recovery in progress. Not yet ready to accept connections` # SQL-08001: `failed: [Vertica][DSI] An error occurred while attempting to retrieve the error message for key 'VConnectFailed' and component ID 101: Could not open error message files` - last unless $err && (($DBI::state || '') eq '57V03' || $err =~ /VConnectFailed/); + last unless $err && (($DBI::state || '') eq '57V03' || $err->message =~ /VConnectFailed/); sleep 1 if $i < 30; }