diff options
-rw-r--r-- | BitKeeper/etc/logging_ok | 1 | ||||
-rw-r--r-- | client/mysql.cc | 2 | ||||
-rw-r--r-- | client/mysqlcheck.c | 2 | ||||
-rw-r--r-- | client/mysqldump.c | 2 | ||||
-rw-r--r-- | client/mysqlimport.c | 2 | ||||
-rw-r--r-- | client/sql_string.h | 4 | ||||
-rw-r--r-- | heap/hp_test1.c | 2 | ||||
-rw-r--r-- | heap/hp_test2.c | 11 | ||||
-rw-r--r-- | include/my_sys.h | 2 | ||||
-rw-r--r-- | isam/isamchk.c | 2 | ||||
-rw-r--r-- | mysys/charset.c | 37 | ||||
-rw-r--r-- | mysys/charset2html.c | 5 | ||||
-rw-r--r-- | mysys/test_charset.c | 5 | ||||
-rw-r--r-- | sql/mysqld.cc | 3 |
14 files changed, 23 insertions, 57 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 62ae7f6af5b..148c96de0bc 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -77,6 +77,7 @@ ram@gw.udmsearch.izhnet.ru ram@mysql.r18.ru ram@ram.(none) ranger@regul.home.lan +root@home.(none) root@x3.internalnet salle@banica.(none) salle@geopard.(none) diff --git a/client/mysql.cc b/client/mysql.cc index f784f529c46..03f8d226d13 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -790,7 +790,7 @@ static int get_options(int argc, char **argv) } if (default_charset) { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) + if (!(system_charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) exit(1); } if (argc > 1) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index cd67a2c7522..0333833ba11 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -309,7 +309,7 @@ static int get_options(int *argc, char ***argv) } if (default_charset) { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) + if (!(system_charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) exit(1); } if (*argc > 0 && opt_alldbs) diff --git a/client/mysqldump.c b/client/mysqldump.c index 49bc56890fb..18755b7a913 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -483,7 +483,7 @@ static int get_options(int *argc, char ***argv) } if (default_charset) { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) + if (!(system_charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) exit(1); } if ((*argc < 1 && !opt_alldbs) || (*argc > 0 && opt_alldbs)) diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 408a5873589..ff6895145f7 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -239,7 +239,7 @@ static int get_options(int *argc, char ***argv) } if (default_charset) { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) + if (!(system_charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) exit(1); } if (*argc < 2) diff --git a/client/sql_string.h b/client/sql_string.h index 42f9e446981..33f34a43b7f 100644 --- a/client/sql_string.h +++ b/client/sql_string.h @@ -39,12 +39,12 @@ public: String() { Ptr=0; str_length=Alloced_length=0; alloced=0; - str_charset=default_charset_info; + str_charset= &my_charset_latin1; } String(uint32 length_arg) { alloced=0; Alloced_length=0; (void) real_alloc(length_arg); - str_charset=default_charset_info; + str_charset= &my_charset_latin1; } String(const char *str, CHARSET_INFO *cs) { diff --git a/heap/hp_test1.c b/heap/hp_test1.c index 2e0a57a12d3..96399fe4f2e 100644 --- a/heap/hp_test1.c +++ b/heap/hp_test1.c @@ -51,7 +51,7 @@ int main(int argc, char **argv) keyinfo[0].seg[0].type=HA_KEYTYPE_BINARY; keyinfo[0].seg[0].start=1; keyinfo[0].seg[0].length=6; - keyinfo[0].seg[0].charset=default_charset_info; + keyinfo[0].seg[0].charset= &my_charset_latin1; keyinfo[0].flag = HA_NOSAME; deleted=0; diff --git a/heap/hp_test2.c b/heap/hp_test2.c index 73e8039d125..09ade212fa6 100644 --- a/heap/hp_test2.c +++ b/heap/hp_test2.c @@ -64,6 +64,7 @@ int main(int argc, char *argv[]) HA_KEYSEG keyseg[MAX_KEYS*5]; HEAP_PTR position; HP_CREATE_INFO hp_create_info; + CHARSET_INFO *cs= &my_charset_latin1; MY_INIT(argv[0]); /* init my_sys library & pthreads */ LINT_INIT(position); @@ -85,7 +86,7 @@ int main(int argc, char *argv[]) keyinfo[0].seg[0].start=0; keyinfo[0].seg[0].length=6; keyinfo[0].seg[0].null_bit=0; - keyinfo[0].seg[0].charset=default_charset_info; + keyinfo[0].seg[0].charset=cs; keyinfo[1].seg=keyseg+1; keyinfo[1].keysegs=2; keyinfo[1].flag=0; @@ -94,12 +95,12 @@ int main(int argc, char *argv[]) keyinfo[1].seg[0].start=7; keyinfo[1].seg[0].length=6; keyinfo[1].seg[0].null_bit=0; - keyinfo[1].seg[0].charset=default_charset_info; + keyinfo[1].seg[0].charset=cs; keyinfo[1].seg[1].type=HA_KEYTYPE_TEXT; keyinfo[1].seg[1].start=0; /* key in two parts */ keyinfo[1].seg[1].length=6; keyinfo[1].seg[1].null_bit=0; - keyinfo[1].seg[1].charset=default_charset_info; + keyinfo[1].seg[1].charset=cs; keyinfo[2].seg=keyseg+3; keyinfo[2].keysegs=1; keyinfo[2].flag=HA_NOSAME; @@ -108,7 +109,7 @@ int main(int argc, char *argv[]) keyinfo[2].seg[0].start=12; keyinfo[2].seg[0].length=8; keyinfo[2].seg[0].null_bit=0; - keyinfo[2].seg[0].charset=default_charset_info; + keyinfo[2].seg[0].charset=cs; keyinfo[3].seg=keyseg+4; keyinfo[3].keysegs=1; keyinfo[3].flag=HA_NOSAME; @@ -118,7 +119,7 @@ int main(int argc, char *argv[]) keyinfo[3].seg[0].length=1; keyinfo[3].seg[0].null_bit=1; keyinfo[3].seg[0].null_pos=38; - keyinfo[3].seg[0].charset=default_charset_info; + keyinfo[3].seg[0].charset=cs; bzero((char*) key1,sizeof(key1)); bzero((char*) key3,sizeof(key3)); diff --git a/include/my_sys.h b/include/my_sys.h index b23de114ede..e53e2442983 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -209,11 +209,9 @@ extern CHARSET_INFO compiled_charsets[]; extern uint get_charset_number(const char *cs_name); extern const char *get_charset_name(uint cs_number); extern CHARSET_INFO *get_charset(uint cs_number, myf flags); -extern my_bool set_default_charset(uint cs, myf flags); extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint cs_flags, myf my_flags); -extern my_bool set_default_charset_by_name(const char *cs_name, myf flags); extern void free_charsets(void); extern char *list_charsets(myf want_flags); /* my_free() this string... */ extern char *get_charsets_dir(char *buf); diff --git a/isam/isamchk.c b/isam/isamchk.c index 35b4e881962..dc772290e13 100644 --- a/isam/isamchk.c +++ b/isam/isamchk.c @@ -681,7 +681,7 @@ static void get_options(register int *argc, register char ***argv) } if (default_charset) { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) + if (!(default_charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) exit(1); } return; diff --git a/mysys/charset.c b/mysys/charset.c index 3ad27469c03..7baacd613b4 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -606,24 +606,6 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags) return cs; } -my_bool set_default_charset(uint cs, myf flags) -{ - CHARSET_INFO *new_charset; - DBUG_ENTER("set_default_charset"); - DBUG_PRINT("enter",("character set: %d",(int) cs)); - - new_charset= get_charset(cs, flags); - if (!new_charset) - { - DBUG_PRINT("error",("Couldn't set default character set")); - DBUG_RETURN(TRUE); /* error */ - } - default_charset_info= new_charset; - system_charset_info= new_charset; - - DBUG_RETURN(FALSE); -} - CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags) { uint cs_number; @@ -673,25 +655,6 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, } -my_bool set_default_charset_by_name(const char *cs_name, myf flags) -{ - CHARSET_INFO *new_charset; - DBUG_ENTER("set_default_charset_by_name"); - DBUG_PRINT("enter",("character set: %s", cs_name)); - - new_charset= get_charset_by_name(cs_name, flags); - if (!new_charset) - { - DBUG_PRINT("error",("Couldn't set default character set")); - DBUG_RETURN(TRUE); /* error */ - } - - default_charset_info= new_charset; - system_charset_info= new_charset; - DBUG_RETURN(FALSE); -} - - /* Only append name if it doesn't exist from before */ static my_bool charset_in_string(const char *name, DYNAMIC_STRING *s) diff --git a/mysys/charset2html.c b/mysys/charset2html.c index 0d6450a8116..3da24232ad4 100644 --- a/mysys/charset2html.c +++ b/mysys/charset2html.c @@ -108,6 +108,7 @@ static void print_cs(CHARSET_INFO *cs) int main(int argc, char **argv) { const char *the_set = MYSQL_CHARSET; int argcnt = 1; + CHARSET_INFO *cs; my_init(); @@ -120,10 +121,10 @@ int main(int argc, char **argv) { if (argc > argcnt) charsets_dir = argv[argcnt++]; - if (set_default_charset_by_name(the_set, MYF(MY_WME))) + if (!(cs= get_charset_by_name(the_set, MYF(MY_WME)))) return 1; - print_cs(default_charset_info); + print_cs(cs); return 0; } diff --git a/mysys/test_charset.c b/mysys/test_charset.c index d031007a1da..6b0f728593a 100644 --- a/mysys/test_charset.c +++ b/mysys/test_charset.c @@ -58,6 +58,7 @@ int main(int argc, char **argv) { const char *the_set = MYSQL_CHARSET; char *cs_list; int argcnt = 1; + CHARSET_INFO *cs; my_init(); @@ -70,11 +71,11 @@ int main(int argc, char **argv) { if (argc > argcnt) charsets_dir = argv[argcnt++]; - if (set_default_charset_by_name(the_set, MYF(MY_WME))) + if (!(cs= get_charset_by_name(the_set, MYF(MY_WME)))) return 1; puts("CHARSET INFO:"); - _print_csinfo(default_charset_info); + _print_csinfo(cs); fflush(stdout); cs_list = list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG)); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c6403f97f07..5c6988f1a0c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2068,8 +2068,9 @@ static int init_common_variables(const char *conf_file_name, int argc, #ifdef USE_REGEX regex_init(&my_charset_latin1); #endif - if (set_default_charset_by_name(sys_charset.value, MYF(MY_WME))) + if (!(default_charset_info= get_charset_by_name(sys_charset.value, MYF(MY_WME)))) return 1; + system_charset_info= default_charset_info; charsets_list= list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG)); if (use_temp_pool && bitmap_init(&temp_pool,1024,1)) |