summaryrefslogtreecommitdiff
path: root/statement.h
diff options
context:
space:
mode:
authorHeikki Linnakangas2014-04-11 12:14:26 +0000
committerHeikki Linnakangas2014-04-11 12:16:16 +0000
commitb5c9a65eedc5f16031b7d44421bc161b9758d9fc (patch)
tree5cb70b0c18108112d2b031bd11ab9430d4a1083f /statement.h
parentc38504ae9064a766d41316b28144d5a05c9cd9f0 (diff)
Fix two UseDeclareFetch bugs.
1. NOTICE messages were not delivered to the application, if they arrived as response to the DECLARE CURSOR statement. 2. Array-bound parameters on SELECT-queries caused a "cursor already open" error. These bugs were found by running the regression suite with UseDeclareFetch=1. It's now clean.
Diffstat (limited to 'statement.h')
-rw-r--r--statement.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/statement.h b/statement.h
index aa847e6..6a138be 100644
--- a/statement.h
+++ b/statement.h
@@ -422,7 +422,13 @@ enum
#define SC_ref_CC_error(a) ((a->ref_CC_error) = TRUE)
void SC_forget_unnamed(StatementClass *self);
#define SC_can_parse_statement(a) (STMT_TYPE_SELECT == (a)->statement_type)
-#define SC_may_use_cursor(a) (STMT_TYPE_SELECT == (a)->statement_type || STMT_TYPE_WITH == (a)->statement_type)
+/*
+ * DECLARE CURSOR + FETCH can only be used with SELECT-type queries. And
+ * it's not currently supported with array-bound parameters.
+ */
+#define SC_may_use_cursor(a) \
+ (SC_get_APDF(a)->paramset_size <= 1 && \
+ (STMT_TYPE_SELECT == (a)->statement_type || STMT_TYPE_WITH == (a)->statement_type) )
#define SC_may_fetch_rows(a) (STMT_TYPE_SELECT == (a)->statement_type || STMT_TYPE_WITH == (a)->statement_type)
#define SC_can_req_colinfo(a) (STMT_TYPE_SELECT == (a)->statement_type || \
STMT_TYPE_WITH == (a)->statement_type || \
@@ -501,8 +507,6 @@ BOOL SC_SetExecuting(StatementClass *self, BOOL on);
BOOL SC_SetCancelRequest(StatementClass *self);
BOOL SC_AcceptedCancelRequest(const StatementClass *self);
-DescriptorClass *SC_set_ARD(StatementClass *stmt, DescriptorClass *desc);
-DescriptorClass *SC_set_APD(StatementClass *stmt, DescriptorClass *desc);
int enqueueNeedDataCallback(StatementClass *self, NeedDataCallfunc, void *);
RETCODE dequeueNeedDataCallback(RETCODE, StatementClass *self);
void cancelNeedDataState(StatementClass *self);