mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Fix #33694 invalid sql or timeouts makes it impossible to reuse persistent connections
This commit is contained in:
parent
0f510a6a95
commit
5ccfa591b7
@ -229,6 +229,7 @@ static void _free_mssql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
mssql_result *result = (mssql_result *)rsrc->ptr;
|
||||
|
||||
_free_result(result, 1);
|
||||
dbcancel(result->mssql_ptr->link);
|
||||
efree(result);
|
||||
}
|
||||
|
||||
@ -1233,6 +1234,7 @@ PHP_FUNCTION(mssql_query)
|
||||
}
|
||||
if (dbsqlexec(mssql_ptr->link)==FAIL || (retvalue = dbresults(mssql_ptr->link))==FAIL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed");
|
||||
dbcancel(mssql_ptr->link);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -1247,6 +1249,7 @@ PHP_FUNCTION(mssql_query)
|
||||
|
||||
retvalue=dbnextrow(mssql_ptr->link);
|
||||
if (retvalue==FAIL) {
|
||||
dbcancel(mssql_ptr->link);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -2172,6 +2175,7 @@ PHP_FUNCTION(mssql_execute)
|
||||
|
||||
if (dbrpcexec(mssql_ptr->link)==FAIL || dbsqlok(mssql_ptr->link)==FAIL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure execution failed");
|
||||
dbcancel(mssql_ptr->link);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -2179,6 +2183,7 @@ PHP_FUNCTION(mssql_execute)
|
||||
|
||||
if (retval_results==FAIL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not retrieve results");
|
||||
dbcancel(mssql_ptr->link);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user