[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7644) inverted MDB_SET_RANGE desired



vissermc@gmail.com wrote:
> Full_Name: Michiel Visser
> Version: 2.4.35
> OS: Linux
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (88.159.211.22)
>
>
> Feature request:
> MDB_SET_RANGE is an important option for me (I'm implementing a generic triple
> store on top of MDB). But I also desire some additions:
> 1) let's call it MDB_SET_RANGE_INV: find key equal of smaller. In theory I could
> also apply an inverted compare function, but this makes it counter-intuitive
> ('bigger' actually implying 'smaller'). And I understand I can also use
> SET_RANGE, followed by a cursor-previous-traversal, but it would require extra
> logic to check whether the key is already equal, which brings me to my second
> point:

Extra logic will be required anyway, whether inside liblmdb or in your 
application. In this case I don't see value in making the library bigger to 
handle this.

> 2) a way to see whether the returned key is equal (to the supplied key), to
> avoid another call to get/cursor_get, or avoid a manual key compare.

The mdb_cursor_get() function signature is what it is, there's nowhere to 
return any other parameters. How would you propose to indicate this to the caller?

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/