diff options
author | bar@mysql.com <> | 2005-10-20 11:12:34 +0500 |
---|---|---|
committer | bar@mysql.com <> | 2005-10-20 11:12:34 +0500 |
commit | 6c258beb2d5d5f8c226f12ac38767b7934622e0d (patch) | |
tree | 2aa03882d1e2394198bacc0cbeb3bcb7ce8ba3aa /mysys/charset.c | |
parent | 2c90e2f7a6e40fdcd5399c3825f9e2da7e105fda (diff) | |
parent | af3d8bd4ad218e7f668a92b0d506b66a19313c9d (diff) | |
download | mariadb-git-6c258beb2d5d5f8c226f12ac38767b7934622e0d.tar.gz |
Merge mysql.com:/usr/home/bar/mysql-4.1
into mysql.com:/usr/home/bar/mysql-5.0
Diffstat (limited to 'mysys/charset.c')
-rw-r--r-- | mysys/charset.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/mysys/charset.c b/mysys/charset.c index e61d08cbc33..64b15fab0c2 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -38,6 +38,22 @@ my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2) } +static uint +get_collation_number_internal(const char *name) +{ + CHARSET_INFO **cs; + for (cs= all_charsets; + cs < all_charsets+array_elements(all_charsets)-1 ; + cs++) + { + if ( cs[0] && cs[0]->name && + !my_strcasecmp(&my_charset_latin1, cs[0]->name, name)) + return cs[0]->number; + } + return 0; +} + + static my_bool init_state_maps(CHARSET_INFO *cs) { uint i; @@ -189,7 +205,8 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs) static int add_collation(CHARSET_INFO *cs) { - if (cs->name && (cs->number || (cs->number=get_collation_number(cs->name)))) + if (cs->name && (cs->number || + (cs->number=get_collation_number_internal(cs->name)))) { if (!all_charsets[cs->number]) { @@ -419,18 +436,8 @@ void free_charsets(void) uint get_collation_number(const char *name) { - CHARSET_INFO **cs; init_available_charsets(MYF(0)); - - for (cs= all_charsets; - cs < all_charsets+array_elements(all_charsets)-1 ; - cs++) - { - if ( cs[0] && cs[0]->name && - !my_strcasecmp(&my_charset_latin1, cs[0]->name, name)) - return cs[0]->number; - } - return 0; /* this mimics find_type() */ + return get_collation_number_internal(name); } |