Commit 7f771ce2 authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

"character_sets" has been removed from SHOW VARIABLES. Use SHOW CHARACTER SET instead.

 "character_set_system" has been added to display the system character set
parent c725a34b
...@@ -216,7 +216,6 @@ extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); ...@@ -216,7 +216,6 @@ extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
uint cs_flags, myf my_flags); uint cs_flags, myf my_flags);
extern void free_charsets(void); extern void free_charsets(void);
extern char *list_charsets(myf want_flags); /* my_free() this string... */
extern char *get_charsets_dir(char *buf); extern char *get_charsets_dir(char *buf);
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
......
...@@ -688,70 +688,3 @@ static void charset_append(DYNAMIC_STRING *s, const char *name) ...@@ -688,70 +688,3 @@ static void charset_append(DYNAMIC_STRING *s, const char *name)
dynstr_append(s, " "); dynstr_append(s, " ");
} }
} }
/* Returns a dynamically-allocated string listing the character sets
requested. The caller is responsible for freeing the memory. */
char *list_charsets(myf want_flags)
{
DYNAMIC_STRING s;
char *p;
(void)init_available_charsets(MYF(0));
init_dynamic_string(&s, NullS, 256, 1024);
if (want_flags & MY_CS_COMPILED)
{
CHARSET_INFO **cs;
for (cs= all_charsets; cs < all_charsets+255; cs++)
{
if (cs[0])
{
dynstr_append(&s, cs[0]->name);
dynstr_append(&s, " ");
}
}
}
if (want_flags & MY_CS_CONFIG)
{
CHARSET_INFO **cs;
char buf[FN_REFLEN];
MY_STAT status;
for (cs=all_charsets; cs < all_charsets+255; cs++)
{
if (!cs[0] || !cs[0]->name || charset_in_string(cs[0]->name, &s))
continue;
get_charset_conf_name(cs[0]->name, buf);
if (!my_stat(buf, &status, MYF(0)))
continue; /* conf file doesn't exist */
dynstr_append(&s, cs[0]->name);
dynstr_append(&s, " ");
}
}
if (want_flags & (MY_CS_INDEX|MY_CS_LOADED))
{
CHARSET_INFO **cs;
for (cs= all_charsets; cs < all_charsets + 255; cs++)
if (cs[0] && cs[0]->name && (cs[0]->state & want_flags) )
charset_append(&s, cs[0]->name);
}
if (s.length)
{
s.str[s.length - 1]= '\0'; /* chop trailing space */
p= my_strdup(s.str, MYF(MY_WME));
}
else
{
p= my_strdup("", MYF(MY_WME));
}
dynstr_free(&s);
return p;
}
...@@ -678,7 +678,7 @@ bool open_log(MYSQL_LOG *log, const char *hostname, ...@@ -678,7 +678,7 @@ bool open_log(MYSQL_LOG *log, const char *hostname,
extern time_t start_time; extern time_t start_time;
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH], extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
mysql_real_data_home[], *charsets_list, *opt_mysql_tmpdir; mysql_real_data_home[], *opt_mysql_tmpdir;
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list)) #define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
extern MY_TMPDIR mysql_tmpdir_list; extern MY_TMPDIR mysql_tmpdir_list;
extern const char *command_name[]; extern const char *command_name[];
......
...@@ -420,7 +420,7 @@ ulong expire_logs_days = 0; ...@@ -420,7 +420,7 @@ ulong expire_logs_days = 0;
char mysql_real_data_home[FN_REFLEN], char mysql_real_data_home[FN_REFLEN],
language[LIBLEN],reg_ext[FN_EXTLEN], language[LIBLEN],reg_ext[FN_EXTLEN],
mysql_charsets_dir[FN_REFLEN], *charsets_list, mysql_charsets_dir[FN_REFLEN],
blob_newline,f_fyllchar,max_sort_char,*mysqld_user,*mysqld_chroot, blob_newline,f_fyllchar,max_sort_char,*mysqld_user,*mysqld_chroot,
*opt_init_file; *opt_init_file;
char *language_ptr= language; char *language_ptr= language;
...@@ -942,7 +942,6 @@ void clean_up(bool print_message) ...@@ -942,7 +942,6 @@ void clean_up(bool print_message)
#endif #endif
if (defaults_argv) if (defaults_argv)
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_free(charsets_list, MYF(MY_ALLOW_ZERO_PTR));
free_tmpdir(&mysql_tmpdir_list); free_tmpdir(&mysql_tmpdir_list);
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
my_free(slave_load_tmpdir,MYF(MY_ALLOW_ZERO_PTR)); my_free(slave_load_tmpdir,MYF(MY_ALLOW_ZERO_PTR));
...@@ -2111,8 +2110,6 @@ static int init_common_variables(const char *conf_file_name, int argc, ...@@ -2111,8 +2110,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
global_system_variables.collation_client= default_charset_info; global_system_variables.collation_client= default_charset_info;
global_system_variables.collation_connection= default_charset_info; global_system_variables.collation_connection= default_charset_info;
charsets_list= list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG));
if (use_temp_pool && bitmap_init(&temp_pool,1024,1)) if (use_temp_pool && bitmap_init(&temp_pool,1024,1))
return 1; return 1;
return 0; return 0;
...@@ -4607,6 +4604,7 @@ static void set_options(void) ...@@ -4607,6 +4604,7 @@ static void set_options(void)
#endif #endif
sys_charset.value= (char*) MYSQL_CHARSET; sys_charset.value= (char*) MYSQL_CHARSET;
sys_charset_system.value= (char*) system_charset_info->csname;
(void) strmake(language, LANGUAGE, sizeof(language)-1); (void) strmake(language, LANGUAGE, sizeof(language)-1);
(void) strmake(mysql_real_data_home, get_relative_path(DATADIR), (void) strmake(mysql_real_data_home, get_relative_path(DATADIR),
sizeof(mysql_real_data_home)-1); sizeof(mysql_real_data_home)-1);
......
...@@ -105,6 +105,10 @@ sys_var_str sys_charset("character_set", ...@@ -105,6 +105,10 @@ sys_var_str sys_charset("character_set",
sys_check_charset, sys_check_charset,
sys_update_charset, sys_update_charset,
sys_set_default_charset); sys_set_default_charset);
sys_var_str sys_charset_system("character_set_system",
sys_check_charset,
sys_update_charset,
sys_set_default_charset);
sys_var_collation_client sys_collation_client("collation_client"); sys_var_collation_client sys_collation_client("collation_client");
sys_var_collation_connection sys_collation_connection("collation_connection"); sys_var_collation_connection sys_collation_connection("collation_connection");
sys_var_collation_results sys_collation_results("collation_results"); sys_var_collation_results sys_collation_results("collation_results");
...@@ -463,8 +467,8 @@ struct show_var_st init_vars[]= { ...@@ -463,8 +467,8 @@ struct show_var_st init_vars[]= {
#endif #endif
{sys_binlog_cache_size.name,(char*) &sys_binlog_cache_size, SHOW_SYS}, {sys_binlog_cache_size.name,(char*) &sys_binlog_cache_size, SHOW_SYS},
{sys_bulk_insert_buff_size.name,(char*) &sys_bulk_insert_buff_size,SHOW_SYS}, {sys_bulk_insert_buff_size.name,(char*) &sys_bulk_insert_buff_size,SHOW_SYS},
{sys_charset.name, (char*) &sys_charset, SHOW_SYS}, {sys_charset.name, (char*) &sys_charset, SHOW_SYS},
{"character_sets", (char*) &charsets_list, SHOW_CHAR_PTR}, {sys_charset_system.name, (char*) &sys_charset_system, SHOW_SYS},
{sys_collation_client.name, (char*) &sys_collation_client, SHOW_SYS}, {sys_collation_client.name, (char*) &sys_collation_client, SHOW_SYS},
{sys_collation_connection.name,(char*) &sys_collation_connection, SHOW_SYS}, {sys_collation_connection.name,(char*) &sys_collation_connection, SHOW_SYS},
{sys_collation_results.name, (char*) &sys_collation_results, SHOW_SYS}, {sys_collation_results.name, (char*) &sys_collation_results, SHOW_SYS},
......
...@@ -582,4 +582,5 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list); ...@@ -582,4 +582,5 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list);
void fix_delay_key_write(THD *thd, enum_var_type type); void fix_delay_key_write(THD *thd, enum_var_type type);
extern sys_var_str sys_charset; extern sys_var_str sys_charset;
extern sys_var_str sys_charset_system;
CHARSET_INFO *get_old_charset_by_name(const char *old_name); CHARSET_INFO *get_old_charset_by_name(const char *old_name);
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