diff options
author | bar@bar.mysql.r18.ru <> | 2003-03-04 18:01:59 +0400 |
---|---|---|
committer | bar@bar.mysql.r18.ru <> | 2003-03-04 18:01:59 +0400 |
commit | f95eb82934bf21a1f8d3aafba2ea2dde42014e38 (patch) | |
tree | ec01d4c8c14546cc3ecf4ff069124834d4ee8959 /sql/sql_analyse.cc | |
parent | 143c85057eb5cac447d653b291b622ef49ead9b5 (diff) | |
download | mariadb-git-f95eb82934bf21a1f8d3aafba2ea2dde42014e38.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) |