From b5d14acc0ed84ea6618ec14e371ab147eb39cc26 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Wed, 6 May 2009 08:29:26 +0000 Subject: [PATCH] bug #2787162 [interface] Table with name log_views is incorrectly displayed as a view --- ChangeLog | 2 ++ libraries/Table.class.php | 19 +++---------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae633a14e..6782a7a32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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, diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 09a60d731..7453d68d9 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -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)