mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Adding Item_string_sys and Item_string_ascii to reduce duplicate code
This commit is contained in:
@@ -203,15 +203,13 @@ bool Explain_query::print_explain_str(THD *thd, String *out_str)
|
||||
|
||||
static void push_str(List<Item> *item_list, const char *str)
|
||||
{
|
||||
item_list->push_back(new Item_string(str,
|
||||
strlen(str), system_charset_info));
|
||||
item_list->push_back(new Item_string_sys(str));
|
||||
}
|
||||
|
||||
|
||||
static void push_string(List<Item> *item_list, String *str)
|
||||
{
|
||||
item_list->push_back(new Item_string(str->ptr(), str->length(),
|
||||
system_charset_info));
|
||||
item_list->push_back(new Item_string_sys(str->ptr(), str->length()));
|
||||
}
|
||||
|
||||
|
||||
@@ -262,8 +260,7 @@ int Explain_union::print_explain(Explain_query *query,
|
||||
len+= lastop;
|
||||
table_name_buffer[len - 1]= '>'; // change ',' to '>'
|
||||
}
|
||||
const CHARSET_INFO *cs= system_charset_info;
|
||||
item_list.push_back(new Item_string(table_name_buffer, len, cs));
|
||||
item_list.push_back(new Item_string_sys(table_name_buffer, len));
|
||||
}
|
||||
|
||||
/* `partitions` column */
|
||||
@@ -298,8 +295,7 @@ int Explain_union::print_explain(Explain_query *query,
|
||||
{
|
||||
extra_buf.append(STRING_WITH_LEN("Using filesort"));
|
||||
}
|
||||
const CHARSET_INFO *cs= system_charset_info;
|
||||
item_list.push_back(new Item_string(extra_buf.ptr(), extra_buf.length(), cs));
|
||||
item_list.push_back(new Item_string_sys(extra_buf.ptr(), extra_buf.length()));
|
||||
|
||||
//output->unit.offset_limit_cnt= 0;
|
||||
if (output->send_data(item_list))
|
||||
@@ -349,12 +345,10 @@ int Explain_select::print_explain(Explain_query *query,
|
||||
if (message)
|
||||
{
|
||||
List<Item> item_list;
|
||||
const CHARSET_INFO *cs= system_charset_info;
|
||||
Item *item_null= new Item_null();
|
||||
|
||||
item_list.push_back(new Item_int((int32) select_id));
|
||||
item_list.push_back(new Item_string(select_type,
|
||||
strlen(select_type), cs));
|
||||
item_list.push_back(new Item_string_sys(select_type));
|
||||
for (uint i=0 ; i < 7; i++)
|
||||
item_list.push_back(item_null);
|
||||
if (explain_flags & DESCRIBE_PARTITIONS)
|
||||
@@ -362,7 +356,7 @@ int Explain_select::print_explain(Explain_query *query,
|
||||
if (explain_flags & DESCRIBE_EXTENDED)
|
||||
item_list.push_back(item_null);
|
||||
|
||||
item_list.push_back(new Item_string(message,strlen(message),cs));
|
||||
item_list.push_back(new Item_string_sys(message));
|
||||
|
||||
if (output->send_data(item_list))
|
||||
return 1;
|
||||
@@ -560,7 +554,7 @@ int Explain_table_access::print_explain(select_result_sink *output, uint8 explai
|
||||
extra_buf.append(STRING_WITH_LEN("Using filesort"));
|
||||
}
|
||||
|
||||
item_list.push_back(new Item_string(extra_buf.ptr(), extra_buf.length(), cs));
|
||||
item_list.push_back(new Item_string_sys(extra_buf.ptr(), extra_buf.length()));
|
||||
|
||||
if (output->send_data(item_list))
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user