alexey.verkhovsky@gmail.com
2008-Feb-11 03:11 UTC
[CruiseControl] RubyOnRails build 8856 failed
The build failed. CHANGES ------- Revision 8856 committed by nzkoz on 2008-02-11 02:50:58 Fix eager loading with pre-quoted table names. Closes #11046 [danielmorrison, Koz, Jeremy Kemper] M /trunk/activerecord/lib/active_record/associations.rb M /trunk/activerecord/test/cases/associations/eager_test.rb TEST FAILURES AND ERRORS ----------------------- Name: test_eager_association_loading_with_belongs_to_and_conditions_string_with_quoted_table_name(EagerAssociationTest) Type: Failure Message: Exception raised: Class: <ActiveRecord::StatementInvalid> Message: <"PGError: ERROR: column \"posts.id\" does not exist\n: SELECT \"comments\".\"id\" AS t0_r0, \"comments\".\"post_id\" AS t0_r1, \"comments\".\"type\" AS t0_r2, \"comments\".\"body\" AS t0_r3, \"posts\".\"id\" AS t1_r0, \"posts\".\"author_id\" AS t1_r1, \"posts\".\"title\" AS t1_r2, \"posts\".\"type\" AS t1_r3, \"posts\".\"body\" AS t1_r4, \"posts\".\"comments_count\" AS t1_r5, \"posts\".\"taggings_count\" AS t1_r6 FROM \"comments\" LEFT OUTER JOIN \"posts\" ON \"posts\".id = \"comments\".post_id WHERE (\"posts.id\" = 4) "> ---Backtrace--- ./test/cases/../../lib/active_record/connection_adapters/abstract_adapter.rb:151:in `log'' ./test/cases/../../lib/active_record/connection_adapters/postgresql_adapter.rb:407:in `execute_without_counting'' ./test/cases/helper.rb:46:in `execute'' ./test/cases/../../lib/active_record/connection_adapters/postgresql_adapter.rb:787:in `select_raw'' ./test/cases/../../lib/active_record/connection_adapters/postgresql_adapter.rb:774:in `select'' ./test/cases/../../lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'' ./test/cases/../../lib/active_record/connection_adapters/abstract/query_cache.rb:55:in `select_all'' ./test/cases/../../lib/active_record/associations.rb:1301:in `select_all_rows'' ./test/cases/../../lib/active_record/associations.rb:1170:in `find_with_associations'' ./test/cases/../../lib/active_record/associations.rb:1168:in `catch'' ./test/cases/../../lib/active_record/associations.rb:1168:in `find_with_associations'' ./test/cases/../../lib/active_record/base.rb:1243:in `find_every'' ./test/cases/../../lib/active_record/base.rb:502:in `find'' ./test/cases/associations/eager_test.rb:130:in `test_eager_association_loading_with_belongs_to_and_conditions_string_with_quoted_table_name'' ./test/cases/associations/eager_test.rb:129:in `test_eager_association_loading_with_belongs_to_and_conditions_string_with_quoted_table_name'' ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:59:in `__send__'' ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:59:in `run'' --------------- ./test/cases/associations/eager_test.rb:129:in `test_eager_association_loading_with_belongs_to_and_conditions_string_with_quoted_table_name'' ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:59:in `__send__'' ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:59:in `run'' Name: test_eager_association_loading_with_belongs_to_and_order_string_with_quoted_table_name(EagerAssociationTest) Type: Failure Message: Exception raised: Class: <ActiveRecord::StatementInvalid> Message: <"PGError: ERROR: column \"posts.id\" does not exist\n: SELECT \"comments\".\"id\" AS t0_r0, \"comments\".\"post_id\" AS t0_r1, \"comments\".\"type\" AS t0_r2, \"comments\".\"body\" AS t0_r3, \"posts\".\"id\" AS t1_r0, \"posts\".\"author_id\" AS t1_r1, \"posts\".\"title\" AS t1_r2, \"posts\".\"type\" AS t1_r3, \"posts\".\"body\" AS t1_r4, \"posts\".\"comments_count\" AS t1_r5, \"posts\".\"taggings_count\" AS t1_r6 FROM \"comments\" LEFT OUTER JOIN \"posts\" ON \"posts\".id = \"comments\".post_id ORDER BY \"posts.id\""> ---Backtrace--- ./test/cases/../../lib/active_record/connection_adapters/abstract_adapter.rb:151:in `log'' ./test/cases/../../lib/active_record/connection_adapters/postgresql_adapter.rb:407:in `execute_without_counting'' ./test/cases/helper.rb:46:in `execute'' ./test/cases/../../lib/active_record/connection_adapters/postgresql_adapter.rb:787:in `select_raw'' ./test/cases/../../lib/active_record/connection_adapters/postgresql_adapter.rb:774:in `select'' ./test/cases/../../lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'' ./test/cases/../../lib/active_record/connection_adapters/abstract/query_cache.rb:55:in `select_all'' ./test/cases/../../lib/active_record/associations.rb:1301:in `select_all_rows'' ./test/cases/../../lib/active_record/associations.rb:1170:in `find_with_associations'' ./test/cases/../../lib/active_record/associations.rb:1168:in `catch'' ./test/cases/../../lib/active_record/associations.rb:1168:in `find_with_associations'' ./test/cases/../../lib/active_record/base.rb:1243:in `find_every'' ./test/cases/../../lib/active_record/base.rb:502:in `find'' ./test/cases/associations/eager_test.rb:142:in `test_eager_association_loading_with_belongs_to_and_order_string_with_quoted_table_name'' ./test/cases/associations/eager_test.rb:141:in `test_eager_association_loading_with_belongs_to_and_order_string_with_quoted_table_name'' ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:59:in `__send__'' ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:59:in `run'' --------------- ./test/cases/associations/eager_test.rb:141:in `test_eager_association_loading_with_belongs_to_and_order_string_with_quoted_table_name'' ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:59:in `__send__'' ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:59:in `run'' See http://cruisecontrolrb.thoughtworks.com/builds/RubyOnRails/8856 for details. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> CHANGES > ------- > Revision 8856 committed by nzkoz on 2008-02-11 02:50:58 > Fix eager loading with pre-quoted table names. Closes #11046 [danielmorrison, Koz, Jeremy Kemper] > > M /trunk/activerecord/lib/active_record/associations.rb > M /trunk/activerecord/test/cases/associations/eager_test.rbOK, I can change the regexp to make it more like it was before, but I''m confused by the generated SQL. Can anyone with postgresql confirm the current failure goes away with the attached patch? But I can''t follow why it''s generating "posts.id" which I assume isn''t equivalent to "posts"."id". Anyone want to take a stab? -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 11, 2008 4:26 AM, Michael Koziarski <michael@koziarski.com> wrote:> > But I can''t follow why it''s generating "posts.id" which I assume isn''t > equivalent to "posts"."id". Anyone want to take a stab?The test says: :order => Comment.connection.quote_table_name(''posts.id'') Which is totally weird (I can''t think of why the test is written like that). MySQL adapter is actually the only adapter that takes care of the period inside the "table name" (I can''t think of why it does that, either--the whole point of quoting is escaping special characters in a query). def quote_table_name(name) #:nodoc: @quoted_table_names[name] ||= quote_column_name(name).gsub(''.'', ''`.`'') end In all other databases, quote_table_name simply uses quote_column_name. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 11, 2008 4:45 PM, Mislav Marohnić <mislav.marohnic@gmail.com> wrote:> On Feb 11, 2008 4:26 AM, Michael Koziarski <michael@koziarski.com> wrote: > > > > > But I can't follow why it's generating "posts.id" which I assume isn't > > equivalent to "posts"."id". Anyone want to take a stab? > > The test says: > > :order => Comment.connection.quote_table_name('posts.id') > > Which is totally weird (I can't think of why the test is written like that). > MySQL adapter is actually the only adapter that takes care of the period > inside the "table name" (I can't think of why it does that, either--the > whole point of quoting is escaping special characters in a query).Thanks for that mislav, sometimes it's hard to see the forest for the trees :) -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
2008/2/11 Michael Koziarski <michael@koziarski.com>:> > The test says: > > > > :order => Comment.connection.quote_table_name(''posts.id'') > > > > Which is totally weird (I can''t think of why the test is written like > that). > > MySQL adapter is actually the only adapter that takes care of the period > > inside the "table name" (I can''t think of why it does that, either--the > > whole point of quoting is escaping special characters in a query). > > Thanks for that mislav, sometimes it''s hard to see the forest for the > trees :)Well, there is still an issue of quote_table_name in mysql adapter doing stuff that it shouldn''t. It shouldn''t detect periods. So is this going to be removed? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> Well, there is still an issue of quote_table_name in mysql adapter doing > stuff that it shouldn''t. It shouldn''t detect periods. So is this going to be > removed?Here''s where it came from: http://dev.rubyonrails.org/changeset/7980 Not sure of the merits / alternatives. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---