#3820 hide_db, only_db not working in left panel

4.2.5
open
nobody
None
5
2014-07-08
2013-02-11
Timo Gurr
No

$cfg['Servers'][$i]['hide_db'] = '^(information_schema|performance_schema|mysql)$';

Does work in 3.5.6 but doesn't seem to do anything in 4.0.0(_beta1). I also tried something simpler without regex but it also doesn't work, the databases are still displayed in the navigation sidebar.

Discussion

1 2 3 > >> (Page 1 of 3)
  • Marc Delisle
    Marc Delisle
    2013-02-13

    However, hide_db works in the Databases tab.

     
  • Marc Delisle
    Marc Delisle
    2013-02-14

    Also, the only_db directive is not respected in the navigation panel.

    Rouslan, any particular reason why PMA_DBI_get_databases_full() was not used in the navigation?

     
  • I'm not sure how using PMA_DBI_get_databases_full would help with this bug. I had a look at that function, it doesn't do any filtering on hide_db or only_db. And it's slow...

     
  • Michal Čihař
    Michal Čihař
    2013-02-14

    The Node should use PMA_List_Database class for listing databases or integrate it's functionality - it was only used in navigation and current is not used at all.

     
  • Marc Delisle
    Marc Delisle
    2013-02-14

    Talking about being slow, we had to add the DisableIS directive which disables the use of information_schema, and it's true by default. The reason is explained in Documentation.html for this directive.
    So, PMA_DBI_get_databases_full(), by default, executes the "else" part starting with
    foreach ($GLOBALS['pma']->databases as $database_name) {

    and this references the object created with libraries/PMA.php, which does the filtering later in the code (see checkHideDatabase() in libraries/List_Database.class.php).

     
  • Marc Delisle
    Marc Delisle
    2013-02-14

    Michal, PMA_List_Database is used, that's why in the Databases tab, the hide_db and only_db directives work.

     
  • @nijel: It's used in the PMA class

    @lem9: I know about the DisableIS directive, the Node class uses that, too.
    So, what you're saying is that if DisableIS is set to false, the code will run the if clause instead of the else clause, thus ignoring the hide_db and only_db directives? That sounds like another bug to me...

     
    • Michal Čihař
      Michal Čihař
      2013-02-14

      Ah okay, I did miss that PMA class overrides __get method.

      Also it should do filtering in both cases - in if(!DisableIS) there is array_diff against filtered database list, the else part uses that directly. I can say I understand fully the logic, but it seems to do the filtering in both cases.

       
  • Marc Delisle
    Marc Delisle
    2013-02-14

    Rouslan,
    if DisableIS is set to false, the "if" clause will run but the hide_db and only_db directives are obeyed, I just tested the case.

     
1 2 3 > >> (Page 1 of 3)