Skip to content

Commit

Permalink
MDEV-19237 - small performance tweak
Browse files Browse the repository at this point in the history
Avoid calling constructor for Protocol_text, if not necessary.
  • Loading branch information
vaintroub committed May 9, 2021
1 parent 916b237 commit fbad1b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sql/protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
List_iterator_fast<Item> it(*list);
Item *item;
Protocol_text prot(thd, thd->variables.net_buffer_length);
DBUG_ENTER("Protocol::send_result_set_metadata");

bool send_column_info= should_send_column_info(thd, list, flags);
Expand All @@ -1195,6 +1192,9 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)

if (send_column_info)
{
List_iterator_fast<Item> it(*list);
Item *item;
Protocol_text prot(thd, thd->variables.net_buffer_length);
#ifndef DBUG_OFF
field_handlers= (const Type_handler **) thd->alloc(
sizeof(field_handlers[0]) * list->elements);
Expand Down

0 comments on commit fbad1b1

Please sign in to comment.