]> granicus.if.org Git - php/commitdiff
Report all ODBC error's not just the top of the stack
authorNick Gorham <lurcher@php.net>
Thu, 9 Dec 1999 09:59:17 +0000 (09:59 +0000)
committerNick Gorham <lurcher@php.net>
Thu, 9 Dec 1999 09:59:17 +0000 (09:59 +0000)
NEWS
ext/odbc/php_odbc.c

diff --git a/NEWS b/NEWS
index d5ee710f325e1222c15101578ed7bb6f11783532..10413e51ec832d913366aaff49bbc9b3d968565a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PHP 4.0                                                                    NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ?? ?? ????, Version 4.0 Beta 4
+- Report all ODBC error's not just the one on the top of the stack (lurcher)
 - OCI8 now returns NULL values in LONG columns correct. (Thies)
 - Added support for a C-like assert() function. (Thies)
 - Added CyberCash support. (Evan)
index 9a2d412809eef3b3fe676bc58b33a08034577962..5ab7bf915c2982f74b0eda78f7c7b80cb98fb73d 100644 (file)
@@ -461,17 +461,20 @@ void ODBC_SQL_ERROR(HENV henv, HDBC conn, HSTMT stmt, char *func)
        SDWORD  error;        /* Not used */
        char    errormsg[255];
        SWORD   errormsgsize; /* Not used */
+    SQLRETURN ret;
        ODBCLS_FETCH();
-       
-       SQLError(henv, conn, stmt, state,
-                        &error, errormsg, sizeof(errormsg)-1, &errormsgsize);
-       if (func) {
-               php_error(E_WARNING, "SQL error: %s, SQL state %s in %s",
+
+    do {
+           SQLError(henv, conn, stmt, state,
+                           &error, errormsg, sizeof(errormsg)-1, &errormsgsize);
+           if (func) {
+                   php_error(E_WARNING, "SQL error: %s, SQL state %s in %s",
                                   errormsg, state, func);
-       } else {
-               php_error(E_WARNING, "SQL error: %s, SQL state %s",
-                                  errormsg, state);
-       }
+           } else {
+                   php_error(E_WARNING, "SQL error: %s, SQL state %s",
+                                   errormsg, state);
+           }
+    } while ( SQL_SUCCEEDED( ret ));
 }
 
 void php3_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode)