From e3a6cec03dc033fc859c3bb61aaadb64bbcb4fe9 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 22 Jun 2018 00:30:33 +0100 Subject: [PATCH] ITS#8868 don't convert IDL to range needlessly in idl_intersection. It may lose precision in a subsequent union. --- servers/slapd/back-bdb/idl.c | 9 +-------- servers/slapd/back-mdb/idl.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 3e0d7a6b12..685f0fc666 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -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; } diff --git a/servers/slapd/back-mdb/idl.c b/servers/slapd/back-mdb/idl.c index 3455fe2d60..b297ec8a13 100644 --- a/servers/slapd/back-mdb/idl.c +++ b/servers/slapd/back-mdb/idl.c @@ -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; } -- 2.39.2