Commit 8783de7c authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Turn on -O2 again

git-svn-id: file:///svn/tokudb@851 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4c053495
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
LIBNAME=libdb LIBNAME=libdb
# OPTFLAGS = -O2 OPTFLAGS = -O2
CFLAGS = -W -Wall -Werror -g -fPIC $(OPTFLAGS) CFLAGS = -W -Wall -Werror -g -fPIC $(OPTFLAGS)
CPPFLAGS = -I../include -I../newbrt CPPFLAGS = -I../include -I../newbrt
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
......
...@@ -616,21 +616,37 @@ static int toku_db_del(DB * db, DB_TXN * txn, DBT * key, u_int32_t flags) { ...@@ -616,21 +616,37 @@ static int toku_db_del(DB * db, DB_TXN * txn, DBT * key, u_int32_t flags) {
return r; return r;
} }
static int toku_db_get(DB * db, DB_TXN * txn __attribute__ ((unused)), DBT * key, DBT * data, u_int32_t flags) { static int toku_db_get(DB * db, DB_TXN * txn, DBT * key, DBT * data, u_int32_t flags) {
assert(flags == 0); assert(flags == 0);
int r; int r;
unsigned int brtflags; unsigned int brtflags;
DBT primary_key;
DBT *sdata;
DB *primary = db->i->primary;
int is_secondary = primary!=0;
if (is_secondary) {
memset(&primary_key, 0, sizeof(primary_key));
sdata=&primary_key;
} else {
sdata=data;
}
toku_brt_get_flags(db->i->brt, &brtflags); toku_brt_get_flags(db->i->brt, &brtflags);
if (brtflags & TOKU_DB_DUPSORT) { if (brtflags & TOKU_DB_DUPSORT) {
DBC *dbc; DBC *dbc;
r = db->cursor(db, txn, &dbc, 0); r = db->cursor(db, txn, &dbc, 0);
if (r == 0) { if (r == 0) {
r = dbc->c_get(dbc, key, data, DB_SET); r = dbc->c_get(dbc, key, sdata, DB_SET);
dbc->c_close(dbc); dbc->c_close(dbc);
} }
} else } else
r = toku_brt_lookup(db->i->brt, key, data); r = toku_brt_lookup(db->i->brt, key, sdata);
if (r!=0) return r;
if (is_secondary) {
// Time to do a get on the primary
return primary->get(primary, txn, &primary_key, data, 0);
} else {
return r; return r;
}
} }
static int toku_db_key_range(DB * db, DB_TXN * txn, DBT * dbt, DB_KEY_RANGE * kr, u_int32_t flags) { static int toku_db_key_range(DB * db, DB_TXN * txn, DBT * dbt, DB_KEY_RANGE * kr, u_int32_t flags) {
......
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