Skip to content

Commit b333164

Browse files
SakiTakamachinielsdos
authored andcommitted
Fix GH-12969: Fixed PDO::getAttribute() to get PDO::ATTR_STRINGIFY_FETCHES
Partial backport of GH-12793. Closes GH-12970.
1 parent 7c4763a commit b333164

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

NEWS

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ PHP NEWS
2929
. Fixed bug GH-12987 (openssl_csr_sign might leak new cert on error).
3030
(Jakub Zelenka)
3131

32+
- PDO:
33+
. Fix GH-12969 (Fixed PDO::getAttribute() to get PDO::ATTR_STRINGIFY_FETCHES).
34+
(SakiTakamachi)
35+
3236
- PDO_ODBC:
3337
. Fixed bug GH-12767 (Unable to turn on autocommit mode with setAttribute()).
3438
(SakiTakamachi)
@@ -67,7 +71,7 @@ PHP NEWS
6771

6872
- FTP:
6973
. Fixed bug GH-9348 (FTP & SSL session reuse). (nielsdos)
70-
74+
7175
- Intl:
7276
. Fixed bug GH-12635 (Test bug69398.phpt fails with ICU 74.1). (nielsdos)
7377

ext/pdo/pdo_dbh.c

+5
Original file line numberDiff line numberDiff line change
@@ -930,8 +930,13 @@ PHP_METHOD(PDO, getAttribute)
930930
add_next_index_zval(return_value, &dbh->def_stmt_ctor_args);
931931
}
932932
return;
933+
933934
case PDO_ATTR_DEFAULT_FETCH_MODE:
934935
RETURN_LONG(dbh->default_fetch_type);
936+
937+
case PDO_ATTR_STRINGIFY_FETCHES:
938+
RETURN_BOOL(dbh->stringify);
939+
935940
default:
936941
break;
937942
}

ext/pdo_mysql/tests/bug68371.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ array(1) {
9696
ERR
9797
ERR
9898
string(5) "mysql"
99-
ERR
99+
bool(false)
100100
ERR
101101
int(4)

ext/pdo_pgsql/tests/bug68371.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ array(1) {
9595
ERR
9696
ERR
9797
string(5) "pgsql"
98-
ERR
98+
bool(true)
9999
ERR
100100
int(4)

0 commit comments

Comments
 (0)