liuis / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Cannot Get a record right away after putting it #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
leveldb::Slice key = sequence.substr(start,length);
string value, value1;

leveldb::Status s = (*db)->Put(leveldb::WriteOptions(), key, value);
leveldb::Status s1 = (*db)->Get(leveldb::ReadOptions(), key, &value1);

s1.IsNotFound() is always true. Why cannot Get the record back from the db?

Original issue reported on code.google.com by WanPing....@gmail.com on 2 Dec 2011 at 11:09

GoogleCodeExporter commented 9 years ago
This type of functionality is well tested, so my suspicion is that there is 
some bad interaction with the rest of your test.  Do you have a full test 
program that demonstrates the problem?

Did you check whether or not "s" is OK (i.e., that the write operation did not 
encounter an error).

Original comment by san...@google.com on 16 Oct 2012 at 11:38

GoogleCodeExporter commented 9 years ago

Original comment by dgrogan@chromium.org on 29 May 2013 at 2:31