diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-08 22:01:00 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-08 22:01:00 +0000 |
commit | e2d8451024b074ff467b6264edb17f2758322f3e (patch) | |
tree | f7cb460d1e101096d3d56d0b03c62ed4a6fb5757 /activerecord | |
parent | d7e4f5f22e87b1a5a7c234210a56a8cfb71e21fa (diff) | |
download | rails-e2d8451024b074ff467b6264edb17f2758322f3e.tar.gz rails-e2d8451024b074ff467b6264edb17f2758322f3e.tar.bz2 rails-e2d8451024b074ff467b6264edb17f2758322f3e.zip |
We cant make MySQL 5 happy if it means making SQLite and PostgreSQL cry. So currently MySQL 5 is not fully supported for Rails when youre using eager loading (closes #6133, #6135). I have contacted MySQL to make them fix http://bugs.mysql.com/bug.php?id=13551 [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5075 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 |
3 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 4c672c02a9..9c5f3adb55 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,7 +1,5 @@ *SVN* -* Added parentheses around FROM clauses generated by Base and associations since MySQL 5 claim that to be the standard (and will screw up joins if its not there), see http://bugs.mysql.com/bug.php?id=13551 [DHH] - * Rename AR::Base#quote so people can use that name in their models. #3628 [Koz] * Add deprecation warning for inferred foreign key. #6029 [Josh Susser] diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 6168c8a723..e2dca89d49 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1131,7 +1131,7 @@ module ActiveRecord def construct_finder_sql_with_included_associations(options, join_dependency) scope = scope(:find) - sql = "SELECT #{column_aliases(join_dependency)} FROM (#{(scope && scope[:from]) || options[:from] || table_name}) " + sql = "SELECT #{column_aliases(join_dependency)} FROM #{(scope && scope[:from]) || options[:from] || table_name} " sql << join_dependency.join_associations.collect{|join| join.association_join }.join add_joins!(sql, options, scope) diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 756d63dfdb..e9c9212560 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1089,7 +1089,7 @@ module ActiveRecord #:nodoc: def construct_finder_sql(options) scope = scope(:find) sql = "SELECT #{(scope && scope[:select]) || options[:select] || '*'} " - sql << "FROM (#{(scope && scope[:from]) || options[:from] || table_name}) " + sql << "FROM #{(scope && scope[:from]) || options[:from] || table_name} " add_joins!(sql, options, scope) add_conditions!(sql, options[:conditions], scope) |