Skip to content

Calling put(MDB_txn, std::string, std::string) is not doing what is expected. #32

Open
@JeromeA

Description

@JeromeA

Describe the bug
put(MDB_txn, std::string, std::string) is storing the binary representation of the std::string objects, when a C++ user would expect it to be the C++ friendly version of put(MDB_txn, const char*, const char*). This is made worse by the existence of lmdb::cursor::get(std::string& key, std::string& value) which is indeed C++ friendly.

To reproduce
std::string key = "mykey";
std::string value = "myvalue";
dbi.put(wtxn, key, value);

Expected behavior
It should insert the strings contained in the std::string objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions