From 69c7f024882f8150a2bda8536e1480d19c982e04 Mon Sep 17 00:00:00 2001 From: kennyj Date: Sat, 3 Mar 2012 22:25:15 +0900 Subject: Fix GH #3163. Should quote database on mysql/mysql2. --- activerecord/test/cases/adapters/mysql2/schema_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'activerecord/test/cases/adapters/mysql2/schema_test.rb') diff --git a/activerecord/test/cases/adapters/mysql2/schema_test.rb b/activerecord/test/cases/adapters/mysql2/schema_test.rb index d5676bc522..fd9996c937 100644 --- a/activerecord/test/cases/adapters/mysql2/schema_test.rb +++ b/activerecord/test/cases/adapters/mysql2/schema_test.rb @@ -35,6 +35,17 @@ module ActiveRecord def test_table_exists_wrong_schema assert(!@connection.table_exists?("#{@db_name}.zomg"), "table should not exist") end + + def test_tables_quoting + begin + @connection.tables(nil, "foo-bar", nil) + flunk + rescue => e + # assertion for *quoted* database properly + assert_match(/Access denied for user/, e.inspect) + end + end + end end end -- cgit v1.2.3