From f6e5ff30a494d6c0eaf521056c6f71ad5d3c47dd Mon Sep 17 00:00:00 2001 From: "ashwin.kayyoor" Date: Wed, 15 Jul 2020 19:34:51 -0700 Subject: [PATCH] Previous fix had bigger splash zone. So we have reduced the splash zone by modifying/assigning original column name just before packet gets formed to be sent to client by mysql protocol. --- sql/item.cc | 4 ++++ sql/sql_select.cc | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 69524cf8116..c67fb61d0d9 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -6344,6 +6344,10 @@ void Item_field::make_send_field(THD *thd, Send_field *tmp_field) { DBUG_ASSERT(name.length == strlen(name.str)); tmp_field->col_name= name; // Use user supplied name + if(orig_field_name.str && cmp(name, orig_field_name) != 0) + { + tmp_field->org_col_name= orig_field_name; + } } if (table_name) tmp_field->table_name= table_name; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index a7d7b15942b..b8173ab036c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17859,9 +17859,7 @@ Item_field::create_tmp_field_from_item_field(TABLE *new_table, } else { - LEX_CSTRING *tmp= orig_item - ? &orig_item->name - : (orig_field_name.length > 0) ? &orig_field_name : &name; + LEX_CSTRING *tmp= orig_item ? &orig_item->name : &name; bool tmp_maybe_null= param->modify_item() ? maybe_null : field->maybe_null(); result= field->create_tmp_field(new_table->in_use->mem_root, new_table, -- 2.19.2