https://bugs.openldap.org/show_bug.cgi?id=10245
Issue ID: 10245 Summary: mdb_env_set_maxdbs signature appears incorrect Product: LMDB Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: liblmdb Assignee: bugs@openldap.org Reporter: bchik@meta.com Target Milestone: ---
The current signature for mdb_env_set_maxdbs: int mdb_env_set_maxdbs(MDB_env *env, MDB_dbi dbs);
The documentation says the second parameter is intended to be the maximum number of databases, however, the parameter is typed as a DB handle. This appears to work because MDB_dbi is typedef'd to an unsigned int.
I believe the intended signature would be: int mdb_env_set_maxdbs(MDB_env *env, unsigned int dbs);
https://bugs.openldap.org/show_bug.cgi?id=10245
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Howard Chu hyc@openldap.org --- Works as designed.
https://bugs.openldap.org/show_bug.cgi?id=10245
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED Keywords|needs_review |
https://bugs.openldap.org/show_bug.cgi?id=10245
bchik@meta.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FEEDBACK
--- Comment #2 from bchik@meta.com --- Could you please elaborate? I'm having a hard time making sense of this.
The purpose of mdb_env_set_maxdbs says: @brief Set the maximum number of named databases for the environment.
The argument says: @param[in] dbs The maximum number of databases
...so based on these, I would expect the dbs parameter to be a number. But it's currently MDB_dbi, and that type says: /** @brief A handle for an individual database in the DB environment. */ typedef unsigned int MDB_dbi;
It doesn't make sense to me that we would be passing in a handle to a database to a method that says it's taking the number of databases.
https://bugs.openldap.org/show_bug.cgi?id=10245
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|FEEDBACK |INVALID
--- Comment #3 from Howard Chu hyc@openldap.org --- An MDB_dbi *is* just a number. Just like a Unix file descriptor is just a number.