- unless ($grantaccess) {
- $rq =
- $dbh->prepare("SHOW GRANTS FOR \'$info{user}\'\@'\%'");
- $rq->execute;
- while ( my ($line) = $rq->fetchrow ) {
- my $dbname = $info{dbname};
- if ( $line =~ m/$dbname/ || index( $line, '*.*' ) > 0 )
- {
- $grantaccess = 1
- if (
- index( $line, 'ALL PRIVILEGES' ) > 0
- || ( ( index( $line, 'SELECT' ) > 0 )
- && ( index( $line, 'INSERT' ) > 0 )
- && ( index( $line, 'UPDATE' ) > 0 )
- && ( index( $line, 'DELETE' ) > 0 )
- && ( index( $line, 'CREATE' ) > 0 )
- && ( index( $line, 'DROP' ) > 0 ) )
- );
- }
- }
- }