abies Tue Aug 12 22:19:15 2003 EDT
Modified files:
/php-src/ext/interbase interbase.c php_interbase.h
Log:
Allow the use of EXECUTE PROCEDURE statements
Index: php-src/ext/interbase/interbase.c
diff -u php-src/ext/interbase/interbase.c:1.137 php-src/ext/interbase/interbase.c:1.138
--- php-src/ext/interbase/interbase.c:1.137 Tue Aug 12 14:01:59 2003
+++ php-src/ext/interbase/interbase.c Tue Aug 12 22:19:14 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: interbase.c,v 1.137 2003/08/12 18:01:59 abies Exp $ */
+/* $Id: interbase.c,v 1.138 2003/08/13 02:19:14 abies Exp $ */
/* TODO: Arrays, roles?
@@ -82,8 +82,8 @@
#endif
#ifdef ZEND_DEBUG
-/* #define IBDEBUG(a) php_printf("::: %s (%d)\n", a, __LINE__); */
-#define IBDEBUG(a)
+#define IBDEBUG(a) php_printf("::: %s (%d)\n", a, __LINE__);
+/* #define IBDEBUG(a) */
#else
#define IBDEBUG(a)
#endif
@@ -698,7 +698,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "Interbase Support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.137 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.138 $");
#ifdef COMPILE_DL_INTERBASE
php_info_print_table_row(2, "Dynamic Module", "Yes");
#endif
@@ -1554,7 +1554,8 @@
BIND_BUF *bind_buf = NULL;
int rv = FAILURE;
char info_count[] = {isc_info_sql_records}, result[64];
-
+ ISC_STATUS isc_result;
+
RESET_ERRMSG;
if (argc > 0 && args != NULL) {
@@ -1627,6 +1628,7 @@
IB_RESULT->link = ib_query->link->handle;
IB_RESULT->trans = ib_query->trans->handle;
IB_RESULT->stmt = ib_query->stmt;
+ IB_RESULT->statement_type = ib_query->statement_type;
IB_RESULT->drop_stmt = 0; /* when free result close but not drop!*/
out_sqlda = IB_RESULT->out_sqlda =
emalloc(XSQLDA_LENGTH(ib_query->out_sqlda->sqld));
@@ -1656,7 +1658,12 @@
}
}
- if (isc_dsql_execute(IB_STATUS, &ib_query->trans->handle, &ib_query->stmt,
ib_query->dialect, in_sqlda)) {
+ if (ib_query->statement_type == isc_info_sql_stmt_exec_procedure) {
+ isc_result = isc_dsql_execute2(IB_STATUS, &ib_query->trans->handle,
&ib_query->stmt, SQLDA_CURRENT_VERSION, in_sqlda, out_sqlda);
+ } else {
+ isc_result = isc_dsql_execute(IB_STATUS, &ib_query->trans->handle,
&ib_query->stmt, SQLDA_CURRENT_VERSION, in_sqlda);
+ }
+ if (isc_result) {
IBDEBUG("Could not execute query");
_php_ibase_error(TSRMLS_C);
goto _php_ibase_exec_error;
@@ -2505,15 +2512,20 @@
RETURN_FALSE;
}
- if (isc_dsql_fetch(IB_STATUS, &ib_result->stmt, 1, ib_result->out_sqlda)) {
+ if (ib_result->statement_type != isc_info_sql_stmt_exec_procedure) {
- ib_result->has_more_rows = 0;
- if (IB_STATUS[0] && IB_STATUS[1]) { /* error in fetch */
- _php_ibase_error(TSRMLS_C);
+ if (isc_dsql_fetch(IB_STATUS, &ib_result->stmt, 1,
ib_result->out_sqlda)) {
+
+ ib_result->has_more_rows = 0;
+ if (IB_STATUS[0] && IB_STATUS[1]) { /* error in fetch */
+ _php_ibase_error(TSRMLS_C);
+ }
+ RETURN_FALSE;
}
- RETURN_FALSE;
- }
-
+ } else {
+ ib_result->has_more_rows = 0;
+ }
+
array_init(return_value);
arr_cnt = 0;
Index: php-src/ext/interbase/php_interbase.h
diff -u php-src/ext/interbase/php_interbase.h:1.46
php-src/ext/interbase/php_interbase.h:1.47
--- php-src/ext/interbase/php_interbase.h:1.46 Tue Aug 12 14:08:13 2003
+++ php-src/ext/interbase/php_interbase.h Tue Aug 12 22:19:14 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_interbase.h,v 1.46 2003/08/12 18:08:13 abies Exp $ */
+/* $Id: php_interbase.h,v 1.47 2003/08/13 02:19:14 abies Exp $ */
#ifndef PHP_INTERBASE_H
#define PHP_INTERBASE_H
@@ -166,6 +166,7 @@
XSQLDA *out_sqlda;
ibase_array *out_array;
unsigned char has_more_rows;
+ char statement_type;
} ibase_result;
typedef struct _php_ibase_varchar {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php