diff options
author | unknown <monty@bitch.mysql.fi> | 2001-09-28 07:28:06 +0300 |
---|---|---|
committer | unknown <monty@bitch.mysql.fi> | 2001-09-28 07:28:06 +0300 |
commit | 97743792973f4d289b4185ad68f7ee08fafa7613 (patch) | |
tree | b2d055b0ac8e0e31f775a7284722f0be4875cdb5 /mysys | |
parent | 1608dbbb2ff7a184dbb9d2768564f21ca08d7873 (diff) | |
parent | c21867da8c98c6245383eab4f37862f3adc2c626 (diff) | |
download | mariadb-git-97743792973f4d289b4185ad68f7ee08fafa7613.tar.gz |
Merge hundin:/my/mysql-4.0 into bitch.mysql.fi:/my/mysql-4.0
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/charset.c | 35 | ||||
-rw-r--r-- | mysys/my_open.c | 5 | ||||
-rw-r--r-- | mysys/typelib.c | 3 |
3 files changed, 18 insertions, 25 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/my_open.c b/mysys/my_open.c index 2ed1af1eca1..748113528a1 100644 --- a/mysys/my_open.c +++ b/mysys/my_open.c @@ -75,8 +75,8 @@ int my_close(File fd, myf MyFlags) pthread_mutex_destroy(&my_file_info[fd].mutex); #endif my_file_info[fd].type = UNOPEN; - my_file_opened--; } + my_file_opened--; pthread_mutex_unlock(&THR_LOCK_open); DBUG_RETURN(err); } /* my_close */ @@ -96,9 +96,8 @@ File my_register_filename(File fd, const char *FileName, enum file_type my_error(EE_OUT_OF_FILERESOURCES, MYF(ME_BELL+ME_WAITTANG), FileName, my_errno); return(-1); -#else - thread_safe_increment(my_file_opened,&THR_LOCK_open); #endif + thread_safe_increment(my_file_opened,&THR_LOCK_open); return(fd); /* safeguard */ } pthread_mutex_lock(&THR_LOCK_open); 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) |