diff --git a/ChangeLog b/ChangeLog index 047adb695..71211ae5b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - ChangeLog $Id$ $Source$ +2006-04-27 Sebastian Mendel + * db_printview.php: fixed bug 'no tables found', refactored + 2006-04-27 Michal Čihař * Documentation.html, libraries/config.default.php, libraries/auth/cookie.auth.lib.php: Logout from all servers by default diff --git a/db_printview.php b/db_printview.php index 6e840ae6d..01192e972 100644 --- a/db_printview.php +++ b/db_printview.php @@ -10,7 +10,6 @@ require_once './libraries/common.lib.php'; $print_view = true; require_once './libraries/header.inc.php'; - PMA_checkParameters(array('db')); /** @@ -27,7 +26,9 @@ $cfgRelation = PMA_getRelationsParam(); /** * Gets the list of the table in the current db and informations about these * tables if possible - */ + * + * @todo merge this speedup _optionaly_ into PMA_DBI_get_tables_full() + * // staybyte: speedup view on locked tables - 11 June 2001 // Special speedup for newer MySQL Versions (in 4.0 format changed) if ($cfg['SkipLockedTables'] == true) { @@ -41,7 +42,6 @@ if ($cfg['SkipLockedTables'] == true) { } } PMA_DBI_free_result($result); - unset($result); if (isset($sot_cache)) { $result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE); @@ -56,14 +56,14 @@ if ($cfg['SkipLockedTables'] == true) { } } PMA_DBI_free_result($result); - unset($result); $sot_ready = true; } } + unset($tmp, $result); } } -if (!isset($sot_ready)) { +if (! isset($sot_ready)) { $result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ';'); if (PMA_DBI_num_rows($result) > 0) { while ($sts_tmp = PMA_DBI_fetch_assoc($result)) { @@ -73,28 +73,17 @@ if (!isset($sot_ready)) { unset($res); } } -$num_tables = isset($tables) ? count($tables) : 0; - -if ($cfgRelation['commwork']) { - $comment = PMA_getComments($db); - - /** - * Displays DB comment - */ - if (is_array($comment)) { - ?> - -

- -

- '; + // 1. No table if ($num_tables == 0) { echo $strNoTablesFound; @@ -102,12 +91,10 @@ if ($num_tables == 0) { // 2. Shows table informations on mysql >= 3.23.03 - staybyte - 11 June 2001 else { ?> - - - +
- + - $sts_data) { - $table = $sts_data['Name']; + foreach ($tables as $sts_data) { + if (strtoupper($sts_data['ENGINE']) == 'MRG_MYISAM' + || strtoupper($sts_data['ENGINE']) == 'FEDERATED') { + $merged_size = true; + } else { + $merged_size = false; + } + $sum_entries += $sts_data['TABLE_ROWS']; ?> - + 0) { - list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, 1); - } else { - list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, 0); - } - } elseif ($cfg['ShowStats']) { - $formated_size = ' - '; - $unit = ''; - } - $sum_entries += $sts_data['Rows']; - } - // MyISAM MERGE Table - elseif ($cfg['ShowStats'] && $mergetable == true) { - $formated_size = ' - '; - $unit = ''; - } elseif ($cfg['ShowStats']) { - $formated_size = 'unknown'; - $unit = ''; - } + if (isset($sts_data['TABLE_ROWS'])) { ?> + + + + + + + + + + + + + +
  
-     - + + ' . number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . '' . "\n"; + if ($merged_size) { + echo '' . number_format($sts_data['TABLE_ROWS'], 0, $number_decimal_separator, $number_thousands_separator) . '' . "\n"; } else { - echo number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; + echo number_format($sts_data['TABLE_ROWS'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; } ?> -    + -   + - '; - } else { - $needs_break = ''; - } + if (! empty($sts_data['Comment'])) { + echo $sts_data['Comment']; + $needs_break = '
'; + } else { + $needs_break = ''; + } - if ((isset($sts_data['Create_time']) && !empty($sts_data['Create_time'])) - || (isset($sts_data['Update_time']) && !empty($sts_data['Update_time'])) - || (isset($sts_data['Check_time']) && !empty($sts_data['Check_time']))) { - echo $needs_break; + if (! empty($sts_data['Create_time']) + || ! empty($sts_data['Update_time']) + || ! empty($sts_data['Check_time'])) { + echo $needs_break; + ?> + + -
- - - - - - - - - - - - - - - - -
+
+ -    + @@ -263,6 +222,7 @@ else { @@ -295,7 +255,7 @@ function printPage()

-