[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: LMBD - If passing NULL to data parameter is legal in mdb_cursor_get()



Kaho Ng wrote:
Hi,

When reading the documentation of lmdb, I wonder if the behavior in regards
to passing NULL as data parameter to mdb_cursor_get() is subject to changes.

No. Unless there's an obvious bug, or the documentation specifically says "subject to change", existing behavior will not change.

When reading the source code of the library, I found that for some of the
operations, if NULL is passed as data parameter EINVAL will be returned, and
for the other operations passing will lead to different behavior
(for instance, MDB_SET).

I am not sure if the behavior of future versions of lmdb will stay in
line with the
current version. Or is it generally illegal to pass NULL as data parameter?

Could you give me some hints on that?  Thank you.

Ask yourself why you would ever pass NULL in each case and what that would mean. This is basic logic.

--
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/