diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index c1a97b437..c72c48545 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -955,12 +955,14 @@ function PMA_DBI_postConnect($link, $is_controluser = false) if (! defined('PMA_MYSQL_INT_VERSION')) { if (PMA_cacheExists('PMA_MYSQL_INT_VERSION', true)) { define('PMA_MYSQL_INT_VERSION', PMA_cacheGet('PMA_MYSQL_INT_VERSION', true)); + define('PMA_MYSQL_MAJOR_VERSION', PMA_cacheGet('PMA_MYSQL_MAJOR_VERSION', true)); define('PMA_MYSQL_STR_VERSION', PMA_cacheGet('PMA_MYSQL_STR_VERSION', true)); } else { $mysql_version = PMA_DBI_fetch_value( 'SELECT VERSION()', 0, 0, $link, PMA_DBI_QUERY_STORE); if ($mysql_version) { $match = explode('.', $mysql_version); + define('PMA_MYSQL_MAJOR_VERSION', (int)$match[0]); define('PMA_MYSQL_INT_VERSION', (int) sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2]))); @@ -968,9 +970,11 @@ function PMA_DBI_postConnect($link, $is_controluser = false) unset($mysql_version, $match); } else { define('PMA_MYSQL_INT_VERSION', 50015); + define('PMA_MYSQL_MAJOR_VERSION', 5); define('PMA_MYSQL_STR_VERSION', '5.00.15'); } PMA_cacheSet('PMA_MYSQL_INT_VERSION', PMA_MYSQL_INT_VERSION, true); + PMA_cacheSet('PMA_MYSQL_MAJOR_VERSION', PMA_MYSQL_MAJOR_VERSION, true); PMA_cacheSet('PMA_MYSQL_STR_VERSION', PMA_MYSQL_STR_VERSION, true); } }