[Date Prev][Date Next]
- To: OpenLDAP Devel <email@example.com>
- Subject: mdb_cursor_del
- From: David Barbour <firstname.lastname@example.org>
- Date: Wed, 4 Feb 2015 17:31:48 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=vRP/uVZzXvJvI5AxTq4sUTf8WAT2MMKyffBbyvCYnx0=; b=B0EjamnIe3hgCL2IhxrF8nxNe/x3RHmHnUNPYPwayGSp7i0AR70s8I2gp8fijgUDMo gGz6gEkiQNwHqdWHsRDHFgyCieM5UJUiOlsGPBjgOMj1pRJ77sp54ybYE/NZvsbYf2Dv +Vb0mEc9Q3MoXi1dHCrrynBm+I5zf7205BkIA5CuSQNMTk+VxGTDEeUZnaK+LSmQu7g0 rGxHbz25ra4VUhT0fb5za95hgTm2R+d3lpvaWxxAt8y6hytTPR9PVXW4kICkY91yeUhL Ipm9CLnOe02AqRIWdA/p6MgLQZD0GRBZ9dXQstUseaIg27cxTq4Y3c2JOZHTi34z1+vC idTw==
The documentation for the `mdb_cursor_del` function doesn't indicate what happens to the state of the cursor after the targeted object is deleted.
This makes it difficult to reason about, for example, the task of scanning through the database and deleting keys or values according to some criterion.
What does MDB_NEXT mean on a cursor after deletion? Will it return the next element, or should I use MDB_GET_CURRENT for the next element? Or will these operations return in error, and I should use MDB_SET_RANGE with the deleted key?
Similarly, what happens to every other cursor pointing to the same key? I see you have some code that touches them, but no documentation to tell the user's what is happening.
This needs to be documented. Iterator invalidation is painful in C++ where it is thoroughly documented. When it's reduced to guesswork or testing without a clear indication of intended behavior, it's worse.