Skip to content

Commit 44377c3

Browse files
committed
Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird
Dialect 1 databases store and transfer `NUMERIC(15,2)` values as doubles, which we need to cater to in `firebird_stmt_get_col()` to avoid `ZEND_ASSUME(0)` to ever be triggered, since that may result in undefined behavior. Since adding a regression test would require to create a dialect 1 database, we go without it. Closes GH-10021.
1 parent bcc0030 commit 44377c3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ PHP NEWS
3636
. Fixed bug GH-9298 (Signal handler called after rshutdown leads to crash).
3737
(Erki Aring)
3838

39+
- PDO_Firebird:
40+
. Fixed bug GH-9971 (Incorrect NUMERIC value returned from PDO_Firebird).
41+
(cmb)
42+
3943
- Session:
4044
. Fixed GH-9932 (session name silently fails with . and [). (David Carlier)
4145

ext/pdo_firebird/firebird_statement.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ static int firebird_stmt_get_col(
382382
case SQL_INT64:
383383
n = *(ISC_INT64*)var->sqldata;
384384
break;
385+
case SQL_DOUBLE:
386+
break;
385387
EMPTY_SWITCH_DEFAULT_CASE()
386388
}
387389

0 commit comments

Comments
 (0)