Permalink
Browse files

skip count_by_sql test using COUNT(DISTINCT) for sqlite2 only

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3978 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 4610675 commit 8196e8e72315386b44f38f9f893a960235114bdf @technoweenie technoweenie committed Mar 19, 2006
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/test/base_test.rb
@@ -1094,8 +1094,10 @@ def test_count_with_join
end
assert_equal res4, res5
-
- res6 = Post.count_by_sql "SELECT COUNT(DISTINCT p.id) FROM posts p, comments c WHERE p.#{QUOTED_TYPE} = 'Post' AND p.id=c.post_id"
+
+ unless ActiveRecord::Base.connection.raw_connection.class.name == 'SQLite::Database'
+ res6 = Post.count_by_sql "SELECT COUNT(DISTINCT p.id) FROM posts p, comments c WHERE p.#{QUOTED_TYPE} = 'Post' AND p.id=c.post_id"
+ end
res7 = nil
assert_nothing_raised do
res7 = Post.count(:conditions => "p.#{QUOTED_TYPE} = 'Post' AND p.id=c.post_id",

0 comments on commit 8196e8e

Please sign in to comment.