X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/1efc049dfc1cee42a2b13b8932274053aa129c07..3369f9515111a99387cda562a342f94ea1a13778:/cookbooks/mysql/libraries/mysql.rb?ds=inline diff --git a/cookbooks/mysql/libraries/mysql.rb b/cookbooks/mysql/libraries/mysql.rb index 516c38a41..a40161be0 100644 --- a/cookbooks/mysql/libraries/mysql.rb +++ b/cookbooks/mysql/libraries/mysql.rb @@ -85,7 +85,9 @@ module OpenStreetMap end def mysql_users - @mysql_users ||= query("SELECT * FROM user").each_with_object({}) do |user, users| + privilege_columns = USER_PRIVILEGES.collect { |privilege| "#{privilege}_priv" }.join(", ") + + @mysql_users ||= query("SELECT user, host, #{privilege_columns} FROM user").each_with_object({}) do |user, users| name = "'#{user[:user]}'@'#{user[:host]}'" users[name] = USER_PRIVILEGES.each_with_object({}) do |privilege, privileges|