Commit 8420d76f authored by igor@rurik.mysql.com's avatar igor@rurik.mysql.com

sql_select.cc, sql_class.h:

  Reversed the changes to fix bug #12095 after review
  done by SergeyG. Applied a fix suggested by him.
parent 1e2e10af
...@@ -1325,12 +1325,10 @@ class TMP_TABLE_PARAM :public Sql_alloc ...@@ -1325,12 +1325,10 @@ class TMP_TABLE_PARAM :public Sql_alloc
bool using_indirect_summary_function; bool using_indirect_summary_function;
/* If >0 convert all blob fields to varchar(convert_blob_length) */ /* If >0 convert all blob fields to varchar(convert_blob_length) */
uint convert_blob_length; uint convert_blob_length;
bool need_const; /* <=> const items are saved in tmp table */
TMP_TABLE_PARAM() TMP_TABLE_PARAM()
:copy_field(0), group_parts(0), :copy_field(0), group_parts(0),
group_length(0), group_null_parts(0), convert_blob_length(0), group_length(0), group_null_parts(0), convert_blob_length(0)
need_const(0)
{} {}
~TMP_TABLE_PARAM() ~TMP_TABLE_PARAM()
{ {
......
...@@ -5201,8 +5201,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, ...@@ -5201,8 +5201,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
param->using_indirect_summary_function=1; param->using_indirect_summary_function=1;
continue; continue;
} }
if (item->const_item() && (int) hidden_field_count <= 0 && if (item->const_item() && (int) hidden_field_count <= 0)
!param->need_const)
continue; // We don't have to store this continue; // We don't have to store this
} }
if (type == Item::SUM_FUNC_ITEM && !group && !save_sum_fields) if (type == Item::SUM_FUNC_ITEM && !group && !save_sum_fields)
......
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