making cursors sticky is difficult. need the stateless cursor implementation. addresses #259

git-svn-id: file:///svn/tokudb@1604 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Rich Prohaska 2008-01-11 16:24:43 +00:00
parent d3239fc444
commit 4b52108a21

View file

@ -862,11 +862,11 @@ static int toku_c_get_next_dup(DBC *c, DBT *key, DBT *data) {
if (r != 0) goto finish;
r = toku_c_get_noassociate(c, &nkey, &nval, DB_NEXT);
if (r != 0) {
int rr = toku_c_get_noassociate(c, &nkey, &nval, DB_LAST); assert(rr == 0); /* sticky */
int rr = toku_c_get_noassociate(c, &nkey, &nval, DB_LAST); if (0) assert(rr == 0); /* sticky */
goto finish;
}
if (!keyeq(c, &currentkey, &nkey)) {
int rr = toku_c_get_noassociate(c, &nkey, &nval, DB_PREV); assert(rr == 0); /* sticky */
int rr = toku_c_get_noassociate(c, &nkey, &nval, DB_PREV); if (0) assert(rr == 0); /* sticky */
r = DB_NOTFOUND;
goto finish;
}
@ -891,11 +891,11 @@ static int toku_c_get_prev_dup(DBC *c, DBT *key, DBT *data) {
if (r != 0) goto finish;
r = toku_c_get_noassociate(c, &nkey, &nval, DB_PREV);
if (r != 0) {
int rr = toku_c_get_noassociate(c, &nkey, &nval, DB_FIRST); assert(rr == 0); /* sticky */
int rr = toku_c_get_noassociate(c, &nkey, &nval, DB_FIRST); if (0) assert(rr == 0); /* sticky */
goto finish;
}
if (!keyeq(c, &currentkey, &nkey)) {
int rr = toku_c_get_noassociate(c, &nkey, &nval, DB_NEXT); assert(rr == 0); /* sticky */
int rr = toku_c_get_noassociate(c, &nkey, &nval, DB_NEXT); if (0) assert(rr == 0); /* sticky */
r = DB_NOTFOUND;
goto finish;
}