Here’s an other thing that is not supposed to happen, but invariably does.
Playing aroung with Unit Testing in Rails (you are using them, right?), one test fails with:
Exception `ActiveRecord::StatementInvalid’ at
…/active_record/connection_adapters/mysql_adapter.rb:185
- Mysql::Error: Warning: Some non-transactional changed
tables couldn’t be rolled back: ROLLBACK
Turns out that on my OS (debian), the default mysql database table type is MyISAM and it does not support ROLLBACK, try InnoDB instead.
March 12, 2006 update:
In case this is not possible, or too much problem, there is an other solution (albeit slower).
In test/test_helper.rb, change:
self.use_transactional_fixtures = true
to
self.use_transactional_fixtures = false
this way, the testing framework won’t use rollback but drop and recreate the tables each time (which explains why this is slower).
Thanks man, I changed the engine to InnoDB and now it works fine. Does that make the table size bigger by the way?
Not sure it impacts size too much, at least not in a meaningful way. However, the performance characteristics may be different. See http://low.cc/t2TGt