mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix for lp:780425 sql_buffer_result=1 gives wrong result for GROUP BY with a +# constant expression"
mysql-test/r/select.result: Test case for lp:780425 mysql-test/r/select_pkeycache.result: lp:780425 mysql-test/t/select.test: lp:780425 sql/sql_select.cc: Added DBUG_ASSERT to be prove some logic and later be able to simplify the code Set implicit_grouping if we delete a GROUP BY to signal do_select() that a grouping needs to be done.
This commit is contained in:
@ -1295,7 +1295,10 @@ JOIN::optimize()
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (old_group_list && !group_list)
|
||||
{
|
||||
DBUG_ASSERT(group);
|
||||
select_distinct= 0;
|
||||
}
|
||||
}
|
||||
if (!group_list && group)
|
||||
{
|
||||
@ -1303,6 +1306,7 @@ JOIN::optimize()
|
||||
simple_order=1;
|
||||
select_distinct= 0; // No need in distinct for 1 row
|
||||
group_optimized_away= 1;
|
||||
implicit_grouping= TRUE;
|
||||
}
|
||||
|
||||
calc_group_buffer(this, group_list);
|
||||
|
Reference in New Issue
Block a user