lwe Wed Nov 14 22:09:21 2007 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/pdo_firebird firebird_statement.c
php_pdo_firebird_int.h
Log:
- Fixed bug #43271 (pdo_firebird: closeCursor not implemented)
# Actually firebird_stmt_execute() didn't close a previously opened cursor,
but implemented closeCursor anyway.
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_firebird/firebird_statement.c?r1=1.18.2.1.2.5.2.1&r2=1.18.2.1.2.5.2.2&diff_format=u
Index: php-src/ext/pdo_firebird/firebird_statement.c
diff -u php-src/ext/pdo_firebird/firebird_statement.c:1.18.2.1.2.5.2.1
php-src/ext/pdo_firebird/firebird_statement.c:1.18.2.1.2.5.2.2
--- php-src/ext/pdo_firebird/firebird_statement.c:1.18.2.1.2.5.2.1 Tue Oct
30 16:31:41 2007
+++ php-src/ext/pdo_firebird/firebird_statement.c Wed Nov 14 22:09:21 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: firebird_statement.c,v 1.18.2.1.2.5.2.1 2007/10/30 16:31:41 lwe Exp $
*/
+/* $Id: firebird_statement.c,v 1.18.2.1.2.5.2.2 2007/11/14 22:09:21 lwe Exp $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -92,11 +92,11 @@
pdo_firebird_db_handle *H = S->H;
do {
- /* named cursors should be closed first */
- if (*S->name && isc_dsql_free_statement(H->isc_status,
&S->stmt, DSQL_close)) {
+ /* named or open cursors should be closed first */
+ if ((*S->name || S->cursor_open) &&
isc_dsql_free_statement(H->isc_status, &S->stmt, DSQL_close)) {
break;
}
-
+ S->cursor_open = 0;
/* assume all params have been bound */
if ((S->statement_type == isc_info_sql_stmt_exec_procedure &&
@@ -113,6 +113,7 @@
}
*S->name = 0;
+ S->cursor_open = 1;
S->exhausted = 0;
return 1;
@@ -612,6 +613,20 @@
}
/* }}} */
+static int firebird_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
+
+ /* close the statement handle */
+ if (isc_dsql_free_statement(S->H->isc_status, &S->stmt, DSQL_close)) {
+ RECORD_ERROR(stmt);
+ return 0;
+ }
+ return 1;
+}
+/* }}} */
+
+
struct pdo_stmt_methods firebird_stmt_methods = { /* {{{ */
firebird_stmt_dtor,
firebird_stmt_execute,
@@ -620,7 +635,10 @@
firebird_stmt_get_col,
firebird_stmt_param_hook,
firebird_stmt_set_attribute,
- firebird_stmt_get_attribute
+ firebird_stmt_get_attribute,
+ NULL, /* get_column_meta_func */
+ NULL, /* next_rowset_func */
+ firebird_stmt_cursor_closer
};
/* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_firebird/php_pdo_firebird_int.h?r1=1.10.2.1.2.1.2.1&r2=1.10.2.1.2.1.2.2&diff_format=u
Index: php-src/ext/pdo_firebird/php_pdo_firebird_int.h
diff -u php-src/ext/pdo_firebird/php_pdo_firebird_int.h:1.10.2.1.2.1.2.1
php-src/ext/pdo_firebird/php_pdo_firebird_int.h:1.10.2.1.2.1.2.2
--- php-src/ext/pdo_firebird/php_pdo_firebird_int.h:1.10.2.1.2.1.2.1 Tue Oct
30 16:26:25 2007
+++ php-src/ext/pdo_firebird/php_pdo_firebird_int.h Wed Nov 14 22:09:21 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pdo_firebird_int.h,v 1.10.2.1.2.1.2.1 2007/10/30 16:26:25 lwe Exp
$ */
+/* $Id: php_pdo_firebird_int.h,v 1.10.2.1.2.1.2.2 2007/11/14 22:09:21 lwe Exp
$ */
#ifndef PHP_PDO_FIREBIRD_INT_H
#define PHP_PDO_FIREBIRD_INT_H
@@ -102,7 +102,10 @@
/* whether EOF was reached for this statement */
unsigned exhausted:1;
- unsigned _reserved:23;
+ /* successful isc_dsql_execute opens a cursor */
+ unsigned cursor_open:1;
+
+ unsigned _reserved:22;
/* the named params that were converted to ?'s by the driver */
HashTable *named_params;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php