diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2021-05-09 13:23:22 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2021-05-09 13:23:22 +0200 |
commit | fbad1b115025e2b8d919ee3cae8b5ba5785eb002 (patch) | |
tree | 303432261697875c1ea2dba603a719c7d58c6065 | |
parent | 916b237b3f6ee4d8e113d480c53bca232cadbb7b (diff) | |
download | mariadb-git-fbad1b115025e2b8d919ee3cae8b5ba5785eb002.tar.gz |
MDEV-19237 - small performance tweak
Avoid calling constructor for Protocol_text, if not necessary.
-rw-r--r-- | sql/protocol.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index f369fa1c66f..d0566ed2506 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -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); @@ -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); |