]> granicus.if.org Git - php/commitdiff
Fixed bug #35694 (Improved error message for invalid fetch mode).
authorIlia Alshanetsky <iliaa@php.net>
Thu, 15 Dec 2005 22:33:02 +0000 (22:33 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 15 Dec 2005 22:33:02 +0000 (22:33 +0000)
NEWS
ext/pdo/pdo_stmt.c

diff --git a/NEWS b/NEWS
index 8d1c34513524ae7795127a50c4bd606d4f427cd6..0991fdfe16aafbc6ccdd9f78dce38d1c583c4f03 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ PHP                                                                        NEWS
 - Fixed many bugs in OCI8. (Tony)
 - Fixed crash and leak in mysqli when using 4.1.x client libraries and
   connecting to 5.x server. (Andrey)
+- Fixed bug #35694 (Improved error message for invalid fetch mode). (Ilia)
 - Fixed bug #35690 (pack() tries to allocate huge memory block when packing 
   float values to strings). (Tony)
 - Fixed bug #35655 (whitespace following end of heredoc is lost). (Ilia)
index 60eb726c06fb5e7553d137701830043abb017b15..ae3b47b08e545027c618f53e917f1bd213cbb6a7 100755 (executable)
@@ -1798,13 +1798,8 @@ fail_out:
                        break;
                
                default:
-                       if ((mode & ~PDO_FETCH_FLAGS) < PDO_FETCH__MAX && (mode & ~PDO_FETCH_FLAGS) >= 0) {
-                               pdo_raise_impl_error(stmt->dbh, stmt, "22003", "unhandled mode; this is a PDO bug, please report it" TSRMLS_CC);
-                       } else {
-                               pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range" TSRMLS_CC);
-                       }
-                       efree(args);
-                       return FAILURE;
+                       pdo_raise_impl_error(stmt->dbh, stmt, "22003", "Invalid fetch mode specified" TSRMLS_CC);
+                       goto fail_out;
        }
 
        stmt->default_fetch_type = mode;