1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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* *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] * 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] * .with_scope imposed create parameters now bypass attr_protected [Tobias Luetke]

View file

@ -243,11 +243,11 @@ module ActiveRecord
end end
def create_database(name) #:nodoc: def create_database(name) #:nodoc:
execute "CREATE DATABASE #{name}" execute "CREATE DATABASE `#{name}`"
end end
def drop_database(name) #:nodoc: def drop_database(name) #:nodoc:
execute "DROP DATABASE IF EXISTS #{name}" execute "DROP DATABASE IF EXISTS `#{name}`"
end end