Permalink
Browse files

Escape database name in MySQL adapter when creating and dropping data…

…bases. Closes #3409.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent f1a01c8 commit 1e2b3d8b5a37e70134cf4dd05f6ff9e6d19bb0eb Marcel Molina committed Jan 13, 2006
Showing with 4 additions and 2 deletions.
  1. +2 −0 activerecord/CHANGELOG
  2. +2 −2 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
View
@@ -1,5 +1,7 @@
*SVN*
+* Escape database name in MySQL adapter when creating and dropping databases. #3409 [anna@wota.jp]
+
* Disambiguate table names for columns in validates_uniquness_of's WHERE clause. #3423 [alex.borovsky@gmail.com]
* .with_scope imposed create parameters now bypass attr_protected [Tobias Luetke]
@@ -243,11 +243,11 @@ def recreate_database(name) #:nodoc:
end
def create_database(name) #:nodoc:
- execute "CREATE DATABASE #{name}"
+ execute "CREATE DATABASE `#{name}`"
end
def drop_database(name) #:nodoc:
- execute "DROP DATABASE IF EXISTS #{name}"
+ execute "DROP DATABASE IF EXISTS `#{name}`"
end

0 comments on commit 1e2b3d8

Please sign in to comment.