/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1999-2007 The OpenLDAP Foundation.
+ * Copyright 1999-2011 The OpenLDAP Foundation.
* Portions Copyright 1999 Dmitry Kovalev.
* Portions Copyright 2002 Pierangelo Masarati.
* All rights reserved.
backsql_tree_delete_search_cb( Operation *op, SlapReply *rs )
{
if ( rs->sr_type == REP_SEARCH ) {
- backsql_info *bi = (backsql_info*)op->o_bd->be_private;
backsql_tree_delete_t *btd;
backsql_entryID *eid;
{
Operation op2 = *op;
slap_callback sc = { 0 };
- SlapReply rs2 = { 0 };
- Filter f = { 0 };
+ SlapReply rs2 = { REP_RESULT };
backsql_tree_delete_t btd = { 0 };
int rc;
op2.ors_deref = LDAP_DEREF_NEVER;
op2.ors_slimit = SLAP_NO_LIMIT;
op2.ors_tlimit = SLAP_NO_LIMIT;
- op2.ors_filter = &f;
- f.f_choice = LDAP_FILTER_PRESENT;
- f.f_desc = slap_schema.si_ad_objectClass;
- BER_BVSTR( &op2.ors_filterstr, "(objectClass=*)" );
+ op2.ors_filter = (Filter *)slap_filter_objectClass_pres;
+ op2.ors_filterstr = *slap_filterstr_objectClass_pres;
op2.ors_attrs = slap_anlist_all_attributes;
op2.ors_attrsonly = 0;
int
backsql_delete( Operation *op, SlapReply *rs )
{
- backsql_info *bi = (backsql_info*)op->o_bd->be_private;
SQLHDBC dbh = SQL_NULL_HDBC;
SQLHSTMT sth = SQL_NULL_HSTMT;
backsql_oc_map_rec *oc = NULL;
break;
case LDAP_COMPARE_TRUE:
+#ifdef SLAP_CONTROL_X_TREE_DELETE
if ( get_treeDelete( op ) ) {
rs->sr_err = LDAP_SUCCESS;
break;
}
+#endif /* SLAP_CONTROL_X_TREE_DELETE */
Debug( LDAP_DEBUG_TRACE, " backsql_delete(): "
"entry \"%s\" has children\n",
}
e = &d;
+#ifdef SLAP_CONTROL_X_TREE_DELETE
if ( get_treeDelete( op ) ) {
backsql_tree_delete( op, rs, dbh, &sth );
if ( rs->sr_err == LDAP_OTHER || rs->sr_err == LDAP_SUCCESS )
e = NULL;
}
- } else {
+ } else
+#endif /* SLAP_CONTROL_X_TREE_DELETE */
+ {
backsql_delete_int( op, rs, dbh, &sth, &e_id, &e );
}