1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge mysql.com:/home/hf/work/29717/my41-29717

into  mysql.com:/home/hf/work/29717/my50-29717
This commit is contained in:
holyfoot/hf@hfmain.(none)
2007-07-31 11:03:31 +05:00
4 changed files with 62 additions and 1 deletions

View File

@ -1121,6 +1121,7 @@ JOIN::optimize()
order=0; // The output has only one row
simple_order=1;
select_distinct= 0; // No need in distinct for 1 row
group_optimized_away= 1;
}
calc_group_buffer(this, group_list);
@ -11461,7 +11462,8 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if (!join->first_record || end_of_records ||
(idx=test_if_group_changed(join->group_fields)) >= 0)
{
if (join->first_record || (end_of_records && !join->group))
if (join->first_record ||
(end_of_records && !join->group && !join->group_optimized_away))
{
if (join->procedure)
join->procedure->end_group();