]> granicus.if.org Git - php/commitdiff
Fixed bug #41971 (PDOStatement::fetch and PDOStatement::setFetchMode causes
authorIlia Alshanetsky <iliaa@php.net>
Tue, 31 Jul 2007 22:48:42 +0000 (22:48 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 31 Jul 2007 22:48:42 +0000 (22:48 +0000)
unexpected behavior).

NEWS
ext/pdo/pdo_stmt.c

diff --git a/NEWS b/NEWS
index cacb4ed983d49b6d556ec06a4218fdc6b12b436d..d5f3c409d99b409690512d0c54292f74910bf259 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -90,6 +90,8 @@ PHP                                                                        NEWS
 - Fixed bug #41989 (move_uploaded_file() & relative path in ZTS mode). (Tony)
 - Fixed bug #41984 (Hangs on large SoapClient requests). (Dmitry)
 - Fixed bug #41983 (Error Fetching http headers terminated by '\n'). (Dmitry)
+- Fixed bug #41971 (PDOStatement::fetch and PDOStatement::setFetchMode causes
+  unexpected behavior). (Ilia)
 - Fixed bug #41964 (strtotime returns a timestamp for non-time string of
   pattern '(A|a) .+'). (Derick)
 - Fixed bug #41961 (Ensure search for hidden private methods does not stray
index bb0ed50b0e0ad23ec3571a354402c42d4b2a5550..b6b278d5b414a8c15d0c0c73610d972177726551 100755 (executable)
@@ -867,10 +867,10 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
        zend_class_entry *ce = NULL, *old_ce = NULL;
        zval grp_val, *grp, **pgrp, *retval, *old_ctor_args = NULL;
 
-       how = how & ~PDO_FETCH_FLAGS;
        if (how == PDO_FETCH_USE_DEFAULT) {
                how = stmt->default_fetch_type;
        }
+       how = how & ~PDO_FETCH_FLAGS;
 
        if (!do_fetch_common(stmt, ori, offset, do_bind TSRMLS_CC)) {
                return 0;