Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ PHP NEWS
. Added TLS session resumption support for streams with new context options
and Openssl\Session class. (Jakub Zelenka)

- PDO_DBLIB;
. Added dblib_handle_check_liveness handler. (freddy77)

- PDO_PGSQL:
. Clear session-local state disconnect-equivalent processing.
(KentarouTakeda)
Expand Down
4 changes: 4 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ PHP 8.6 UPGRADE NOTES
. Output of openssl_x509_parse() contains criticalExtensions listing all
critical certificate extensions.

- PDO_DBLIB:
. When using persistent connections, there is now a liveness check in the
constructor.

- Phar:
. Phar::mungServer() now supports reference values.

Expand Down
13 changes: 12 additions & 1 deletion ext/pdo_dblib/dblib_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,17 @@ static int dblib_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_valu
return 1;
}

static zend_result dblib_handle_check_liveness(pdo_dbh_t *dbh)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;

if (dbdead(H->link)) {
return FAILURE;
}

return SUCCESS;
}

static const struct pdo_dbh_methods dblib_methods = {
dblib_handle_closer,
dblib_handle_preparer,
Expand All @@ -432,7 +443,7 @@ static const struct pdo_dbh_methods dblib_methods = {
dblib_handle_last_id, /* last insert id */
dblib_fetch_error, /* fetch error */
dblib_get_attribute, /* get attr */
NULL, /* check liveness */
dblib_handle_check_liveness, /* check_liveness */
NULL, /* get driver methods */
NULL, /* request shutdown */
NULL, /* in transaction, use PDO's internal tracking mechanism */
Expand Down
Loading