From: Kalle Sommer Nielsen Date: Mon, 23 Feb 2009 21:20:47 +0000 (+0000) Subject: Fixed #37209 (mssql_execute with non fatal errors) X-Git-Tag: php-5.4.0alpha1~191^2~4221 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bbe59046e054db9006459c861214bc7c496bac5b;p=php Fixed #37209 (mssql_execute with non fatal errors) --- diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index 0462947611..5316c52fc1 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -2096,6 +2096,7 @@ PHP_FUNCTION(mssql_execute) mssql_result *result; int num_fields; int batchsize; + int exec_retval; batchsize = MS_SQL_G(batchsize); @@ -2106,10 +2107,15 @@ PHP_FUNCTION(mssql_execute) ZEND_FETCH_RESOURCE(statement, mssql_statement *, &stmt, -1, "MS SQL-Statement", le_statement); mssql_ptr=statement->link; + exec_retval = dbrpcexec(mssql_ptr->link); - if (dbrpcexec(mssql_ptr->link)==FAIL || dbsqlok(mssql_ptr->link)==FAIL) { + if (exec_retval == FAIL || dbsqlok(mssql_ptr->link) == FAIL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure execution failed"); - dbcancel(mssql_ptr->link); + + if (exec_retval == FAIL) { + dbcancel(mssql_ptr->link); + } + RETURN_FALSE; }