Skip to content

Commit 2661923

Browse files
authored
Skip fb4_datatypes*.phpt for Firebird server < 4.0.0 (GH-15354)
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.
1 parent 8115018 commit 2661923

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

ext/pdo_firebird/tests/fb4_datatypes.phpt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ pdo_firebird
77
if (Pdo\Firebird::getApiVersion() < 40) {
88
die('skip: Firebird API version must be greater than or equal to 40');
99
}
10+
require 'testdb.inc';
11+
$dbh = getDbConnection();
12+
$stmt = $dbh->query("SELECT RDB\$get_context('SYSTEM', 'ENGINE_VERSION') AS VERSION FROM RDB\$DATABASE");
13+
$data = $stmt->fetch(\PDO::FETCH_ASSOC);
14+
if (!$data || !array_key_exists('VERSION', $data) || version_compare($data['VERSION'], '4.0.0') < 0) {
15+
die("skip Firebird Server version must be greater than or equal to 4.0.0");
16+
}
1017
?>
1118
--XLEAK--
1219
A bug in firebird causes a memory leak when calling `isc_attach_database()`.

ext/pdo_firebird/tests/fb4_datatypes_params.phpt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ pdo_firebird
77
if (Pdo\Firebird::getApiVersion() < 40) {
88
die('skip: Firebird API version must be greater than or equal to 40');
99
}
10+
require 'testdb.inc';
11+
$dbh = getDbConnection();
12+
$stmt = $dbh->query("SELECT RDB\$get_context('SYSTEM', 'ENGINE_VERSION') AS VERSION FROM RDB\$DATABASE");
13+
$data = $stmt->fetch(\PDO::FETCH_ASSOC);
14+
if (!$data || !array_key_exists('VERSION', $data) || version_compare($data['VERSION'], '4.0.0') < 0) {
15+
die("skip Firebird Server version must be greater than or equal to 4.0.0");
16+
}
1017
?>
1118
--XLEAK--
1219
A bug in firebird causes a memory leak when calling `isc_attach_database()`.

0 commit comments

Comments
 (0)