Commit 69a98e17 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2056], fix bug

git-svn-id: file:///svn/mysql/tokudb-engine/src@14855 c7de825b-a66e-492c-adef-691d508d4ae1
parent 83c42a9b
......@@ -1425,21 +1425,24 @@ int tokudb_cmp_dbt_data(DB *file, const DBT *keya, const DBT *keyb) {
// so just use a default comparison function
//
if (file->descriptor->size - row_desc_offset == 0) {
return memcmp(
int num_bytes_cmp = keya->size < keyb->size ?
keya->size : keyb->size;
cmp = memcmp(keya->data,keyb->data,num_bytes_cmp);
if (cmp == 0 && (keya->size != keyb->size)) {
cmp = keya->size < keyb->size ? 1 : -1;
}
}
else {
cmp = tokudb_compare_two_keys(
keya->data,
keyb->data,
(keya->size < keyb->size) ? keya->size : keyb->size
keya->size,
keyb->data,
keyb->size,
(uchar *)file->descriptor->data + row_desc_offset,
file->descriptor->size - row_desc_offset,
false
);
}
cmp = tokudb_compare_two_keys(
keya->data,
keya->size,
keyb->data,
keyb->size,
(uchar *)file->descriptor->data + row_desc_offset,
file->descriptor->size - row_desc_offset,
false
);
return cmp;
}
......
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