Skip to content

Commit

Permalink
Fix GH-12969: Fixed PDO::getAttribute() to get PDO::ATTR_STRINGIFY_FE…
Browse files Browse the repository at this point in the history
…TCHES

Partial backport of GH-12793.

Closes GH-12970.
  • Loading branch information
SakiTakamachi authored and nielsdos committed Dec 22, 2023
1 parent 7c4763a commit b333164
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ PHP NEWS
. Fixed bug GH-12987 (openssl_csr_sign might leak new cert on error).
(Jakub Zelenka)

- PDO:
. Fix GH-12969 (Fixed PDO::getAttribute() to get PDO::ATTR_STRINGIFY_FETCHES).
(SakiTakamachi)

- PDO_ODBC:
. Fixed bug GH-12767 (Unable to turn on autocommit mode with setAttribute()).
(SakiTakamachi)
Expand Down Expand Up @@ -67,7 +71,7 @@ PHP NEWS

- FTP:
. Fixed bug GH-9348 (FTP & SSL session reuse). (nielsdos)

- Intl:
. Fixed bug GH-12635 (Test bug69398.phpt fails with ICU 74.1). (nielsdos)

Expand Down
5 changes: 5 additions & 0 deletions ext/pdo/pdo_dbh.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,13 @@ PHP_METHOD(PDO, getAttribute)
add_next_index_zval(return_value, &dbh->def_stmt_ctor_args);
}
return;

case PDO_ATTR_DEFAULT_FETCH_MODE:
RETURN_LONG(dbh->default_fetch_type);

case PDO_ATTR_STRINGIFY_FETCHES:
RETURN_BOOL(dbh->stringify);

default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_mysql/tests/bug68371.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ array(1) {
ERR
ERR
string(5) "mysql"
ERR
bool(false)
ERR
int(4)
2 changes: 1 addition & 1 deletion ext/pdo_pgsql/tests/bug68371.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ array(1) {
ERR
ERR
string(5) "pgsql"
ERR
bool(true)
ERR
int(4)

0 comments on commit b333164

Please # to comment.