Commit dc869b68 authored by Yoni Fogel's avatar Yoni Fogel

Closes #241

DB->get on a secondary with flag DB_GET_BOTH will now return EINVAL
instead of crashing on an assert.

Also revamped test_db_get_put_flags to test this, and made all tests run on both
BDB and tokudb

git-svn-id: file:///svn/tokudb@1502 c7de825b-a66e-492c-adef-691d508d4ae1
parent f54d6515
This diff is collapsed.
......@@ -1206,7 +1206,8 @@ static int toku_db_get (DB * db, DB_TXN * txn, DBT * key, DBT * data, u_int32_t
if (db->i->primary==0) r = toku_db_get_noassociate(db, txn, key, data, flags);
else {
// It's a get on a secondary.
assert(flags == 0); // We aren't ready to handle flags such as DB_GET_BOTH or DB_READ_COMMITTED or DB_READ_UNCOMMITTED or DB_RMW
if (flags == DB_GET_BOTH) return EINVAL;
assert(flags == 0); // We aren't ready to handle flags such as DB_READ_COMMITTED or DB_READ_UNCOMMITTED or DB_RMW
DBT primary_key;
memset(&primary_key, 0, sizeof(primary_key));
r = db->pget(db, txn, key, &primary_key, data, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment