Skip to content

Commit

Permalink
Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6
Browse files Browse the repository at this point in the history
* 'PHP-5.6' of git.php.net:/php-src:
  fix NEWS
  NEWS
  Fix Bug #63171 	Script hangs after max_execution_time
  • Loading branch information
laruence committed Mar 17, 2016
2 parents 8e2f658 + b5b1ba8 commit eb40562
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions ext/odbc/php_odbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ static void _free_odbc_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
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);
Expand Down Expand Up @@ -487,9 +488,12 @@ static void _close_odbc_conn(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
}

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)--;
}
Expand All @@ -515,9 +519,12 @@ static void _close_odbc_pconn(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
}

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)--;
Expand Down

0 comments on commit eb40562

Please sign in to comment.