summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-03-21 23:46:11 +0200
committerunknown <monty@mysql.com>2005-03-21 23:46:11 +0200
commit61f1e9a3e4257df5849723c7c0a68f537db25f75 (patch)
tree577397cc3f61f408845744ee2b839dd184070121 /sql/sql_select.cc
parent87110734d334b89f95323980f080b265e38810bf (diff)
parent802c41e04d0b4bb193abfff1b7084d3a6c971df6 (diff)
downloadmariadb-git-61f1e9a3e4257df5849723c7c0a68f537db25f75.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0 sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item_sum.cc: Auto merged sql/sql_select.cc: Auto merged
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b6cda4f8d85..856fb937b6e 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10144,20 +10144,18 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
join->sum_funcs_end[send_group_parts]);
if (join->having && join->having->val_int() == 0)
error= -1;
- else if ((error=table->file->write_row(table->record[0])))
+ else if ((error= table->file->write_row(table->record[0])))
{
if (create_myisam_from_heap(join->thd, table,
&join->tmp_table_param,
error, 0))
DBUG_RETURN(-1);
}
- if (join->rollup.state != ROLLUP::STATE_NONE && error <= 0)
+ if (join->rollup.state != ROLLUP::STATE_NONE)
{
if (join->rollup_write_data((uint) (idx+1), table))
- error= 1;
+ DBUG_RETURN(-1);
}
- if (error > 0)
- DBUG_RETURN(-1);
if (end_of_records)
DBUG_RETURN(0);
}
@@ -12684,17 +12682,21 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields,
{
/* Check if this is something that is part of this group by */
ORDER *group_tmp;
- for (group_tmp= start_group, i-- ;
+ for (group_tmp= start_group, i= pos ;
group_tmp ; group_tmp= group_tmp->next, i++)
{
if (*group_tmp->item == item)
{
+ Item_null_result *null_item;
/*
This is an element that is used by the GROUP BY and should be
set to NULL in this level
*/
item->maybe_null= 1; // Value will be null sometimes
- Item_null_result *null_item= rollup.null_items[i];
+ null_item= rollup.null_items[i];
+ DBUG_ASSERT(null_item->result_field == 0 ||
+ null_item->result_field ==
+ ((Item_field *) item)->result_field);
null_item->result_field= ((Item_field *) item)->result_field;
item= null_item;
break;