Mysql::Error: You have an error in your SQL syntax; check the manual
corresponds to your MySQL server version for the right syntax to use
‘RELEASE SAVEPOINT active_record_1’ at line 1: RELEASE SAVEPOINT
a rails ticket concerning this error which was marked invalid:
another rails doc concerning issue:
Apparently any nested transaction (ex. a create statement inside a test)
will fail if you’re using MySQL.
still fighting it. If you create an ActiveRecord object in one ‘it’
it’s still there in the next block ?!?
The only workaround I’ve found for the MySQL’s unsupported nested
transactions is the following:
user1 = User.create(:name => “Alice”)
User.transaction(:requires_new => true) do
user2 = User.create(:name => “Bob”)
This is actually emulated using save points because most databases do
support nested transactions. Some databases (SQLite) donâ€™t support
save points or nested transactions, so in that case this works just like
Rails 2.2 where the inner transaction(s) have no effect and if there are
exceptions the entire transaction is rolled back.
PLUGIN SOLUTIONS that DON’T fix spec issues:
http://github.com/spint/savepoints/tree/master (github version with
support for oracle)
HELP, RSPEC COMMUNITY!!!