Michael Schoen
2007-Jul-07 02:50 UTC
Rails AR/Oracle Unit Test: [7167] failed (getting worse)
"nzkoz" has kicked AR/Oracle while it was down... http://dev.rubyonrails.org/changeset/7167 ------------------------------------------------------------------------ r7167 | nzkoz | 2007-07-06 19:42:42 -0700 (Fri, 06 Jul 2007) | 3 lines Move from select * to select tablename.* to avoid clobbering IDs. Closes #8889 [dasil003] ------------------------------------------------------------------------ U activerecord/test/finder_test.rb U activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb U activerecord/lib/active_record/base.rb U activerecord/CHANGELOG Updated to revision 7167. 1) Error: test_joins_dont_clobber_id(FinderTest): ActiveRecord::StatementInvalid: OCIError: ORA-00905: missing keyword: select * from (select raw_sql_.*, rownum raw_rnum_ from (SELECT companies.* FROM companies INNER JOIN companies AS clients ON clients.firm_id = companies.id WHERE (companies.id = 1) AND ( (companies.type = ''Firm'' ) ) ) raw_sql_ where rownum <= 1) where raw_rnum_ > 0 ./test/../lib/active_record/connection_adapters/abstract_adapter.rb:135:in `log'' ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:214:in `execute_without_counting'' ./test/abstract_unit.rb:71:in `execute'' ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:514:in `select'' ./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all'' ./test/../lib/active_record/base.rb:439:in `find_by_sql'' ./test/../lib/active_record/base.rb:1003:in `find_every'' ./test/../lib/active_record/base.rb:997:in `find_initial'' ./test/../lib/active_record/base.rb:429:in `find'' ./test/finder_test.rb:511:in `test_joins_dont_clobber_id'' /usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.5.1/lib/mocha/test_case_adapter.rb:19:in `run'' 2) Failure: test_rename_column_with_sql_reserved_word(MigrationTest) [./test/migration_test.rb:403:in `test_rename_column_with_sql_reserved_word'' /usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.5.1/lib/mocha/test_case_adapter.rb:19:in `run'']: Exception raised: Class: <ActiveRecord::StatementInvalid> Message: <"OCIError: ORA-00904: : invalid identifier: ALTER TABLE people RENAME COLUMN first_name to group"> ---Backtrace--- ./test/../lib/active_record/connection_adapters/abstract_adapter.rb:135:in `log'' ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:214:in `execute_without_counting'' ./test/abstract_unit.rb:71:in `execute'' ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:400:in `rename_column'' ./test/migration_test.rb:403:in `test_rename_column_with_sql_reserved_word'' ./test/migration_test.rb:403:in `test_rename_column_with_sql_reserved_word'' /usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.5.1/lib/mocha/test_case_adapter.rb:19:in `run'' --------------- 1106 tests, 4073 assertions, 1 failures, 1 errors rake aborted! Command failed with status (1): [/usr/pkg/ruby184/bin/ruby -Ilib:test:test/...] (See full trace by running task with --trace) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gabe da Silveira
2007-Jul-07 02:57 UTC
Re: Rails AR/Oracle Unit Test: [7167] failed (getting worse)
Ugg, this is from my patch. I know nothing about Oracle. Can someone explain what the error means and why the query is in a subselect? On 7/6/07, Michael Schoen <schoenm@earthlink.net> wrote:> > "nzkoz" has kicked AR/Oracle while it was down... > > http://dev.rubyonrails.org/changeset/7167 > ------------------------------------------------------------------------ > r7167 | nzkoz | 2007-07-06 19:42:42 -0700 (Fri, 06 Jul 2007) | 3 lines > > Move from select * to select tablename.* to avoid clobbering IDs. Closes #8889 [dasil003] > > > ------------------------------------------------------------------------ > > U activerecord/test/finder_test.rb > U activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb > U activerecord/lib/active_record/base.rb > U activerecord/CHANGELOG > Updated to revision 7167. > > 1) Error: > test_joins_dont_clobber_id(FinderTest): > ActiveRecord::StatementInvalid: OCIError: ORA-00905: missing keyword: select * from (select raw_sql_.*, rownum raw_rnum_ from (SELECT companies.* FROM companies INNER JOIN companies AS clients ON clients.firm_id = companies.id WHERE (companies.id = 1) AND ( (companies.type = ''Firm'' ) ) ) raw_sql_ where rownum <= 1) where raw_rnum_ > 0 > ./test/../lib/active_record/connection_adapters/abstract_adapter.rb:135:in `log'' > ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:214:in `execute_without_counting'' > ./test/abstract_unit.rb:71:in `execute'' > ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:514:in `select'' > ./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all'' > ./test/../lib/active_record/base.rb:439:in `find_by_sql'' > ./test/../lib/active_record/base.rb:1003:in `find_every'' > ./test/../lib/active_record/base.rb:997:in `find_initial'' > ./test/../lib/active_record/base.rb:429:in `find'' > ./test/finder_test.rb:511:in `test_joins_dont_clobber_id'' > /usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.5.1/lib/mocha/test_case_adapter.rb:19:in `run'' > > 2) Failure: > test_rename_column_with_sql_reserved_word(MigrationTest) > [./test/migration_test.rb:403:in `test_rename_column_with_sql_reserved_word'' > /usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.5.1/lib/mocha/test_case_adapter.rb:19:in `run'']: > Exception raised: > Class: <ActiveRecord::StatementInvalid> > Message: <"OCIError: ORA-00904: : invalid identifier: ALTER TABLE people RENAME COLUMN first_name to group"> > ---Backtrace--- > ./test/../lib/active_record/connection_adapters/abstract_adapter.rb:135:in `log'' > ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:214:in `execute_without_counting'' > ./test/abstract_unit.rb:71:in `execute'' > ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:400:in `rename_column'' > ./test/migration_test.rb:403:in `test_rename_column_with_sql_reserved_word'' > ./test/migration_test.rb:403:in `test_rename_column_with_sql_reserved_word'' > /usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.5.1/lib/mocha/test_case_adapter.rb:19:in `run'' > --------------- > > 1106 tests, 4073 assertions, 1 failures, 1 errors > rake aborted! > Command failed with status (1): [/usr/pkg/ruby184/bin/ruby -Ilib:test:test/...] > > (See full trace by running task with --trace) > > > > >-- Gabe da Silveira http://darwinweb.net --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Michael A. Schoen
2007-Jul-07 05:02 UTC
Re: Rails AR/Oracle Unit Test: [7167] failed (getting worse)
Gabe da Silveira wrote:> Ugg, this is from my patch. I know nothing about Oracle. Can someone > explain what the error means and why the query is in a subselect?Haven''t had a chance to look at yet, but for pagination (ie., limit or offset) you need to use a subquery for Oracle. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gabe da Silveira
2007-Jul-07 15:53 UTC
Re: Rails AR/Oracle Unit Test: [7167] failed (getting worse)
Hmmm, the test I added doesn''t use limit or offset... It''s just an INNER JOIN to test that SELECT * becomes SELECT table_name.* On 7/6/07, Michael A. Schoen <schoenm@earthlink.net> wrote:> > Gabe da Silveira wrote: > > Ugg, this is from my patch. I know nothing about Oracle. Can someone > > explain what the error means and why the query is in a subselect? > > Haven''t had a chance to look at yet, but for pagination (ie., limit or > offset) you need to use a subquery for Oracle. > > > > >-- Gabe da Silveira http://darwinweb.net --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---