diff options
author | unknown <monty@hundin.mysql.fi> | 2001-09-28 07:21:24 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-09-28 07:21:24 +0300 |
commit | cf350ce984ac75ef27d5750af2a11cc9704af7e9 (patch) | |
tree | 22593a2eb7d844740398f5321b2808d6657f5bca | |
parent | 05794bca08a0a6107233536c2198b9ba4772a3c5 (diff) | |
download | mariadb-git-cf350ce984ac75ef27d5750af2a11cc9704af7e9.tar.gz |
Fixed that one can always get a name for a compiled characterset
Docs/manual.texi:
Added section "Problems with character sets"
acinclude.m4:
Fixed typos
include/m_ctype.h:
Made some declarations global
sql/gen_lex_hash.cc:
Smaller array
-rw-r--r-- | Docs/manual.texi | 58 | ||||
-rw-r--r-- | acinclude.m4 | 8 | ||||
-rw-r--r-- | include/m_ctype.h | 2 | ||||
-rw-r--r-- | mysys/charset.c | 35 | ||||
-rw-r--r-- | sql/gen_lex_hash.cc | 2 |
5 files changed, 72 insertions, 33 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index b1815b4eac9..5f1e4480005 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -19777,6 +19777,10 @@ joins that don't use keys properly. @item If @code{Threads_created} is big, you may want to increase the @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 @@ -20411,6 +20415,7 @@ Create Table: CREATE TABLE t ( * Character arrays:: The character definition arrays * String collating:: String Collating Support * Multi-byte characters:: Multi-byte Character Support +* Problems with character sets:: @end menu @@ -20744,7 +20749,7 @@ the maximum ratio the strings may grow during @code{my_strxfrm_MYSET} (it 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 @cindex characters, multi-byte @@ -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 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 @section MySQL Server-Side Scripts and Utilities @@ -39313,7 +39353,7 @@ likely it is that we can fix the problem! * C API function overview:: C API Function Overview * C API functions:: C API Function Descriptions * 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 * Building clients:: Building Client Programs * 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 threaded client. @xref{Threaded clients}. @menu -* my_init():: @code{my_init()} -* mysql_thread_init():: @code{mysql_thread_init()} -* mysql_thread_end():: @code{mysql_thread_end()} +* my_init():: @code{my_init()} +* mysql_thread_init():: @code{mysql_thread_init()} +* mysql_thread_end():: @code{mysql_thread_end()} @end menu @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 a stand-alone server without modifying any code. @menu -* mysql_server_init():: -* mysql_server_end():: +* mysql_server_init():: +* mysql_server_end():: @end menu @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 files. -@node Threaded clients, libmysqld , Building clients, C +@node Threaded clients, libmysqld, Building clients, C @subsection How to Make a Threaded Client @cindex clients, threaded @@ -42812,7 +42852,7 @@ clean: rm -f $(targets) $(objects) *.core @end example -@node libmysqld licensing, , libmysqld example, libmysqld +@node libmysqld licensing, , libmysqld example, libmysqld @subsubsection Licensing the Embedded Server The MySQL source code is covered by the GNU GPL license diff --git a/acinclude.m4 b/acinclude.m4 index 8a7413b9b08..260e9b127b9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -726,7 +726,7 @@ AC_MSG_CHECKING(for OpenSSL) openssl_includes="-I/usr/local/ssl/include" AC_DEFINE(HAVE_OPENSSL) else - AC_MSG_RESULT("disabled because --with-vio wasn't used") + AC_MSG_RESULT(disabled because --with-vio wasn not used) fi else AC_MSG_RESULT(no) @@ -748,15 +748,19 @@ dnl Call MYSQL_CHECK_ORBIT even if mysqlfs == no, so that @orbit_*@ dnl get substituted. MYSQL_CHECK_ORBIT + AC_MSG_CHECKING(if we should build MySQLFS) fs_dirs="" if test "$mysqlfs" = "yes" then if test -n "$orbit_exec_prefix" then fs_dirs=fs + AC_MSG_RESULT([yes]) 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 + else + AC_MSG_RESULT([no]) fi AC_SUBST([fs_dirs]) ]) diff --git a/include/m_ctype.h b/include/m_ctype.h index b41323e10b9..86a67541d73 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -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_by_name(const char *name); 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_CURRENT (default_charset_info->number) 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/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc index 6530e5dd4cf..2358dde7b6d 100644 --- a/sql/gen_lex_hash.cc +++ b/sql/gen_lex_hash.cc @@ -474,7 +474,7 @@ int main(int argc,char **argv) 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)) exit(1); |