summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xext/pdo/pdo_dbh.c10
-rwxr-xr-xext/pdo/php_pdo_driver.h5
2 files changed, 14 insertions, 1 deletions
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 883f98defc..23c852553a 100755
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -1371,6 +1371,16 @@ static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC)
pefree(dbh, dbh->is_persistent);
}
+PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ dbh->refcount++;
+}
+
+PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ dbh_free(dbh TSRMLS_CC);
+}
+
static void pdo_dbh_free_storage(pdo_dbh_t *dbh TSRMLS_DC)
{
if (dbh->in_txn && dbh->methods && dbh->methods->rollback) {
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index ad754e7736..38f65d6af2 100755
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -44,7 +44,7 @@ PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC);
# define FALSE 0
#endif
-#define PDO_DRIVER_API 20051031
+#define PDO_DRIVER_API 20051128
enum pdo_param_type {
PDO_PARAM_NULL,
@@ -645,6 +645,9 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt,
const char *sqlstate, const char *supp TSRMLS_DC);
+PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh TSRMLS_DC);
+PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh TSRMLS_DC);
+
PDO_API void php_pdo_stmt_addref(pdo_stmt_t *stmt TSRMLS_DC);
PDO_API void php_pdo_stmt_delref(pdo_stmt_t *stmt TSRMLS_DC);