SQLite and SQLite3 builds are broken

Hi all,

As you may (or may not) remember, we started running continuous integration build of Rails over at http://cruisecontrolrb.thoughtworks.com/projects
last week.

Today, I’ve tried to add SQLite and SQLite3 builds to it, but it turns out that both builds are broken. Below are build outputs. While CC.rb host is an OS X box, I also reproduced the same failures on a Linux.

It wouldn’t be right to add to the build anything currently broken, so if you are passionate about SQLite adapter, please fix the builds and ping me back.
I will then add them to the CI build and if they are ever broken again, it won’t go unnoticed.

– AV

cruisecontrolrb:~/src/cruise/projects/RubyOnRails/work/activerecord cruise$ rake test_sqlite (in /Users/cruise/src/cruise/projects/RubyOnRails/work/activerecord)

/opt/local/bin/ruby -Ilib:test:test/connections/native_sqlite “/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb” “test/aaa_create_tables_test.rb” “test/adapter_test.rb” “test/aggregations_test.rb” “test/ar_schema_test.rb” “test/associations_test.rb” “test/attribute_methods_test.rb” “test/base_test.rb” “test/binary_test.rb” “test/calculations_test.rb” “test/callbacks_test.rb” “test/class_inheritable_attributes_test.rb” “test/column_alias_test.rb” “test/defaults_test.rb” “test/deprecated_associations_test.rb” “test/deprecated_finder_test.rb” “test/empty_date_time_test.rb” “test/finder_test.rb” “test/fixtures_test.rb” “test/inheritance_test.rb” “test/lifecycle_test.rb” “test/locking_test.rb” “test/method_scoping_test.rb” “test/migration_test.rb” “test/mixin_nested_set_test.rb” “test/mixin_test.rb” “test/modules_test.rb” “test/multiple_db_test.rb” “test/pk_test.rb” “test/query_cache_test.rb” “test/readonly_test.rb” “test/reflection_test.rb” “test/schema_dumper_test.rb” “test/threaded_connections_test.rb” “test/transactions_test.rb” “test/unconnected_test.rb” “test/validations_test.rb” “test/xml_serialization_test.rb” “test/associations/callbacks_test.rb” “test/associations/cascaded_eager_loading_test.rb” “test/associations/eager_singularization_test.rb” “test/associations/eager_test.rb” “test/associations/extension_test.rb” “test/associations/join_model_test.rb”

Using native SQlite
Loaded suite /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader
Started
…FF…E…

Finished in 30.317663 seconds.

  1. Failure:
    test_native_decimal_insert_manual_vs_automatic(MigrationTest)
    [./test/migration_test.rb:235:in test_native_decimal_insert_manual_vs_automatic' /opt/local/lib/ruby/gems/1.8/gems/mocha- 0.4.0/lib/mocha/test_case_adapter.rb:19:in send
    /opt/local/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/test_case_adapter.rb:19:in `run’]:
    <#<BigDecimal:323e4a4,‘0.1234567890 12346E20’,16(20)>> expected but was

<#<BigDecimal:3220b34,‘0.1234567890 1234567890 0123456789E20’,32(36)>>.

  1. Failure:
    test_native_types(MigrationTest)
    [./test/migration_test.rb:285:in test_native_types' /opt/local/lib/ruby/gems/1.8/gems/mocha- 0.4.0/lib/mocha/test_case_adapter.rb:19:in send
    /opt/local/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/test_case_adapter.rb:19:in `run’]:
    <#<BigDecimal:2f8274c,‘0.1234567890 12346E20’,16(20)>> expected but was

<#<BigDecimal:2f82698,‘0.1234567890 1234567890 0123456789E20’,32(36)>>.

  1. Error:
    test_manually_rolling_back_a_transaction(TransactionTest):
    SQLite::Exceptions::SQLException: cannot commit - no transaction is active
/opt/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/lib/sqlite/resultset.rb:71:in `compile'
/opt/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/lib/sqlite/resultset.rb:71:in `commence'
/opt/local/lib/ruby/gems/1.8/gems/sqlite-

ruby-2.2.3/lib/sqlite/resultset.rb:65:in initialize' /opt/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/lib/sqlite/statement.rb:104:in new’
/opt/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/lib/sqlite/statement.rb:104:in `execute’

/opt/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/lib/sqlite/database.rb:194:in `execute'
/opt/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/lib/sqlite/database.rb:594:in `commit'
./test/../lib/active_record/connection_adapters/sqlite_adapter.rb:196:in `commit_db_transaction'

./test/../lib/active_record/connection_adapters/sqlite_adapter.rb:361:in `catch_schema_changes'
./test/../lib/active_record/connection_adapters/sqlite_adapter.rb:196:in `commit_db_transaction'
./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:69:in `transaction'

./test/../lib/active_record/transactions.rb:106:in `transaction'
./test/transactions_test.rb:172:in `test_manually_rolling_back_a_transaction'
/opt/local/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/test_case_adapter.rb:19:in `__send__'

/opt/local/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/test_case_adapter.rb:19:in `run'

1069 tests, 4051 assertions, 2 failures, 1 errors
rake aborted!

cruisecontrolrb:~/src/cruise/projects/RubyOnRails/work/activerecord cruise$ rake test_sqlite3

(in /Users/cruise/src/cruise/projects/RubyOnRails/work/activerecord)
/opt/local/bin/ruby -Ilib:test:test/connections/native_sqlite3 “/opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb” “test/aaa_create_tables_test.rb” “test/adapter_test.rb” “test/aggregations_test.rb” “test/ar_schema_test.rb” “test/associations_test.rb” “test/attribute_methods_test.rb” “test/base_test.rb” “test/binary_test.rb” “test/calculations_test.rb” “test/callbacks_test.rb” “test/class_inheritable_attributes_test.rb” “test/column_alias_test.rb” “test/defaults_test.rb” “test/deprecated_associations_test.rb” “test/deprecated_finder_test.rb” “test/empty_date_time_test.rb” “test/finder_test.rb” “test/fixtures_test.rb” “test/inheritance_test.rb” “test/lifecycle_test.rb” “test/locking_test.rb” “test/method_scoping_test.rb” “test/migration_test.rb” “test/mixin_nested_set_test.rb” “test/mixin_test.rb” “test/modules_test.rb” “test/multiple_db_test.rb” “test/pk_test.rb” “test/query_cache_test.rb” “test/readonly_test.rb” “test/reflection_test.rb” “test/schema_dumper_test.rb” “test/threaded_connections_test.rb” “test/transactions_test.rb” “test/unconnected_test.rb” “test/validations_test.rb” “test/xml_serialization_test.rb” “test/associations/callbacks_test.rb” “test/associations/cascaded_eager_loading_test.rb” “test/associations/eager_singularization_test.rb” “test/associations/eager_test.rb” “test/associations/extension_test.rb” “test/associations/join_model_test.rb”

Using native SQLite3
Loaded suite /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader
Started
…/opt/local/lib/ruby/gems/1.8/gems/sqlite3-
ruby-1.2.1/lib/sqlite3/errors.rb:94:in check': SQL logic error or missing database (SQLite3::SQLException) from /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:76:in check’

    from /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:68:in `commence'
    from /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:61:in `initialize'

    from /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/statement.rb:163:in `new'
    from /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/statement.rb:163:in `execute'

    from /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:212:in `execute'
    from /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:187:in `prepare'

    from /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:211:in `execute'
     ... 19 levels...
    from /opt/local/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run'

    from /opt/local/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run'
    from /opt/local/lib/ruby/1.8/test/unit.rb:278
    from /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5