So my automated script caught this issue, though I think my email headers were bad, so rails-core has put the automated email on hold pending "moderation". I''ll fix that issue, and look at the one below as well. -------- Original Message -------- Subject: Rails AR/Oracle Unit Test: [4185] failed Date: Thu, 6 Apr 2006 08:32:04 -0700 From: Michael Schoen <schoenm@earthlink.net> To: Michael Schoen <mschoen@looksmart.net>, Michael Schoen <schoenm@earthlink.net> "rick" made AR/Oracle cry... http://dev.rubyonrails.org/changeset/4185 ------------------------------------------------------------------------ r4185 | rick | 2006-04-06 08:23:56 -0700 (Thu, 06 Apr 2006) | 1 line Enable Limit/Offset in Calculations (closes #4558) [lmarlow@yahoo.com] ------------------------------------------------------------------------ U activerecord/test/calculations_test.rb U activerecord/lib/active_record/calculations.rb U activerecord/CHANGELOG Updated to revision 4185. 1) Error: test_should_limit_calculation(CalculationsTest): TypeError: can''t convert String into Array ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:310:in `replace'' ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:310:in `add_limit_offset!'' ./test/../lib/active_record/base.rb:1046:in `add_limit!'' ./test/../lib/active_record/calculations.rb:156:in `construct_calculation_sql'' ./test/../lib/active_record/calculations.rb:172:in `execute_grouped_calculation'' ./test/../lib/active_record/calculations.rb:139:in `calculate'' ./test/../lib/active_record/calculations.rb:92:in `sum'' ./test/calculations_test.rb:52:in `test_should_limit_calculation'' 2) Error: test_should_limit_calculation_with_offset(CalculationsTest): TypeError: can''t convert String into Array ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:310:in `replace'' ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:310:in `add_limit_offset!'' ./test/../lib/active_record/base.rb:1046:in `add_limit!'' ./test/../lib/active_record/calculations.rb:156:in `construct_calculation_sql'' ./test/../lib/active_record/calculations.rb:172:in `execute_grouped_calculation'' ./test/../lib/active_record/calculations.rb:139:in `calculate'' ./test/../lib/active_record/calculations.rb:92:in `sum'' ./test/calculations_test.rb:58:in `test_should_limit_calculation_with_offset'' 847 tests, 2823 assertions, 0 failures, 2 errors rake aborted! Command failed with status (1): [/usr/pkg/ruby184/bin/ruby -Ilib:test:test/...] (See full trace by running task with --trace)
So my automated script caught this issue, though I think my email headers were bad, so rails-core has put the automated email on hold pending "moderation". I''ll fix that issue, and look at the one below as well. -------- Original Message -------- Subject: Rails AR/Oracle Unit Test: [4185] failed Date: Thu, 6 Apr 2006 08:32:04 -0700 From: Michael Schoen <schoenm@earthlink.net> To: Michael Schoen <mschoen@looksmart.net>, Michael Schoen <schoenm@earthlink.net> "rick" made AR/Oracle cry... http://dev.rubyonrails.org/changeset/4185 ------------------------------------------------------------------------ r4185 | rick | 2006-04-06 08:23:56 -0700 (Thu, 06 Apr 2006) | 1 line Enable Limit/Offset in Calculations (closes #4558) [lmarlow@yahoo.com] ------------------------------------------------------------------------ U activerecord/test/calculations_test.rb U activerecord/lib/active_record/calculations.rb U activerecord/CHANGELOG Updated to revision 4185. 1) Error: test_should_limit_calculation(CalculationsTest): TypeError: can''t convert String into Array ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:310:in `replace'' ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:310:in `add_limit_offset!'' ./test/../lib/active_record/base.rb:1046:in `add_limit!'' ./test/../lib/active_record/calculations.rb:156:in `construct_calculation_sql'' ./test/../lib/active_record/calculations.rb:172:in `execute_grouped_calculation'' ./test/../lib/active_record/calculations.rb:139:in `calculate'' ./test/../lib/active_record/calculations.rb:92:in `sum'' ./test/calculations_test.rb:52:in `test_should_limit_calculation'' 2) Error: test_should_limit_calculation_with_offset(CalculationsTest): TypeError: can''t convert String into Array ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:310:in `replace'' ./test/../lib/active_record/connection_adapters/oracle_adapter.rb:310:in `add_limit_offset!'' ./test/../lib/active_record/base.rb:1046:in `add_limit!'' ./test/../lib/active_record/calculations.rb:156:in `construct_calculation_sql'' ./test/../lib/active_record/calculations.rb:172:in `execute_grouped_calculation'' ./test/../lib/active_record/calculations.rb:139:in `calculate'' ./test/../lib/active_record/calculations.rb:92:in `sum'' ./test/calculations_test.rb:58:in `test_should_limit_calculation_with_offset'' 847 tests, 2823 assertions, 0 failures, 2 errors rake aborted! Command failed with status (1): [/usr/pkg/ruby184/bin/ruby -Ilib:test:test/...] (See full trace by running task with --trace)
> "rick" made AR/Oracle cry...What a wuss! Here, try this: Apparently, the oracle adapter doesn''t like the fact that I used an array to construct the calculations queries. Index: lib/active_record/calculations.rb ==================================================================--- lib/active_record/calculations.rb (revision 4185) +++ lib/active_record/calculations.rb (working copy) @@ -145,7 +145,7 @@ protected def construct_calculation_sql(aggregate, aggregate_alias, options) #:nodoc: scope = scope(:find) - sql = ["SELECT #{aggregate} AS #{aggregate_alias}"] + sql = "SELECT #{aggregate} AS #{aggregate_alias}" sql << ", #{options[:group_field]} AS #{options[:group_alias]}" if options[:group] sql << " FROM #{table_name} " add_joins!(sql, options, scope) @@ -154,7 +154,7 @@ sql << " HAVING #{options[:having]}" if options[:group] && options[:having] sql << " ORDER BY #{options[:order]}" if options[:order] add_limit!(sql, options) - sql.join + sql end def execute_simple_calculation(operation, column_name, column, aggregate, aggregate_alias, options) #:nodoc: -- Rick Olson http://techno-weenie.net
Ha, just submitted that exact patch, #4626. Rick Olson wrote:>> "rick" made AR/Oracle cry... > > What a wuss! Here, try this: > > Apparently, the oracle adapter doesn''t like the fact that I used an > array to construct the calculations queries. > > Index: lib/active_record/calculations.rb > ==================================================================> --- lib/active_record/calculations.rb (revision 4185) > +++ lib/active_record/calculations.rb (working copy) > @@ -145,7 +145,7 @@ > protected > def construct_calculation_sql(aggregate, aggregate_alias, > options) #:nodoc: > scope = scope(:find) > - sql = ["SELECT #{aggregate} AS #{aggregate_alias}"] > + sql = "SELECT #{aggregate} AS #{aggregate_alias}" > sql << ", #{options[:group_field]} AS > #{options[:group_alias]}" if options[:group] > sql << " FROM #{table_name} " > add_joins!(sql, options, scope) > @@ -154,7 +154,7 @@ > sql << " HAVING #{options[:having]}" if options[:group] && > options[:having] > sql << " ORDER BY #{options[:order]}" if options[:order] > add_limit!(sql, options) > - sql.join > + sql > end > > def execute_simple_calculation(operation, column_name, > column, aggregate, aggregate_alias, options) #:nodoc: > > -- > Rick Olson > http://techno-weenie.net > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >
Ok, so how do we do better next time? We now had an automated alert of the breakage, Rick and I both came to the same fix, but 1.1.1 got tagged about 1/2hr before the patch got committed. Is it too late to update the 1.1.1 tag? Michael Schoen wrote:> Ha, just submitted that exact patch, #4626. > > Rick Olson wrote: >>> "rick" made AR/Oracle cry... >> >> What a wuss! Here, try this: >> >> Apparently, the oracle adapter doesn''t like the fact that I used an >> array to construct the calculations queries.
David Heinemeier Hansson
2006-Apr-06 21:53 UTC
Re: [Fwd: Rails AR/Oracle Unit Test: [4185] failed]
> We now had an automated alert of the breakage, Rick and I both came to > the same fix, but 1.1.1 got tagged about 1/2hr before the patch got > committed. > > Is it too late to update the 1.1.1 tag?Ugh. I thought Rick had applied this fix already. We''re going apply this to branches/stable, though, which is just for the latest release + fixes. -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework
David Heinemeier Hansson wrote:>> We now had an automated alert of the breakage, Rick and I both came to >> the same fix, but 1.1.1 got tagged about 1/2hr before the patch got >> committed. >> >> Is it too late to update the 1.1.1 tag? > > Ugh. I thought Rick had applied this fix already. We''re going apply > this to branches/stable, though, which is just for the latest release > + fixes.Any chance of updating the 1.1.1 gem that just got published? Having 2 official gem releases in a row w/ Oracle not fully working makes me sad.
David Heinemeier Hansson
2006-Apr-06 23:56 UTC
Re: [Fwd: Rails AR/Oracle Unit Test: [4185] failed]
> > Ugh. I thought Rick had applied this fix already. We''re going apply > > this to branches/stable, though, which is just for the latest release > > + fixes. > > Any chance of updating the 1.1.1 gem that just got published? Having 2 > official gem releases in a row w/ Oracle not fully working makes me sad.We can''t fix something that''s already out there. But I''ll post beta gems now, so at least you can get to this fix easily. And it''ll be in stable too. In any case, this fix is only for calculations that use limit/offset, right? Not really a big ticket problem. -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework