aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-03-19 17:19:17 +0000
committerRick Olson <technoweenie@gmail.com>2006-03-19 17:19:17 +0000
commit8196e8e72315386b44f38f9f893a960235114bdf (patch)
tree55f94381b7ada5bb4d9681e3d13fe73b0ba75a74
parent46106755b7c8a783a53791e4ed2f5e98a0c40170 (diff)
downloadrails-8196e8e72315386b44f38f9f893a960235114bdf.tar.gz
rails-8196e8e72315386b44f38f9f893a960235114bdf.tar.bz2
rails-8196e8e72315386b44f38f9f893a960235114bdf.zip
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
-rwxr-xr-xactiverecord/test/base_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb
index f3b4e09cf7..d35f876002 100755
--- a/activerecord/test/base_test.rb
+++ b/activerecord/test/base_test.rb
@@ -1094,8 +1094,10 @@ class BasicsTest < Test::Unit::TestCase
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",