diff --git a/ChangeLog b/ChangeLog index e70c97bf5..abaf739da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #1798646 [display] Character '+' in query wrongly interpreted - bug #1801919 [themes] Do not use NaviDatabaseNameColor for fieldset legend - bug #1764735 [core] Designer: PDF error when deleting a table +- bug #1764195 [views] DROP button does not work on defective views 2.11.1.0 (2007-09-20) diff --git a/libraries/Table.class.php b/libraries/Table.class.php index f063d4957..d2916c4d4 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -252,7 +252,9 @@ class PMA_Table { // MySQL from 5.0.0 to 5.0.12 returns 'view', // from 5.0.13 returns 'VIEW'. $comment = strtoupper(PMA_DBI_fetch_value('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . $table . '\'', 0, 'Comment')); - return ($comment == 'VIEW'); + // use substr() because the comment might contain something like: + // (VIEW 'BASE2.VTEST' REFERENCES INVALID TABLE(S) OR COLUMN(S) OR FUNCTION) + return (substr($comment, 0, 4) == 'VIEW'); } /** diff --git a/libraries/tbl_info.inc.php b/libraries/tbl_info.inc.php index 670b1a5d7..9aeb9ceea 100644 --- a/libraries/tbl_info.inc.php +++ b/libraries/tbl_info.inc.php @@ -56,10 +56,7 @@ if ($table_info_result && PMA_DBI_num_rows($table_info_result) > 0) { if (!isset($showtable['Type']) && isset($showtable['Engine'])) { $showtable['Type'] =& $showtable['Engine']; } - // MySQL < 5.0.13 returns "view", >= 5.0.13 returns "VIEW" - if (PMA_MYSQL_INT_VERSION >= 50000 && !isset($showtable['Type']) - && isset($showtable['Comment']) - && strtoupper($showtable['Comment']) == 'VIEW') { + if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) { $tbl_is_view = true; $tbl_type = $GLOBALS['strView']; $show_comment = null;