diff options
author | George Peter Banyard <girgias@php.net> | 2020-12-23 02:17:46 +0100 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2021-01-06 10:20:57 +0000 |
commit | d04adf60bee30a167845644c3d480583ca755420 (patch) | |
tree | 531f72ea2f7b6b5a1db76431b2bd6eef9d89268b /ext/pdo/php_pdo_driver.h | |
parent | 6728c1bd72f2ddb46528a0c61ac833b1036a12a2 (diff) | |
download | php-git-d04adf60bee30a167845644c3d480583ca755420.tar.gz |
Boolify PDO's transaction handlers
This includes begin(), commit(), rollBack(), and inTransaction()
Diffstat (limited to 'ext/pdo/php_pdo_driver.h')
-rw-r--r-- | ext/pdo/php_pdo_driver.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index a8478cb3a6..33d8cbef6d 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -237,8 +237,9 @@ typedef zend_long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const char *sql, size_t sql /* quote a string */ typedef int (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const char *unquoted, size_t unquotedlen, char **quoted, size_t *quotedlen, enum pdo_param_type paramtype); -/* transaction related */ -typedef int (*pdo_dbh_txn_func)(pdo_dbh_t *dbh); +/* transaction related (beingTransaction(), commit, rollBack, inTransaction) + * Return true if currently inside a transaction, false otherwise. */ +typedef bool (*pdo_dbh_txn_func)(pdo_dbh_t *dbh); /* setting of attributes */ typedef int (*pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val); @@ -305,6 +306,7 @@ struct pdo_dbh_methods { pdo_dbh_check_liveness_func check_liveness; pdo_dbh_get_driver_methods_func get_driver_methods; pdo_dbh_request_shutdown persistent_shutdown; + /* if defined to NULL, PDO will use its internal transaction tracking state */ pdo_dbh_txn_func in_transaction; pdo_dbh_get_gc_func get_gc; }; @@ -446,7 +448,7 @@ struct _pdo_dbh_t { unsigned alloc_own_columns:1; /* if true, commit or rollBack is allowed to be called */ - unsigned in_txn:1; + bool in_txn:1; /* max length a single character can become after correct quoting */ unsigned max_escaped_char_length:3; |