Commit 11548574 authored by Vincenzo Liberatore's avatar Vincenzo Liberatore

Addresses #293

Addresses #307
Write lock tests. Bug fix on borderwrite check. 

git-svn-id: file:///svn/tokudb@2078 c7de825b-a66e-492c-adef-691d508d4ae1
parent d1e31549
...@@ -824,12 +824,10 @@ static int __toku_lt_borderwrite_insert(toku_lock_tree* tree, ...@@ -824,12 +824,10 @@ static int __toku_lt_borderwrite_insert(toku_lock_tree* tree,
int r; int r;
toku_range_tree* borderwrite = tree->borderwrite; assert(borderwrite); toku_range_tree* borderwrite = tree->borderwrite; assert(borderwrite);
const u_int32_t query_size = 1; const u_int32_t query_size = 1;
toku_range buffer[query_size];
u_int32_t buflen = query_size;
toku_range* buf = &buffer[0];
u_int32_t numfound; u_int32_t numfound;
r = toku_rt_find(borderwrite, query, query_size, &buf, &buflen, &numfound); r = toku_rt_find(borderwrite, query, query_size, &tree->buf, &tree->buflen,
&numfound);
if (r!=0) return __toku_lt_panic(tree); if (r!=0) return __toku_lt_panic(tree);
assert(numfound <= query_size); assert(numfound <= query_size);
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <errno.h> #include <errno.h>
int verbose=0; int verbose=0;
BOOL want_panic = FALSE;
int toku_keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2len) { int toku_keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2len) {
int comparelen = key1len<key2len ? key1len : key2len; int comparelen = key1len<key2len ? key1len : key2len;
const unsigned char *k1; const unsigned char *k1;
...@@ -41,6 +43,7 @@ BOOL panicked = FALSE; ...@@ -41,6 +43,7 @@ BOOL panicked = FALSE;
int dbpanic(DB* db) { int dbpanic(DB* db) {
if (verbose) printf("AHH!!!! Run away %p!!!\n", db); if (verbose) printf("AHH!!!! Run away %p!!!\n", db);
panicked = TRUE; panicked = TRUE;
assert(want_panic);
return EINVAL; return EINVAL;
} }
......
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