Tuesday, June 14, 2016

[389-commits] Branch '389-ds-base-1.3.4' - 3 commits - ldap/admin ldap/ldif ldap/servers Makefile.am Makefile.in VERSION.sh

Makefile.am | 3
Makefile.in | 3
VERSION.sh | 2
ldap/admin/src/scripts/91reindex.pl.in | 103 ---------
ldap/admin/src/scripts/91subtreereindex.pl | 8
ldap/admin/src/scripts/setup-ds.res.in | 1
ldap/ldif/template-dse.ldif.in | 1
ldap/servers/plugins/replication/repl5_replica_config.c | 7
ldap/servers/plugins/replication/repl5_tot_protocol.c | 169 ++++------------
ldap/servers/slapd/back-ldbm/back-ldbm.h | 6
ldap/servers/slapd/back-ldbm/dblayer.c | 5
ldap/servers/slapd/back-ldbm/filterindex.c | 18 -
ldap/servers/slapd/back-ldbm/idl_new.c | 87 +-------
ldap/servers/slapd/back-ldbm/index.c | 22 --
ldap/servers/slapd/back-ldbm/init.c | 2
ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 2
ldap/servers/slapd/back-ldbm/misc.c | 1
ldap/servers/slapd/entry.c | 4
ldap/servers/slapd/slap.h | 4
ldap/servers/slapd/slapi-plugin.h | 8
20 files changed, 88 insertions(+), 368 deletions(-)

New commits:
commit 2c95bee921e2bb39d55a8688ca042c7847a30922
Author: Noriko Hosoi <nhosoi@redhat.com>
Date: Tue Jun 14 09:31:18 2016 -0700

Revert "Ticket #48755 - moving an entry could make the online init fail"

This reverts commit 4e70ab58808cae57642f459ff00a298e69265e08.

diff --git a/Makefile.am b/Makefile.am
index 2d19a74..8dcdb36 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -589,8 +589,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/50AES-pbe-plugin.ldif\
ldap/admin/src/scripts/50updateconfig.ldif \
ldap/admin/src/scripts/52updateAESplugin.pl \
- ldap/admin/src/scripts/dnaplugindepends.ldif \
- ldap/admin/src/scripts/91reindex.pl
+ ldap/admin/src/scripts/dnaplugindepends.ldif

update_SCRIPTS = ldap/admin/src/scripts/exampleupdate.sh

diff --git a/Makefile.in b/Makefile.in
index 4298c57..a29509d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1997,8 +1997,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/50AES-pbe-plugin.ldif\
ldap/admin/src/scripts/50updateconfig.ldif \
ldap/admin/src/scripts/52updateAESplugin.pl \
- ldap/admin/src/scripts/dnaplugindepends.ldif \
- ldap/admin/src/scripts/91reindex.pl
+ ldap/admin/src/scripts/dnaplugindepends.ldif

update_SCRIPTS = ldap/admin/src/scripts/exampleupdate.sh

diff --git a/ldap/admin/src/scripts/91reindex.pl.in b/ldap/admin/src/scripts/91reindex.pl.in
deleted file mode 100644
index c861f64..0000000
--- a/ldap/admin/src/scripts/91reindex.pl.in
+++ /dev/null
@@ -1,103 +0,0 @@
-use Mozilla::LDAP::Conn;
-use Mozilla::LDAP::Utils qw(normalizeDN);
-use Mozilla::LDAP::API qw(:constant ldap_url_parse ldap_explode_dn);
-use DSUpdate qw(isOffline);
-
-sub runinst {
- my ($inf, $inst, $dseldif, $conn) = @_;
- my $rc, @errs;
-
- # List of index to be reindexed
- my @toreindex = qw(parentid);
- # rdn-format value. See $rdn_format set below.
- # If equal to or greater than this value, no need to reindex.
- # If it needs to be unconditionally reindexed, set 0.
- my @rdnconditions = (4)
-
- my $config = $conn->search("cn=config", "base", "(objectclass=*)");
- if (!$config) {
- push @errs, ['error_finding_config_entry', 'cn=config',
- $conn->getErrorString()];
- return @errs;
- }
-
- ($rc, @errs) = isOffline($inf, $inst, $conn);
- if (!$rc) {
- return @errs;
- }
-
- my $reindex = "@sbindir@/db2index -Z $inst";
- my @errs;
- my $instconf = $conn->search("cn=ldbm database,cn=plugins,cn=config", "onelevel", "(objectclass=*)");
- if (!$instconf) {
- push @errs, ['error_finding_config_entry', 'cn=*,cn=ldbm database,cn=plugins,cn=config', $conn->getErrorString()];
- return @errs;
- }
-
- my $dbconf = $conn->search("cn=config,cn=ldbm database,cn=plugins,cn=config", "base", "(objectclass=*)");
- if (!$dbconf) {
- push @errs, ['error_finding_config_entry',
- 'cn=config,cn=ldbm database,cn=plugins,cn=config',
- $conn->getErrorString()];
- return @errs;
- }
-
- # Get the value of nsslapd-subtree-rename-switch.
- my $switch = $dbconf->getValues('nsslapd-subtree-rename-switch');
- if ("" eq $switch) {
- return (); # subtree-rename-switch does not exist; do nothing.
- } elsif ("off" eq $switch || "OFF" eq $switch) {
- return (); # subtree-rename-switch is OFF; do nothing.
- }
-
- my $dbdir = $dbconf->getValues('nsslapd-directory');
- my $dbversion0 = $dbdir . "/DBVERSION";
- my $rdn_format = 0;
- my $dbversionstr = "";
- if (!open(DBVERSION, "$dbversion0")) {
- push @errs, ['error_opening_file', $dbversion0, $!];
- return @errs;
- } else {
- while (<DBVERSION>) {
- if ($_ =~ /rdn-format/) {
- $rdn_format = 1;
- $dbversionstr = $_;
- if ($_ =~ /rdn-format-1/) {
- $rdn_format = 2;
- } elsif ($_ =~ /rdn-format-2/) {
- $rdn_format = 3;
- } elsif ($_ =~ /rdn-format-3/) {
- $rdn_format = 4;
- } elsif ($_ =~ /rdn-format-4/) {
- $rdn_format = 5;
- } elsif ($_ =~ /rdn-format-5/) {
- $rdn_format = 6;
- } elsif ($_ =~ /rdn-format-/) {
- # assume greater than -5
- $rdn_format = 7;
- }
- }
- }
- close DBVERSION;
- }
-
- while ($instconf) {
- my $backend= $instconf->getValues('cn');
- if (($backend eq "config") || ($backend eq "monitor")) {
- goto NEXT;
- }
-
- for (my $idx = 0; $ <= $#toreindex; $idx++) {
- if (0 == $rdnconditions[$idx] || $rdnconditions[$idx] > $rdn_format) {
- my $rc = system("$reindex -n $backend -t $idx");
- if ($rc) {
- push @errs, ["error_reindexng", $idx, $backend, $rc];
- }
- }
- }
-NEXT:
- $instconf = $conn->nextEntry();
- }
-
- return @errs;
-}
diff --git a/ldap/admin/src/scripts/91subtreereindex.pl b/ldap/admin/src/scripts/91subtreereindex.pl
index c4b40a3..a031cc1 100644
--- a/ldap/admin/src/scripts/91subtreereindex.pl
+++ b/ldap/admin/src/scripts/91subtreereindex.pl
@@ -51,18 +51,14 @@ sub runinst {
if ($_ =~ /rdn-format-1/) {
$is_rdn_format = 2;
}
- elsif ($_ =~ /rdn-format-2/) {
+ if ($_ =~ /rdn-format-2/) {
$is_rdn_format = 3;
}
- elsif ($_ =~ /rdn-format-/) {
- # assume greater than -2
- $is_rdn_format = 4;
- }
}
}
close DBVERSION;

- if (3 <= $is_rdn_format) {
+ if (3 == $is_rdn_format) {
return (); # DB already has the new rdn format.
}

diff --git a/ldap/admin/src/scripts/setup-ds.res.in b/ldap/admin/src/scripts/setup-ds.res.in
index 760db6f..7134e25 100644
--- a/ldap/admin/src/scripts/setup-ds.res.in
+++ b/ldap/admin/src/scripts/setup-ds.res.in
@@ -208,4 +208,3 @@ error_opening_file = Opening file '%s' failed. Error: %s\n
error_format_error = '%s' has invalid format.\n
error_update_not_offline = Error: offline mode selected but the server [%s] is still running.\n
error_update_all = Failed to update all the Directory Server instances.\n
-error_reindexing = Failed to reindex '%s' in backend '%s'. Error: %s\n
diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in
index 2988cb9..6acbfae 100644
--- a/ldap/ldif/template-dse.ldif.in
+++ b/ldap/ldif/template-dse.ldif.in
@@ -927,7 +927,6 @@ objectclass: nsIndex
cn: parentid
nssystemindex: true
nsindextype: eq
-nsmatchingrule: integerOrderingMatch

dn: cn=seeAlso,cn=default indexes, cn=config,cn=ldbm database,cn=plugins,cn=config
objectclass: top
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index fa436ac..4d7135c 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -405,7 +405,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
{
if (apply_mods)
replica_set_precise_purging(r, 0);
- }
+ }
else
{
*returncode = LDAP_UNWILLING_TO_PERFORM;
@@ -567,7 +567,8 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
{
if (apply_mods)
{
- if (config_attr_value[0]) {
+ if (apply_mods && config_attr_value[0])
+ {
PRUint64 on_off = 0;

if (strcasecmp(config_attr_value, "on") == 0){
@@ -586,7 +587,7 @@ replica_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry*
break;
}
replica_set_precise_purging(r, on_off);
- } else {
+ } else if (apply_mods) {
replica_set_precise_purging(r, 0);
}
}
diff --git a/ldap/servers/plugins/replication/repl5_tot_protocol.c b/ldap/servers/plugins/replication/repl5_tot_protocol.c
index 03d0c3e..d0c4402 100644
--- a/ldap/servers/plugins/replication/repl5_tot_protocol.c
+++ b/ldap/servers/plugins/replication/repl5_tot_protocol.c
@@ -323,10 +323,6 @@ repl5_tot_run(Private_Repl_Protocol *prp)
int init_retry = 0;
Replica *replica;
ReplicaId rid = 0; /* Used to create the replica keep alive subentry */
- Slapi_Entry *suffix = NULL;
- char **instances = NULL;
- Slapi_Backend *be = NULL;
- int is_entryrdn = 0;

PR_ASSERT(NULL != prp);

@@ -358,21 +354,21 @@ retry:
*/
if (rc != ACQUIRE_SUCCESS)
{
- int optype, ldaprc, wait_retry;
- conn_get_error(prp->conn, &optype, &ldaprc);
- if (rc == ACQUIRE_TRANSIENT_ERROR && INIT_RETRY_MAX > init_retry++) {
- wait_retry = init_retry * INIT_RETRY_INT;
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: unable to "
- "acquire replica for total update, error: %d,"
+ int optype, ldaprc, wait_retry;
+ conn_get_error(prp->conn, &optype, &ldaprc);
+ if (rc == ACQUIRE_TRANSIENT_ERROR && INIT_RETRY_MAX > init_retry++) {
+ wait_retry = init_retry * INIT_RETRY_INT;
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: unable to "
+ "acquire replica for total update, error: %d,"
" retrying in %d seconds.\n",
- ldaprc, wait_retry);
- DS_Sleep(PR_SecondsToInterval(wait_retry));
- goto retry;
- } else {
- agmt_set_last_init_status(prp->agmt, ldaprc,
- prp->last_acquire_response_code, 0, NULL);
- goto done;
- }
+ ldaprc, wait_retry);
+ DS_Sleep(PR_SecondsToInterval(wait_retry));
+ goto retry;
+ } else {
+ agmt_set_last_init_status(prp->agmt, ldaprc,
+ prp->last_acquire_response_code, 0, NULL);
+ goto done;
+ }
}
else if (prp->terminate)
{
@@ -409,121 +405,48 @@ retry:
and that the order implies that perent entry is always ahead of the
child entry in the list. Otherwise, the consumer would not be
properly updated because bulk import at the moment skips orphand entries. */
- /* XXXggood above assumption may not be valid if orphaned entry moved???? */
+ /* XXXggood above assumption may not be valid if orphaned entry moved???? */

agmt_set_last_init_status(prp->agmt, 0, 0, 0, "Total update in progress");

slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Beginning total update of replica "
- "\"%s\".\n", agmt_get_long_name(prp->agmt));
+ "\"%s\".\n", agmt_get_long_name(prp->agmt));

/* RMREPL - need to send schema here */

pb = slapi_pblock_new ();

- replica = (Replica*) object_get_data(prp->replica_object);
- /*
- * Get the info about the entryrdn vs. entrydn from the backend.
- * If NOT is_entryrdn, its ancestor entries are always found prior to an entry.
- */
- rc = slapi_lookup_instance_name_by_suffix((char *)slapi_sdn_get_dn(area_sdn), NULL, &instances, 1);
- if (rc || !instances) {
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: unable to "
- "get the instance name for the suffix \"%s\".\n", slapi_sdn_get_dn(area_sdn));
- goto done;
- }
- be = slapi_be_select_by_instance_name(instances[0]);
- if (!be) {
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: unable to "
- "get the instance for the suffix \"%s\".\n", slapi_sdn_get_dn(area_sdn));
- goto done;
- }
- rc = slapi_back_get_info(be, BACK_INFO_IS_ENTRYRDN, (void **)&is_entryrdn);
- if (is_entryrdn) {
- /*
- * Supporting entries out of order -- parent could have a larger id than its children.
- * Entires are retireved sorted by parentid without the allid threshold.
- */
- /* Get suffix */
- rc = slapi_search_internal_get_entry(area_sdn, NULL, &suffix, repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION));
- if (rc) {
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: unable to "
- "get the suffix entry \"%s\".\n", slapi_sdn_get_dn(area_sdn));
- goto done;
- }
-
- cb_data.prp = prp;
- cb_data.rc = 0;
- cb_data.num_entries = 1UL;
- cb_data.sleep_on_busy = 0UL;
- cb_data.last_busy = current_time ();
- cb_data.flowcontrol_detection = 0;
- cb_data.lock = PR_NewLock();
-
- /* This allows during perform_operation to check the callback data
- * especially to do flow contol on delta send msgid / recv msgid
- */
- conn_set_tot_update_cb(prp->conn, (void *) &cb_data);
-
- /* Send suffix first. */
- rc = send_entry(suffix, (void *)&cb_data);
- if (rc) {
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: unable to "
- "send the suffix entry \"%s\" to the consumer.\n", slapi_sdn_get_dn(area_sdn));
- goto done;
- }
-
- /* we need to provide managedsait control so that referral entries can
- be replicated */
- ctrls = (LDAPControl **)slapi_ch_calloc (3, sizeof (LDAPControl *));
- ctrls[0] = create_managedsait_control ();
- ctrls[1] = create_backend_control(area_sdn);
+ /* we need to provide managedsait control so that referral entries can
+ be replicated */
+ ctrls = (LDAPControl **)slapi_ch_calloc (3, sizeof (LDAPControl *));
+ ctrls[0] = create_managedsait_control ();
+ ctrls[1] = create_backend_control(area_sdn);

- /* Time to make sure it exists a keep alive subentry for that replica */
- if (replica)
- {
- rid = replica_get_rid(replica);
- }
- replica_subentry_check(area_sdn, rid);
+ /* Time to make sure it exists a keep alive subentry for that replica */
+ replica = (Replica*) object_get_data(prp->replica_object);
+ if (replica)
+ {
+ rid = replica_get_rid(replica);
+ }
+ replica_subentry_check(area_sdn, rid);
+
+ slapi_search_internal_set_pb (pb, slapi_sdn_get_dn (area_sdn),
+ LDAP_SCOPE_SUBTREE, "(|(objectclass=ldapsubentry)(objectclass=nstombstone)(nsuniqueid=*))", NULL, 0, ctrls, NULL,
+ repl_get_plugin_identity (PLUGIN_MULTIMASTER_REPLICATION), 0);
+
+ cb_data.prp = prp;
+ cb_data.rc = 0;
+ cb_data.num_entries = 0UL;
+ cb_data.sleep_on_busy = 0UL;
+ cb_data.last_busy = current_time ();
+ cb_data.flowcontrol_detection = 0;
+ cb_data.lock = PR_NewLock();
+
+ /* This allows during perform_operation to check the callback data
+ * especially to do flow contol on delta send msgid / recv msgid
+ */
+ conn_set_tot_update_cb(prp->conn, (void *) &cb_data);

- /* Send the subtree of the suffix in the order of parentid index plus ldapsubentry and nstombstone. */
- slapi_search_internal_set_pb(pb, slapi_sdn_get_dn (area_sdn),
- LDAP_SCOPE_SUBTREE, "(|(parentid>=1)(objectclass=ldapsubentry)(objectclass=nstombstone))", NULL, 0, ctrls, NULL,
- repl_get_plugin_identity (PLUGIN_MULTIMASTER_REPLICATION), 0);
- cb_data.num_entries = 0UL;
- } else {
- /* Original total update */
- /* we need to provide managedsait control so that referral entries can
- be replicated */
- ctrls = (LDAPControl **)slapi_ch_calloc (3, sizeof (LDAPControl *));
- ctrls[0] = create_managedsait_control ();
- ctrls[1] = create_backend_control(area_sdn);
-
- /* Time to make sure it exists a keep alive subentry for that replica */
- replica = (Replica*) object_get_data(prp->replica_object);
- if (replica)
- {
- rid = replica_get_rid(replica);
- }
- replica_subentry_check(area_sdn, rid);
-
- slapi_search_internal_set_pb (pb, slapi_sdn_get_dn (area_sdn),
- LDAP_SCOPE_SUBTREE, "(|(objectclass=ldapsubentry)(objectclass=nstombstone)(nsuniqueid=*))", NULL, 0, ctrls, NULL,
- repl_get_plugin_identity (PLUGIN_MULTIMASTER_REPLICATION), 0);
-
- cb_data.prp = prp;
- cb_data.rc = 0;
- cb_data.num_entries = 0UL;
- cb_data.sleep_on_busy = 0UL;
- cb_data.last_busy = current_time ();
- cb_data.flowcontrol_detection = 0;
- cb_data.lock = PR_NewLock();
-
- /* This allows during perform_operation to check the callback data
- * especially to do flow contol on delta send msgid / recv msgid
- */
- conn_set_tot_update_cb(prp->conn, (void *) &cb_data);
- }
-
/* Before we get started on sending entries to the replica, we need to
* setup things for async propagation:
* 1. Create a thread that will read the LDAP results from the connection.
@@ -547,7 +470,7 @@ retry:
slapi_search_internal_callback_pb (pb, &cb_data /* callback data */,
get_result /* result callback */,
send_entry /* entry callback */,
- NULL /* referral callback*/);
+ NULL /* referral callback*/);

/*
* After completing the sending operation (or optionally failing), we need to clean up
diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h
index 2d77a8a..9499292 100644
--- a/ldap/servers/slapd/back-ldbm/back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h
@@ -132,7 +132,7 @@ typedef unsigned short u_int16_t;
#define BDB_BACKEND "libback-ldbm" /* This backend plugin */
#define BDB_NEWIDL "newidl" /* new idl format */
#define BDB_RDNFORMAT "rdn-format" /* Subtree rename enabled */
-#define BDB_RDNFORMAT_VERSION "3" /* rdn-format version (by default, 0) */
+#define BDB_RDNFORMAT_VERSION "2" /* rdn-format version (by default, 0) */
#define BDB_DNFORMAT "dn-4514" /* DN format RFC 4514 compliant */
#define BDB_DNFORMAT_VERSION "1" /* DN format version */

@@ -808,11 +808,11 @@ typedef struct _back_search_result_set
/* #define LDBM_ENTRYRDN_OID "2.16.840.1.113730.3.1.2097" */

#define LDBM_ANCESTORID_STR "ancestorid"
-#define LDBM_ENTRYDN_STR SLAPI_ATTR_ENTRYDN
+#define LDBM_ENTRYDN_STR "entrydn"
#define LDBM_ENTRYRDN_STR "entryrdn"
#define LDBM_NUMSUBORDINATES_STR "numsubordinates"
#define LDBM_TOMBSTONE_NUMSUBORDINATES_STR "tombstonenumsubordinates"
-#define LDBM_PARENTID_STR SLAPI_ATTR_PARENTID
+#define LDBM_PARENTID_STR "parentid"

/* Name of psuedo attribute used to track default indexes */
#define LDBM_PSEUDO_ATTR_DEFAULT ".default"
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 9e74d9b..33506f4 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -7485,11 +7485,6 @@ ldbm_back_get_info(Slapi_Backend *be, int cmd, void **info)
}
break;
}
- case BACK_INFO_IS_ENTRYRDN:
- {
- *(int *)info = entryrdn_get_switch();
- break;
- }
default:
break;
}
diff --git a/ldap/servers/slapd/back-ldbm/filterindex.c b/ldap/servers/slapd/back-ldbm/filterindex.c
index 9a7e7be..9c14de4 100644
--- a/ldap/servers/slapd/back-ldbm/filterindex.c
+++ b/ldap/servers/slapd/back-ldbm/filterindex.c
@@ -552,7 +552,6 @@ range_candidates(
struct berval *low = NULL, *high = NULL;
struct berval **lows = NULL, **highs = NULL;
back_txn txn = {NULL};
- int operator = 0;

LDAPDebug(LDAP_DEBUG_TRACE, "=> range_candidates attr=%s\n", type, 0, 0);

@@ -579,21 +578,18 @@ range_candidates(
}
high = attr_value_lowest(highs, slapi_berval_cmp);
}
- if (entryrdn_get_switch() && !strcasecmp(type, LDBM_PARENTID_STR)) {
- /* parentid is treated specially that is needed for the bulk import. (See #48755) */
- operator = SLAPI_OP_RANGE_NO_IDL_SORT|SLAPI_OP_RANGE_NO_ALLIDS;
- }
+
if (low == NULL) {
- operator |= SLAPI_OP_LESS_OR_EQUAL;
- idl = index_range_read_ext(pb, be, type, (char*)indextype_EQUALITY, operator,
+ idl = index_range_read_ext(pb, be, type, (char*)indextype_EQUALITY,
+ SLAPI_OP_LESS_OR_EQUAL,
high, NULL, 0, &txn, err, allidslimit);
} else if (high == NULL) {
- operator |= SLAPI_OP_GREATER_OR_EQUAL;
- idl = index_range_read_ext(pb, be, type, (char*)indextype_EQUALITY, operator,
+ idl = index_range_read_ext(pb, be, type, (char*)indextype_EQUALITY,
+ SLAPI_OP_GREATER_OR_EQUAL,
low, NULL, 0, &txn, err, allidslimit);
} else {
- operator |= SLAPI_OP_LESS_OR_EQUAL;
- idl = index_range_read_ext(pb, be, type, (char*)indextype_EQUALITY, operator,
+ idl = index_range_read_ext(pb, be, type, (char*)indextype_EQUALITY,
+ SLAPI_OP_LESS_OR_EQUAL,
low, high, 1, &txn, err, allidslimit);
}

diff --git a/ldap/servers/slapd/back-ldbm/idl_new.c b/ldap/servers/slapd/back-ldbm/idl_new.c
index 6ca6c96..25b3bfa 100644
--- a/ldap/servers/slapd/back-ldbm/idl_new.c
+++ b/ldap/servers/slapd/back-ldbm/idl_new.c
@@ -350,31 +350,17 @@ error:
return idl;
}

-typedef struct _range_id_pair {
- ID key;
- ID id;
-} idl_range_id_pair;
/*
* Perform the range search in the idl layer instead of the index layer
* to improve the performance.
*/
-/*
- * NOTE:
- * In the total update (bulk import), an entry requires its ancestors already added.
- * To guarantee it, the range search with parentid is used with setting the flag
- * SLAPI_OP_RANGE_NO_IDL_SORT in operator.
- *
- * If the flag is set,
- * 1. the IDList is not sorted by the ID.
- * 2. holding to add an ID to the IDList unless the key is found in the IDList.
- */
IDList *
idl_new_range_fetch(
- backend *be,
- DB* db,
- DBT *lowerkey,
+ backend *be,
+ DB* db,
+ DBT *lowerkey,
DBT *upperkey,
- DB_TXN *txn,
+ DB_TXN *txn,
struct attrinfo *ai,
int *flag_err,
int allidslimit,
@@ -394,7 +380,7 @@ idl_new_range_fetch(
size_t count = 0;
#ifdef DB_USE_BULK_FETCH
/* beware that a large buffer on the stack might cause a stack overflow on some platforms */
- char buffer[BULK_FETCH_BUFFER_SIZE];
+ char buffer[BULK_FETCH_BUFFER_SIZE];
void *ptr;
DBT dataret;

No comments:

Post a Comment