From f92275d136447294973d56f951c2b8f5533f966a Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 25 Jun 2006 12:42:25 +0000 Subject: [PATCH] workaround information_schema problem when a db directory has wrong permissions or ownership --- ChangeLog | 7 +++++-- libraries/database_interface.lib.php | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d79bcd78..de450a712 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,10 +8,13 @@ $Source$ 2006-06-25 Marc Delisle * libraries/export/pdf.php, libraries/plugin_interface.lib.php, lang/*: bug #1504218: display an explanation for what is a PDF export + * libraries/database_interface.lib.php: when a db directory has + wrong permissions/ownership, information_shema does not work + for all databases so we revert to SHOW TABLE STATUS 2006-06-23 Marc Delisle - * libraries/Config.class.php: bug #1501027, possible user/password - disclosure when switching from http to https + * libraries/Config.class.php: bug #1501027, possible user/password + disclosure when switching from http to https 2006-06-22 Marc Delisle * libraries/database_interface.lib.php, /export/sql.php, lang/*: diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index bf08dd04f..2f42880eb 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -297,7 +297,11 @@ function PMA_DBI_get_tables_full($database, $table = false, $tables = PMA_DBI_fetch_result($sql, array('TABLE_SCHEMA', 'TABLE_NAME'), null, $link); unset( $sql_where_table, $sql ); - } else { + } + // If permissions are wrong on even one database directory, + // information_schema does not return any table info for any database + // this is why we fall back to SHOW TABLE STATUS even for MySQL >= 50002 + if ( PMA_MYSQL_INT_VERSION < 50002 || empty($tables)) { foreach ( $databases as $each_database ) { if ( true === $tbl_is_group ) { $sql = 'SHOW TABLE STATUS FROM '