Skip to content

Commit

Permalink
We cant make MySQL 5 happy if it means making SQLite and PostgreSQL c…
Browse files Browse the repository at this point in the history
…ry. 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
  • Loading branch information
dhh committed Sep 8, 2006
1 parent d7e4f5f commit e2d8451
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class FormBuilder #:nodoc:
class_inheritable_accessor :field_helpers
self.field_helpers = (FormHelper.instance_methods - ['form_for'])

attr_accessor :object_name, :object
attr_accessor :object_name, :object, :options

def initialize(object_name, object, template, options, proc)
@object_name, @object, @template, @options, @proc = object_name, object, template, options, proc
Expand Down
2 changes: 0 additions & 2 deletions activerecord/CHANGELOG
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/associations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ def select_all_rows(options, join_dependency)

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)
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ def type_name_with_module(type_name)
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)
Expand Down

0 comments on commit e2d8451

Please sign in to comment.