From 2b2b28915d87a118a63212c5692eaee864ca79de Mon Sep 17 00:00:00 2001
From: Johannes Meyer <johannes.meyer@netways.de>
Date: Mon, 1 Dec 2014 11:00:12 +0100
Subject: [PATCH] Fix granting privileges on a mysql host

In case current_user() reports a wildcard identification for the user's
host (e.g. user@%) the percent sign was not escaped causing sprintf
to complain as there were too few arguments in this case.

fixes #7853
---
 modules/setup/library/Setup/Utils/DbTool.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/setup/library/Setup/Utils/DbTool.php b/modules/setup/library/Setup/Utils/DbTool.php
index 37d0673b1..a368bfa1a 100644
--- a/modules/setup/library/Setup/Utils/DbTool.php
+++ b/modules/setup/library/Setup/Utils/DbTool.php
@@ -486,7 +486,7 @@ class DbTool
                 'GRANT %%s ON %s.%%s TO %s@%s',
                 $this->quoteIdentifier($this->config['dbname']),
                 $this->quoteIdentifier($username),
-                $this->quoteIdentifier($host)
+                str_replace('%', '%%', $this->quoteIdentifier($host))
             );
 
             $dbPrivileges = array();