diff options
author | unknown <serg@serg.mylan> | 2004-01-15 16:31:27 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-01-15 16:31:27 +0100 |
commit | ae4b94598c08747fcb75480ebe7ab2681f38bde6 (patch) | |
tree | cbfd9c9f41af1345b736db36fc74e2e18e474d26 /myisam | |
parent | 3640f7e11b629c4e0e0b47dd270b120d4dcd2377 (diff) | |
download | mariadb-git-ae4b94598c08747fcb75480ebe7ab2681f38bde6.tar.gz |
an obvious bug in _mi_key_cmp fixed (BUG#2295 - range on blobs)
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_search.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/myisam/mi_search.c b/myisam/mi_search.c index 5d0750f6a82..c6ee18a8477 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -840,9 +840,11 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, break; case HA_KEYTYPE_VARTEXT: { - int a_length,b_length,pack_length; + int a_length,full_a_length,b_length,full_b_length,pack_length; get_key_length(a_length,a); get_key_pack_length(b_length,pack_length,b); + full_a_length=a_length; + full_b_length=b_length; next_key_length=key_length-b_length-pack_length; if (!(nextflag & (SEARCH_PREFIX | SEARCH_UPDATE))) @@ -857,8 +859,8 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, (my_bool) ((nextflag & SEARCH_PREFIX) && next_key_length <= 0)))) return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); - a+=a_length; - b+=b_length; + a+=full_a_length; + b+=full_b_length; break; } break; @@ -963,7 +965,7 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, if (keyseg->flag & HA_REVERSE_SORT) { - swap(uchar*,a,b); + swap(uchar*,a,b); swap_flag=1; /* Remember swap of a & b */ end= a+ (int) (end-b); } |