Issue 7793 - mdb_cursor_put(,,,MDB_CURRENT) should ignore key
Summary: mdb_cursor_put(,,,MDB_CURRENT) should ignore key
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-28 02:04 UTC by Hallvard Furuseth
Modified: 2014-12-11 01:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Hallvard Furuseth 2014-01-28 02:04:59 UTC
Full_Name: Hallvard B Furuseth
Version: LMDB_0.9.11
OS: Linux x86_64
URL: ftp://ftp.openldap.org/incoming/Hallvard-Furuseth-140128.c
Submission from: (NULL) (81.191.45.35)
Submitted by: hallvard


The doc for mdb_cursor_put:MDB_CURRENT says "The key parameter is
ignored".  However:

- key==NULL gives EINVAL after a thinko in the assert cleanup.
  5bda3565a9bfaa6cd54053faeafcc06da15bc00c moved assert(key) from
  mdb_cursor_set() to the wrong place in the one relevant caller.

- A huge key.mv_size triggers mdb_page_spill().

- If data.mv_size==0, the record's key instead of data is
  modified (so you can modify e.g. key:"foo" to key:"bar").
  I expect the test should be (mc->mc_flags & C_SUB).

  Changing that has a side effect on a non-MDB_CURRENT case:
  With a cmp function like strncasecmp, changing "KEY" to "key"
  currently works with if old datasize = new datasize = 0.
  After this it won't, as with non-empty data of the same size.

Test program enclosed.
Comment 1 Hallvard Furuseth 2014-01-28 05:29:13 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 2 Hallvard Furuseth 2014-04-01 22:22:52 UTC
changed notes
Comment 3 OpenLDAP project 2014-08-01 21:04:50 UTC
fixed in mdb.master: doc was wrong
Comment 4 Quanah Gibson-Mount 2014-12-11 01:07:23 UTC
changed state Test to Closed