From 2ff0016df35be813d335178cab2df0c99e6cbeff Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Jan 2004 19:18:57 +0400 Subject: a fix (Bug #2298: Trailing whitespace inconsistently handled in WHERE clause) --- myisam/mi_key.c | 4 ++-- myisam/mi_search.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'myisam') diff --git a/myisam/mi_key.c b/myisam/mi_key.c index 766ecf334b6..58318697e57 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -62,7 +62,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, end=pos+length; if (type != HA_KEYTYPE_NUM) { - while (end > pos && end[-1] == ' ') + while (end > pos && (end[-1] == ' ' || end[-1] == '\t')) end--; } else @@ -186,7 +186,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, end=pos+length; if (type != HA_KEYTYPE_NUM) { - while (end > pos && end[-1] == ' ') + while (end > pos && (end[-1] == ' ' || end[-1] == '\t')) end--; } else diff --git a/myisam/mi_search.c b/myisam/mi_search.c index c6ee18a8477..82004c6f172 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -795,9 +795,9 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, uint length=(uint) (end-a), a_length=length, b_length=length; if (!(nextflag & SEARCH_PREFIX)) { - while (a_length && a[a_length-1] == ' ') + while (a_length && (a[a_length-1] == ' ' || a[a_length-1] == '\t')) a_length--; - while (b_length && b[b_length-1] == ' ') + while (b_length && (b[b_length-1] == ' ' || b[b_length-1] == '\t')) b_length--; } if (piks && @@ -849,9 +849,9 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, if (!(nextflag & (SEARCH_PREFIX | SEARCH_UPDATE))) { - while (a_length && a[a_length-1] == ' ') + while (a_length && (a[a_length-1] == ' ' || a[a_length-1] == '\t')) a_length--; - while (b_length && b[b_length-1] == ' ') + while (b_length && (b[b_length-1] == ' ' || b[b_length-1] == '\t')) b_length--; } if (piks && -- cgit v1.2.1