bug #2787162 [interface] Table with name log_views is incorrectly displayed as a view

This commit is contained in:
Herman van Rink
2009-05-06 08:29:26 +00:00
parent 70c6e5a32c
commit b5d14acc0e
2 changed files with 5 additions and 16 deletions

View File

@@ -60,6 +60,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
+ patch #2745215 [edit] Multi-row change with "]" improved,
thanks to Virsacer - virsacer
+ rfe #2657696 Automatically copy generated password
- bug #2787162 [interface] Table with name 'log_views' is incorrectly displayed as a view
3.1.5.0 (not yet released)
- patch #2739001 [export] XML does not allow spaces in element names,
@@ -69,6 +70,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug [calendar] js error "window.parent.addEvent is not a function"
- patch #2773818 [export] Invalid "Content-Encoding" header,
thanks to abignale - abignale
- bug #2787162 [interface] Table with name 'log_views' is incorrectly displayed as a view
3.1.4.0 (2009-04-25)
+ patch #1808339 [doc] Apache SSLOptions and StdEnvVars FAQ,

View File

@@ -233,22 +233,9 @@ class PMA_Table
return true;
}
// This would be the correct way of doing the check but at least in
// MySQL 5.0.33 it's too slow when there are hundreds of databases
// and/or tables (more than 3 minutes for 400 tables)
/*if (false === PMA_DBI_fetch_value('SELECT TABLE_NAME FROM `information_schema`.`VIEWS` WHERE `TABLE_SCHEMA` = \'' . $db . '\' AND `TABLE_NAME` = \'' . $table . '\';')) {
return false;
} else {
return true;
} */
// A more complete way of finding a view would be to check if all
// columns from the result set are NULL except Name and Comment.
// Use strtoupper() because MySQL from 5.0.0 to 5.0.12 returns 'view',
// from 5.0.13 returns 'VIEW'.
// Use substr() because the comment might contain something like:
// (VIEW 'BASE2.VTEST' REFERENCES INVALID TABLE(S) OR COLUMN(S) OR FUNCTION)
$comment = strtoupper(PMA_Table::sGetStatusInfo($db, $table, 'Comment'));
return substr($comment, 0, 4) == 'VIEW';
// Since phpMyAdmin 3.2 the field TABLE_TYPE is properly filled by PMA_DBI_get_tables_full()
$type = PMA_Table::sGetStatusInfo($db, $table, 'TABLE_TYPE');
return $type == 'VIEW';
}
static public function sGetToolTip($db, $table)