aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/tasks
diff options
context:
space:
mode:
authorRune Schjellerup Philosof <rp@centic.dk>2017-04-06 14:05:49 +0200
committerRune Schjellerup Philosof <rp@centic.dk>2017-04-20 10:14:07 +0200
commit2d699e24ff10158c0831cf6b7f5e5b12ac41903a (patch)
treeb45ebf13161a312298b019da50ff467e3909abab /activerecord/lib/active_record/tasks
parentfd097cff79c62fedabffae4e9f0fb53c2ec8bcbe (diff)
downloadrails-2d699e24ff10158c0831cf6b7f5e5b12ac41903a.tar.gz
rails-2d699e24ff10158c0831cf6b7f5e5b12ac41903a.tar.bz2
rails-2d699e24ff10158c0831cf6b7f5e5b12ac41903a.zip
Fix quoting in db:create grant all statement.
The database name used in the test would have actually shown this if it had tried to execute on a real Mysql instead of being stubbed out (dashes in database names needs quotes).
Diffstat (limited to 'activerecord/lib/active_record/tasks')
-rw-r--r--activerecord/lib/active_record/tasks/mysql_database_tasks.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb
index 920830b9cf..c05f0a8fbb 100644
--- a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb
+++ b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb
@@ -104,7 +104,7 @@ module ActiveRecord
def grant_statement
<<-SQL
-GRANT ALL PRIVILEGES ON #{configuration['database']}.*
+GRANT ALL PRIVILEGES ON `#{configuration['database']}`.*
TO '#{configuration['username']}'@'localhost'
IDENTIFIED BY '#{configuration['password']}' WITH GRANT OPTION;
SQL