From b486f36942c8c4316362394475643e51a480803a Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 12 Aug 2024 11:48:10 +0200 Subject: [PATCH] Skip fb4_datatypes*.phpt for Firebird server < 4.0.0 Using a newer fbclient version with an older server is generally supported, and as such we must not only skip these tests for older fbclients, but also for older servers. In lack of some readily available function, we're querying the server to find its version. --- ext/pdo_firebird/tests/fb4_datatypes.phpt | 7 +++++++ ext/pdo_firebird/tests/fb4_datatypes_params.phpt | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ext/pdo_firebird/tests/fb4_datatypes.phpt b/ext/pdo_firebird/tests/fb4_datatypes.phpt index 3ae452d5eb4e..11c1b96d2c6f 100644 --- a/ext/pdo_firebird/tests/fb4_datatypes.phpt +++ b/ext/pdo_firebird/tests/fb4_datatypes.phpt @@ -7,6 +7,13 @@ pdo_firebird if (Pdo\Firebird::getApiVersion() < 40) { die('skip: Firebird API version must be greater than or equal to 40'); } +require 'testdb.inc'; +$dbh = getDbConnection(); +$stmt = $dbh->query("SELECT RDB\$get_context('SYSTEM', 'ENGINE_VERSION') AS VERSION FROM RDB\$DATABASE"); +$data = $stmt->fetch(\PDO::FETCH_ASSOC); +if (!$data || !array_key_exists('VERSION', $data) || version_compare($data['VERSION'], '4.0.0') < 0) { + die("skip Firebird Server version must be greater than or equal to 4.0.0"); +} ?> --XLEAK-- A bug in firebird causes a memory leak when calling `isc_attach_database()`. diff --git a/ext/pdo_firebird/tests/fb4_datatypes_params.phpt b/ext/pdo_firebird/tests/fb4_datatypes_params.phpt index f1b4827b9e72..74dca970ef55 100644 --- a/ext/pdo_firebird/tests/fb4_datatypes_params.phpt +++ b/ext/pdo_firebird/tests/fb4_datatypes_params.phpt @@ -7,6 +7,13 @@ pdo_firebird if (Pdo\Firebird::getApiVersion() < 40) { die('skip: Firebird API version must be greater than or equal to 40'); } +require 'testdb.inc'; +$dbh = getDbConnection(); +$stmt = $dbh->query("SELECT RDB\$get_context('SYSTEM', 'ENGINE_VERSION') AS VERSION FROM RDB\$DATABASE"); +$data = $stmt->fetch(\PDO::FETCH_ASSOC); +if (!$data || !array_key_exists('VERSION', $data) || version_compare($data['VERSION'], '4.0.0') < 0) { + die("skip Firebird Server version must be greater than or equal to 4.0.0"); +} ?> --XLEAK-- A bug in firebird causes a memory leak when calling `isc_attach_database()`.