Skip to content

Commit

Permalink
Fix short key not fill up all space (#1183)
Browse files Browse the repository at this point in the history
  • Loading branch information
lichaoyong authored and imay committed May 22, 2019
1 parent 5e245e0 commit d42409c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions be/src/olap/field.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ inline int Field::index_cmp(char* left, char* right) const {
// Only the fixed length of prefix index should be compared.
// If r_slice->size > l_slice->size, igonre the extra parts directly.
res = strncmp(l_slice->data, r_slice->data, compare_size);
if (res == 0 && compare_size != (_index_size - OLAP_STRING_MAX_BYTES)) {
if (l_slice->size < r_slice->size) {
res = -1;
} else if (l_slice->size > r_slice->size) {
res = 1;
} else {
res = 0;
}
}
} else {
res = l_slice->compare(*r_slice);
}
Expand Down

0 comments on commit d42409c

Please sign in to comment.