XML escaping problem (>= doesn"t become >=)

XML escaping problem (>= doesn"t become >=)

am 06.01.2004 12:57:40 von thiago

I found a little glitch on mysql's XML output. It turns out that the
exit is not properly escaped for some ">=3D" clauses. Here is an example:


bash$ mysql -u user -ppass MyDB -X -e \
"select C.name Op, count(E.emailProfileId) TotalAccounts \
from MDEmailReader.EmailProfiles E, MDRegister.Carriers C, \
MDRegister.CarrierAreaCodes CAC \
where C.carrierId =3D CAC.carrierId and \
LEFT(E.userCellphone, 2) =3D CAC.prefix and \
MID(E.userCellphone, 3, 2) <=3D CAC.endNumber and \
MID(E.userCellphone, 3, 2) >=3D CAC.startNumber \
group by C.carrierId;"=20

The problem is in the "statement" value. The clause
"MID(E.userCellphone, 3, 2) >=3D CAC.startNumber" was not correctly
escaped to
"MID(E.userCellphone, 3, 2) >=3D CAC.startNumber".

Here is the actual output.



TotalAccounts from MDEmailReader.EmailProfiles E, MDRegister.Carriers C,
MDRegister.CarrierAreaCodes CAC =20
where C.carrierId =3D CAC.carrierId and =20
LEFT(E.userCellphone, 2) =3D CAC.prefix and =20
MID(E.userCellphone, 3, 2) <=3D CAC.endNumber and =20
MID(E.userCellphone, 3, 2) >=3D CAC.startNumber =20
group by C.carrierId">


Claro
2665



Vivo
58



I haven't found this on previous posts to the bugs list. I'm sorry if
this is a known issue. Please let me know if you need further
information (such as tables definitions etc).

Regards,

--=20
Thiago Figueir=F3 Ger=EAncia de Operações
thiago@ntime.com.br Cel.: (21) 9329-0308

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=3Dgcdmb-bugs@m.gmane.org

Re: XML escaping problem (>= doesn"t become &gt;=)

am 06.01.2004 16:57:56 von Dean Ellis

On 09:57 Tue 06 Jan , Thiago Conde Figueir? wrote:
> I found a little glitch on mysql's XML output. It turns out
> that the exit is not properly escaped for some ">=" clauses. Here
> is an example:
> MID(E.userCellphone, 3, 2) <= CAC.endNumber and
> MID(E.userCellphone, 3, 2) >= CAC.startNumber
>
> MID(E.userCellphone, 3, 2) <= CAC.endNumber and
> MID(E.userCellphone, 3, 2) >= CAC.startNumber

As I read the XML specification, only "<" must be escaped within
attribute values.

Also, I have parsed our XML output with several validators and it only
identifies a literal, unescaped "<" as an error. It handles a
literal, unescaped ">" without issue.

If you like, we can handle this as a feature request, but at least so
far as my reading of the specification and my XML processors are
concerned, it does not seem to be a bug.

Best regards,
--
Dean Ellis, Support Engineer & Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified? www.mysql.com/certification

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: XML escaping problem (>= doesn"t become &gt;=)

am 06.01.2004 17:21:19 von thiago

On Tue, 6 Jan 2004 09:57:56 -0600
Dean Ellis wrote:

> On 09:57 Tue 06 Jan , Thiago Conde Figueiro wrote:
> > I found a little glitch on mysql's XML output. It turns out
> > that the exit is not properly escaped for some ">=3D" clauses. Here
> > is an example:
(...)

> As I read the XML specification, only "<" must be escaped within
> attribute values.
(...)

In that case, I stand corrected. What I really need is to stop using
crappy XML parsers .

> If you like, we can handle this as a feature request, but at least so
> far as my reading of the specification and my XML processors are=20
> concerned, it does not seem to be a bug.


Please don't bother. I will fix my side and hope other people don't
have trouble with that, as it is a little catchy. At least now the
issue is on the list archives.

Thanks for the fast answer.

Regards,

--=20
Thiago Figueir=F3 Ger=EAncia de Operações
thiago@ntime.com.br Cel.: (21) 9329-0308

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=3Dgcdmb-bugs@m.gmane.org