From 7971a6001d10645b9866384cc58a8e344a10e09f Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Sep 2024 00:25:49 +0200 Subject: [PATCH 01/11] Try to get firebird working on linux x32 CI --- .github/actions/apt-x32/action.yml | 1 + .github/actions/configure-x32/action.yml | 1 + .github/workflows/push.yml | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/.github/actions/apt-x32/action.yml b/.github/actions/apt-x32/action.yml index af1d7918bb28d..39ef1df6c2c8c 100644 --- a/.github/actions/apt-x32/action.yml +++ b/.github/actions/apt-x32/action.yml @@ -38,6 +38,7 @@ runs: libxml2-dev:i386 \ libxpm-dev:i386 \ libxslt1-dev:i386 \ + firebird-dev:i386 \ locales \ make \ pkg-config:i386 \ diff --git a/.github/actions/configure-x32/action.yml b/.github/actions/configure-x32/action.yml index de500e02d4991..a5c5df4f7971d 100644 --- a/.github/actions/configure-x32/action.yml +++ b/.github/actions/configure-x32/action.yml @@ -27,6 +27,7 @@ runs: --with-pgsql \ --with-pdo-pgsql \ --with-pdo-sqlite \ + --with-pdo-firebird \ --without-pear \ --enable-gd \ --with-jpeg \ diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f59fcb8d7badc..34d450fbc460a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -155,6 +155,15 @@ jobs: env: MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: root + firebird: + image: jacobalberty/firebird + ports: + - 3050:3050 + env: + ISC_PASSWORD: test + FIREBIRD_DATABASE: test.fdb + FIREBIRD_USER: test + FIREBIRD_PASSWORD: test steps: - name: git checkout uses: actions/checkout@v4 From 94c97aefd55a3afbcf5012b04352cc137584ad4d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Sep 2024 00:26:16 +0200 Subject: [PATCH 02/11] Disable irrelevant actions --- .github/workflows/push.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 34d450fbc460a..df2545ff3743f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -41,7 +41,7 @@ env: CXX: ccache g++ jobs: LINUX_X64: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + if: false services: mysql: image: mysql:8.3 @@ -192,7 +192,7 @@ jobs: -d zend_extension=opcache.so -d opcache.enable_cli=1 MACOS_DEBUG_NTS: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + if: false strategy: fail-fast: false matrix: @@ -235,7 +235,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files WINDOWS: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + if: false name: WINDOWS_X64_ZTS runs-on: windows-2022 timeout-minutes: 50 @@ -263,7 +263,7 @@ jobs: run: .github/scripts/windows/test.bat BENCHMARKING: name: BENCHMARKING - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + if: false runs-on: ubuntu-24.04 timeout-minutes: 50 steps: From b294349a5a9e679cc89d57eddb8e03e966f453c8 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Sep 2024 00:33:36 +0200 Subject: [PATCH 03/11] Fix compilation warning on 32-bit --- ext/pdo_firebird/firebird_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 157766f51dd17..9d7cb20d2cdeb 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -1409,7 +1409,7 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* char errmsg[512]; const ISC_STATUS *s = H->isc_status; fb_interpret(errmsg, sizeof(errmsg),&s); - zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1], "SQLSTATE[%s] [%ld] %s", + zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1], "SQLSTATE[%s] [%" PRIiPTR "] %s", "HY000", H->isc_status[1], errmsg); } From 1cbdbcd9fd593df65dc7a57e64a02f10c87fd7d7 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Sep 2024 01:00:32 +0200 Subject: [PATCH 04/11] Test setting env vars in workflow --- .github/workflows/push.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index df2545ff3743f..cb7d11d4ac7b4 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -147,6 +147,10 @@ jobs: MYSQL_TEST_HOST: mysql PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test PDO_MYSQL_TEST_HOST: mysql + PDO_FIREBIRD_TEST_DATABASE: test.fdb + PDO_FIREBIRD_TEST_DSN: firebird:dbname=localhost:test.fdb + PDO_FIREBIRD_TEST_PASS: test + PDO_FIREBIRD_TEST_USER: test services: mysql: image: mysql:8.3 From 84d567d07880132f4badb4ab5324cc85c6413bee Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Sep 2024 01:01:00 +0200 Subject: [PATCH 05/11] Temporarily only run firebird tests --- .github/actions/test-linux/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml index 164606ecddc12..a53c58bcd6119 100644 --- a/.github/actions/test-linux/action.yml +++ b/.github/actions/test-linux/action.yml @@ -49,4 +49,4 @@ runs: --offline \ --show-diff \ --show-slow 1000 \ - --set-timeout 120 + --set-timeout 120 ext/pdo_firebird From 3a8d29a3987065e0b71981407fd23e123f63e7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Sun, 29 Sep 2024 02:46:24 +0000 Subject: [PATCH 06/11] Refer to container name for connection from x32 test --- .github/actions/test-linux/action.yml | 4 +++- .github/workflows/push.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml index a53c58bcd6119..c06e3a9a4a63e 100644 --- a/.github/actions/test-linux/action.yml +++ b/.github/actions/test-linux/action.yml @@ -30,7 +30,9 @@ runs: export PDO_PGSQL_TEST_DSN="pgsql:host=localhost port=5432 dbname=test user=postgres password=postgres" fi export PDO_FIREBIRD_TEST_DATABASE=test.fdb - export PDO_FIREBIRD_TEST_DSN=firebird:dbname=localhost:test.fdb + if [[ -z "$PDO_FIREBIRD_TEST_DSN" ]]; then + export PDO_FIREBIRD_TEST_DSN=firebird:dbname=localhost:test.fdb + fi export PDO_FIREBIRD_TEST_PASS=test export PDO_FIREBIRD_TEST_USER=test export ODBC_TEST_USER="odbc_test" diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index cb7d11d4ac7b4..7c870b8b8c06b 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -148,7 +148,7 @@ jobs: PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test PDO_MYSQL_TEST_HOST: mysql PDO_FIREBIRD_TEST_DATABASE: test.fdb - PDO_FIREBIRD_TEST_DSN: firebird:dbname=localhost:test.fdb + PDO_FIREBIRD_TEST_DSN: firebird:dbname=firebird:test.fdb PDO_FIREBIRD_TEST_PASS: test PDO_FIREBIRD_TEST_USER: test services: From 03a96aeaa0a04f8de297c1cb248653d79afbbbad Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:37:43 +0200 Subject: [PATCH 07/11] Trim config --- .github/workflows/push.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 7c870b8b8c06b..b7c2f451c6124 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -147,10 +147,7 @@ jobs: MYSQL_TEST_HOST: mysql PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test PDO_MYSQL_TEST_HOST: mysql - PDO_FIREBIRD_TEST_DATABASE: test.fdb PDO_FIREBIRD_TEST_DSN: firebird:dbname=firebird:test.fdb - PDO_FIREBIRD_TEST_PASS: test - PDO_FIREBIRD_TEST_USER: test services: mysql: image: mysql:8.3 From bc3240c047c73ccbecaad3b1f694567ea142eb74 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Sep 2024 13:49:34 +0200 Subject: [PATCH 08/11] Make test compatible with 32-bit --- ext/pdo_firebird/tests/bug_15604.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pdo_firebird/tests/bug_15604.phpt b/ext/pdo_firebird/tests/bug_15604.phpt index e8aa04c9ddf54..2a31d29e7b8cc 100644 --- a/ext/pdo_firebird/tests/bug_15604.phpt +++ b/ext/pdo_firebird/tests/bug_15604.phpt @@ -15,7 +15,7 @@ $dbh = getDbConnection(); $dbh->exec(' recreate table t_bug_15604 ( - id bigint not null, + id int not null, a int not null, b int, constraint pk_bug_15604 primary key(id) From b5d94ec9d0f1aea91cd1c04080657a2905a20db5 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Sep 2024 15:19:37 +0200 Subject: [PATCH 09/11] debug: asan --- .github/actions/configure-x32/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/configure-x32/action.yml b/.github/actions/configure-x32/action.yml index a5c5df4f7971d..6e658ffc9aa57 100644 --- a/.github/actions/configure-x32/action.yml +++ b/.github/actions/configure-x32/action.yml @@ -21,6 +21,7 @@ runs: --prefix=/usr \ --enable-phpdbg \ --enable-fpm \ + --enable-address-sanitizer \ --enable-intl \ --with-pdo-mysql=mysqlnd \ --with-mysqli=mysqlnd \ From 352249c43f17cc6efdb9c257d145a3ca174065a3 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 2 Dec 2024 19:38:23 +0100 Subject: [PATCH 10/11] skip test maybe --- ext/pdo_firebird/tests/bug_76448.phpt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/pdo_firebird/tests/bug_76448.phpt b/ext/pdo_firebird/tests/bug_76448.phpt index 0d567dbc6282f..f3a967f80f0b6 100644 --- a/ext/pdo_firebird/tests/bug_76448.phpt +++ b/ext/pdo_firebird/tests/bug_76448.phpt @@ -6,6 +6,8 @@ sockets --XLEAK-- A bug in firebird causes a memory leak when calling `isc_attach_database()`. See https://github.com/FirebirdSQL/firebird/issues/7849 +--SKIPIF-- + --FILE-- Date: Mon, 2 Dec 2024 22:15:55 +0100 Subject: [PATCH 11/11] Update .github/workflows/push.yml Co-authored-by: Christoph M. Becker --- .github/workflows/push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b7c2f451c6124..17f82a3ed5e1a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -192,6 +192,7 @@ jobs: runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 + --asan MACOS_DEBUG_NTS: if: false strategy: