]> git.sur5r.net Git - openldap/commitdiff
ITS#8868 don't convert IDL to range needlessly
authorHoward Chu <hyc@openldap.org>
Thu, 21 Jun 2018 23:30:33 +0000 (00:30 +0100)
committerHoward Chu <hyc@openldap.org>
Thu, 21 Jun 2018 23:31:04 +0000 (00:31 +0100)
in idl_intersection. It may lose precision in a subsequent union.

servers/slapd/back-bdb/idl.c
servers/slapd/back-mdb/idl.c

index c8901431b24cead55a204752c5e52536ba433e8d..fec46e68051cd487a01df7ceb2f504f9a5b04428 100644 (file)
@@ -1085,18 +1085,11 @@ bdb_idl_intersection(
        }
 
        /* If a range completely covers the list, the result is
-        * just the list. If idmin to idmax is contiguous, just
-        * turn it into a range.
+        * just the list.
         */
        if ( BDB_IDL_IS_RANGE( b )
                && BDB_IDL_RANGE_FIRST( b ) <= BDB_IDL_FIRST( a )
                && BDB_IDL_RANGE_LAST( b ) >= BDB_IDL_LLAST( a ) ) {
-               if (idmax - idmin + 1 == a[0])
-               {
-                       a[0] = NOID;
-                       a[1] = idmin;
-                       a[2] = idmax;
-               }
                goto done;
        }
 
index 3455fe2d60a2c9ea085ab11cc8bd61c60a37ab86..b297ec8a13cb9c2eb0eac0e7bac489466aa89cba 100644 (file)
@@ -711,18 +711,11 @@ mdb_idl_intersection(
        }
 
        /* If a range completely covers the list, the result is
-        * just the list. If idmin to idmax is contiguous, just
-        * turn it into a range.
+        * just the list.
         */
        if ( MDB_IDL_IS_RANGE( b )
                && MDB_IDL_RANGE_FIRST( b ) <= MDB_IDL_FIRST( a )
                && MDB_IDL_RANGE_LAST( b ) >= MDB_IDL_LLAST( a ) ) {
-               if (idmax - idmin + 1 == a[0])
-               {
-                       a[0] = NOID;
-                       a[1] = idmin;
-                       a[2] = idmax;
-               }
                goto done;
        }