Commit 9d22160c authored by Yoni Fogel's avatar Yoni Fogel

addresses #554

while investigating 554, came across this issue of not checking for proper value
This MAY fix 554, but we doubt it.

git-svn-id: file:///svn/tokudb@2953 c7de825b-a66e-492c-adef-691d508d4ae1
parent e4604aac
...@@ -108,13 +108,13 @@ void toku_lth_delete(toku_lth* lth, toku_lock_tree* key) { ...@@ -108,13 +108,13 @@ void toku_lth_delete(toku_lth* lth, toku_lock_tree* key) {
toku_lth_elt* prev = head; toku_lth_elt* prev = head;
toku_lth_elt* current = prev->next_in_bucket; toku_lth_elt* current = prev->next_in_bucket;
while (current != head) { while (current != NULL) {
if (current->value.hash_key == key) break; if (current->value.hash_key == key) break;
prev = current; prev = current;
current = current->next_in_bucket; current = current->next_in_bucket;
} }
/* Must be found. */ /* Must be found. */
assert(current != head); assert(current);
current->prev_in_iteration->next_in_iteration = current->next_in_iteration; current->prev_in_iteration->next_in_iteration = current->next_in_iteration;
current->next_in_iteration->prev_in_iteration = current->prev_in_iteration; current->next_in_iteration->prev_in_iteration = current->prev_in_iteration;
prev->next_in_bucket = current->next_in_bucket; prev->next_in_bucket = current->next_in_bucket;
......
...@@ -108,13 +108,13 @@ void toku_rth_delete(toku_rth* rth, DB_TXN* key) { ...@@ -108,13 +108,13 @@ void toku_rth_delete(toku_rth* rth, DB_TXN* key) {
toku_rth_elt* prev = head; toku_rth_elt* prev = head;
toku_rth_elt* current = prev->next_in_bucket; toku_rth_elt* current = prev->next_in_bucket;
while (current != head) { while (current != NULL) {
if (current->value.hash_key == key) break; if (current->value.hash_key == key) break;
prev = current; prev = current;
current = current->next_in_bucket; current = current->next_in_bucket;
} }
/* Must be found. */ /* Must be found. */
assert(current != head); assert(current);
current->prev_in_iteration->next_in_iteration = current->next_in_iteration; current->prev_in_iteration->next_in_iteration = current->next_in_iteration;
current->next_in_iteration->prev_in_iteration = current->prev_in_iteration; current->next_in_iteration->prev_in_iteration = current->prev_in_iteration;
prev->next_in_bucket = current->next_in_bucket; prev->next_in_bucket = current->next_in_bucket;
......
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