[Date Prev][Date Next]
(ITS#7793) mdb_cursor_put(,,,MDB_CURRENT) should ignore key
Full_Name: Hallvard B Furuseth
OS: Linux x86_64
Submission from: (NULL) (18.104.22.168)
Submitted by: hallvard
The doc for mdb_cursor_put:MDB_CURRENT says "The key parameter is
- 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.