From 473e88e57418ebf6ee87e1035a97b52d1a0e8902 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 2 Jun 2005 15:42:58 +0000 Subject: [PATCH] MFH: fix bug #33214 (odbc_next_result does not signal SQL errors with 2-statement SQL batches). Path by rich at kastle dot com. --- NEWS | 2 ++ ext/odbc/php_odbc.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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; } } -- 2.50.1