[Phpmyadmin-devel] refactoring sql.php and $goto

Marc Delisle marc at infomarc.info
Thu Jul 4 19:38:09 CEST 2013


Supun Nakandala a écrit :
> Hi Marc,
> I identified seven situations where the method
> PMA_sendResponseForNoResultsReturned runs.
>  1-> When browsing an empty table
>  2-> When executing a query on a non empty table which returns zero results
>  3-> When executing a query on an empty table
>  4-> When executing an INSERT, UPDATE, DELETE query from the SQL  tab
>  5-> When deleting a row from BROWSE tab
>  6-> When searching using the SEARCH tab which returns zero results
>  7-> When changing the structure of the table except change operation
> 
> In the first case the $goto variable is not initialized. But in the second,
> third and fourth cases it is initialized to tbl_sql.php.
> In the third, fourth and fifth cases the $goto variable is initialized with
> sql.php itself with certain other url parameters.
> In the 7 th case $goto variable is set to $tbl_structure.php
> 
> But I identified all these cases send Ajax responses where $goto variable
> or sending header location were never used. I would like to know whether my
> test scenarios are comprehensive if so shall I remove the redundant code
> segments.

Hi Supun,
your list of situations seems comprehensive; to readers who are 
wondering what this comes from, see [0].

As you can see, it's always important to test all code paths, to be able 
to find dead code. I agree that you remove this dead code, therefore 
helping to heal my $goto and $is_gotofile allergy :)

Probably as comments in PMA_sendResponseForNoResultsReturned(), please 
list the situations you are mentionning in this email.

[0] https://github.com/phpmyadmin/phpmyadmin/pull/476

-- 
Marc Delisle
http://infomarc.info




More information about the Developers mailing list