diff options
author | Remi Collet <remi@php.net> | 2016-03-17 13:42:34 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2016-03-17 13:42:34 +0100 |
commit | 2291ebc0ea9c71e6170f5331813f77ac6ef03026 (patch) | |
tree | ed5164718e79b4813d640500df9f34681b33f147 | |
parent | b4eedd128ba9f61be08a50c94afd72837d7cf70b (diff) | |
parent | d513b4cde5cdb25ea7f8fcd064ee98a6ffa53322 (diff) | |
download | php-git-2291ebc0ea9c71e6170f5331813f77ac6ef03026.tar.gz |
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
NEWS
Fix Bug #63171 Script hangs after max_execution_time
-rw-r--r-- | ext/odbc/php_odbc.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index e3c8e86a4e..f432dcd551 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -434,7 +434,8 @@ static void _free_odbc_result(zend_resource *rsrc) efree(res->values); 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) SQLTransact(res->conn_ptr->henv, res->conn_ptr->hdbc, (SQLUSMALLINT) SQL_COMMIT); @@ -487,9 +488,12 @@ static void _close_odbc_conn(zend_resource *rsrc) } } ZEND_HASH_FOREACH_END(); - safe_odbc_disconnect(conn->hdbc); - SQLFreeConnect(conn->hdbc); - SQLFreeEnv(conn->henv); + /* 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); + SQLFreeConnect(conn->hdbc); + SQLFreeEnv(conn->henv); + } efree(conn); ODBCG(num_links)--; } @@ -512,9 +516,12 @@ static void _close_odbc_pconn(zend_resource *rsrc) } } ZEND_HASH_FOREACH_END(); - safe_odbc_disconnect(conn->hdbc); - SQLFreeConnect(conn->hdbc); - SQLFreeEnv(conn->henv); + /* 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); + SQLFreeConnect(conn->hdbc); + SQLFreeEnv(conn->henv); + } free(conn); ODBCG(num_links)--; |