]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/config.c
Cleanup ISO C compatibility for recent commits
[openldap] / servers / slapd / back-sql / config.c
index 06cc682ab25e437f467c8b7399520d37339294d1..197787ce5a39d1e5b34c41db39320b80550d44fd 100644 (file)
@@ -1,7 +1,7 @@
 /* $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 Masarati.
  * Portions Copyright 2004 Mark Adamson.
@@ -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;
        }