[Phpmyadmin-devel] BugFix question - Bug #641765

Robin Johnson robbat2 at orbis-terrarum.net
Mon Jan 13 06:56:03 CET 2003


On Mon, Jan 13, 2003 at 09:16:29AM -0500, Marc Delisle wrote:
> 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
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpmyadmin/phpMyAdmin/sql.php3.diff?r1=1.133&r2=1.135
Shows the function quite nicely.

> This line is not useless since it puts back a reformatted query,
> with reserved words upcased.
The things that function is listed as doing are:
1. Separates a backquoted expression with spaces
2. Separates a parenthesized expression with spaces
3. Removes repeated spaces
4. Uppercase reserved words

why do we need to uppercase the words anyway (see further below)? MySQL
has never been case-sensitive for reserved AFAIK, that is part of the
ANSI SQL standard (which mysql strives to follow).

The SQL parser definetly does #1, #3, #4 and is a lot pickier about using
#2.

> 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.
Looking at that code, it looks like a major code-cleaning is needed
there, because I see MySQL4 and even later parts of MySQL3.23 subetly
failing parts of that code. It uses case-insensative regex for searching
negating #4 above.  Furthermore that stuff can use the results of the
SQL parser for a nice speed improvement (through replacing the slow
eregi), and have the same results.

I'll go and rewrite that code to use the SQP results instead.  It seems
to be lines 48, 92, 222, 239-296, 379. Any more than you can point out ?


-- 
Robin Hugh Johnson
E-Mail     : robbat2 at orbis-terrarum.net
Home Page  : http://www.orbis-terrarum.net/?l=people.robbat2
ICQ#       : 30269588 or 41961639
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20030113/e4fb44e1/attachment.sig>


More information about the Developers mailing list