[php-src] PHP-8.5: Merge branch 'PHP-8.4' into PHP-8.5

From: Date: Sat, 05 Sep 2026 01:22:22 +0000
Subject: [php-src] PHP-8.5: Merge branch 'PHP-8.4' into PHP-8.5
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141071@lists.php.net to get a copy of this message
Author: Saki Takamachi (SakiTakamachi) Date: 2026-09-05T10:21:36+09:00 Commit: https://github.com/php/php-src/commit/353af24dc385a77443f34e6812c1fb3ef10ddea0 Raw diff: https://github.com/php/php-src/commit/353af24dc385a77443f34e6812c1fb3ef10ddea0.diff Merge branch 'PHP-8.4' into PHP-8.5 * PHP-8.4: Fixed the behavior when using FETCH_DEFAULT (#21864) Changed paths: M ext/pdo/pdo_stmt.c Diff: diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 5d8b4089ca04..39ac9cb1ce65 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1626,7 +1626,7 @@ bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode_a pdo_stmt_free_default_fetch_mode(stmt); - stmt->default_fetch_type = PDO_FETCH_BOTH; + stmt->default_fetch_type = stmt->dbh->default_fetch_type; flags = mode & PDO_FETCH_FLAGS; @@ -1634,6 +1634,8 @@ bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode_a return false; } + bool use_default = (mode & ~PDO_FETCH_FLAGS) == PDO_FETCH_USE_DEFAULT; + switch (mode & ~PDO_FETCH_FLAGS) { case PDO_FETCH_USE_DEFAULT: case PDO_FETCH_LAZY: @@ -1750,7 +1752,9 @@ bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode_a return false; } - stmt->default_fetch_type = mode; + if (!use_default) { + stmt->default_fetch_type = mode; + } return true; }

« previous php.cvs (#141071) next »