diff --git a/ChangeLog b/ChangeLog index 315fc55a40..965438aa37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -50,7 +50,7 @@ phpMyAdmin - ChangeLog - bug #4145 Config screen fails to validate MemoryLimit = -1 (new default) - bug #4123 Double config including - bug #4134 After deleting all rows on a page, it returns to a blank page -+ Dropped configuration directive: DisableIS ++ Dropped configuration directive: DisableIS, ShowDatabasesCommand 4.0.10.0 (not yet released) - bug #4150 Clicking database name in query window opens a new tab diff --git a/doc/config.rst b/doc/config.rst index 1cc0729607..fa354d0928 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -1012,28 +1012,6 @@ Server connection settings * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xx[yyy-zzz]`` (partial :term:`IPv6` address range) -.. config:option:: $cfg['Servers'][$i]['ShowDatabasesCommand'] - - :type: string - :default: ``'SHOW DATABASES'`` - - On a server with a huge number of databases, the default ``SHOW DATABASES`` - command used to fetch the name of available databases will probably be too - slow, so it can be replaced by faster commands. You can use ``#user#`` - string will be replaced by current user. - - When using ``false``, it will disable fetching databases from the server, - only databases in :config:option:`$cfg['Servers'][$i]['only_db']` will be - displayed. - - Examples: - - * ``'SHOW DATABASES'`` - * ``"SHOW DATABASES LIKE '#user#\_%'"`` - * ``'SELECT DISTINCT TABLE_SCHEMA FROM information_schema.SCHEMA_PRIVILEGES'`` - * ``'SELECT SCHEMA_NAME FROM information_schema.SCHEMATA'`` - * ``false`` - .. config:option:: $cfg['Servers'][$i]['SignonScript'] :type: string diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index 607441204a..7a23e3ac09 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -55,12 +55,6 @@ class PMA_List_Database extends PMA_List */ protected $show_databases_disabled = false; - /** - * @var string command to retrieve databases from server - * @access protected - */ - protected $command = null; - /** * Constructor * @@ -103,7 +97,6 @@ class PMA_List_Database extends PMA_List * @param string $like_db_name usually a db_name containing wildcards * * @return array - * @todo we could also search mysql tables if all fail? */ protected function retrieve($like_db_name = null) { @@ -111,16 +104,11 @@ class PMA_List_Database extends PMA_List return array(); } + $command = "SELECT `SCHEMA_NAME` FROM `INFORMATION_SCHEMA`.`SCHEMATA`" + . " WHERE TRUE"; + if (null !== $like_db_name) { - $command = "SHOW DATABASES LIKE '" . $like_db_name . "'"; - } elseif (null === $this->command) { - $command = str_replace( - '#user#', $GLOBALS['cfg']['Server']['user'], - $GLOBALS['cfg']['Server']['ShowDatabasesCommand'] - ); - $this->command = $command; - } else { - $command = $this->command; + $command .= " AND `SCHEMA_NAME` LIKE '" . $like_db_name . "'"; } $database_list = $GLOBALS['dbi']->fetchResult( @@ -130,7 +118,7 @@ class PMA_List_Database extends PMA_List if ($GLOBALS['errno'] !== 0) { // failed to get database list, try the control user - // (hopefully there is one and he has SHOW DATABASES right) + // (hopefully there is one and he has the necessary rights) $this->db_link = $this->db_link_control; $database_list = $GLOBALS['dbi']->fetchResult( $command, null, null, $this->db_link diff --git a/libraries/config.default.php b/libraries/config.default.php index bd02bd922b..ace0b526f5 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -513,32 +513,6 @@ $cfg['Servers'][$i]['AllowDeny']['order'] = ''; */ $cfg['Servers'][$i]['AllowDeny']['rules'] = array(); -/** - * SQL command to fetch available databases - * - * by default most user will be fine with SHOW DATABASES, - * for servers with a huge amount of databases it is possible to - * define a command which executes faster but with less information - * - * especially when accessing database servers from ISPs changing this command - * can result in a great speed improvement - * - * false will disable fetching databases from the server, only databases in - * $cfg['Servers'][$i]['only_db'] will be displayed - * - * #user# will be replaced by current user - * - * examples: - * 'SHOW DATABASES' - * "SHOW DATABASES LIKE '#user#\_%'" - * 'SELECT DISTINCT TABLE_SCHEMA FROM information_schema.SCHEMA_PRIVILEGES' - * 'SELECT SCHEMA_NAME FROM information_schema.SCHEMATA' - * false - * - * @global array $cfg['Servers'][$i]['ShowDatabasesCommand'] - */ -$cfg['Servers'][$i]['ShowDatabasesCommand'] = 'SHOW DATABASES'; - /** * Whether the tracking mechanism creates * versions for tables and views automatically. diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php index 6c7e769adf..a8aa99be29 100644 --- a/libraries/config/messages.inc.php +++ b/libraries/config/messages.inc.php @@ -422,8 +422,6 @@ $strConfigServers_recent_desc = __('Leave blank for no "persistent" recently use $strConfigServers_recent_name = __('Recently used table'); $strConfigServers_relation_desc = __('Leave blank for no [a@http://wiki.phpmyadmin.net/pma/relation]relation-links[/a] support, suggested: [kbd]pma__relation[/kbd]'); $strConfigServers_relation_name = __('Relation table'); -$strConfigServers_ShowDatabasesCommand_desc = __('SQL command to fetch available databases'); -$strConfigServers_ShowDatabasesCommand_name = __('SHOW DATABASES command'); $strConfigServers_SignonSession_desc = __('See [a@http://wiki.phpmyadmin.net/pma/auth_types#signon]authentication types[/a] for an example'); $strConfigServers_SignonSession_name = __('Signon session name'); $strConfigServers_SignonURL_name = __('Signon URL'); diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php index 4ed7ab6719..c52aebb110 100644 --- a/libraries/config/setup.forms.php +++ b/libraries/config/setup.forms.php @@ -58,8 +58,7 @@ $forms['Servers']['Server_config'] = array('Servers' => array(1 => array( 'AllowRoot', 'AllowNoPassword', 'AllowDeny/order', - 'AllowDeny/rules', - 'ShowDatabasesCommand'))); + 'AllowDeny/rules'))); $forms['Servers']['Server_pmadb'] = array('Servers' => array(1 => array( 'pmadb' => 'phpmyadmin', 'controlhost',