a fix (Bug #2298: Trailing whitespace inconsistently handled in WHERE clause)

This commit is contained in:
ram@gw.mysql.r18.ru 2004-01-16 19:18:57 +04:00
parent 00a6a9c033
commit a0bbfbf4a3
2 changed files with 6 additions and 6 deletions

View File

@ -62,7 +62,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
end=pos+length; end=pos+length;
if (type != HA_KEYTYPE_NUM) if (type != HA_KEYTYPE_NUM)
{ {
while (end > pos && end[-1] == ' ') while (end > pos && (end[-1] == ' ' || end[-1] == '\t'))
end--; end--;
} }
else else
@ -186,7 +186,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
end=pos+length; end=pos+length;
if (type != HA_KEYTYPE_NUM) if (type != HA_KEYTYPE_NUM)
{ {
while (end > pos && end[-1] == ' ') while (end > pos && (end[-1] == ' ' || end[-1] == '\t'))
end--; end--;
} }
else else

View File

@ -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; uint length=(uint) (end-a), a_length=length, b_length=length;
if (!(nextflag & SEARCH_PREFIX)) 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--; a_length--;
while (b_length && b[b_length-1] == ' ') while (b_length && (b[b_length-1] == ' ' || b[b_length-1] == '\t'))
b_length--; b_length--;
} }
if (piks && if (piks &&
@ -849,9 +849,9 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a,
if (!(nextflag & (SEARCH_PREFIX | SEARCH_UPDATE))) 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--; a_length--;
while (b_length && b[b_length-1] == ' ') while (b_length && (b[b_length-1] == ' ' || b[b_length-1] == '\t'))
b_length--; b_length--;
} }
if (piks && if (piks &&