summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-08 22:27:50 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-08 22:27:50 +0300
commite6ab3827c47706ba3d9c0f7133ee54aa8fb25db7 (patch)
tree27ff27be57dd729e6c9670b68b6d81a3eca7c95d /sql
parent770aa9f2d10ac3b10d5e80c88cc154c3fa3cf81b (diff)
parentec09d2e5a83eb52e2b5a51a3c390805a1e9f78fa (diff)
downloadmariadb-git-e6ab3827c47706ba3d9c0f7133ee54aa8fb25db7.tar.gz
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 6e819150692..3feb0fdddc3 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -135,7 +135,7 @@ static TABLE *get_sort_by_table(ORDER *a,ORDER *b,TABLE_LIST *tables);
static void calc_group_buffer(JOIN *join,ORDER *group);
static bool alloc_group_fields(JOIN *join,ORDER *group);
static bool make_sum_func_list(JOIN *join,List<Item> &fields);
-static bool change_to_use_tmp_fields(List<Item> &func);
+static bool change_to_use_tmp_fields(List<Item> &func, bool change=false);
static bool change_refs_to_tmp_fields(THD *thd, List<Item> &func);
static void init_tmptable_sum_functions(Item_sum **func);
static void update_tmptable_sum_func(Item_sum **func,TABLE *tmp_table);
@@ -788,7 +788,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
tmp_table=tmp_table2;
join.join_tab[0].table=0; // Table is freed
- if (change_to_use_tmp_fields(all_fields)) // No sum funcs anymore
+ if (change_to_use_tmp_fields(all_fields,true)) // No sum funcs anymore
goto err;
join.tmp_table_param.field_count+=join.tmp_table_param.sum_func_count;
join.tmp_table_param.sum_func_count=0;
@@ -6764,7 +6764,7 @@ make_sum_func_list(JOIN *join,List<Item> &fields)
*/
static bool
-change_to_use_tmp_fields(List<Item> &items)
+change_to_use_tmp_fields(List<Item> &items, bool change)
{
List_iterator<Item> it(items);
Item *item_field,*item;
@@ -6776,6 +6776,11 @@ change_to_use_tmp_fields(List<Item> &items)
continue;
if (item->type() == Item::FIELD_ITEM)
{
+ if (change)
+ {
+ ((Item_field*) item)->result_field->null_ptr=0;
+ item->maybe_null=0;
+ }
((Item_field*) item)->field=
((Item_field*) item)->result_field;
}