goto cleanup;
}
- ci->updatable_cursors = DISALLOW_UPDATABLE_CURSORS;
- if (ci->allow_keyset)
- {
- if (ci->drivers.lie || !ci->drivers.use_declarefetch)
- ci->updatable_cursors |= (ALLOW_STATIC_CURSORS | ALLOW_KEYSET_DRIVEN_CURSORS | ALLOW_BULK_OPERATIONS | SENSE_SELF_OPERATIONS);
- else
- ci->updatable_cursors |= (ALLOW_STATIC_CURSORS | ALLOW_BULK_OPERATIONS | SENSE_SELF_OPERATIONS);
- }
+ ci_updatable_cursors_set(ci);
if (CC_get_errornumber(self) > 0)
CC_clear_error(self); /* clear any initial command errors */
* statement */
} CONN_Status;
-enum
-{
- DISALLOW_UPDATABLE_CURSORS = 0, /* No cursors are updatable */
- ALLOW_STATIC_CURSORS = 1L, /* Static cursors are updatable */
- ALLOW_KEYSET_DRIVEN_CURSORS = (1L << 1), /* Keyset-driven cursors are updatable */
- ALLOW_DYNAMIC_CURSORS = (1L << 2), /* Dynamic cursors are updatable */
- ALLOW_BULK_OPERATIONS = (1L << 3), /* Bulk operations available */
- SENSE_SELF_OPERATIONS = (1L << 4), /* Sense self update/delete/add */
-};
-
/* These errors have general sql error state */
#define CONNECTION_SERVER_NOT_REACHED 101
#define CONNECTION_MSG_TOO_LONG 103
return rptr;
}
+signed char ci_updatable_cursors_set(ConnInfo *ci)
+{
+ ci->updatable_cursors = DISALLOW_UPDATABLE_CURSORS;
+ if (ci->allow_keyset)
+ {
+ if (ci->drivers.lie || !ci->drivers.use_declarefetch)
+ ci->updatable_cursors |= (ALLOW_STATIC_CURSORS | ALLOW_KEYSET_DRIVEN_CURSORS | ALLOW_BULK_OPERATIONS | SENSE_SELF_OPERATIONS);
+ else
+ ci->updatable_cursors |= (ALLOW_STATIC_CURSORS | ALLOW_BULK_OPERATIONS | SENSE_SELF_OPERATIONS);
+ }
+ return ci->updatable_cursors;
+}
+
void
CC_conninfo_release(ConnInfo *conninfo)
{
UInt4 getExtraOptions(const ConnInfo *);
BOOL setExtraOptions(ConnInfo *, const char *str, const char *format);
char *extract_extra_attribute_setting(const pgNAME setting, const char *attr);
+signed char ci_updatable_cursors_set(ConnInfo *ci);
#ifdef __cplusplus
}
#include "qresult.h"
#include "pgapifunc.h"
#include "loadlib.h"
+#include "dlg_specific.h"
/* SQLError -> SQLDiagRec */
break;
case SQL_ATTR_PGOPT_USE_DECLAREFETCH:
conn->connInfo.drivers.use_declarefetch = CAST_UPTR(SQLCHAR, Value);
+ ci_updatable_cursors_set(&conn->connInfo);
qlog("declarefetch => %d\n", conn->connInfo.drivers.use_declarefetch);
mylog("declarefetch => %d\n", conn->connInfo.drivers.use_declarefetch);
break;
#define XMIN_NAME "xmin"
#define TABLEOID_NAME "tableoid"
+enum
+{
+ DISALLOW_UPDATABLE_CURSORS = 0, /* No cursors are updatable */
+ ALLOW_STATIC_CURSORS = 1L, /* Static cursors are updatable */
+ ALLOW_KEYSET_DRIVEN_CURSORS = (1L << 1), /* Keyset-driven cursors are updatable */
+ ALLOW_DYNAMIC_CURSORS = (1L << 2), /* Dynamic cursors are updatable */
+ ALLOW_BULK_OPERATIONS = (1L << 3), /* Bulk operations available */
+ SENSE_SELF_OPERATIONS = (1L << 4), /* Sense self update/delete/add */
+};
+
#ifdef __cplusplus
}
#endif