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);
}
}
- 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)--;
}
}
}
- 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)--;