MT#22031 ngcp-sync-grants compatibility with MariaDB

* MariaDB + dbd::mysql: dbh->select* returns
      "fetch() without execute()" on non-table based sql
      statements such as "SHOW GRANTS FOR ..." when there are
      no rows to return. Such false error is avoided as
      execute() is performed automatically by DBI on "non-prepare()"
      methods.

Change-Id: Iac1c1c0473f39ed9f377abb5dea1cbcfbc67868a
changes/91/8091/5
Kirill Solomko 10 years ago
parent f7501760c0
commit e6a21c16d5

@ -359,7 +359,8 @@ sub check_grants {
my $current_grants = $dbh->selectall_arrayref(
"SHOW GRANTS FOR ?\@?", undef, $user, $host);
if ($DBI::errstr
&& $DBI::errstr !~ /There is no such grant defined/) {
&& ($DBI::errstr !~ /There is no such grant defined/ &&
$DBI::errstr !~ /fetch[()]+ without execute[()]+/)) {
die sprintf "Cannot select grants for %s\@%s: %s",
$user, $host, $DBI::errstr;
}

Loading…
Cancel
Save