diff options
author | unknown <bar@bar.mysql.r18.ru> | 2002-10-25 13:58:32 +0500 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2002-10-25 13:58:32 +0500 |
commit | e8237515485b53bd0662e5fc5592bea5507594b8 (patch) | |
tree | d8d121f81f5cf89edfe070e49636482fd879f1fa /sql/sql_string.cc | |
parent | 372b26e7786dcc812bc5fd2e8541d8c58201ea5b (diff) | |
download | mariadb-git-e8237515485b53bd0662e5fc5592bea5507594b8.tar.gz |
BINARY charset is now used instead of binary_flag
Diffstat (limited to 'sql/sql_string.cc')
-rw-r--r-- | sql/sql_string.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sql/sql_string.cc b/sql/sql_string.cc index d2d14d4e7a2..457e555463d 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -521,12 +521,23 @@ int sortcmp(const String *x,const String *y) #endif /* USE_STRCOLL */ x_len-=len; // For easy end space test y_len-=len; - while (len--) + if (x->str_charset->sort_order) { - if (x->str_charset->sort_order[(uchar) *s++] != + while (len--) + { + if (x->str_charset->sort_order[(uchar) *s++] != x->str_charset->sort_order[(uchar) *t++]) - return ((int) x->str_charset->sort_order[(uchar) s[-1]] - - (int) x->str_charset->sort_order[(uchar) t[-1]]); + return ((int) x->str_charset->sort_order[(uchar) s[-1]] - + (int) x->str_charset->sort_order[(uchar) t[-1]]); + } + } + else + { + while (len--) + { + if (*s++ != *t++) + return ((int) s[-1] - (int) t[-1]); + } } #ifndef CMP_ENDSPACE /* Don't compare end space in strings */ |