Closed MartinMystikJonas closed 2 years ago
Version: all
When count(column) is used on selection group and having conditions are ignored
count(column)
group
having
$selection->group('column1')->having('SUM(column2) > 0')->count('column1')
Return only rows where having conditions is met instead or all rows.
Also copy group and having parameters in importConditions of SqlBuilder https://github.com/nette/database/blob/f0e379670b20f21a2d3d052d1c9cf1b6984210be/src/Database/Table/SqlBuilder.php#L239
importConditions
SqlBuilder
Or is there reason why it is not copied?
I can prepare PR if proposed fix is ok.
That would be great.
Version: all
Bug Description
When
count(column)
is used on selectiongroup
andhaving
conditions are ignoredSteps To Reproduce
Expected Behavior
Return only rows where having conditions is met instead or all rows.
Possible Solution
Also copy group and having parameters in
importConditions
ofSqlBuilder
https://github.com/nette/database/blob/f0e379670b20f21a2d3d052d1c9cf1b6984210be/src/Database/Table/SqlBuilder.php#L239Or is there reason why it is not copied?