From 9cfc6d90d43cfff2041ad05a31e6b70bdbcf269b Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 25 Nov 2015 15:09:54 +0000
Subject: [PATCH] Fix referrals not being returned by a search

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2URI.java |    2 +-
 opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/JEStorage.java    |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/JEStorage.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/JEStorage.java
index 30e4cc7..6194069 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/JEStorage.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/JEStorage.java
@@ -228,6 +228,10 @@
         {
           return false;
         }
+        else if (index == 0)
+        {
+          return true;
+        }
 
         // equivalent to READ_UNCOMMITTED
         long skipped = cursor.skipNext(index, dbKey, dbValue, null);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2URI.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2URI.java
index 5b98702..b3e43f4 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2URI.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2URI.java
@@ -625,7 +625,7 @@
     {
       // Initialize the cursor very close to the starting value then
       // step forward until we pass the ending value.
-      boolean success = cursor.positionToKey(suffix);
+      boolean success = cursor.positionToKeyOrNext(suffix);
       while (success && cursor.getKey().compareTo(end) < 0)
       {
         // We have found a subordinate referral.

--
Gitblit v1.10.0