Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

backport test fixs related to SQLite from master

#4633

At this moment the AR suite of 2-3-stable has a couple of failures:

  1) Failure:
test_should_sum_expression(CalculationsTest)
    [./test/cases/calculations_test.rb:300:in `test_should_sum_expression'
     ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `__send__'
     ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run']:
<"636"> expected but was
<636>.

  2) Failure:
test_cache_does_not_wrap_string_results_in_arrays(QueryCacheTest)
    [./test/cases/query_cache_test.rb:53:in `test_cache_does_not_wrap_string_results_in_arrays'
     ./test/cases/../../lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
     ./test/cases/../../lib/active_record/query_cache.rb:9:in `cache'
     ./test/cases/query_cache_test.rb:52:in `test_cache_does_not_wrap_string_results_in_arrays'
     ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `__send__'
     ./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run']:
<2> expected to be an instance of
<String> but was
<Fixnum>.

Perhaps they would be fixed backporting beda2d43 from master.

Reported by Xavier Noria · May 17th, 2010 @ 11:59 PM

State: resolved
Milestone: 2.3.6
Assigned to: Aaron Patterson Aaron Patterson
Importance: High

Activity

  1. Santiago Pastorino
    Santiago Pastorino
    • Tag set to activerecord, patch, sqlite3

    Backport here

    May 20th, 2010 @ 01:11 AM

  2. Aaron Patterson
    Aaron Patterson

    Here is my take on the backport.

    May 22nd, 2010 @ 07:19 PM

  3. Xavier Noria
  4. Santiago Pastorino
    Santiago Pastorino

    Here i'm sending a part of the backport that is important because is safer.
    And a tiny refactor for master, so the code on master and 2-3-stable follows the same logic.

    May 22nd, 2010 @ 08:51 PM

  5. Aaron Patterson
    Aaron Patterson

    +1 on both of these patches from me. They will make sure rails 2.3.x works with future versions of sqlite-ruby

    May 22nd, 2010 @ 10:55 PM

  6. Xavier Noria
    Xavier Noria

    Regarding the 2.3 patch, I see a similar string comparison on line 236:

    index.unique = row['unique'] != '0'
    

    Should that one get a #to_i call as well?

    Another question: these field and row values can't be nil right? You know, nil.to_i would give 0 and thus the test would pass, while now we have nil == "0", which would not.

    May 23rd, 2010 @ 10:20 PM

  7. Santiago Pastorino
    Santiago Pastorino

    my patch changes the line 236

    May 25th, 2010 @ 01:32 AM

  8. Repository
  9. Repository