Don't rely on the documentation a lot. This is generated by doxygen for a specific version. With 0.9.11 and current master, you cannot pass a NULL key to mdb_cursor_put(). So you really need to store the curkey somewhere and re-use it.