Commit 27db1288 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 ec030bda
...@@ -1425,12 +1425,14 @@ int tokudb_cmp_dbt_data(DB *file, const DBT *keya, const DBT *keyb) { ...@@ -1425,12 +1425,14 @@ int tokudb_cmp_dbt_data(DB *file, const DBT *keya, const DBT *keyb) {
// so just use a default comparison function // so just use a default comparison function
// //
if (file->descriptor->size - row_desc_offset == 0) { if (file->descriptor->size - row_desc_offset == 0) {
return memcmp( int num_bytes_cmp = keya->size < keyb->size ?
keya->data, keya->size : keyb->size;
keyb->data, cmp = memcmp(keya->data,keyb->data,num_bytes_cmp);
(keya->size < keyb->size) ? keya->size : keyb->size if (cmp == 0 && (keya->size != keyb->size)) {
); cmp = keya->size < keyb->size ? 1 : -1;
}
} }
else {
cmp = tokudb_compare_two_keys( cmp = tokudb_compare_two_keys(
keya->data, keya->data,
keya->size, keya->size,
...@@ -1440,6 +1442,7 @@ int tokudb_cmp_dbt_data(DB *file, const DBT *keya, const DBT *keyb) { ...@@ -1440,6 +1442,7 @@ int tokudb_cmp_dbt_data(DB *file, const DBT *keya, const DBT *keyb) {
file->descriptor->size - row_desc_offset, file->descriptor->size - row_desc_offset,
false false
); );
}
return cmp; 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