Commit 0da8aea8 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Zardosht found what looks like the bug. This might fix the two regressions. Addresses #788, #789.

git-svn-id: file:///svn/tokudb@3973 c7de825b-a66e-492c-adef-691d508d4ae1
parent adc26fd7
......@@ -1437,6 +1437,10 @@ static int brt_leaf_put_cmd (BRT t, BRTNODE node, BRT_CMD cmd,
int compare_both = should_compare_both_keys(node, cmd);
struct cmd_leafval_bessel_extra be = {t, cmd, compare_both};
//static int counter=0;
//counter++;
//printf("counter=%d\n", counter);
switch (cmd->type) {
case BRT_INSERT:
......@@ -2403,6 +2407,7 @@ int toku_brt_delete(BRT brt, DBT *key, TOKUTXN txn) {
}
int toku_brt_delete_both(BRT brt, DBT *key, DBT *val, TOKUTXN txn) {
//{ unsigned i; printf("del %p keylen=%d key={", brt->db, key->size); for(i=0; i<key->size; i++) printf("%d,", ((char*)key->data)[i]); printf("} datalen=%d data={", val->size); for(i=0; i<val->size; i++) printf("%d,", ((char*)val->data)[i]); printf("}\n"); }
int r;
if (txn) {
BYTESTRING keybs = {key->size, toku_memdup(key->data, key->size)};
......@@ -2614,8 +2619,8 @@ int pair_leafval_bessel_le_committed (u_int32_t klen, void *kval,
search->k ? toku_fill_dbt(&x, kval, klen) : 0,
search->v ? toku_fill_dbt(&y, dval, dlen) : 0);
switch (search->direction) {
case BRT_SEARCH_LEFT: return cmp==0 ? -1 : +1;
case BRT_SEARCH_RIGHT: return cmp==0 ? +1 : -1; // Because the comparison runs backwards for right searches.
case BRT_SEARCH_LEFT: return cmp<0 ? -1 : +1;
case BRT_SEARCH_RIGHT: return cmp>0 ? -1 : +1; // Because the comparison runs backwards for right searches.
}
assert(0);
return 0;
......
......@@ -1936,7 +1936,10 @@ static int locked_c_pget(DBC * c, DBT *key, DBT *pkey, DBT *data, u_int32_t flag
}
static int locked_c_get(DBC * c, DBT * key, DBT * data, u_int32_t flag) {
toku_ydb_lock(); int r = toku_c_get(c, key, data, flag); toku_ydb_unlock(); return r;
//{ unsigned int i; printf("cget flags=%d keylen=%d key={", flag, key->size); for(i=0; i<key->size; i++) printf("%d,", ((char*)key->data)[i]); printf("} datalen=%d data={", data->size); for(i=0; i<data->size; i++) printf("%d,", ((char*)data->data)[i]); printf("}\n"); }
toku_ydb_lock(); int r = toku_c_get(c, key, data, flag); toku_ydb_unlock();
//{ unsigned int i; printf("cgot r=%d keylen=%d key={", r, key->size); for(i=0; i<key->size; i++) printf("%d,", ((char*)key->data)[i]); printf("} datalen=%d data={", data->size); for(i=0; i<data->size; i++) printf("%d,", ((char*)data->data)[i]); printf("}\n"); }
return r;
}
static int locked_c_close(DBC * c) {
......@@ -2730,6 +2733,7 @@ static int locked_db_open(DB *db, DB_TXN *txn, const char *fname, const char *db
static inline int autotxn_db_put(DB* db, DB_TXN* txn, DBT* key, DBT* data,
u_int32_t flags) {
//{ unsigned i; printf("put %p keylen=%d key={", db, key->size); for(i=0; i<key->size; i++) printf("%d,", ((char*)key->data)[i]); printf("} datalen=%d data={", data->size); for(i=0; i<data->size; i++) printf("%d,", ((char*)data->data)[i]); printf("}\n"); }
BOOL changed; int r;
r = toku_db_construct_autotxn(db, &txn, &changed, FALSE);
if (r!=0) 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