1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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

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

View File

@ -777,6 +777,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);
@ -6896,7 +6897,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();