Commit ed0339f
committed
Fix GH-20214: PDO::FETCH_DEFAULT unexpected behavior with PDOStatement::setFetchMode
When setFetchMode(PDO::FETCH_DEFAULT) is called, mode=0
(PDO_FETCH_USE_DEFAULT) gets stored as the statement's default fetch
type. Later, do_fetch() tries to resolve PDO_FETCH_USE_DEFAULT by
reading stmt->default_fetch_type, which is also 0 — circular
reference that on 8.4 silently fell through to FETCH_BOTH and on
master throws a ValueError.
Resolve PDO_FETCH_USE_DEFAULT to the connection-level default early in
pdo_stmt_setup_fetch_mode(), before flags extraction and the mode
switch, so the rest of the function processes the actual fetch mode.
Closes GH-202141 parent 9f33bff commit ed0339f
2 files changed
+42
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1731 | 1731 | | |
1732 | 1732 | | |
1733 | 1733 | | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
1734 | 1738 | | |
1735 | 1739 | | |
1736 | 1740 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments