diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-03-04 18:01:59 +0400 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-03-04 18:01:59 +0400 |
commit | 3cbb978d51ce694c941671f8bc4efd673d80e4e0 (patch) | |
tree | ec01d4c8c14546cc3ecf4ff069124834d4ee8959 /sql/sql_analyse.cc | |
parent | 9dfa4eb60af7661e613f900d620de15d29bce54b (diff) | |
download | mariadb-git-3cbb978d51ce694c941671f8bc4efd673d80e4e0.tar.gz |
stringcmp() and sortcmp() have been unified
into the only one sortcmp() with additional
CHARSET_INFO *cmp_charset argument.
Diffstat (limited to 'sql/sql_analyse.cc')
-rw-r--r-- | sql/sql_analyse.cc | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 9e9d7a08925..36464126ae5 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -41,13 +41,13 @@ int sortcmp2(void* cmp_arg __attribute__((unused)), const String *a,const String *b) { - return sortcmp(a,b); + return sortcmp(a,b,a->charset()); } int stringcmp2(void* cmp_arg __attribute__((unused)), const String *a,const String *b) { - return stringcmp(a,b); + return sortcmp(a,b,&my_charset_bin); } int compare_double2(void* cmp_arg __attribute__((unused)), @@ -329,20 +329,10 @@ void field_str::add() if (length > max_length) max_length = length; - if (item->binary()) - { - if (stringcmp(res, &min_arg) < 0) - min_arg.copy(*res); - if (stringcmp(res, &max_arg) > 0) - max_arg.copy(*res); - } - else - { - if (sortcmp(res, &min_arg) < 0) - min_arg.copy(*res); - if (sortcmp(res, &max_arg) > 0) - max_arg.copy(*res); - } + if (sortcmp(res, &min_arg,item->charset()) < 0) + min_arg.copy(*res); + if (sortcmp(res, &max_arg,item->charset()) > 0) + max_arg.copy(*res); } if (room_in_tree) |