Commit fbad1b11 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-19237 - small performance tweak

Avoid calling constructor for Protocol_text, if not necessary.
parent 916b237b
...@@ -1168,9 +1168,6 @@ static bool should_send_column_info(THD* thd, List<Item>* list, uint flags) ...@@ -1168,9 +1168,6 @@ static bool should_send_column_info(THD* thd, List<Item>* list, uint flags)
*/ */
bool Protocol::send_result_set_metadata(List<Item> *list, uint flags) bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
{ {
List_iterator_fast<Item> it(*list);
Item *item;
Protocol_text prot(thd, thd->variables.net_buffer_length);
DBUG_ENTER("Protocol::send_result_set_metadata"); DBUG_ENTER("Protocol::send_result_set_metadata");
bool send_column_info= should_send_column_info(thd, list, flags); bool send_column_info= should_send_column_info(thd, list, flags);
...@@ -1195,6 +1192,9 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags) ...@@ -1195,6 +1192,9 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
if (send_column_info) if (send_column_info)
{ {
List_iterator_fast<Item> it(*list);
Item *item;
Protocol_text prot(thd, thd->variables.net_buffer_length);
#ifndef DBUG_OFF #ifndef DBUG_OFF
field_handlers= (const Type_handler **) thd->alloc( field_handlers= (const Type_handler **) thd->alloc(
sizeof(field_handlers[0]) * list->elements); sizeof(field_handlers[0]) * list->elements);
......
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