diff options
author | Cody Cutrer <cody@instructure.com> | 2013-12-13 15:20:03 -0700 |
---|---|---|
committer | Cody Cutrer <cody@cutrer.us> | 2013-12-14 07:07:10 -0700 |
commit | 75a2e4a8dff8c01dad913048d3676b993a8e23a2 (patch) | |
tree | 1cea1a48cc5d501f5146c392d5fa8d05c71b8637 /activerecord/test/cases/adapters/mysql2 | |
parent | 068580d4456e881e568de4a4d20a401e87b6c9e1 (diff) | |
download | rails-75a2e4a8dff8c01dad913048d3676b993a8e23a2.tar.gz rails-75a2e4a8dff8c01dad913048d3676b993a8e23a2.tar.bz2 rails-75a2e4a8dff8c01dad913048d3676b993a8e23a2.zip |
support creating temporary tables from queries
also override drop_table in AbstractMySQLAdapter to properly drop
temporary tables without committing the transaction
Diffstat (limited to 'activerecord/test/cases/adapters/mysql2')
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/schema_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/schema_test.rb b/activerecord/test/cases/adapters/mysql2/schema_test.rb index 5db60ff8a0..43c9116b5a 100644 --- a/activerecord/test/cases/adapters/mysql2/schema_test.rb +++ b/activerecord/test/cases/adapters/mysql2/schema_test.rb @@ -65,6 +65,15 @@ module ActiveRecord assert_nil index_c.using assert_equal :fulltext, index_c.type end + + def test_drop_temporary_table + @connection.transaction do + @connection.create_table(:temp_table, temporary: true) + # if it doesn't properly say DROP TEMPORARY TABLE, the transaction commit + # will complain that no transaction is active + @connection.drop_table(:temp_table, temporary: true) + end + end end end end |