Escape database name in MySQL adapter when creating and dropping databases. Closes #3409.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Marcel Molina 2006-01-13 01:58:11 +00:00
parent f1a01c80db
commit 1e2b3d8b5a
2 changed files with 4 additions and 2 deletions

View File

@ -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]

View File

@ -243,11 +243,11 @@ module ActiveRecord
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