summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2005-07-28 19:11:29 -0700
committerigor@rurik.mysql.com <>2005-07-28 19:11:29 -0700
commita5f2c7528c9d6238bcd80d8616b29fcf582ae6a9 (patch)
tree8e54c9874df89c6e578ffdefa6b2843f8bcf9b37 /sql
parentf503c4152de0b45d6780d1c669988810055c0fa9 (diff)
downloadmariadb-git-a5f2c7528c9d6238bcd80d8616b29fcf582ae6a9.tar.gz
func_gconcat.result, func_gconcat.test:
Added a test case for bug #12095. sql_class.h: Fixed bug #12095: a join query with GROUP_CONCAT over a single row table. Added a flag to the TMP_TABLE_PARAM class forcing to put constant items generated after elimination of a single row table into temp table in some cases (e.g. when GROUP_CONCAT is calculated over a single row table). bk ci sql/item_sum.cc Fixed bug #12095: a join query with GROUP_CONCAT over a single row table. If GROUP_CONCAT is calculated we always put its argument into a temp table, even when the argument is a constant item. sql_select.cc: Fixed bug #12095: a join query with GROUP_CONCAT over one row table. If temp table is used to calculate GROUP_CONCAT the argument should be always put into this table, even when it is a constant item.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_class.h4
-rw-r--r--sql/sql_select.cc3
2 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index b6bf0dcdc45..85ff901fe72 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1325,10 +1325,12 @@ public:
bool using_indirect_summary_function;
/* If >0 convert all blob fields to varchar(convert_blob_length) */
uint convert_blob_length;
+ bool need_const; /* <=> const items are saved in tmp table */
TMP_TABLE_PARAM()
: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()
{
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 1bde62276b8..fc85f49093d 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -5201,7 +5201,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
param->using_indirect_summary_function=1;
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
}
if (type == Item::SUM_FUNC_ITEM && !group && !save_sum_fields)