Commit 2ff0016d authored by unknown's avatar unknown

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

parent d894ca49
......@@ -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
......
......@@ -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 &&
......
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