For information schema, the tooltips initially all display 0 rows, while phpmyadmin apparently doesn't know the row count.
After you've browsed a table, it displays the correct count for that table. It shouldn't display 0 if it doesn't know.
if (null === $tables) {
@@ -789,14 +791,14 @@
// Do not check exact row count here,
// if row count is invalid possibly the table is defect
// and this would break left frame;
- // but we can check row count if this is a view,
+ // but we can check row count if this is a view or the information_schema database,
// since PMA_Table::countRecords() returns a limited row count
// in this case.
// set this because PMA_Table::countRecords() can use it
$tbl_is_view = PMA_Table::isView($db, $table['Name']);
- if ($tbl_is_view) {
+ if ($tbl_is_view || $db == 'information_schema') {
$table['Rows'] = PMA_Table::countRecords($db, $table['Name'],
$return = true);
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Patch merged, thanks Herman. But I find a little curious that now for information_schema, on the main panel the type is reported as MEMORY for some "tables" and as "MyISAM" for others.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem here is that MySQL returns NULL values for the row count when using a query like "show table status from `information_schema`;"
We however have an alternate method of calculating the number of rows, which is already used for views.
Below is a patch that uses this alternate method for both navigation.php and db_structure.php.
Index: db_structure.php
--- db_structure.php (revision 12236)
+++ db_structure.php (working copy)
@@ -288,6 +288,10 @@
case 'ISAM' :
case 'HEAP' :
case 'MEMORY' :
+ if ($db_is_information_schema) {
+ $each_table['Rows'] = PMA_Table::countRecords($db, $each_table['Name'], $return = true);
+ }
+
if ($is_show_stats) {
$tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']);
$sum_size += $tblsize;
Index: libraries/common.lib.php
===================================================================
--- libraries/common.lib.php (revision 12236)
+++ libraries/common.lib.php (working copy)
@@ -744,6 +744,8 @@
*/
function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count = false)
{
+ global $db_is_information_schema;
+ debug($db_is_information_schema, -2, '$db_is_information_schema');
$sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
if (null === $tables) {
@@ -789,14 +791,14 @@
// Do not check exact row count here,
// if row count is invalid possibly the table is defect
// and this would break left frame;
- // but we can check row count if this is a view,
+ // but we can check row count if this is a view or the information_schema database,
// since PMA_Table::countRecords() returns a limited row count
// in this case.
// set this because PMA_Table::countRecords() can use it
$tbl_is_view = PMA_Table::isView($db, $table['Name']);
- if ($tbl_is_view) {
+ if ($tbl_is_view || $db == 'information_schema') {
$table['Rows'] = PMA_Table::countRecords($db, $table['Name'],
$return = true);
}
Hmm, I see that I was a bit too quick in adding that comment.
The following 2 lines should be removed.
+ global $db_is_information_schema;
+ debug($db_is_information_schema, -2, '$db_is_information_schema');
I had been looking into the possibility of re-using $db_is_information_schema in the PMA_getTableList function.
Moved to patches
Patch merged, thanks Herman. But I find a little curious that now for information_schema, on the main panel the type is reported as MEMORY for some "tables" and as "MyISAM" for others.
That difference in table type also made me look twice.
However it is what the server returns when using the following query:
show table status from `information_schema`;