Skip to content

Commit 7f7da6a

Browse files
Enable pdo-firebird nightly testing (#12699)
* Enable `pdo-firebird` Testing in Nightly * fix(ext/pdo_firebird/tests): dont detect memory leak * fix(ext/pdo_firebird): memory alignment error
1 parent 62b2ad4 commit 7f7da6a

30 files changed

+115
-51
lines changed

.github/workflows/nightly.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ jobs:
4848
POSTGRES_USER: postgres
4949
POSTGRES_PASSWORD: postgres
5050
POSTGRES_DB: test
51+
firebird:
52+
image: jacobalberty/firebird
53+
ports:
54+
- 3050:3050
55+
env:
56+
ISC_PASSWORD: test
57+
FIREBIRD_DATABASE: test.fdb
58+
FIREBIRD_USER: test
59+
FIREBIRD_PASSWORD: test
5160
strategy:
5261
fail-fast: false
5362
matrix:
@@ -287,6 +296,15 @@ jobs:
287296
POSTGRES_USER: postgres
288297
POSTGRES_PASSWORD: postgres
289298
POSTGRES_DB: test
299+
firebird:
300+
image: jacobalberty/firebird
301+
ports:
302+
- 3050:3050
303+
env:
304+
ISC_PASSWORD: test
305+
FIREBIRD_DATABASE: test.fdb
306+
FIREBIRD_USER: test
307+
FIREBIRD_PASSWORD: test
290308
runs-on: ubuntu-22.04
291309
steps:
292310
- name: git checkout
@@ -518,6 +536,15 @@ jobs:
518536
POSTGRES_USER: postgres
519537
POSTGRES_PASSWORD: postgres
520538
POSTGRES_DB: test
539+
firebird:
540+
image: jacobalberty/firebird
541+
ports:
542+
- 3050:3050
543+
env:
544+
ISC_PASSWORD: test
545+
FIREBIRD_DATABASE: test.fdb
546+
FIREBIRD_USER: test
547+
FIREBIRD_PASSWORD: test
521548
strategy:
522549
fail-fast: false
523550
matrix:

ext/pdo_firebird/firebird_statement.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ static zend_always_inline double get_double_from_sqldata(const ISC_SCHAR *sqldat
5151
READ_AND_RETURN_USING_MEMCPY(double, sqldata);
5252
}
5353

54+
static zend_always_inline float get_float_from_sqldata(const ISC_SCHAR *sqldata)
55+
{
56+
READ_AND_RETURN_USING_MEMCPY(float, sqldata);
57+
}
58+
5459
static zend_always_inline ISC_TIMESTAMP get_isc_timestamp_from_sqldata(const ISC_SCHAR *sqldata)
5560
{
5661
READ_AND_RETURN_USING_MEMCPY(ISC_TIMESTAMP, sqldata);
@@ -459,7 +464,7 @@ static int firebird_stmt_get_col(
459464
break;
460465
case SQL_FLOAT:
461466
/* TODO: Why is this not returned as the native type? */
462-
ZVAL_STR(result, zend_strpprintf(0, "%F", *(float*)var->sqldata));
467+
ZVAL_STR(result, zend_strpprintf(0, "%F", get_float_from_sqldata(var->sqldata)));
463468
break;
464469
case SQL_DOUBLE:
465470
/* TODO: Why is this not returned as the native type? */

ext/pdo_firebird/tests/bug_47415.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Bug #47415 PDO_Firebird segfaults when passing lowercased column name to bindCol
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require 'testdb.inc';

ext/pdo_firebird/tests/bug_48877.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: bug 48877 The "bindValue" and "bindParam" do not work for PDO Fire
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112

ext/pdo_firebird/tests/bug_53280.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: bug 53280 segfaults if query column count is less than param count
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112

ext/pdo_firebird/tests/bug_62024.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Bug #62024 Cannot insert second row with null using parametrized query (Firebird
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112

ext/pdo_firebird/tests/bug_64037.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Bug #64037 Firebird return wrong value for numeric field
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112

ext/pdo_firebird/tests/bug_72583.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: Feature 72583 Fetch integers as php integers not as strings
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require 'testdb.inc';

ext/pdo_firebird/tests/bug_72931.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: Bug 72931 Insert returning fails on Firebird 3
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require 'testdb.inc';

ext/pdo_firebird/tests/bug_73087.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: bug 73087 segfault binding blob parameter
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require 'testdb.inc';

ext/pdo_firebird/tests/bug_74462.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: Bug #74462 Returns only NULLs for boolean fields
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require 'testdb.inc';

ext/pdo_firebird/tests/bug_76448.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ Bug #76448 (Stack buffer overflow in firebird_info_cb)
33
--EXTENSIONS--
44
pdo_firebird
55
sockets
6-
--ENV--
7-
LSAN_OPTIONS=detect_leaks=0
6+
--XLEAK--
7+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
8+
See https://github.com/FirebirdSQL/firebird/issues/7849
89
--FILE--
910
<?php
1011
require_once "payload_server.inc";

ext/pdo_firebird/tests/bug_76449.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ Bug #76449 (SIGSEGV in firebird_handle_doer)
33
--EXTENSIONS--
44
pdo_firebird
55
sockets
6-
--ENV--
7-
LSAN_OPTIONS=detect_leaks=0
6+
--XLEAK--
7+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
8+
See https://github.com/FirebirdSQL/firebird/issues/7849
89
--FILE--
910
<?php
1011
require_once "payload_server.inc";

ext/pdo_firebird/tests/bug_76450.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ Bug #76450 (SIGSEGV in firebird_stmt_execute)
33
--EXTENSIONS--
44
pdo_firebird
55
sockets
6-
--ENV--
7-
LSAN_OPTIONS=detect_leaks=0
6+
--XLEAK--
7+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
8+
See https://github.com/FirebirdSQL/firebird/issues/7849
89
--FILE--
910
<?php
1011
require_once "payload_server.inc";

ext/pdo_firebird/tests/bug_76452.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Bug ##76452 (Crash while parsing blob data in firebird_fetch_blob)
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
710
--FILE--
811
<?php
912
require_once "payload_server.inc";

ext/pdo_firebird/tests/bug_76488.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: Bug #76488 Memory leak when fetching a BLOB field
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require 'testdb.inc';

ext/pdo_firebird/tests/bug_77863.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: Bug #76488 PDO Firebird does not support boolean datatype in input
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112

ext/pdo_firebird/tests/bug_80521.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Bug #80521 (Parameters with underscores no longer recognized)
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require 'testdb.inc';

ext/pdo_firebird/tests/bug_aaa.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: cursor should not be marked as opened on singleton statements
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require 'testdb.inc';

ext/pdo_firebird/tests/common.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pdo_firebird
99
# magic auto-configuration
1010

1111
$config = array(
12+
// A bug in firebird causes a memory leak when calling `isc_attach_database()`. See https://github.com/FirebirdSQL/firebird/issues/7849
1213
'ENV' => ['LSAN_OPTIONS' => 'detect_leaks=0'],
1314
'TESTS' => 'ext/pdo/tests'
1415
);

ext/pdo_firebird/tests/connect.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: connect/disconnect
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require("testdb.inc");

ext/pdo_firebird/tests/ddl.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: DDL/transactions
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112

ext/pdo_firebird/tests/dialect_1.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ if (strpos(getenv('PDO_FIREBIRD_TEST_DSN'), 'dialect=1')===false) {
88
die('skip: PDO_FIREBIRD_TEST_DSN must contain a string "dialect=1"');
99
}
1010
?>
11-
--ENV--
12-
LSAN_OPTIONS=detect_leaks=0
11+
--XLEAK--
12+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
13+
See https://github.com/FirebirdSQL/firebird/issues/7849
1314
--FILE--
1415
<?php
1516
require("testdb.inc");

ext/pdo_firebird/tests/execute.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: prepare/execute/binding
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112
require("testdb.inc");

ext/pdo_firebird/tests/execute_block.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc');
77
?>
8-
--ENV--
9-
LSAN_OPTIONS=detect_leaks=0
8+
--XLEAK--
9+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
10+
See https://github.com/FirebirdSQL/firebird/issues/7849
1011
--FILE--
1112
<?php
1213
require("testdb.inc");

ext/pdo_firebird/tests/gh10908.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ GH-10908 (Bus error with PDO Firebird on RPI with 64 bit kernel and 32 bit userl
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112

ext/pdo_firebird/tests/gh8576.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ GH-8576 (Bad interpretation of length when char is UTF-8)
44
pdo_firebird
55
--SKIPIF--
66
<?php require 'skipif.inc'; ?>
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
710
--FILE--
811
<?php
912
require 'testdb.inc';

ext/pdo_firebird/tests/ignore_parammarks.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc');
77
?>
8-
--ENV--
9-
LSAN_OPTIONS=detect_leaks=0
8+
--XLEAK--
9+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
10+
See https://github.com/FirebirdSQL/firebird/issues/7849
1011
--FILE--
1112
<?php
1213
require("testdb.inc");

ext/pdo_firebird/tests/payload_test.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ FB payload server satisfies connection attempt
33
--EXTENSIONS--
44
pdo_firebird
55
sockets
6-
--ENV--
7-
LSAN_OPTIONS=detect_leaks=0
6+
--XLEAK--
7+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
8+
See https://github.com/FirebirdSQL/firebird/issues/7849
89
--FILE--
910
<?php
1011
require_once "payload_server.inc";

ext/pdo_firebird/tests/rowCount.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ PDO_Firebird: rowCount
44
pdo_firebird
55
--SKIPIF--
66
<?php require('skipif.inc'); ?>
7-
--ENV--
8-
LSAN_OPTIONS=detect_leaks=0
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
910
--FILE--
1011
<?php
1112

0 commit comments

Comments
 (0)