Merge pull request #1076 from bfabiszewski/master

Fix for missing 'Trigger' menu for older MySQL versions
This commit is contained in:
Michal Čihař 2014-03-19 16:28:30 +01:00
commit b2a37601fe

View File

@ -3817,6 +3817,12 @@ class PMA_Util
*/
public static function currentUserHasPrivilege($priv, $db = null, $tbl = null)
{
// TRIGGER privilege was added in MySQL 5.1.6.
// Before MySQL 5.1.6, the SUPER privilege was required to create or drop triggers.
if ($priv == "TRIGGER" && PMA_MYSQL_INT_VERSION < 50160) {
$priv = "SUPER";
}
// Get the username for the current user in the format
// required to use in the information schema database.
$user = $GLOBALS['dbi']->fetchValue("SELECT CURRENT_USER();");