pdo_firebird: PDOStatement->closeCursor
am 12.11.2007 22:03:16 von Hans-Peter Oeri--------------080400020604020909000902
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi!
I fell out of bed as I noticed that PDOStatement->closeCursor is not
implemented for pdo_firebird.
Again, I'm not a php guru, but patched my version with the attached diff.
HPO
--------------080400020604020909000902
Content-Type: text/plain;
name="pdo_firebird_statement_closer.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="pdo_firebird_statement_closer.diff"
--- php5-orig/ext/pdo_firebird/firebird_statement.c 2007-11-12 21:54:13.000000000 +0100
+++ php5/ext/pdo_firebird/firebird_statement.c 2007-11-12 21:51:03.000000000 +0100
@@ -621,6 +620,22 @@
}
/* }}} */
+static int firebird_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+ int result = 1;
+
+ /* close the statement */
+ if (isc_dsql_free_statement(S->H->isc_status, &S->stmt, DSQL_close)) {
+ RECORD_ERROR(stmt);
+ result = 0;
+ }
+
+ return result;
+}
+/* }}} */
+
+
struct pdo_stmt_methods firebird_stmt_methods = { /* {{{ */
firebird_stmt_dtor,
firebird_stmt_execute,
@@ -629,7 +644,10 @@
firebird_stmt_get_col,
firebird_stmt_param_hook,
firebird_stmt_set_attribute,
- firebird_stmt_get_attribute
+ firebird_stmt_get_attribute,
+ NULL,
+ NULL,
+ firebird_stmt_cursor_closer
};
/* }}} */
--------------080400020604020909000902
Content-Type: text/plain; charset=us-ascii
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--------------080400020604020909000902--