Commit 2667f61b authored by unknown's avatar unknown

sql_show.cc:

  Less default_charset_info


sql/sql_show.cc:
  Less default_charset_info
parent 605ddceb
...@@ -56,7 +56,7 @@ extern struct st_VioSSLAcceptorFd * ssl_acceptor_fd; ...@@ -56,7 +56,7 @@ extern struct st_VioSSLAcceptorFd * ssl_acceptor_fd;
int int
mysqld_show_dbs(THD *thd,const char *wild) mysqld_show_dbs(THD *thd,const char *wild)
{ {
Item_string *field=new Item_string("",0,default_charset_info); Item_string *field=new Item_string("",0,thd->charset());
List<Item> field_list; List<Item> field_list;
char *end; char *end;
List<char> files; List<char> files;
...@@ -141,7 +141,7 @@ int mysqld_show_open_tables(THD *thd,const char *wild) ...@@ -141,7 +141,7 @@ int mysqld_show_open_tables(THD *thd,const char *wild)
int mysqld_show_tables(THD *thd,const char *db,const char *wild) int mysqld_show_tables(THD *thd,const char *db,const char *wild)
{ {
Item_string *field=new Item_string("",0,default_charset_info); Item_string *field=new Item_string("",0,thd->charset());
List<Item> field_list; List<Item> field_list;
char path[FN_LEN],*end; char path[FN_LEN],*end;
List<char> files; List<char> files;
...@@ -734,7 +734,7 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild, ...@@ -734,7 +734,7 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
null_default_value=1; null_default_value=1;
if (!null_default_value && !field->is_null()) if (!null_default_value && !field->is_null())
{ // Not null by default { // Not null by default
type.set(tmp,sizeof(tmp),default_charset_info); type.set(tmp,sizeof(tmp),&my_charset_bin);
field->val_str(&type,&type); field->val_str(&type,&type);
protocol->store(type.ptr(),type.length()); protocol->store(type.ptr(),type.length());
} }
...@@ -1041,7 +1041,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) ...@@ -1041,7 +1041,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
List<Item> field_list; List<Item> field_list;
char tmp[MAX_FIELD_WIDTH]; char tmp[MAX_FIELD_WIDTH];
String type(tmp, sizeof(tmp),default_charset_info); String type(tmp, sizeof(tmp),&my_charset_bin);
if (table->tmp_table) if (table->tmp_table)
packet->append("CREATE TEMPORARY TABLE ", 23); packet->append("CREATE TEMPORARY TABLE ", 23);
else else
...@@ -1061,7 +1061,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) ...@@ -1061,7 +1061,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
packet->append(' '); packet->append(' ');
// check for surprises from the previous call to Field::sql_type() // check for surprises from the previous call to Field::sql_type()
if (type.ptr() != tmp) if (type.ptr() != tmp)
type.set(tmp, sizeof(tmp),default_charset_info); type.set(tmp, sizeof(tmp),&my_charset_bin);
field->sql_type(type); field->sql_type(type);
packet->append(type.ptr(),type.length()); packet->append(type.ptr(),type.length());
...@@ -1088,7 +1088,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) ...@@ -1088,7 +1088,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
packet->append(" default ", 9); packet->append(" default ", 9);
if (!field->is_null()) if (!field->is_null())
{ // Not null by default { // Not null by default
type.set(tmp,sizeof(tmp),default_charset_info); type.set(tmp,sizeof(tmp),&my_charset_bin);
field->val_str(&type,&type); field->val_str(&type,&type);
if (type.length()) if (type.length())
append_unescaped(packet, type.ptr(), type.length()); append_unescaped(packet, type.ptr(), type.length());
...@@ -1409,7 +1409,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) ...@@ -1409,7 +1409,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
int mysqld_show_charsets(THD *thd, const char *wild) int mysqld_show_charsets(THD *thd, const char *wild)
{ {
char buff[8192]; char buff[8192];
String packet2(buff,sizeof(buff),default_charset_info); String packet2(buff,sizeof(buff),thd->charset());
List<Item> field_list; List<Item> field_list;
CHARSET_INFO **cs; CHARSET_INFO **cs;
Protocol *protocol= thd->protocol; Protocol *protocol= thd->protocol;
......
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