[php-src] master: Merge branch 'PHP-8.6'
| From: | Saki Takamachi | Date: | Tue, 29 Sep 2026 11:56:11 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.6' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141675@lists.php.net to get a copy of this message | ||
Author: Saki Takamachi (SakiTakamachi)
Date: 2026-09-29T20:55:15+09:00
Commit: https://github.com/php/php-src/commit/ff1bb609dfa794af8cacb9013cdde3a14ca89cc8
Raw diff: https://github.com/php/php-src/commit/ff1bb609dfa794af8cacb9013cdde3a14ca89cc8.diff
Merge branch 'PHP-8.6'
* PHP-8.6:
Fix GH-23758: PDO_Firebird returns null for empty BLOBs (#23763)
Changed paths:
A ext/pdo_firebird/tests/gh23758.phpt
M ext/pdo_firebird/firebird_statement.c
Diff:
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index bdca5af974cf..c508c34305ca 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -436,6 +436,8 @@ static int php_firebird_fetch_blob(pdo_stmt_t *stmt, int colno, zval *result, IS
php_firebird_error_stmt_with_info(stmt, "HY000", strlen("HY000"), msg,
strlen(msg));
goto fetch_blob_end;
}
+ } else {
+ ZVAL_EMPTY_STRING(result);
}
retval = 1;
diff --git a/ext/pdo_firebird/tests/gh23758.phpt b/ext/pdo_firebird/tests/gh23758.phpt
new file mode 100644
index 000000000000..5f90d2ddbc8b
--- /dev/null
+++ b/ext/pdo_firebird/tests/gh23758.phpt
@@ -0,0 +1,52 @@
+--TEST--
+GH-23758 (PDO_Firebird returns null for non-null empty BLOBs)
+--EXTENSIONS--
+pdo_firebird
+--SKIPIF--
+<?php require('skipif.inc'); ?>
+--XLEAK--
+A bug in firebird causes a memory leak when calling
isc_attach_database().
+See https://github.com/FirebirdSQL/firebird/issues/7849
+--FILE--
+<?php
+
+require("testdb.inc");
+
+$dbh = getDbConnection();
+$dbh->exec('CREATE TABLE gh23758 (ID INTEGER, BIN_VAL BLOB SUB_TYPE BINARY, TEXT_VAL BLOB
SUB_TYPE TEXT)');
+
+$stmt = $dbh->prepare('INSERT INTO gh23758 VALUES (?, ?, ?)');
+$stmt->execute([1, null, null]);
+$stmt->execute([2, '', '']);
+
+$stmt = $dbh->query('SELECT BIN_VAL, TEXT_VAL FROM gh23758 ORDER BY ID');
+var_dump($stmt->fetchAll(PDO::FETCH_NUM));
+
+unset($stmt);
+unset($dbh);
+
+?>
+--CLEAN--
+<?php
+require 'testdb.inc';
+$dbh = getDbConnection();
+@$dbh->exec('DROP TABLE gh23758');
+unset($dbh);
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ NULL
+ [1]=>
+ NULL
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(0) ""
+ }
+}