Bug #55095

Replace SHOW DATABASE by query to schema

Added by Alexander Opitz over 1 year ago. Updated about 1 month ago.

Status:Closed Start date:2014-01-17
Priority:Should have Due date:
Assigned To:Morton Jonuschat % Done:

0%

Category:DBAL Spent time: -
Target version:7.4 (Backend)
TYPO3 Version:6.2 Is Regression:No
PHP Version: Sprint Focus:
Complexity:

Description

In #53761 the usage of deprecated "mysql_list_dbs()" was replaced by "mysql_query('SHOW DATABASES', ...". But this isn't the best way as it may be that the user is restricted. You should better select the information_schema as already done for "admin_get_dbs()" in core, see #47744 for more information.


Related issues

related to Core - Bug #47744: Fatal error: Call to a member function fetch_object() on ... Resolved 2013-04-30
related to Core - Bug #53761: Deprecated function call mysql_list_dbs in dbal Resolved 2013-11-19

History

#1 Updated by Ingo Schmitt over 1 year ago

The user also could be restricted that he could not query the information_schema.

#2 Updated by Alexander Opitz over 1 year ago

From MySQL Manual
http://dev.mysql.com/doc/refman/5.7/en/information-schema.html

Each MySQL user has the right to access these tables, but can see only the rows in the tables that correspond to objects for which the user has the proper access privileges.
In some cases (for example, the ROUTINE_DEFINITION column in the INFORMATION_SCHEMA.ROUTINES table), users who have insufficient privileges will see NULL. 

So this is the way to go and we don't need two different implementations in core.

#3 Updated by Mathias Schreiber 6 months ago

  • Target version set to 7.4 (Backend)

#4 Updated by Morton Jonuschat about 1 month ago

  • Assigned To set to Morton Jonuschat

#5 Updated by Morton Jonuschat about 1 month ago

  • Status changed from New to Closed

Duplicate, change already implemented in #47744
Change: https://review.typo3.org/#/c/23637/

Also available in: Atom PDF