Please sign in to comment.
Fix `count(:all)` to correctly work `distinct` with custom SELECT list
Currently `count(:all)` with `distinct` doesn't work correctly because SELECT list is always replaced to `*` or primary key in that case even if having custom SELECT list. And also, PostgreSQL has a limitation that ORDER BY expressions must appear in select list for SELECT DISTINCT. Therefore, we should not replace custom SELECT list when using `count(:all)` with `distinct`. Closes #31277.
- Loading branch information...
Showing with 24 additions and 10 deletions.