Commit 6b11fa3a authored by unknown's avatar unknown

set_default_charset() is not used anymore

Some system_charset_info were removed


BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
parent a4d81744
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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))
......
......@@ -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)
......
......@@ -39,12 +39,12 @@ class String
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)
{
......
......@@ -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;
......
......@@ -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));
......
......@@ -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);
......
......@@ -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;
......
......@@ -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)
......
......@@ -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;
}
......@@ -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));
......
......@@ -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))
......
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