]> git.sur5r.net Git - openldap/commitdiff
ITS#7743 Fix indexed AND filter
authorHoward Chu <hyc@openldap.org>
Tue, 12 Nov 2013 05:01:33 +0000 (21:01 -0800)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 12 Nov 2013 16:35:07 +0000 (08:35 -0800)
Partially revert 47f6aec61e65afd66bea096887f1cd550b55946e
Was using RANGE_FIRST/RANGE_LAST on an IDL known to *not* be a range.

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

index af52079d198d921a9ec16a006fe0589e1fc3cadd..d135335dbeab4613ef3bff31a9320ebc83977c3e 100644 (file)
@@ -1089,8 +1089,8 @@ bdb_idl_intersection(
         * turn it into a range.
         */
        if ( BDB_IDL_IS_RANGE( b )
-               && BDB_IDL_RANGE_FIRST( b ) <= BDB_IDL_RANGE_FIRST( a )
-               && BDB_IDL_RANGE_LAST( b ) >= BDB_IDL_RANGE_LAST( a ) ) {
+               && 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;
index a606488337f12beec28df06ee22c4665775f3d5f..b3affa2afb7787cb159e69eb26e19ffe0cabb8f8 100644 (file)
@@ -62,6 +62,7 @@
 #define BDB_IDL_ALL( bdb, ids ) BDB_IDL_RANGE( ids, 1, ((bdb)->bi_lastid) )
 
 #define BDB_IDL_FIRST( ids )   ( (ids)[1] )
+#define BDB_IDL_LLAST( ids )   ( (ids)[(ids)[0]] )
 #define BDB_IDL_LAST( ids )            ( BDB_IDL_IS_RANGE(ids) \
        ? (ids)[2] : (ids)[(ids)[0]] )
 
index 9260d2be9adb590d38d1df093abab423c0eb7d46..e435491e45426eb51a3276abdaeaa98861689cc9 100644 (file)
@@ -715,8 +715,8 @@ mdb_idl_intersection(
         * turn it into a range.
         */
        if ( MDB_IDL_IS_RANGE( b )
-               && MDB_IDL_RANGE_FIRST( b ) <= MDB_IDL_RANGE_FIRST( a )
-               && MDB_IDL_RANGE_LAST( b ) >= MDB_IDL_RANGE_LAST( a ) ) {
+               && 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;
index 8ce742a8c1b2bfe7f355c33feb5e5ab25f61c409..bc0dd41d762f8998c88b4c04d3f28253bb3dd9aa 100644 (file)
@@ -62,6 +62,7 @@
 #define MDB_IDL_ALL( ids ) MDB_IDL_RANGE( ids, 1, NOID )
 
 #define MDB_IDL_FIRST( ids )   ( (ids)[1] )
+#define MDB_IDL_LLAST( ids )   ( (ids)[(ids)[0]] )
 #define MDB_IDL_LAST( ids )            ( MDB_IDL_IS_RANGE(ids) \
        ? (ids)[2] : (ids)[(ids)[0]] )