diff --git a/NEWS b/NEWS index 869fa29a9b5..0b3388c5c18 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,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) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index ce9c7967e72..4ac271fefd4 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -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; } diff --git a/ext/pdo_mysql/tests/bug68371.phpt b/ext/pdo_mysql/tests/bug68371.phpt index 375011af33e..8a5113e437b 100644 --- a/ext/pdo_mysql/tests/bug68371.phpt +++ b/ext/pdo_mysql/tests/bug68371.phpt @@ -96,6 +96,6 @@ array(1) { ERR ERR string(5) "mysql" -ERR +bool(false) ERR int(4) diff --git a/ext/pdo_pgsql/tests/bug68371.phpt b/ext/pdo_pgsql/tests/bug68371.phpt index 04a0dd70dd3..32173a5a964 100644 --- a/ext/pdo_pgsql/tests/bug68371.phpt +++ b/ext/pdo_pgsql/tests/bug68371.phpt @@ -95,6 +95,6 @@ array(1) { ERR ERR string(5) "pgsql" -ERR +bool(true) ERR int(4)