Commit 6f23eb85 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#6612

parent a0e04557
......@@ -2,6 +2,7 @@ OpenLDAP 2.4 Change Log
OpenLDAP 2.4.24 Engineering
Added slapd-null back-config support (ITS#6624)
Added slapd-sql autocommit support (ITS#6612)
Fixed liblber to not close invalid sockets (ITS#6585)
Fixed libldap dnssrv port format specifier (ITS#6644)
Fixed libldap GnuTLS hang on socket close (ITS#6673)
......
......@@ -336,6 +336,10 @@ Subsequent args are passed to the layer configuration routine.
This is \fIhighly experimental\fP and should be used with extreme care.
The API of the layers is not frozen yet, so it is unpublished.
.TP
.B autocommit { NO | yes }
Activates autocommit; by default, it is off.
.SH METAINFORMATION USED
.LP
Almost everything mentioned later is illustrated in examples located
......
......@@ -517,6 +517,7 @@ typedef struct backsql_info {
#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)
......@@ -549,6 +550,8 @@ typedef struct backsql_info {
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
......
......@@ -639,6 +639,37 @@ backsql_db_config(
ber_str2bv( argv[ 1 ], 0, 1, &bi->sql_aliasing_quote );
} else if ( !strcasecmp( argv[ 0 ], "autocommit" ) ) {
if ( argc != 2 ) {
Debug( LDAP_DEBUG_TRACE,
"<==backsql_db_config (%s line %d): "
"missing arg "
"in \"autocommit {NO|yes}\" directive\n",
fname, lineno, 0 );
return 1;
}
if ( !strcasecmp( argv[ 1 ], "yes" ) ||
!strcasecmp( argv[ 1 ], "TRUE" ) ||
!strcasecmp( argv[ 1 ], "on" ) )
{
bi->sql_flags |= BSQLF_AUTOCOMMIT_ON;
} else if ( !strcasecmp( argv[ 1 ], "no" ) ||
!strcasecmp( argv[ 1 ], "FALSE" ) ||
!strcasecmp( argv[ 1 ], "off" ) )
{
bi->sql_flags &= ~BSQLF_AUTOCOMMIT_ON;
} else {
Debug( LDAP_DEBUG_TRACE,
"<==backsql_db_config (%s line %d): "
"invalid arg "
"in \"autocommit {NO|yes}\" directive\n",
fname, lineno, 0 );
return 1;
}
} else {
return SLAP_CONF_UNKNOWN;
}
......
......@@ -424,7 +424,8 @@ backsql_open_db_handle(
* TimesTen : Turn off autocommit. We must explicitly
* commit any transactions.
*/
SQLSetConnectOption( *dbhp, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF );
SQLSetConnectOption( *dbhp, SQL_AUTOCOMMIT,
BACKSQL_AUTOCOMMIT_ON( bi ) ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF );
/*
* See if this connection is to TimesTen. If it is,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment