Commit 26f8d91e authored by Yoni Fogel's avatar Yoni Fogel

DB->set_flags is now additive.

Closes #165

git-svn-id: file:///svn/tokudb@1083 c7de825b-a66e-492c-adef-691d508d4ae1
parent e3aaec8e
...@@ -1293,12 +1293,20 @@ static int toku_db_set_dup_compare(DB *db, int (*dup_compare)(DB *, const DBT *, ...@@ -1293,12 +1293,20 @@ static int toku_db_set_dup_compare(DB *db, int (*dup_compare)(DB *, const DBT *,
} }
static int toku_db_set_flags(DB * db, u_int32_t flags) { static int toku_db_set_flags(DB * db, u_int32_t flags) {
u_int32_t tflags = 0; u_int32_t tflags;
if (flags & DB_DUP) int r = toku_brt_get_flags(db->i->brt, &tflags);
tflags += TOKU_DB_DUP; if (r!=0) return r;
if (flags & DB_DUPSORT)
tflags += TOKU_DB_DUPSORT; if (flags & DB_DUP) {
int r= toku_brt_set_flags(db->i->brt, tflags); tflags |= TOKU_DB_DUP;
flags &= ~DB_DUP;
}
if (flags & DB_DUPSORT) {
tflags |= TOKU_DB_DUPSORT;
flags &= ~DB_DUPSORT;
}
if (flags != 0) return EINVAL;
r = toku_brt_set_flags(db->i->brt, tflags);
return r; return r;
} }
......
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