Commit 384ae2ef authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Fixed that one can always get a name for a compiled characterset

parent e05bf277
...@@ -19777,6 +19777,10 @@ joins that don't use keys properly. ...@@ -19777,6 +19777,10 @@ joins that don't use keys properly.
@item @item
If @code{Threads_created} is big, you may want to increase the If @code{Threads_created} is big, you may want to increase the
@code{thread_cache_size} variable. @code{thread_cache_size} variable.
@item
If @code{Created_tmp_disk_tables} is big, you may want to increase the
@code{tmp_table_size} variable to get the temporary tables memory based
instead of disk based.
@end itemize @end itemize
...@@ -20411,6 +20415,7 @@ Create Table: CREATE TABLE t ( ...@@ -20411,6 +20415,7 @@ Create Table: CREATE TABLE t (
* Character arrays:: The character definition arrays * Character arrays:: The character definition arrays
* String collating:: String Collating Support * String collating:: String Collating Support
* Multi-byte characters:: Multi-byte Character Support * Multi-byte characters:: Multi-byte Character Support
* Problems with character sets::
@end menu @end menu
...@@ -20744,7 +20749,7 @@ the maximum ratio the strings may grow during @code{my_strxfrm_MYSET} (it ...@@ -20744,7 +20749,7 @@ the maximum ratio the strings may grow during @code{my_strxfrm_MYSET} (it
must be a positive integer). must be a positive integer).
@node Multi-byte characters, , String collating, Localization @node Multi-byte characters, Problems with character sets, String collating, Localization
@subsection Multi-byte Character Support @subsection Multi-byte Character Support
@cindex characters, multi-byte @cindex characters, multi-byte
...@@ -20763,6 +20768,41 @@ You must specify the @code{mbmaxlen_MYSET=N} value in the special ...@@ -20763,6 +20768,41 @@ You must specify the @code{mbmaxlen_MYSET=N} value in the special
comment at the top of the source file. @code{N} should be set to the comment at the top of the source file. @code{N} should be set to the
size in bytes of the largest character in the set. size in bytes of the largest character in the set.
@node Problems with character sets, , Multi-byte characters, Localization
@subsection Problems With Character Sets
If you try to use a character set that is not compiled into your binary,
you can run into a couple of different problems:
@itemize @bullet
@item
Your program has a wrong path to where the character sets are stored.
(Default @file{/usr/local/mysql/share/mysql/charsets}).
This can be fixed by using the @code{--character-sets-dir}
option to the program in question.
@item
The character set is a multi-byte-character set that can't be loaded
dynamicly. In this case you have to recompiled the program with the
support for the character set.
@item
The character set is a dynamic character set, but you don't have a
configure file for it. In this case you should install the configure
file for the character set from a new MySQL distribution.
@item
Your @file{Index} file doesn't contain the name for the character set.
@example
ERROR 1105: File '/usr/local/share/mysql/charsets/?.conf' not found
(Errcode: 2)
@end example
In this case you should either get a new @code{Index} file or add
by hand the name of any missing character sets.
@end itemize
For MyISAM tables, you can check the character set name and number for a
table with @code{myisamchk -dvv table_name}.
@node Server-Side Scripts, Client-Side Scripts, Localization, MySQL Database Administration @node Server-Side Scripts, Client-Side Scripts, Localization, MySQL Database Administration
@section MySQL Server-Side Scripts and Utilities @section MySQL Server-Side Scripts and Utilities
...@@ -39313,7 +39353,7 @@ likely it is that we can fix the problem! ...@@ -39313,7 +39353,7 @@ likely it is that we can fix the problem!
* C API function overview:: C API Function Overview * C API function overview:: C API Function Overview
* C API functions:: C API Function Descriptions * C API functions:: C API Function Descriptions
* C Thread functions:: C Thread Functions * C Thread functions:: C Thread Functions
* C Embedded Server functions:: C Embedded Server Functions * C Embedded Server functions:: C Embedded Server functions. C Embedded Server Functions
* C API problems:: Common questions and problems when using the C API * C API problems:: Common questions and problems when using the C API
* Building clients:: Building Client Programs * Building clients:: Building Client Programs
* Threaded clients:: How to Make a Threaded Client * Threaded clients:: How to Make a Threaded Client
...@@ -42014,9 +42054,9 @@ You need to use the following functions when you want to create a ...@@ -42014,9 +42054,9 @@ You need to use the following functions when you want to create a
threaded client. @xref{Threaded clients}. threaded client. @xref{Threaded clients}.
@menu @menu
* my_init():: @code{my_init()} * my_init():: @code{my_init()}
* mysql_thread_init():: @code{mysql_thread_init()} * mysql_thread_init():: @code{mysql_thread_init()}
* mysql_thread_end():: @code{mysql_thread_end()} * mysql_thread_end():: @code{mysql_thread_end()}
@end menu @end menu
@node my_init(), mysql_thread_init(), C Thread functions, C Thread functions @node my_init(), mysql_thread_init(), C Thread functions, C Thread functions
...@@ -42084,8 +42124,8 @@ possible to choose between using the embedded MySQL server and ...@@ -42084,8 +42124,8 @@ possible to choose between using the embedded MySQL server and
a stand-alone server without modifying any code. a stand-alone server without modifying any code.
@menu @menu
* mysql_server_init():: * mysql_server_init()::
* mysql_server_end():: * mysql_server_end()::
@end menu @end menu
@node mysql_server_init(), mysql_server_end(), C Embedded Server functions, C Embedded Server functions @node mysql_server_init(), mysql_server_end(), C Embedded Server functions, C Embedded Server functions
...@@ -42338,7 +42378,7 @@ For clients that use MySQL header files, you may need to specify a ...@@ -42338,7 +42378,7 @@ For clients that use MySQL header files, you may need to specify a
files. files.
@node Threaded clients, libmysqld , Building clients, C @node Threaded clients, libmysqld, Building clients, C
@subsection How to Make a Threaded Client @subsection How to Make a Threaded Client
@cindex clients, threaded @cindex clients, threaded
...@@ -42812,7 +42852,7 @@ clean: ...@@ -42812,7 +42852,7 @@ clean:
rm -f $(targets) $(objects) *.core rm -f $(targets) $(objects) *.core
@end example @end example
@node libmysqld licensing, , libmysqld example, libmysqld @node libmysqld licensing, , libmysqld example, libmysqld
@subsubsection Licensing the Embedded Server @subsubsection Licensing the Embedded Server
The MySQL source code is covered by the GNU GPL license The MySQL source code is covered by the GNU GPL license
...@@ -726,7 +726,7 @@ AC_MSG_CHECKING(for OpenSSL) ...@@ -726,7 +726,7 @@ AC_MSG_CHECKING(for OpenSSL)
openssl_includes="-I/usr/local/ssl/include" openssl_includes="-I/usr/local/ssl/include"
AC_DEFINE(HAVE_OPENSSL) AC_DEFINE(HAVE_OPENSSL)
else else
AC_MSG_RESULT("disabled because --with-vio wasn't used") AC_MSG_RESULT(disabled because --with-vio wasn not used)
fi fi
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
...@@ -748,15 +748,19 @@ dnl Call MYSQL_CHECK_ORBIT even if mysqlfs == no, so that @orbit_*@ ...@@ -748,15 +748,19 @@ dnl Call MYSQL_CHECK_ORBIT even if mysqlfs == no, so that @orbit_*@
dnl get substituted. dnl get substituted.
MYSQL_CHECK_ORBIT MYSQL_CHECK_ORBIT
AC_MSG_CHECKING(if we should build MySQLFS)
fs_dirs="" fs_dirs=""
if test "$mysqlfs" = "yes" if test "$mysqlfs" = "yes"
then then
if test -n "$orbit_exec_prefix" if test -n "$orbit_exec_prefix"
then then
fs_dirs=fs fs_dirs=fs
AC_MSG_RESULT([yes])
else else
AC_MSG_RESULT("disabled because ORBIT, the CORBA ORB, wasn't found"]) AC_MSG_RESULT(disabled because ORBIT, the CORBA ORB, was not found)
fi fi
else
AC_MSG_RESULT([no])
fi fi
AC_SUBST([fs_dirs]) AC_SUBST([fs_dirs])
]) ])
......
...@@ -57,6 +57,8 @@ extern CHARSET_INFO *default_charset_info; ...@@ -57,6 +57,8 @@ extern CHARSET_INFO *default_charset_info;
extern CHARSET_INFO *find_compiled_charset(uint cs_number); extern CHARSET_INFO *find_compiled_charset(uint cs_number);
extern CHARSET_INFO *find_compiled_charset_by_name(const char *name); extern CHARSET_INFO *find_compiled_charset_by_name(const char *name);
extern CHARSET_INFO compiled_charsets[]; extern CHARSET_INFO compiled_charsets[];
extern uint compiled_charset_number(const char *name);
extern const char *compiled_charset_name(uint charset_number);
#define MY_CHARSET_UNDEFINED 0 #define MY_CHARSET_UNDEFINED 0
#define MY_CHARSET_CURRENT (default_charset_info->number) #define MY_CHARSET_CURRENT (default_charset_info->number)
......
...@@ -44,13 +44,6 @@ struct simpleconfig_buf_st { ...@@ -44,13 +44,6 @@ struct simpleconfig_buf_st {
char *p; 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) static uint num_from_csname(CS_ID **cs, const char *name)
{ {
CS_ID **c; CS_ID **c;
...@@ -264,22 +257,22 @@ static my_bool read_charset_file(uint cs_number, CHARSET_INFO *set, ...@@ -264,22 +257,22 @@ static my_bool read_charset_file(uint cs_number, CHARSET_INFO *set,
uint get_charset_number(const char *charset_name) uint get_charset_number(const char *charset_name)
{ {
my_bool error; uint number=compiled_charset_number(charset_name);
error = init_available_charsets(MYF(0)); /* If it isn't initialized */ if (number)
if (error) return number;
return compiled_charset_number(charset_name); if (init_available_charsets(MYF(0))) /* If it isn't initialized */
else return 0;
return num_from_csname(available_charsets, charset_name); return num_from_csname(available_charsets, charset_name);
} }
const char *get_charset_name(uint charset_number) const char *get_charset_name(uint charset_number)
{ {
my_bool error; char *name=compiled_charset_name(charset_number);
error = init_available_charsets(MYF(0)); /* If it isn't initialized */ if (*name != '?')
if (error) return name;
return compiled_charset_name(charset_number); if (init_available_charsets(MYF(0))) /* If it isn't initialized */
else return "?";
return name_from_csnum(available_charsets, charset_number); return name_from_csnum(available_charsets, charset_number);
} }
...@@ -293,8 +286,8 @@ static CHARSET_INFO *find_charset(CHARSET_INFO **table, uint cs_number, ...@@ -293,8 +286,8 @@ static CHARSET_INFO *find_charset(CHARSET_INFO **table, uint cs_number,
return NULL; return NULL;
} }
static CHARSET_INFO *find_charset_by_name(CHARSET_INFO **table, const char *name, static CHARSET_INFO *find_charset_by_name(CHARSET_INFO **table,
size_t tablesz) const char *name, size_t tablesz)
{ {
uint i; uint i;
for (i = 0; i < tablesz; ++i) for (i = 0; i < tablesz; ++i)
......
...@@ -474,7 +474,7 @@ int main(int argc,char **argv) ...@@ -474,7 +474,7 @@ int main(int argc,char **argv)
MY_INIT(argv[0]); MY_INIT(argv[0]);
start_value=1060872L; best_t1=7930739L; best_t2=4311642L; best_type=3; /* mode=5333 add=6 type: 0 */ start_value=1109118L; best_t1=6657025L; best_t2=6114496L; best_type=1; /* mode=4903 add=3 type: 0 */
if (get_options(argc,(char **) argv)) if (get_options(argc,(char **) argv))
exit(1); exit(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment