mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Fix Bug #63171 Script hangs after max_execution_time
If aborted via timer expiration, don't try to call any unixODBC function which may hangs because of internal locks
This commit is contained in:
parent
6d4aec029a
commit
407ad28ae5
1 changed files with 14 additions and 7 deletions
|
@ -431,7 +431,8 @@ static void _free_odbc_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||||
efree(res->values);
|
efree(res->values);
|
||||||
res->values = NULL;
|
res->values = NULL;
|
||||||
}
|
}
|
||||||
if (res->stmt) {
|
/* If aborted via timer expiration, don't try to call any unixODBC function */
|
||||||
|
if (res->stmt && !(PG(connection_status) & PHP_CONNECTION_TIMEOUT)) {
|
||||||
#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35)
|
#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35)
|
||||||
SQLTransact(res->conn_ptr->henv, res->conn_ptr->hdbc,
|
SQLTransact(res->conn_ptr->henv, res->conn_ptr->hdbc,
|
||||||
(SQLUSMALLINT) SQL_COMMIT);
|
(SQLUSMALLINT) SQL_COMMIT);
|
||||||
|
@ -487,9 +488,12 @@ static void _close_odbc_conn(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If aborted via timer expiration, don't try to call any unixODBC function */
|
||||||
|
if (!(PG(connection_status) & PHP_CONNECTION_TIMEOUT)) {
|
||||||
safe_odbc_disconnect(conn->hdbc);
|
safe_odbc_disconnect(conn->hdbc);
|
||||||
SQLFreeConnect(conn->hdbc);
|
SQLFreeConnect(conn->hdbc);
|
||||||
SQLFreeEnv(conn->henv);
|
SQLFreeEnv(conn->henv);
|
||||||
|
}
|
||||||
efree(conn);
|
efree(conn);
|
||||||
ODBCG(num_links)--;
|
ODBCG(num_links)--;
|
||||||
}
|
}
|
||||||
|
@ -515,9 +519,12 @@ static void _close_odbc_pconn(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If aborted via timer expiration, don't try to call any unixODBC function */
|
||||||
|
if (!(PG(connection_status) & PHP_CONNECTION_TIMEOUT)) {
|
||||||
safe_odbc_disconnect(conn->hdbc);
|
safe_odbc_disconnect(conn->hdbc);
|
||||||
SQLFreeConnect(conn->hdbc);
|
SQLFreeConnect(conn->hdbc);
|
||||||
SQLFreeEnv(conn->henv);
|
SQLFreeEnv(conn->henv);
|
||||||
|
}
|
||||||
free(conn);
|
free(conn);
|
||||||
|
|
||||||
ODBCG(num_links)--;
|
ODBCG(num_links)--;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue