summaryrefslogtreecommitdiff
path: root/sql/sql_string.cc
diff options
context:
space:
mode:
authorram@gw.mysql.r18.ru <>2004-01-22 18:05:47 +0400
committerram@gw.mysql.r18.ru <>2004-01-22 18:05:47 +0400
commite515d7018f05b0f007f8d672ec58e87b6433e569 (patch)
treee54fe0db01fe767dff386d9f648bc7f6557511f8 /sql/sql_string.cc
parenta0bbfbf4a35cc3b11f98adf294fedb70f26aa741 (diff)
downloadmariadb-git-e515d7018f05b0f007f8d672ec58e87b6433e569.tar.gz
a proper fix for the bug #2298 Trailing whitespace inconsistently handled in WHERE clause.
<monty> ramil, in MySQL/MyISAM we should only strip end space, not 'space-like' characters. <monty> This is according to SQL; When doing a comparision end space and only end space are ignored.
Diffstat (limited to 'sql/sql_string.cc')
-rw-r--r--sql/sql_string.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 2dcda2d40c2..658cd6d2411 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -467,9 +467,9 @@ int sortcmp(const String *x,const String *y)
if (use_strcoll(default_charset_info))
{
#ifndef CMP_ENDSPACE
- while (x_len && isspace(s[x_len-1]))
+ while (x_len && s[x_len-1] == ' ')
x_len--;
- while (y_len && isspace(t[y_len-1]))
+ while (y_len && t[y_len-1] == ' ')
y_len--;
#endif
return my_strnncoll(default_charset_info,
@@ -493,14 +493,14 @@ int sortcmp(const String *x,const String *y)
{
const char *end=t+y_len;
for (; t != end ; t++)
- if (!isspace(*t))
+ if (*t != ' ')
return -1;
}
else
{
const char *end=s+x_len;
for (; s != end ; s++)
- if (!isspace(*s))
+ if (*s != ' ')
return 1;
}
return 0;