Michael Schoen
2007-Mar-09 03:29 UTC
Rails AR/Oracle Unit Test: [6364] failed (getting worse)
"bitsweat" has kicked AR/Oracle while it was down...
http://dev.rubyonrails.org/changeset/6364
------------------------------------------------------------------------
r6364 | bitsweat | 2007-03-08 19:23:37 -0800 (Thu, 08 Mar 2007) | 1 line
Consistently quote primary key column names. Closes #7763.
------------------------------------------------------------------------
A activerecord/test/fixtures/mixed_case_monkey.rb
U activerecord/test/fixtures/db_definitions/frontbase.sql
U activerecord/test/fixtures/db_definitions/frontbase.drop.sql
U activerecord/test/fixtures/db_definitions/firebird.drop.sql
U activerecord/test/fixtures/db_definitions/sqlserver.drop.sql
U activerecord/test/fixtures/db_definitions/sybase.drop.sql
U activerecord/test/fixtures/db_definitions/openbase.sql
U activerecord/test/fixtures/db_definitions/sqlite.sql
U activerecord/test/fixtures/db_definitions/sqlite.drop.sql
U activerecord/test/fixtures/db_definitions/oracle.sql
U activerecord/test/fixtures/db_definitions/mysql.sql
U activerecord/test/fixtures/db_definitions/db2.sql
U activerecord/test/fixtures/db_definitions/oracle.drop.sql
U activerecord/test/fixtures/db_definitions/mysql.drop.sql
U activerecord/test/fixtures/db_definitions/db2.drop.sql
U activerecord/test/fixtures/db_definitions/firebird.sql
U activerecord/test/fixtures/db_definitions/sqlserver.sql
U activerecord/test/fixtures/db_definitions/sybase.sql
U activerecord/test/fixtures/db_definitions/postgresql.sql
U activerecord/test/fixtures/db_definitions/postgresql.drop.sql
A activerecord/test/fixtures/mixed_case_monkeys.yml
U activerecord/test/pk_test.rb
U activerecord/lib/active_record/base.rb
U activerecord/CHANGELOG
Updated to revision 6364.
1) Failure:
test_native_types(MigrationTest)
[./test/migration_test.rb:307:in `test_native_types''
/usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/test_case_adapter.rb:19:in
`run'']:
<Rational(-1, 3)> expected but was
<0>.
2) Failure:
test_update_counters_should_quote_pkey_and_quote_counter_columns(PrimaryKeysTest)
[./test/pk_test.rb:87:in
`test_update_counters_should_quote_pkey_and_quote_counter_columns''
/usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/test_case_adapter.rb:19:in
`run'']:
Exception raised:
Class: <ActiveRecord::StatementInvalid>
Message: <"OCIError: ORA-00904: \"FLEACOUNT\": invalid
identifier: UPDATE mixed_case_monkeys SET fleaCount = fleaCount + 99 WHERE
(\"monkeyID\" = 1) ">
---Backtrace---
./test/../lib/active_record/connection_adapters/abstract_adapter.rb:139:in
`log''
./test/../lib/active_record/connection_adapters/oracle_adapter.rb:222:in
`execute_without_counting''
./test/abstract_unit.rb:73:in `execute''
./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:42:in
`update''
./test/../lib/active_record/base.rb:500:in `update_all''
./test/../lib/active_record/base.rb:542:in
`update_counters_without_lock''
./test/../lib/active_record/locking/optimistic.rb:122:in
`update_counters''
./test/pk_test.rb:87:in
`test_update_counters_should_quote_pkey_and_quote_counter_columns''
./test/pk_test.rb:87:in
`test_update_counters_should_quote_pkey_and_quote_counter_columns''
/usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/test_case_adapter.rb:19:in
`run''
---------------
1060 tests, 4075 assertions, 2 failures, 0 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
-~----------~----~----~----~------~----~------~--~---
Tim Lucas
2007-Mar-09 04:14 UTC
Re: Rails AR/Oracle Unit Test: [6364] failed (getting worse)
Looks like it uncovered a bug in the Oracle adapter. On 09/03/2007, at 2:29 PM, Michael Schoen wrote:> > "bitsweat" has kicked AR/Oracle while it was down... > > http://dev.rubyonrails.org/changeset/6364 > ---------------------------------------------------------------------- > -- > r6364 | bitsweat | 2007-03-08 19:23:37 -0800 (Thu, 08 Mar 2007) | 1 > line > > Consistently quote primary key column names. Closes #7763. > ---------------------------------------------------------------------- > -- > > 1) Failure: > test_native_types(MigrationTest) > [./test/migration_test.rb:307:in `test_native_types'' > /usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/ > test_case_adapter.rb:19:in `run'']: > <Rational(-1, 3)> expected but was > <0>.no idea what that''s from. That was failing before this commit, yeah?> 2) Failure: > test_update_counters_should_quote_pkey_and_quote_counter_columns > (PrimaryKeysTest) > [./test/pk_test.rb:87:in > `test_update_counters_should_quote_pkey_and_quote_counter_columns'' > /usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/ > test_case_adapter.rb:19:in `run'']: > Exception raised: > Class: <ActiveRecord::StatementInvalid> > Message: <"OCIError: ORA-00904: \"FLEACOUNT\": invalid identifier: > UPDATE mixed_case_monkeys SET fleaCount = fleaCount + 99 WHERE > (\"monkeyID\" = 1) ">Looks like the Oracle adapter method doesn''t like symbols, but core expects to be able to pass them (OracleAdapter, L164): def quote_column_name(name) #:nodoc: name =~ /[A-Z]/ ? "\"#{name}\"" : name end needs a "to_s" on the name comparison: def quote_column_name(name) #:nodoc: name.to_s =~ /[A-Z]/ ? "\"#{name}\"" : name end Here''s an AdapterTestOracle you might wanna add to ensure things do what they''re meant to do: require ''abstract_unit'' class AdapterTestOracle < Test::Unit::TestCase def setup @connection = ActiveRecord::Base.connection end def test_should_quote_string_mixed_case_column_names assert_equal %("mixedCase"), @connection.quote_column_name ("mixedCase") end def test_should_quote_symbol_mixed_case_column_names assert_equal %("mixedCase"), @connection.quote_column_name (:mixedCase) end end Want me to submit another patch for this bug? I can''t actually test Oracle though... -- tim --~--~---------~--~----~------------~-------~--~----~ 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-Mar-09 05:38 UTC
Re: Rails AR/Oracle Unit Test: [6364] failed (getting worse)
Tim Lucas wrote:> Want me to submit another patch for this bug? I can''t actually test > Oracle though...Thanks Tim. I''ll bundle this up w/ a patch for the other issue, probably sometime tomorrow. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tim Lucas
2007-Mar-09 06:37 UTC
Re: Rails AR/Oracle Unit Test: [6364] failed (getting worse)
On 09/03/2007, at 4:38 PM, Michael A. Schoen wrote:> Tim Lucas wrote: >> Want me to submit another patch for this bug? I can''t actually test >> Oracle though... > > Thanks Tim. I''ll bundle this up w/ a patch for the other issue, > probably > sometime tomorrow.cool cool. -- tim --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---