1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/adapters
Ben Woosley 15d6e4dce7 Fix that #exists? can produce invalid SQL: "SELECT DISTINCT DISTINCT"
The combination of a :uniq => true association and the #distinct call
in #construct_limited_ids_condition combine to create invalid SQL, because
we're explicitly selecting DISTINCT, and also sending #distinct on to AREL,
via the relation#distinct_value.

Rather than build a select distinct clause in #construct_limited_ids_condition,
I set #distinct! and pass just the columns into the select statement.
This requires introducing a #columns_for_distinct method to return the
select columns but not the statement itself.
2013-05-10 16:13:46 +02:00
..
firebird please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
mysql Fix broken mysql test 2013-05-03 11:36:02 +01:00
mysql2 Fix broken mysql test 2013-05-03 11:36:02 +01:00
oracle please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
postgresql Fix that #exists? can produce invalid SQL: "SELECT DISTINCT DISTINCT" 2013-05-10 16:13:46 +02:00
sqlite3 each to each_value; remove unused vars 2013-04-07 19:59:07 +05:30