This project is archived and is in readonly mode.
Thousands of errors on AR with ruby-sqlite3 and ruby 1.9.2
-
PacoGuzman
Verified.
In a clean installation of ruby-1.9.2-head with rvm in rails edge
-
PacoGuzman
I've found some not correct uses of assert and I changed them to assert_select. But this break the tests, I think this test not broken well before
I've attached the tests rewrite
I don't know how to proceed with this, any suggestions?
-
PacoGuzman
Excuse me. What I wanted to say is that those tests not worked well before
-
Rohit Arondekar
Verified
I think we need a way to break up those tests (maybe filewise?) so that individuals can work on them without tripping each other.
-
Jeremy Kemper
Paco, thanks for the test fixes (even if they now fail!)
Please upload a diff using
git format-patchso we can credit you as patch author. -
PacoGuzman
Jeremy, I've attached a new patch using git format-patch
-
Repository
(from [c2fb8afaa0e6a8f3d1782c97790a4bea8d4f0b0b]) Use assert_equal correctly in transaction callback tests (exposing some of them as broken)
[#4612 Thousands of errors on AR with ruby-sqlite3 and ruby 1.9.2]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/c2fb8afaa0e6a8f3d1782c97790a4b... -
Santiago Pastorino
Sorry guys, i didn't realize that i paste the wrong part of the output ... here are two of the hard failures ...
1034) Error: test_sane_find_with_scoped_lock(PessimisticLockingTest): SQLite3::SQLException: cannot rollback - no transaction is active /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `close' /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `ensure in prepare' /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `prepare' /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:125:in `execute' /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:512:in `rollback' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:183:in `block in rollback_db_transaction' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:390:in `catch_schema_changes' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:183:in `rollback_db_transaction' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:176:in `rescue in transaction' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:162:in `transaction' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:512:in `block (2 levels) in create_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:503:in `block in create_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/benchmarkable.rb:55:in `silence' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:502:in `create_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:939:in `setup_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:409:in `_run_setup_callbacks' /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:34:in `run' 1035) Error: test_sane_lock_method(PessimisticLockingTest): SQLite3::SQLException: cannot rollback - no transaction is active /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `close' /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `ensure in prepare' /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:89:in `prepare' /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:125:in `execute' /home/santiago/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-ruby-1.3.0.beta.2/lib/sqlite3/database.rb:512:in `rollback' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:183:in `block in rollback_db_transaction' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:390:in `catch_schema_changes' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:183:in `rollback_db_transaction' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:176:in `rescue in transaction' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:162:in `transaction' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:512:in `block (2 levels) in create_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:109:in `disable_referential_integrity' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:503:in `block in create_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/benchmarkable.rb:55:in `silence' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:502:in `create_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:964:in `load_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/fixtures.rb:939:in `setup_fixtures' /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:409:in `_run_setup_callbacks' /home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:34:in `run' -
Rohit Arondekar
Note that Rails is using sqlite3-ruby-1.3.0.beta.2 I think it's beta.2 that's causing problems because that cannot rollback error is pretty common.
-
PacoGuzman
Hi Rohit,
Santiago Pastorino detected this error when Rails edge were using sqlite3-ruby-1.3.0.beta.1
-
Rohit Arondekar
PacoGuzman, Santiago is it possible that the beta version of sqlite3 is causing this problem? Maybe something to do with transactions or rollbacks has changed.
-
Aaron Patterson
I've attached a patch that fixes it. The problem is that rails stores "binary" columns in sqlite3 as UTF-8 columns. It needs to force encoding the binary columns back to ascii-8bit before returning them.
-
Repository
- State changed from open to resolved
(from [eb69721c9bf2bd0f8957a231ecc91080b0645b84]) forcing encoding on 1.9 when dealing with "binary" columns [#4612 Thousands of errors on AR with ruby-sqlite3 and ruby 1.9.2 state:resolved]
Signed-off-by: wycats wycats@gmail.com
http://github.com/rails/rails/commit/eb69721c9bf2bd0f8957a231ecc910...
