]> granicus.if.org Git - php/commitdiff
tweak fix a bit
authorAntony Dovgal <tony2001@php.net>
Thu, 1 Dec 2005 20:39:12 +0000 (20:39 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 1 Dec 2005 20:39:12 +0000 (20:39 +0000)
(by request of Wez)

ext/pdo/pdo_stmt.c

index 9b3a5639fc0a4cdaa225198fc9f25e87366c2b6f..ee1181fae79cf87579916a97aad1a7b6a814a7c1 100755 (executable)
@@ -1117,13 +1117,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;