Remove the ShowDatabasesCommand directive

This commit is contained in:
Marc Delisle 2013-11-06 12:47:27 -05:00
parent 87ffbfbee1
commit 85ea82a409
6 changed files with 7 additions and 70 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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');

View File

@ -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',