Problems with InnoDB status output

This commit is contained in:
Alexander M. Turek
2005-01-15 00:27:48 +00:00
parent 36bb21a53d
commit 11bdb47d57

View File

@@ -84,16 +84,19 @@ if (empty($engine) || empty($mysql_storage_engines[$engine])) {
. ' ' . htmlspecialchars($mysql_storage_engines[$engine]['Comment']) . "\n" . ' ' . htmlspecialchars($mysql_storage_engines[$engine]['Comment']) . "\n"
. ' </i>' . "\n" . ' </i>' . "\n"
. '</p>' . "\n"; . '</p>' . "\n";
$engine_supported = FALSE;
switch ($mysql_storage_engines[$engine]['Support']) { switch ($mysql_storage_engines[$engine]['Support']) {
case 'DEFAULT': case 'DEFAULT':
echo '<p>' echo '<p>'
. ' ' . sprintf($strDefaultEngine, htmlspecialchars($mysql_storage_engines[$engine]['Engine'])) . "\n" . ' ' . sprintf($strDefaultEngine, htmlspecialchars($mysql_storage_engines[$engine]['Engine'])) . "\n"
. '</p>' . "\n"; . '</p>' . "\n";
$engine_supported = TRUE;
break; break;
case 'YES': case 'YES':
echo '<p>' . "\n" echo '<p>' . "\n"
. ' ' . sprintf($strEngineAvailable, htmlspecialchars($mysql_storage_engines[$engine]['Engine'])) . "\n" . ' ' . sprintf($strEngineAvailable, htmlspecialchars($mysql_storage_engines[$engine]['Engine'])) . "\n"
. '</p>' . "\n"; . '</p>' . "\n";
$engine_supported = TRUE;
break; break;
case 'NO': case 'NO':
echo '<p>' . "\n" echo '<p>' . "\n"
@@ -107,25 +110,30 @@ if (empty($engine) || empty($mysql_storage_engines[$engine])) {
break; break;
} }
switch ($engine) { if ($engine_supported) switch ($engine) {
case 'innodb': case 'innodb':
case 'innobase': case 'innobase':
echo '<h3>' . "\n" if ($res = PMA_DBI_try_query('SHOW INNODB STATUS;')) { // We might not have the privileges to do that...
. ' ' . $strInnodbStat . "\n" echo '<h3>' . "\n"
. '</h3>' . "\n\n"; . ' ' . $strInnodbStat . "\n"
$res = PMA_DBI_query('SHOW INNODB STATUS;'); . '</h3>' . "\n\n";
$row = PMA_DBI_fetch_row($res); $row = PMA_DBI_fetch_row($res);
echo '<pre>' . "\n" echo '<pre>' . "\n"
. htmlspecialchars($row[0]) . "\n" . htmlspecialchars($row[0]) . "\n"
. '</pre>' . "\n"; . '</pre>' . "\n";
PMA_DBI_free_result($res); PMA_DBI_free_result($res);
break; unset($row);
break;
}
unset($res);
// break;
default: default:
echo '<p>' . "\n" echo '<p>' . "\n"
. ' ' . $strNoDetailsForEngine . "\n" . ' ' . $strNoDetailsForEngine . "\n"
. '</p>' . "\n"; . '</p>' . "\n";
break; break;
} }
unset($engine_supported);
} }