diff options
author | Alexander Barkov <bar@mysql.com> | 2009-10-15 15:17:32 +0500 |
---|---|---|
committer | Alexander Barkov <bar@mysql.com> | 2009-10-15 15:17:32 +0500 |
commit | 3929dddcd76130529cabfbd68cfff024e6b5c80d (patch) | |
tree | 7f2c2690a6c4b4439750de17315dbc10dec56617 /mysys/charset.c | |
parent | 4def52165d3724080793a752f244e56aea3aecc0 (diff) | |
download | mariadb-git-3929dddcd76130529cabfbd68cfff024e6b5c80d.tar.gz |
Backporting WL#4164 Two-byte collation IDs
Diffstat (limited to 'mysys/charset.c')
-rw-r--r-- | mysys/charset.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mysys/charset.c b/mysys/charset.c index 214ca170757..280b2ad6091 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -42,7 +42,7 @@ get_collation_number_internal(const char *name) { CHARSET_INFO **cs; for (cs= all_charsets; - cs < all_charsets+array_elements(all_charsets)-1 ; + cs < all_charsets + array_elements(all_charsets); cs++) { if ( cs[0] && cs[0]->name && @@ -387,7 +387,7 @@ char *get_charsets_dir(char *buf) DBUG_RETURN(res); } -CHARSET_INFO *all_charsets[256]={NULL}; +CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]={NULL}; CHARSET_INFO *default_charset_info = &my_charset_latin1; void add_compiled_collation(CHARSET_INFO *cs) @@ -429,7 +429,7 @@ static my_bool init_available_charsets(myf myflags) /* Copy compiled charsets */ for (cs=all_charsets; - cs < all_charsets+array_elements(all_charsets)-1 ; + cs < all_charsets + array_elements(all_charsets); cs++) { if (*cs) @@ -469,7 +469,7 @@ uint get_charset_number(const char *charset_name, uint cs_flags) init_available_charsets(MYF(0)); for (cs= all_charsets; - cs < all_charsets+array_elements(all_charsets)-1 ; + cs < all_charsets + array_elements(all_charsets); cs++) { if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) && @@ -543,7 +543,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags) (void) init_available_charsets(MYF(0)); /* If it isn't initialized */ - if (!cs_number || cs_number >= array_elements(all_charsets)-1) + if (!cs_number || cs_number > array_elements(all_charsets)) return NULL; cs=get_internal_charset(cs_number, flags); |