summaryrefslogtreecommitdiff
path: root/strings/ctype-cp932.c
diff options
context:
space:
mode:
authorunknown <bar@bar.myoffice.izhnet.ru>2007-07-05 14:55:02 +0500
committerunknown <bar@bar.myoffice.izhnet.ru>2007-07-05 14:55:02 +0500
commitb15bd3086e6385f7d057d5db4766844734dcf30f (patch)
treedc73de2776d7878fbe04c30bffc7bf30f3fb4481 /strings/ctype-cp932.c
parent32bdbc6d853a2e1615bcae7e9bd7044a3ae934fc (diff)
parent3b1fefbf14c40feea638b210a40ad88b078fd628 (diff)
downloadmariadb-git-b15bd3086e6385f7d057d5db4766844734dcf30f.tar.gz
Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b29333
into mysql.com:/home/bar/mysql-work/mysql-5.0-rpl
Diffstat (limited to 'strings/ctype-cp932.c')
-rw-r--r--strings/ctype-cp932.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index 0ece0ef1270..42325648037 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -250,9 +250,16 @@ static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)),
const uchar *a_end= a + a_length;
const uchar *b_end= b + b_length;
int res= my_strnncoll_cp932_internal(cs, &a, a_length, &b, b_length);
+
+#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
+ diff_if_only_endspace_difference= 0;
+#endif
+
if (!res && (a != a_end || b != b_end))
{
- int swap= 0;
+ int swap= 1;
+ if (diff_if_only_endspace_difference)
+ res= 1; /* Assume 'a' is bigger */
/*
Check the next not space character of the longer key. If it's < ' ',
then it's smaller than the other key.
@@ -263,11 +270,12 @@ static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)),
a_end= b_end;
a= b;
swap= -1; /* swap sign of result */
+ res= -res;
}
for (; a < a_end ; a++)
{
- if (*a != ' ')
- return ((int) *a - (int) ' ') ^ swap;
+ if (*a != (uchar) ' ')
+ return (*a < (uchar) ' ') ? -swap : swap;
}
}
return res;