diff options
author | unknown <monty@hundin.mysql.fi> | 2001-09-28 07:28:05 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-09-28 07:28:05 +0300 |
commit | b89ecd1e5d579bcb85399eb0c1700c52b85bc576 (patch) | |
tree | 5cdccafdfa54f95c7cc040d8d171312a572c5e9c /mysys | |
parent | 4b046921f78783f67c9daacf5dfdb245a7f6e6ea (diff) | |
parent | 52d7293d7403b23e2f724f5044d498940b9ec59c (diff) | |
download | mariadb-git-b89ecd1e5d579bcb85399eb0c1700c52b85bc576.tar.gz |
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
acinclude.m4:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Docs/manual.texi:
Auto merged
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/charset.c | 35 | ||||
-rw-r--r-- | mysys/typelib.c | 3 |
2 files changed, 16 insertions, 22 deletions
diff --git a/mysys/charset.c b/mysys/charset.c index f778afb4144..1bbf7e58c77 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -44,13 +44,6 @@ struct simpleconfig_buf_st { char *p; }; -/* Defined in strings/ctype.c */ - -CHARSET_INFO *find_compiled_charset(uint cs_number); -uint compiled_charset_number(const char *name); -const char *compiled_charset_name(uint charset_number); - - static uint num_from_csname(CS_ID **cs, const char *name) { CS_ID **c; @@ -264,22 +257,22 @@ static my_bool read_charset_file(uint cs_number, CHARSET_INFO *set, uint get_charset_number(const char *charset_name) { - my_bool error; - error = init_available_charsets(MYF(0)); /* If it isn't initialized */ - if (error) - return compiled_charset_number(charset_name); - else - return num_from_csname(available_charsets, charset_name); + uint number=compiled_charset_number(charset_name); + if (number) + return number; + if (init_available_charsets(MYF(0))) /* If it isn't initialized */ + return 0; + return num_from_csname(available_charsets, charset_name); } const char *get_charset_name(uint charset_number) { - my_bool error; - error = init_available_charsets(MYF(0)); /* If it isn't initialized */ - if (error) - return compiled_charset_name(charset_number); - else - return name_from_csnum(available_charsets, charset_number); + char *name=compiled_charset_name(charset_number); + if (*name != '?') + return name; + if (init_available_charsets(MYF(0))) /* If it isn't initialized */ + return "?"; + return name_from_csnum(available_charsets, charset_number); } @@ -293,8 +286,8 @@ static CHARSET_INFO *find_charset(CHARSET_INFO **table, uint cs_number, return NULL; } -static CHARSET_INFO *find_charset_by_name(CHARSET_INFO **table, const char *name, - size_t tablesz) +static CHARSET_INFO *find_charset_by_name(CHARSET_INFO **table, + const char *name, size_t tablesz) { uint i; for (i = 0; i < tablesz; ++i) diff --git a/mysys/typelib.c b/mysys/typelib.c index b18959442ae..f4b638e047e 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -84,7 +84,8 @@ int find_type(my_string x, TYPELIB *typelib, uint full_name) /* Get name of type nr 'nr' */ /* Warning first type is 1, 0 = empty field */ -void make_type(register my_string to, register uint nr, register TYPELIB *typelib) +void make_type(register my_string to, register uint nr, + register TYPELIB *typelib) { DBUG_ENTER("make_type"); if (!nr) |