Commit 8a7d862c authored by unknown's avatar unknown

sql_analyse.cc, spatial.cc:

  Some default_charset_info were removed
sql_select.cc:
  Some default_charset_info were removed.


sql/spatial.cc:
  Some default_charset_info were removed
sql/sql_select.cc:
  Some default_charset_info were removed.
sql/sql_analyse.cc:
  Some default_charset_info were removed
parent 12749eaf
......@@ -66,8 +66,7 @@ Geometry::GClassInfo *Geometry::find_class(const char *name, size_t len)
cur_rt < ci_collection_end; ++cur_rt)
{
if ((cur_rt->m_name[len] == 0) &&
(default_charset_info->strncasecmp(default_charset_info,
cur_rt->m_name, name, len) == 0))
(my_strncasecmp(&my_charset_latin1, cur_rt->m_name, name, len) == 0))
{
return cur_rt;
}
......
......@@ -278,7 +278,7 @@ void free_string(String *s)
void field_str::add()
{
char buff[MAX_FIELD_WIDTH], *ptr;
String s(buff, sizeof(buff),default_charset_info), *res;
String s(buff, sizeof(buff),&my_charset_bin), *res;
ulong length;
if (!(res = item->val_str(&s)))
......@@ -581,9 +581,9 @@ bool analyse::end_of_records()
{
field_info **f = f_info;
char buff[MAX_FIELD_WIDTH];
String *res, s_min(buff, sizeof(buff),default_charset_info),
s_max(buff, sizeof(buff),default_charset_info),
ans(buff, sizeof(buff),default_charset_info);
String *res, s_min(buff, sizeof(buff),&my_charset_bin),
s_max(buff, sizeof(buff),&my_charset_bin),
ans(buff, sizeof(buff),&my_charset_bin);
for (; f != f_end; f++)
{
......@@ -629,14 +629,14 @@ bool analyse::end_of_records()
((*f)->tree.elements_in_tree * 3 - 1 + 6))))
{
char tmp[331]; //331, because one double prec. num. can be this long
String tmp_str(tmp, sizeof(tmp),default_charset_info);
String tmp_str(tmp, sizeof(tmp),&my_charset_bin);
TREE_INFO tree_info;
tree_info.str = &tmp_str;
tree_info.found = 0;
tree_info.item = (*f)->item;
tmp_str.set("ENUM(", 5,default_charset_info);
tmp_str.set("ENUM(", 5,&my_charset_bin);
tree_walk(&(*f)->tree, (*f)->collect_enum(), (char*) &tree_info,
left_root_right);
tmp_str.append(')');
......@@ -919,14 +919,14 @@ int collect_longlong(longlong *element,
TREE_INFO *info)
{
char buff[MAX_FIELD_WIDTH];
String s(buff, sizeof(buff),default_charset_info);
String s(buff, sizeof(buff),&my_charset_bin);
if (info->found)
info->str->append(',');
else
info->found = 1;
info->str->append('\'');
s.set(*element,default_charset_info);
s.set(*element, current_thd->variables.thd_charset);
info->str->append(s);
info->str->append('\'');
return 0;
......@@ -938,14 +938,14 @@ int collect_ulonglong(ulonglong *element,
TREE_INFO *info)
{
char buff[MAX_FIELD_WIDTH];
String s(buff, sizeof(buff),default_charset_info);
String s(buff, sizeof(buff),&my_charset_bin);
if (info->found)
info->str->append(',');
else
info->found = 1;
info->str->append('\'');
s.set(*element,default_charset_info);
s.set(*element, current_thd->variables.thd_charset);
info->str->append(s);
info->str->append('\'');
return 0;
......
......@@ -7874,6 +7874,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
SELECT_LEX *select_lex = &(join->thd->lex.select_lex);
select_result *result=join->result;
Item *item_null= new Item_null();
CHARSET_INFO *cs= &my_charset_latin1;
DBUG_ENTER("select_describe");
DBUG_PRINT("info", ("Select 0x%lx, type %s, message %s",
(ulong)join->select_lex, join->select_lex->type,
......@@ -7886,12 +7887,10 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{
item_list.push_back(new Item_int((int32) join->select_lex->select_number));
item_list.push_back(new Item_string(join->select_lex->type,
strlen(join->select_lex->type),
default_charset_info));
strlen(join->select_lex->type), cs));
for (uint i=0 ; i < 7; i++)
item_list.push_back(item_null);
item_list.push_back(new Item_string(message,strlen(message),
default_charset_info));
item_list.push_back(new Item_string(message,strlen(message),cs));
if (result->send_data(item_list))
join->error= 1;
}
......@@ -7904,8 +7903,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
TABLE *table=tab->table;
char buff[512],*buff_ptr=buff;
char buff1[512], buff2[512];
String tmp1(buff1,sizeof(buff1),default_charset_info);
String tmp2(buff2,sizeof(buff2),default_charset_info);
String tmp1(buff1,sizeof(buff1),cs);
String tmp2(buff2,sizeof(buff2),cs);
tmp1.length(0);
tmp2.length(0);
......@@ -7914,7 +7913,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
join->select_lex->select_number));
item_list.push_back(new Item_string(join->select_lex->type,
strlen(join->select_lex->type),
default_charset_info));
cs));
if (tab->type == JT_ALL && tab->select && tab->select->quick)
tab->type= JT_RANGE;
if (table->tmp_table == TMP_TABLE && table->derived_select_number != 0)
......@@ -7923,15 +7922,15 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
char buff[512];
int len= my_snprintf(buff, 512, "<derived%u>",
table->derived_select_number);
item_list.push_back(new Item_string(buff, len, default_charset_info));
item_list.push_back(new Item_string(buff, len, cs));
}
else
item_list.push_back(new Item_string(table->table_name,
strlen(table->table_name),
default_charset_info));
cs));
item_list.push_back(new Item_string(join_type_str[tab->type],
strlen(join_type_str[tab->type]),
default_charset_info));
cs));
key_map bits;
uint j;
for (j=0,bits=tab->keys ; bits ; j++,bits>>=1)
......@@ -7944,8 +7943,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
}
}
if (tmp1.length())
item_list.push_back(new Item_string(tmp1.ptr(),tmp1.length(),
default_charset_info));
item_list.push_back(new Item_string(tmp1.ptr(),tmp1.length(),cs));
else
item_list.push_back(item_null);
if (tab->ref.key_parts)
......@@ -7961,15 +7959,13 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
tmp2.append(',');
tmp2.append((*ref)->name());
}
item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length(),
default_charset_info));
item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length(),cs));
}
else if (tab->type == JT_NEXT)
{
KEY *key_info=table->key_info+ tab->index;
item_list.push_back(new Item_string(key_info->name,
strlen(key_info->name),
default_charset_info));
strlen(key_info->name),cs));
item_list.push_back(new Item_int((int32) key_info->key_length));
item_list.push_back(item_null);
}
......@@ -7977,8 +7973,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{
KEY *key_info=table->key_info+ tab->select->quick->index;
item_list.push_back(new Item_string(key_info->name,
strlen(key_info->name),
default_charset_info));
strlen(key_info->name),cs));
item_list.push_back(new Item_int((int32) tab->select->quick->
max_used_key_length));
item_list.push_back(item_null);
......@@ -7998,8 +7993,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
key_read=1;
if (tab->info)
item_list.push_back(new Item_string(tab->info,strlen(tab->info),
default_charset_info));
item_list.push_back(new Item_string(tab->info,strlen(tab->info),cs));
else
{
if (tab->select)
......@@ -8032,7 +8026,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (buff_ptr == buff)
buff_ptr+= 2; // Skip inital "; "
item_list.push_back(new Item_string(buff+2,(uint) (buff_ptr - buff)-2,
default_charset_info));
cs));
}
// For next iteration
used_tables|=table->map;
......
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