Full_Name: Hallvard B Furuseth Version: mdb.master bbb27cde4af7 OS: URL: Submission from: (NULL) (193.69.163.163) Submitted by: hallvard
mdb_cursor_put() and mdb_cursor_del() sometimes tests the flags argument with '==' or '!=' instead of '&'. That breaks flag combinations like MDB_CURRENT | MDB_RESERVE:
grep -n 'flags [!=]= MDB_' mdb.c 4884: if (flags != MDB_CURRENT && (key->mv_size == 0 || key->mv_size > MDB_MAXKEYSIZE)) 4900: if (flags == MDB_CURRENT) { 4962: if (flags == MDB_CURRENT) { 4977: if (flags == MDB_CURRENT) 4992: return (flags == MDB_NODUPDATA) ? MDB_KEYEXIST : MDB_SUCCESS; 5025: if (flags == MDB_CURRENT) { 5274: if (flags != MDB_NODUPDATA) {
The mdb_cursor_del() test is not a problem yet since only one flag is valid, but it'll become broken if more flags get supported.