From 3b526ced4f19f7380bc60b7e5f54e870660b7e2f Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Wed, 20 Sep 2006 14:58:41 +0000 Subject: [PATCH] added error reporting if dblist retrieval from information_schema fails --- ChangeLog | 4 +++- libraries/database_interface.lib.php | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a5bb1e76..46220e17c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,13 +5,15 @@ phpMyAdmin - ChangeLog $Id$ $Source$ -2006-08-11 Sebastian Mendel +2006-09-20 Sebastian Mendel * export.php, left.php, libraries\Table.class.php, libraries\common.lib.php, libraries\database_interface.lib.php, libraries\dbi\mysql.dbi.lib.php, libraries\dbi\mysqli.dbi.lib.php, libraries\sql_query_form.lib.php, querywindow.php, server_databases.php, server_export.php, tbl_properties_operations.php: replaced $dblist with new PMA_List_Database class + * libraries\database_interface.lib.php: added error reporting if dblist + retrieval from information_schema fails 2006-09-19 Marc Delisle * Documentation.html, libraries/footer.inc.php, diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index d5e57dc64..4c2523413 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -455,7 +455,12 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false, GROUP BY `information_schema`.`SCHEMATA`.`SCHEMA_NAME` ORDER BY ' . PMA_backquote($sort_by) . ' ' . $sort_order . $limit; - $databases = PMA_DBI_fetch_result( $sql, 'SCHEMA_NAME', null, $link ); + $databases = PMA_DBI_fetch_result($sql, 'SCHEMA_NAME', null, $link); + + $mysql_error = PMA_DBI_getError($link); + if (! count($databases) && $GLOBALS['errno']) { + PMA_mysqlDie($mysql_error, $sql); + } // display only databases also in official database list // f.e. to apply hide_db and only_db @@ -464,9 +469,9 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false, foreach ($drops as $drop) { unset($databases[$drop]); } + unset($drop); } - - unset($sql_where_schema, $sql); + unset($sql_where_schema, $sql, $drops); } else { foreach ($GLOBALS['PMA_List_Database']->items as $database_name) { // MySQL forward compatibility