public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Avoid adding two DISTINCT statements to queries in sqlite 2.
fcheung (author)
Sun Apr 20 16:47:15 -0700 2008
NZKoz (committer)
Sun Apr 20 16:47:15 -0700 2008
commit  55622e0bde999193ae4a848d28cf2ce7e9247d83
tree    3723491acf1fec3d00c34bc46aa6ac54e9afee65
parent  a2028a7d7bf4336d01656d947df77ee504927db0
...
178
179
180
181
 
182
183
184
...
178
179
180
 
181
182
183
184
0
@@ -178,7 +178,7 @@ module ActiveRecord
0
           sql = "SELECT COUNT(*) AS #{aggregate_alias}" if use_workaround
0
 
0
           sql << ", #{options[:group_field]} AS #{options[:group_alias]}" if options[:group]
0
-          sql << " FROM (SELECT DISTINCT #{column_name}" if use_workaround
0
+          sql << " FROM (SELECT #{distinct}#{column_name}" if use_workaround
0
           sql << " FROM #{connection.quote_table_name(table_name)} "
0
           if merged_includes.any?
0
             join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(self, merged_includes, options[:joins])

Comments