diff --git a/ChangeLog b/ChangeLog index cacdb4604..fd9bad0dc 100755 --- a/ChangeLog +++ b/ChangeLog @@ -12,8 +12,9 @@ $Source$ libraries/engines/myisam.lib.php: - Moved engine-specific settings into plugins; - Added ability to create multiple sub-pages in server_engines.php for - a specific engine. + a specific engine; - Added a few InnoDB variables. To be continued. :-) + - New InnoDB buffer pool monitor for MySQL >= 5.0.2. 2005-03-04 Marc Delisle * Documentation.html, libraries/common.lib.php: new FAQ 2.8 about diff --git a/libraries/engines/innodb.lib.php b/libraries/engines/innodb.lib.php index 500542378..a88b1102a 100644 --- a/libraries/engines/innodb.lib.php +++ b/libraries/engines/innodb.lib.php @@ -11,6 +11,11 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine { ), 'innodb_data_file_path' => array( 'title' => $GLOBALS['strInnoDBDataFilePath'] + ), + 'innodb_autoextend_increment' => array( + 'title' => $GLOBALS['strInnoDBAutoextendIncrement'], + 'desc' => $GLOBALS['strInnoDBAutoextendIncrementDesc'], + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC ) ); } @@ -20,21 +25,105 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine { } function getInfoPages () { - return array( - 'status' => $GLOBALS['strInnodbStat'] - ); + if ($this->support < PMA_ENGINE_SUPPORT_YES) { + return array(); + } + $pages = array(); + if (PMA_MYSQL_INT_VERSION >= 50002) { + $pages['bufferpool'] = $GLOBALS['strBufferPool']; + } + $pages['status'] = $GLOBALS['strInnodbStat']; + return $pages; } function getPage($id) { - if ($id == 'status') { - $res = PMA_DBI_query('SHOW INNODB STATUS;'); - $row = PMA_DBI_fetch_row($res); - PMA_DBI_free_result($res); - return '
' . "\n"
-                  . htmlspecialchars($row[0]) . "\n"
-                  . '
' . "\n"; - } else { - return FALSE; + global $cfg; + + switch ($id) { + case 'bufferpool': + if (PMA_MYSQL_INT_VERSION < 50002) { + return FALSE; + } + $res = PMA_DBI_query('SHOW STATUS LIKE \'Innodb\\_buffer\\_pool\\_%\''); + $status = array(); + while ($row = PMA_DBI_fetch_row($res)) { + $status[$row[0]] = $row[1]; + } + PMA_DBI_free_result($res); + unset($res, $row); + $output = '' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . '
' . "\n" + . ' ' . $GLOBALS['strBufferPoolUsage'] . "\n" + . '
' . "\n" + . ' ' . $GLOBALS['strTotalUC'] . "\n" + . ' ' . "\n" + . ' ' . htmlspecialchars($status['Innodb_buffer_pool_pages_total']) . "\n" + . '
' . "\n" + . '  ' . $GLOBALS['strFreePages'] . ' ' . "\n" + . ' ' . "\n" + . ' ' . htmlspecialchars($status['Innodb_buffer_pool_pages_free']) . "\n" + . ' ' . "\n" + . '  ' . $GLOBALS['strDirtyPages'] . ' ' . "\n" + . ' ' . "\n" + . ' ' . htmlspecialchars($status['Innodb_buffer_pool_pages_dirty']) . "\n" + . '
' . "\n" + . '  ' . $GLOBALS['strDataPages'] . ' ' . "\n" + . ' ' . "\n" + . ' ' . htmlspecialchars($status['Innodb_buffer_pool_pages_data']) . "\n" + . ' ' . "\n" + . '  ' . $GLOBALS['strPagesToBeFlushed'] . ' ' . "\n" + . ' ' . "\n" + . ' ' . htmlspecialchars($status['Innodb_buffer_pool_pages_flushed']) . "\n" + . '
' . "\n" + . '  ' . $GLOBALS['strBusyPages'] . ' ' . "\n" + . ' ' . "\n" + . ' ' . htmlspecialchars($status['Innodb_buffer_pool_pages_misc']) . "\n" + . ' ' . "\n" + . '  ' . $GLOBALS['strLatchedPages'] . ' ' . "\n" + . ' ' . "\n" + . ' ' . htmlspecialchars($status['Innodb_buffer_pool_pages_latched']) . "\n" + . '
' . "\n"; + return $output; + case 'status': + $res = PMA_DBI_query('SHOW INNODB STATUS;'); + $row = PMA_DBI_fetch_row($res); + PMA_DBI_free_result($res); + return '
' . "\n"
+                      . htmlspecialchars($row[0]) . "\n"
+                      . '
' . "\n"; + default: + return FALSE; } } } diff --git a/server_engines.php b/server_engines.php index 0b3142aac..8c6257121 100644 --- a/server_engines.php +++ b/server_engines.php @@ -32,6 +32,7 @@ require('./server_links.inc.php'); define('PMA_ENGINE_DETAILS_TYPE_PLAINTEXT', 0); define('PMA_ENGINE_DETAILS_TYPE_SIZE', 1); define('PMA_ENGINE_DETAILS_TYPE_NUMERIC', 2); //Has no effect yet... +define('PMA_ENGINE_DETAILS_TYPE_BOOLEAN', 3); // 'ON' or 'OFF' function PMA_generateEngineDetails($variables, $like = NULL, $indent = 0) { global $cfg; @@ -69,36 +70,36 @@ function PMA_generateEngineDetails($variables, $like = NULL, $indent = 0) { foreach ($variables as $var => $details) { if (!isset($mysql_vars[$var])) continue; - if (!isset($details['type'])) $details['type'] = PMA_ENGINE_DETAILS_TYPE_PLAINTEXT; - $is_num = $details['type'] == PMA_ENGINE_DETAILS_TYPE_SIZE || $details['type'] == PMA_ENGINE_DETAILS_TYPE_NUMERIC; + if (!isset($details['type'])) $details['type'] = PMA_ENGINE_DETAILS_TYPE_PLAINTEXT; + $is_num = $details['type'] == PMA_ENGINE_DETAILS_TYPE_SIZE || $details['type'] == PMA_ENGINE_DETAILS_TYPE_NUMERIC; $bgcolor = $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; $dt_table .= $spaces . ' ' . "\n" - . $spaces . ' ' . "\n"; - if (!empty($variables[$var]['desc'])) { - $dt_table .= $spaces . ' ' . PMA_showHint($details['desc']) . "\n"; - } - $dt_table .= $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '  ' . $details['title'] . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . '  '; + . $spaces . ' ' . "\n"; + if (!empty($variables[$var]['desc'])) { + $dt_table .= $spaces . ' ' . PMA_showHint($details['desc']) . "\n"; + } + $dt_table .= $spaces . ' ' . "\n" + . $spaces . ' ' . "\n" + . $spaces . '  ' . $details['title'] . ' ' . "\n" + . $spaces . ' ' . "\n" + . $spaces . ' ' . "\n" + . $spaces . '  '; switch ($details['type']) { - case PMA_ENGINE_DETAILS_TYPE_SIZE: - $parsed_size = PMA_formatByteDown($mysql_vars[$var]); - $dt_table .= $parsed_size[0] . ' ' . $parsed_size[1]; - unset($parsed_size); - break; - default: - $dt_table .= htmlspecialchars($mysql_vars[$var]); - } - $dt_table .= ' ' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n"; + case PMA_ENGINE_DETAILS_TYPE_SIZE: + $parsed_size = PMA_formatByteDown($mysql_vars[$var]); + $dt_table .= $parsed_size[0] . ' ' . $parsed_size[1]; + unset($parsed_size); + break; + default: + $dt_table .= htmlspecialchars($mysql_vars[$var]); + } + $dt_table .= ' ' . "\n" + . $spaces . ' ' . "\n" + . $spaces . ' ' . "\n"; $useBgcolorOne = !$useBgcolorOne; - $has_content = TRUE; + $has_content = TRUE; } if (!$has_content) return '';