aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-01-24 08:28:02 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-01-25 14:12:58 +0900
commitebc09ed9ad9a04338138739226a1a92c7a2707ee (patch)
tree526b373ddbe05b6ded70a1c3e9662167a33a757b /activerecord/CHANGELOG.md
parent8223408c8dffb14bec33fcc52cfc67e983f5f99e (diff)
downloadrails-ebc09ed9ad9a04338138739226a1a92c7a2707ee.tar.gz
rails-ebc09ed9ad9a04338138739226a1a92c7a2707ee.tar.bz2
rails-ebc09ed9ad9a04338138739226a1a92c7a2707ee.zip
Fix `count(:all)` with eager loading and having an order other than the driving table
This is a regression caused by 6beb4de. In PostgreSQL, ORDER BY expressions must appear in SELECT list when using DISTINCT. When using `count(:all)` with eager loading, Active Record enforces DISTINCT to count the driving table records only. 6beb4de was caused the regression because `count(:all)` with DISTINCT path no longer removes ORDER BY. We need to ignore ORDER BY when DISTINCT is enforced, otherwise not always generated valid SQL for PostgreSQL. Fixes #31783.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 09df0763e7..af77eaae0e 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,9 @@
+* Fix `count(:all)` with eager loading and having an order other than the driving table.
+
+ Fixes #31783.
+
+ *Ryuta Kamizono*
+
* Clear the transaction state when an Active Record object is duped.
Fixes #31670.