From d269703322ad3c3e2a840d73db6dca534fcac902 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 15 Sep 2005 03:49:52 +0000 Subject: [PATCH] Yet another idl_merge fix (test032 failure) --- servers/slapd/back-bdb/idl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; -- 2.39.5