diff --git a/ChangeLog b/ChangeLog index 111cd47a50..eeed770cb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -69,6 +69,7 @@ phpMyAdmin - ChangeLog - bug #4075 Support A10 Networks load balancer - bug #4083 row deleting isn't binlogs friendly - bug #4163 Setup script does not recognize manually-configured server +- bug #4158 Events page says no privileges with ALL PRIVILEGES 4.0.9.0 (2013-11-04) - bug #4104 Can't edit updatable view when searching diff --git a/libraries/Util.class.php b/libraries/Util.class.php index b6c64afa1c..3fbdf06369 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -3849,7 +3849,15 @@ class PMA_Util // (wildcard characters appear as being quoted with a backslash // when querying TABLE_SCHEMA.SCHEMA_PRIVILEGES) $db = str_replace(array('%', '_'), array('\%', '\_'), $db); - $query .= " AND TABLE_SCHEMA='%s'"; + /* + * This is to take into account a wildcard db privilege + * so we replace % by .* and _ by . to be able to compare + * with REGEXP. + * + * Also, we need to double the inner % to please sprintf(). + */ + $query .= " AND '%s' REGEXP" + . " REPLACE(REPLACE(TABLE_SCHEMA, '_', '.'), '%%', '.*')"; $schema_privileges = $GLOBALS['dbi']->fetchValue( sprintf( $query,