From: Howard Chu Date: Thu, 15 Sep 2005 03:49:52 +0000 (+0000) Subject: Yet another idl_merge fix (test032 failure) X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~421 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d269703322ad3c3e2a840d73db6dca534fcac902;p=openldap Yet another idl_merge fix (test032 failure) --- diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 161c926d98..9f44d1083f 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -1263,11 +1263,11 @@ int bdb_idl_merge( ID *a, ID *b ) if ( BDB_IDL_IS_RANGE( a ) || BDB_IDL_IS_RANGE(b) || a[0] + b[0] >= BDB_IDL_UM_MAX ) { - ida = IDL_MIN( a[1], b[1] ); - idb = IDL_MAX( BDB_IDL_LAST(a), BDB_IDL_LAST(b) ); + ida = BDB_IDL_LAST( a ); + idb = BDB_IDL_LAST( b ); + a[2] = IDL_MAX( ida, idb ); + a[1] = IDL_MIN( a[1], b[1] ); a[0] = NOID; - a[1] = ida; - a[2] = idb; return 0; } @@ -1280,6 +1280,8 @@ int bdb_idl_merge( ID *a, ID *b ) if ( b[cursorb] > a[cursora] ) { a[cursorc] = b[cursorb]; cursorb--; + if ( !cursorb ) + break; } else { if ( cursora == cursorc ) break;