diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-12-20 05:09:49 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-12-20 06:41:10 +0900 |
commit | c6cd9a59f200863ccfe8ad1d9c5a8876c39b9c5c (patch) | |
tree | 2fbbd9af309f7e01c43a6571744d824ad1f8ae97 /activerecord/CHANGELOG.md | |
parent | eb6baccda26d65c70d0e2df28c6cd51ec3cdb2ac (diff) | |
download | rails-c6cd9a59f200863ccfe8ad1d9c5a8876c39b9c5c.tar.gz rails-c6cd9a59f200863ccfe8ad1d9c5a8876c39b9c5c.tar.bz2 rails-c6cd9a59f200863ccfe8ad1d9c5a8876c39b9c5c.zip |
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.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 73970c99d0..d5cce3f47c 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,7 @@ +* Fix `count(:all)` to correctly work `distinct` with custom SELECT list. + + *Ryuta Kamizono* + * Using subselect for `delete_all` with `limit` or `offset`. *Ryuta Kamizono* |