From: Antony Dovgal Date: Thu, 2 Jun 2005 15:42:58 +0000 (+0000) Subject: MFH: fix bug #33214 (odbc_next_result does not signal SQL errors with 2-statement... X-Git-Tag: php-4.4.0RC1~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=473e88e57418ebf6ee87e1035a97b52d1a0e8902;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 44fd1911a6..00976483c3 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ PHP 4 NEWS - Changed sha1_file() and md5_file() functions to use streams instead of low level IO. (Uwe) - 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 a053e99f45..cd25df9d46 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2436,8 +2436,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; } }