summaryrefslogtreecommitdiff
path: root/ext/pdo/php_pdo_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo/php_pdo_driver.h')
-rw-r--r--ext/pdo/php_pdo_driver.h8
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;