The branch, master has been updated via e13aab10879ecf1af6541d8abd0ff9a1d2154537 (commit) via 6bbf248350079166ccf79a7ee5cbb570d8e310ef (commit) via 5ab5afd5060599dc25d875a9f06167b17da8ca01 (commit) from c12073871d28eae68769c134781e5eead1722c5f (commit)
- Log ----------------------------------------------------------------- commit e13aab10879ecf1af6541d8abd0ff9a1d2154537 Author: Piotr Przybylski piotrprz@gmail.com Date: Wed Aug 24 21:34:08 2011 +0200
Condition excluding XML output from server export was broken
commit 6bbf248350079166ccf79a7ee5cbb570d8e310ef Author: Piotr Przybylski piotrprz@gmail.com Date: Wed Aug 24 21:26:39 2011 +0200
Remove unused variable
commit 5ab5afd5060599dc25d875a9f06167b17da8ca01 Author: Piotr Przybylski piotrprz@gmail.com Date: Wed Aug 24 21:16:04 2011 +0200
Use PMA_Table::isView() instead of PMA_isView()
-----------------------------------------------------------------------
Summary of changes: libraries/Table.class.php | 15 +++++++++++++-- libraries/database_interface.lib.php | 23 ----------------------- libraries/export/xml.php | 4 ++-- libraries/import.lib.php | 2 +- libraries/plugin_interface.lib.php | 1 - 5 files changed, 16 insertions(+), 29 deletions(-)
diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 8f04945..ba7a12d 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -179,12 +179,23 @@ class PMA_Table */ static public function isView($db = null, $table = null) { - if (strlen($db) && strlen($table)) { + if (empty($db) || empty($table)) { + return false; + } + + // use cached data or load information with SHOW command + if (isset(PMA_Table::$cache[$db][$table]) || $GLOBALS['cfg']['Server']['DisableIS']) { $type = PMA_Table::sGetStatusInfo($db, $table, 'TABLE_TYPE'); return $type == 'VIEW'; }
- return false; + // query information_schema + $result = PMA_DBI_fetch_result( + "SELECT TABLE_NAME + FROM information_schema.VIEWS + WHERE TABLE_SCHEMA = '" . PMA_sqlAddSlashes($db) . "' + AND TABLE_NAME = '" . PMA_sqlAddSlashes($table) . "'"); + return $result ? true : false; }
/** diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 1b10c04..11823f7 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -1345,27 +1345,4 @@ function PMA_DBI_get_triggers($db, $table = '', $delimiter = '//')
return($result); } - -/** - * Returns true if $db.$view_name is a view, false if not - * - * @param string $db database name - * @param string $view_name view/table name - * - * @return bool true if $db.$view_name is a view, false if not - */ -function PMA_isView($db, $view_name) -{ - $result = PMA_DBI_fetch_result( - "SELECT TABLE_NAME - FROM information_schema.VIEWS - WHERE TABLE_SCHEMA = '" . PMA_sqlAddSlashes($db) . "' - AND TABLE_NAME = '" . PMA_sqlAddSlashes($view_name) . "'"); - - if ($result) { - return true; - } else { - return false; - } -} ?> diff --git a/libraries/export/xml.php b/libraries/export/xml.php index a1f7d8f..87f6fe0 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -10,7 +10,7 @@ if (! defined('PHPMYADMIN')) { exit; }
-if (strlen($GLOBALS['db'])) { /* Can't do server export */ +if (!strlen($GLOBALS['db'])) { /* Can't do server export */ return; }
@@ -156,7 +156,7 @@ if (isset($plugin_list)) { $result = PMA_DBI_fetch_result('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), 0); $tbl = $result[$table][1];
- $is_view = PMA_isView($db, $table); + $is_view = PMA_Table::isView($db, $table);
if ($is_view) { $type = 'view'; diff --git a/libraries/import.lib.php b/libraries/import.lib.php index df4290e..a56f201 100644 --- a/libraries/import.lib.php +++ b/libraries/import.lib.php @@ -1115,7 +1115,7 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = null, &$additional_sql =
unset($params);
- if (! PMA_isView($db_name, $tables[$i][TBL_NAME])) { + if (! PMA_Table::isView($db_name, $tables[$i][TBL_NAME])) { $message .= sprintf('<li><a href="%s" title="%s">%s</a> (<a href="%s" title="%s">' . __('Structure') . '</a>) (<a href="%s" title="%s">' . __('Options') . '</a>)</li>', $tbl_url, __('Go to table') . ': ' . htmlspecialchars(PMA_backquote($tables[$i][TBL_NAME])), diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index b0b82f0..ea3a222 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -20,7 +20,6 @@ function PMA_getPlugins($plugins_dir, $plugin_param) /* Scan for plugins */ $plugin_list = array(); if ($handle = @opendir($plugins_dir)) { - $is_first = 0; while ($file = @readdir($handle)) { // In some situations, Mac OS creates a new file for each file // (for example ._csv.php) so the following regexp
hooks/post-receive