This appears to be an over-enthusistic interpretation of %26 == '&'
in wget.

I submit a URL (which is in fact a SQL query) with some embedded &s
(logical ORs). These are encoded as %26, and the URL works just fine
with netscape and lynx.  It fails with wget.

Note that wget rewrites
        Where+((A.status+%26+0x4)+=+0&format=csv
as 
        Where ((A.status & 0x4) = 0
which is a problem.


                                        R




wi:wget-1.8.1>src/wget --version
GNU Wget 1.8.1

Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Originally written by Hrvoje Niksic <[EMAIL PROTECTED]>.

wi:wget-1.8.1>src/wget -O - 
'http://skyserver.sdss.org/en/tools/search/x_sql.asp?cmd=+select+top+10+A.run,+A.camCol,+A.field,+str(A.rowc,7,2)+as+rowc,+str(A.colc,7,2)+as+colc,+str(dbo.fObjFromObjID(A.ObjId),+4)+as+id,+B.run,+B.camCol,+B.field,+str(B.rowc,7,2)+as+rowc,+str(B.colc,7,2)+as+colc,+str(dbo.fObjFromObjID(B.ObjId),+4)+as+id,+str(A.u,+5,3)+as+Au,+str(A.g,+5,3)+as+Ag,+str(A.r,+5,3)+as+Ar,+str(A.i,+5,3)+as+Ai,+str(A.u+-+B.u,+5,3)+as+du,+str(A.g+-+B.g,+5,3)+as+dg,+str(A.r+-+B.r,+5,3)+as+dr,+str(A.i+-+B.i,+5,3)+as+di+from+photoObj+as+A,+photoObj+as+B,+Neighbors+as+ObjN+Where+((A.status+%26+0x4)+=+0&format=csv'
--16:24:15--  
http://skyserver.sdss.org/en/tools/search/x_sql.asp?cmd=+select+top+10+A.run,+A.camCol,+A.field,+str(A.rowc,7,2)+as+rowc,+str(A.colc,7,2)+as+colc,+str(dbo.fObjFromObjID(A.ObjId),+4)+as+id,+B.run,+B.camCol,+B.field,+str(B.rowc,7,2)+as+rowc,+str(B.colc,7,2)+as+colc,+str(dbo.fObjFromObjID(B.ObjId),+4)+as+id,+str(A.u,+5,3)+as+Au,+str(A.g,+5,3)+as+Ag,+str(A.r,+5,3)+as+Ar,+str(A.i,+5,3)+as+Ai,+str(A.u+-+B.u,+5,3)+as+du,+str(A.g+-+B.g,+5,3)+as+dg,+str(A.r+-+B.r,+5,3)+as+dr,+str(A.i+-+B.i,+5,3)+as+di+from+photoObj+as+A,+photoObj+as+B,+Neighbors+as+ObjN+Where+((A.status+%26+0x4)+=+0&format=csv
           => `-'
Resolving skyserver.sdss.org... done.
Connecting to skyserver.sdss.org[131.225.7.80]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 782 [text/html]

 0% [                                                                                  
             ] 0             --.--K/s    ETA --:--<HTML><HEAD>
<TITLE>SQL Statement Error</TITLE>
</HEAD><BODY BGCOLOR=pink>
<H3>Your SQL command was: <BR><PRE>EXEC spExecuteSQL ' select top 10 A.run, A.camCol, 
A.field, str(A.rowc,7,2) as rowc, str(A.colc,7,2) as colc, 
str(dbo.fObjFromObjID(A.ObjId), 4) as id, B.run, B.camCol, B.field, str(B.rowc,7,2) as 
rowc, str(B.colc,7,2) as colc, str(dbo.fObjFromObjID(B.ObjId), 4) as id, str(A.u, 5,3) 
as Au, str(A.g, 5,3) as Ag, str(A.r, 5,3) as Ar, str(A.i, 5,3) as Ai, str(A.u - B.u, 
5,3) as du, str(A.g - B.g, 5,3) as dg, str(A.r - B.r, 5,3) as dr, str(A.i - B.i, 5,3) 
as di from photoObj as A, photoObj as B, Neighbors as ObjN Where ((A.status & 0x4) = 0 
 '</PRE></H3><P><H3 BGCOLOR=pink>SQL returned the following error: <br>     Line 1: 
Incorrect syntax near '0'.</H3></BODY></HTML>
100%[==============================================================================================>]
 782          763.67K/s    ETA 00:00

16:24:15 (763.67 KB/s) - `-' saved [782/782]

Reply via email to