This project is archived and is in readonly mode.

#2943 ✓wontfix
Rob Aldred

drop_table to support temporary option like create_table

Reported by Rob Aldred | July 23rd, 2009 @ 04:09 PM | in 2.x

Part of an application I am working on creates and drops temporary tables for processing data.
I have run in to a few problems where creating and dropping tables breaks testing with transaction fixtures because calling CREATE TABLE or DROP TABLE causes an implicit COMMIT.

Any action called using active record after a drop_table in a test causes the following error:

Mysql::Error: SAVEPOINT active_record_1 does not exist: 
ROLLBACK TO SAVEPOINT active_record_1 (ActiveRecord::StatementInvalid)

Using temporary tables does not have this behavior, create_table already has the :temporary options available, I have proposed a patch to drop_table to mimic the :temporary option.

Thanks
--Rob

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages