[Phpmyadmin-devel] BugFix question - Bug #641765

Marc Delisle delislma at CollegeSherbrooke.qc.ca
Mon Jan 13 06:17:06 CET 2003


Robin Johnson wrote:
> Yo,
> 
> I'm busy fixing bug #641765
> And i've come across a strange bit in sql.php3 @ line 88
> $parsed_sql = PMA_SQP_parse((get_magic_quotes_gpc() ?
> stripslashes($sql_query) : $sql_query)); //86
> $analyzed_sql = PMA_SQP_analyze($parsed_sql); //87
> $sql_query = PMA_SQP_formatHtml($parsed_sql, 'query_only'); //88
> 
> These lines are from:
> "Committed Marc's patches to the SQL parser and pretty printer from bugs
> #605030 and #631421"
> 
> I'm trying to look for the reasoning behind line 88.
> It is, for all-practical purposes, useless, since it just puts the same
> query back into the $sql_query variable. It is also part of the problem
> with #641765, since the SQL parser was giving an empty $parsed_sql
> return value in specific cases.
> 
> I'm commenting it out for now, since that seems to have no ill side
> effects. Any objections can get it put back in.
> 
Robin,

I understand that line 88 might be the cause of a bug, but commenting
out will cause other troubles.

This line is not useless since it puts back a reformatted query,
with reserved words upcased.

There was a function that I removed:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpmyadmin/phpMyAdmin/sql.php3.diff?r1=1.134&r2=1.135

that was modifying sql_query (see the comments in the function), because later in sql.php3
(current lines 244+) there are several tests made.  But this function had problems
in some cases.

Maybe those tests could be made with the analyzer (some more queryflags)
so we would not need to modify $sql_query.

Marc






More information about the Developers mailing list