/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1999-2010 The OpenLDAP Foundation.
+ * Copyright 1999-2011 The OpenLDAP Foundation.
* Portions Copyright 1999 Dmitry Kovalev.
* Portions Copyright 2002 Pierangelo Mararati.
* Portions Copyright 2004 Mark Adamson.
UDWORD *col_prec;
SQLSMALLINT *col_type;
char **cols;
- SQLINTEGER *value_len;
+ SQLLEN *value_len;
} BACKSQL_ROW_NTS;
/*
*/
#undef BACKSQL_ARBITRARY_KEY
+/*
+ * type used for keys
+ */
+#if defined(HAVE_LONG_LONG) && defined(SQL_C_UBIGINT) && \
+ ( defined(HAVE_STRTOULL) || defined(HAVE_STRTOUQ) )
+typedef unsigned long long backsql_key_t;
+#define BACKSQL_C_NUMID SQL_C_UBIGINT
+#define BACKSQL_IDNUMFMT "%llu"
+#define BACKSQL_STR2ID lutil_atoullx
+#else /* ! HAVE_LONG_LONG || ! SQL_C_UBIGINT */
+typedef unsigned long backsql_key_t;
+#define BACKSQL_C_NUMID SQL_C_ULONG
+#define BACKSQL_IDNUMFMT "%lu"
+#define BACKSQL_STR2ID lutil_atoulx
+#endif /* ! HAVE_LONG_LONG */
+
/*
* define to enable support for syncprov overlay
*/
/* flags whether delete_proc is a function (whether back-sql
* should bind first parameter as output for return code) */
int bom_expect_return;
- unsigned long bom_id;
+ backsql_key_t bom_id;
Avlnode *bom_attrs;
AttributeDescription *bom_create_hint;
} backsql_oc_map_rec;
#define BACKSQL_MAX_KEY_LEN 64
#else /* ! BACKSQL_ARBITRARY_KEY */
/* The original numeric key is maintained as default. */
- unsigned long eid_id;
- unsigned long eid_keyval;
+ backsql_key_t eid_id;
+ backsql_key_t eid_keyval;
#endif /* ! BACKSQL_ARBITRARY_KEY */
- unsigned long eid_oc_id;
+ backsql_key_t eid_oc_id;
backsql_oc_map_rec *eid_oc;
struct berval eid_dn;
struct berval eid_ndn;
#define BSQLF_FETCH_ALL_OPATTRS 0x0400
#define BSQLF_FETCH_ALL_ATTRS (BSQLF_FETCH_ALL_USERATTRS|BSQLF_FETCH_ALL_OPATTRS)
#define BSQLF_CHECK_SCHEMA 0x0800
+#define BSQLF_AUTOCOMMIT_ON 0x1000
#define BACKSQL_ISF(si, f) \
(((si)->sql_flags & f) == f)
BACKSQL_ISF(si, BSQLF_FETCH_ALL_ATTRS)
#define BACKSQL_CHECK_SCHEMA(si) \
BACKSQL_ISF(si, BSQLF_CHECK_SCHEMA)
+#define BACKSQL_AUTOCOMMIT_ON(si) \
+ BACKSQL_ISF(si, BSQLF_AUTOCOMMIT_ON)
Entry *sql_baseObject;
#ifdef BACKSQL_ARBITRARY_KEY
#define BACKSQL_IDFMT "%s"
#define BACKSQL_IDARG(arg) ((arg).bv_val)
#else /* ! BACKSQL_ARBITRARY_KEY */
-#define BACKSQL_IDFMT "%lu"
+#define BACKSQL_IDFMT BACKSQL_IDNUMFMT
#define BACKSQL_IDARG(arg) (arg)
#endif /* ! BACKSQL_ARBITRARY_KEY */