Menu

#2877 (ok 3.3) Cannot redeclare pma_tableheader()

3.2.0
fixed
1
2013-06-11
2009-05-21
Sworddragon
No

I tried at http://demo.phpmyadmin.net (phpMyAdmin 3.3.0-dev) to optimize the database information_shema. I switched to the database, selected all 28 tables and then i selected Optimize Table. I got in Firefox 3.0.10 the error "Fatal error: Cannot redeclare pma_tableheader() in /srv/http/pma.cihar.com/trunk-config/db_structure.php on line 83".

Discussion

  • Marc Delisle

    Marc Delisle - 2009-05-21

    On my server, this produces an Apache segmentation fault ... (PHP 5.2.9)

     
  • Sworddragon

    Sworddragon - 2009-05-22

    I tried the same steps on my local server and got the error too. I'm using Windows XP SP3 with Apache 2.2.11, PHP 5.2.9-2, MySQL 5.1.34 and phpMyAdmin 3.1.5.

    The error says "Fatal error: Cannot redeclare pma_tableheader() (previously declared in E:\Programme\Lokaler Server\Apache Software Foundation\Apache2.2\htdocs\phpmyadmin\db_structure.php:81) in E:\Programme\Lokaler Server\Apache Software Foundation\Apache2.2\htdocs\phpmyadmin\db_structure.php on line 116".

     
  • Marc Delisle

    Marc Delisle - 2009-05-23
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2009-05-23

    This is a good hint, as line 116 is not a function definition but only contains a comment that looks like a function definition. What happens if you replace your line 116 which is

    } // end function PMA_TableHeader()

    to
    }

     
  • Marc Delisle

    Marc Delisle - 2009-05-23

    Well, I think that all the operations in this dialog "With selected" just do not make sense for information_schema (apart from Print view) and we should get rid of them.

     
  • Sworddragon

    Sworddragon - 2009-05-23

    If i change "} // end function PMA_TableHeader()" to "}" i get the same error. But i debugged the code and figured out that the db_structure.php is included two times. After the db_structure.php is included the first time the following happens:

    -> db_structure.php includes ./libraries/mult_submits.inc.php on line 26
    -> mult_submits.inc.php is includes ./sql.php on line 409
    -> sql.php includes ./db_structure.php on line 314

    I think that is the reason why pma_tableheader() is declared 2 times.

     
  • Marc Delisle

    Marc Delisle - 2009-05-24

    Good analysis! I'll see what can be done to remediate this wrong code path.

     
  • Marc Delisle

    Marc Delisle - 2009-05-27
    • milestone: --> 3.2.0
    • priority: 5 --> 1
    • summary: Cannot redeclare pma_tableheader() --> (ok 3.3) Cannot redeclare pma_tableheader()
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2009-05-27

    Fixed in subversion, thanks for reporting.

     
  • Marc Delisle

    Marc Delisle - 2010-03-08
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
MongoDB Logo MongoDB