X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-bdb%2Ffilterindex.c;h=a54ccf7cd16fdcc947eadb8026bac4e4af8edf86;hb=b905811d3c800b6f4031d541e424e5de871aa0c7;hp=29c3a64987ea13f2581958f533a998d1fd086792;hpb=ece2a4daa676c85e1d2ae2bdc426a4ade25037a3;p=openldap diff --git a/servers/slapd/back-bdb/filterindex.c b/servers/slapd/back-bdb/filterindex.c index 29c3a64987..a54ccf7cd1 100644 --- a/servers/slapd/back-bdb/filterindex.c +++ b/servers/slapd/back-bdb/filterindex.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2000-2008 The OpenLDAP Foundation. + * Copyright 2000-2011 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -582,6 +582,9 @@ list_candidates( save+BDB_IDL_UM_SIZE ); if ( rc != 0 ) { + if ( rc == DB_LOCK_DEADLOCK ) + return rc; + if ( ftype == LDAP_FILTER_AND ) { rc = 0; continue; @@ -714,6 +717,20 @@ equality_candidates( Debug( LDAP_DEBUG_TRACE, "=> bdb_equality_candidates (%s)\n", ava->aa_desc->ad_cname.bv_val, 0, 0 ); + if ( ava->aa_desc == slap_schema.si_ad_entryDN ) { + EntryInfo *ei = NULL; + rc = bdb_cache_find_ndn( op, rtxn, &ava->aa_value, &ei ); + if ( rc == LDAP_SUCCESS ) { + /* exactly one ID can match */ + ids[0] = 1; + ids[1] = ei->bei_id; + } + if ( ei ) { + bdb_cache_entryinfo_unlock( ei ); + } + return rc; + } + BDB_IDL_ALL( bdb, ids ); rc = bdb_index_param( op->o_bd, ava->aa_desc, LDAP_FILTER_EQUALITY,