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
No related merge requests found
......@@ -1425,12 +1425,14 @@ 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(
keya->data,
keyb->data,
(keya->size < keyb->size) ? keya->size : keyb->size
);
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,
keya->size,
......@@ -1440,6 +1442,7 @@ int tokudb_cmp_dbt_data(DB *file, const DBT *keya, const DBT *keyb) {
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