Commit 4d9f0110 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Do some extra checks. Addresses #162.

git-svn-id: file:///svn/tokudb@1071 c7de825b-a66e-492c-adef-691d508d4ae1
parent 678e59f2
...@@ -198,8 +198,14 @@ static void insert_person (void) { ...@@ -198,8 +198,14 @@ static void insert_person (void) {
int r=do_put("dbp", dbp, &key, &data); CKERR(r); int r=do_put("dbp", dbp, &key, &data); CKERR(r);
// If the cursor is to the left of the current item, then increment count_items // If the cursor is to the left of the current item, then increment count_items
{ {
int compare=strcmp((char*)namearray, nc_key.data); int compare=strcmp(namearray, nc_key.data);
// Verify that the first byte matches the strcmp function.
if (compare<0) assert(namearray[0]< ((char*)nc_key.data)[0]);
if (compare==0) assert(namearray[0]== ((char*)nc_key.data)[0]);
if (compare>0) assert(namearray[0]> ((char*)nc_key.data)[0]);
//printf("%s:%d compare=%d insert %s, cursor at %s\n", __FILE__, __LINE__, compare, namearray, (char*)nc_key.data); //printf("%s:%d compare=%d insert %s, cursor at %s\n", __FILE__, __LINE__, compare, namearray, (char*)nc_key.data);
// Update the counters
if (compare>0) calc_n_items++; if (compare>0) calc_n_items++;
count_all_items++; count_all_items++;
} }
......
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