]> granicus.if.org Git - php/commitdiff
tweak the fix
authorAntony Dovgal <tony2001@php.net>
Thu, 1 Dec 2005 20:39:49 +0000 (20:39 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 1 Dec 2005 20:39:49 +0000 (20:39 +0000)
ext/pdo/pdo_stmt.c

index 4414f9b1f5ae9946649001749a0aef89585cd139..021586b90b923914a824a1b080507a23feee7d3c 100755 (executable)
@@ -1069,13 +1069,13 @@ static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, int mode, int fetch_all TSRMLS
 {
        int flags = mode & PDO_FETCH_FLAGS;
 
+       mode = mode & ~PDO_FETCH_FLAGS;
+
        if (mode < 0 || mode > PDO_FETCH__MAX) {
                pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode" TSRMLS_CC);
                return 0;
        }
        
-       mode = mode & ~PDO_FETCH_FLAGS;
-
        if (mode == PDO_FETCH_USE_DEFAULT) {
                flags = stmt->default_fetch_type & PDO_FETCH_FLAGS;
                mode = stmt->default_fetch_type & ~PDO_FETCH_FLAGS;