From: Antony Dovgal Date: Thu, 2 Jun 2005 15:42:44 +0000 (+0000) Subject: MFH: fix bug #33214 (odbc_next_result does not signal SQL errors with 2-statement... X-Git-Tag: php-5.0.5RC1~220 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc325ce662641565bc094d7914196f86593288ce;p=php MFH: fix bug #33214 (odbc_next_result does not signal SQL errors with 2-statement SQL batches). Path by rich at kastle dot com. --- diff --git a/NEWS b/NEWS index bb3c2d8ccb..7b68487337 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ PHP NEWS of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey) - Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey) - Fixed memory corruption in stristr(). (Derick) +- Fixed bug #33214 (odbc_next_result does not signal SQL errors with + 2-statement SQL batches). (rich at kastle dot com, Tony) - Fixed bug #33210 (relax jpeg recursive loop protection). (Ilia) - Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' modifier misbehave). (Jani) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 10934a89a4..3a4813bec8 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2437,8 +2437,10 @@ PHP_FUNCTION(odbc_next_result) result->values = NULL; } RETURN_TRUE; - } - else { + } else if (rc == SQL_NO_DATA_FOUND) { + RETURN_FALSE; + } else { + odbc_sql_error(result->conn_ptr, result->stmt, "SQLMoreResults"); RETURN_FALSE; } }