diff --git a/ChangeLog b/ChangeLog index e8978a806..9891abd3d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ $Source$ 2006-03-21 Marc Delisle * server_privileges.php: bug #1427707 Priv->user->pass radio buttons unselectable: Sebastian's fix was not in HEAD + * libraries/Table.class.php: bug #1439002, drop basetable of a view gives + error on overview Table.class.php 2006-03-20 Alexander M. Turek * Documentation.html: Added a note about Connector/PHP to FAQ 1.17. diff --git a/libraries/Table.class.php b/libraries/Table.class.php index fbca944dc..86227cf25 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -366,13 +366,17 @@ class PMA_Table { . PMA_backquote($table)); // since counting all rows of a view could be too long } else { - $result = PMA_DBI_query( + // try_query because it can fail ( a VIEW was based on + // a table that no longer exists) + $result = PMA_DBI_try_query( 'SELECT 1 FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . ' LIMIT ' . $GLOBALS['cfg']['MaxExactCount'], null, PMA_DBI_QUERY_STORE); - $row_count = PMA_DBI_num_rows($result); - PMA_DBI_free_result($result); + if (!PMA_DBI_getError()) { + $row_count = PMA_DBI_num_rows($result); + PMA_DBI_free_result($result); + } } } @@ -928,4 +932,4 @@ class PMA_Table { return true; } } -?> \ No newline at end of file +?>