TT#25061 add missing user/host quotes in sql

* that is to allow user/host names with special
      characters

Change-Id: I83005a433d1692f8f98deaf08b3fc5365250567a
changes/55/17255/1
Kirill Solomko 8 years ago
parent 25ed23eac6
commit 8fdb54b8c4

@ -348,7 +348,7 @@ sub grants_helper {
my $host = $TEMP_GRANT_HOST;
set_user_protected_password($user, $host);
$dbh->do("REVOKE ALL PRIVILEGES, GRANT OPTION FROM $user\@$host");
$dbh->do("REVOKE ALL PRIVILEGES, GRANT OPTION FROM '$user'\@'$host'");
foreach my $grant (@$grants) {
$grant = normalise_grant_str($grant);
@ -365,7 +365,7 @@ sub grants_helper {
}
my $temp_grants = $dbh->selectall_arrayref(
"SHOW GRANTS FOR ?\@?", undef, $user, $host);
"SHOW GRANTS FOR '$user'\@'$host'");
for (my $i=0;$i<=$#$temp_grants;$i++) {
if ($temp_grants->[$i][0] =~ /grant usage/i) {
@ -421,7 +421,7 @@ sub check_grants {
my ($grants, $user, $host) = @_;
my $current_grants = $dbh->selectall_arrayref(
"SHOW GRANTS FOR ?\@?", undef, $user, $host);
"SHOW GRANTS FOR '$user'\@'$host'");
if ($DBI::errstr
&& ($DBI::errstr !~ /There is no such grant defined/ &&
$DBI::errstr !~ /fetch[()]+ without execute[()]+/)) {

Loading…
Cancel
Save