Commit 4813db5f authored by Yoni Fogel's avatar Yoni Fogel

Addresses #889

Leaf boundary test now checks left to right and right to left.

git-svn-id: file:///svn/tokudb@4401 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2941d12e
......@@ -65,13 +65,28 @@ void doit (BOOL committed_provdels) {
r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
r = db->cursor(db, txn, &dbc, 0); CKERR(r);
}
i=2*num_insert;
j=(i<<1)+37;
r=db->put(db, txn, dbt_init(&key, &i, sizeof(i)), dbt_init(&data, &j, sizeof(j)), DB_YESOVERWRITE);
int ifirst, ilast, jfirst, jlast;
ilast=2*num_insert;
jlast=(ilast<<1)+37;
ifirst=-1*num_insert;
jfirst=(ifirst<<1)+37;
r=db->put(db, txn, dbt_init(&key, &ifirst, sizeof(ifirst)), dbt_init(&data, &jfirst, sizeof(jfirst)), DB_YESOVERWRITE);
CKERR(r);
r=db->put(db, txn, dbt_init(&key, &ilast, sizeof(ilast)), dbt_init(&data, &jlast, sizeof(jlast)), DB_YESOVERWRITE);
CKERR(r);
r = dbc->c_get(dbc, dbt_init(&key, NULL, 0), dbt_init(&data, NULL, 0), DB_FIRST); CKERR(r);
assert(*(int*)key.data == i);
assert(*(int*)data.data == j);
assert(*(int*)key.data == ifirst);
assert(*(int*)data.data == jfirst);
r = dbc->c_get(dbc, dbt_init(&key, NULL, 0), dbt_init(&data, NULL, 0), DB_NEXT); CKERR(r);
assert(*(int*)key.data == ilast);
assert(*(int*)data.data == jlast);
r = dbc->c_get(dbc, dbt_init(&key, NULL, 0), dbt_init(&data, NULL, 0), DB_LAST); CKERR(r);
assert(*(int*)key.data == ilast);
assert(*(int*)data.data == jlast);
r = dbc->c_get(dbc, dbt_init(&key, NULL, 0), dbt_init(&data, NULL, 0), DB_PREV); CKERR(r);
assert(*(int*)key.data == ifirst);
assert(*(int*)data.data == jfirst);
r = dbc->c_close(dbc); CKERR(r);
r=txn->commit(txn, 0); CKERR(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