diff --git a/ChangeLog b/ChangeLog index 7b6df14aa..017906ab5 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ $Id$ $Source$ 2006-04-12 Sebastian Mendel + * server_databases.php, libraries/database_interface.lib.php: + disable table stats for MySQL 5 by default * server_databases.php: use new functionality of PMA_DBI_get_databases_full() to limit display * libraries/database_interface.lib.php: diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index ae8273fc9..ddc648caf 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -453,7 +453,9 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false, // for PMA bc: // `SCHEMA_FIELD_NAME` AS `SHOW_TABLE_STATUS_FIELD_NAME` $sql = ' - SELECT `information_schema`.`SCHEMATA`.*, + SELECT `information_schema`.`SCHEMATA`.*'; + if ($force_stats) { + $sql .= ', COUNT(`information_schema`.`TABLES`.`TABLE_SCHEMA`) AS `SCHEMA_TABLES`, SUM(`information_schema`.`TABLES`.`TABLE_ROWS`) @@ -468,17 +470,23 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false, + `information_schema`.`TABLES`.`INDEX_LENGTH`) AS `SCHEMA_LENGTH`, SUM(`information_schema`.`TABLES`.`DATA_FREE`) - AS `SCHEMA_DATA_FREE` - FROM `information_schema`.`SCHEMATA` + AS `SCHEMA_DATA_FREE`'; + } + $sql .= ' + FROM `information_schema`.`SCHEMATA`'; + if ($force_stats) { + $sql .= ' LEFT JOIN `information_schema`.`TABLES` ON `information_schema`.`TABLES`.`TABLE_SCHEMA` - = `information_schema`.`SCHEMATA`.`SCHEMA_NAME` + = `information_schema`.`SCHEMATA`.`SCHEMA_NAME`'; + } + $sql .= ' ' . $sql_where_schema . ' GROUP BY `information_schema`.`SCHEMATA`.`SCHEMA_NAME` ORDER BY ' . PMA_backquote($sort_by) . ' ' . $sort_order . $limit; $databases = PMA_DBI_fetch_result( $sql, 'SCHEMA_NAME', null, $link ); - unset( $sql_where_schema, $sql ); + unset($sql_where_schema, $sql); } else { foreach ( PMA_DBI_get_dblist( $link ) as $database_name ) { // MySQL forward compatibility diff --git a/server_databases.php b/server_databases.php index 3edd0b8cc..88b4c2674 100644 --- a/server_databases.php +++ b/server_databases.php @@ -351,22 +351,20 @@ if ($databases_count > 0) { PMA_buttonOrImage( 'drop_selected_dbs', 'mult_submit', 'drop_selected_dbs', $strDrop, 'b_deltbl.png' ); } - if ( PMA_MYSQL_INT_VERSION < 50002 ) { - echo '' . "\n"; + echo '' . "\n"; echo ''; } else { echo $strNoDatabases;