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

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;"

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.

<?xml version=3D"1.0"?>

<resultset statement=3D"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">

<row>
<Op>Claro</Op>
<TotalAccounts>2665</TotalAccounts>
</row>

<row>
<Op>Vivo</Op>
<TotalAccounts>58</TotalAccounts>
</row>
</resultset>

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,

--
Thiago Figueir=F3 Ger=EAncia de Opera=E7=F5es
thiago [at] 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 [at] m.gmane.org
thiago [ Di, 06 Januar 2004 12:57 ] [ ID #82987 ]

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

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 [at] m.gmane.org
Dean Ellis [ Di, 06 Januar 2004 16:57 ] [ ID #82988 ]

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

On Tue, 6 Jan 2004 09:57:56 -0600
Dean Ellis <dean [at] mysql.com> 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 <g>.

> 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.


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,

--
Thiago Figueir=F3 Ger=EAncia de Opera=E7=F5es
thiago [at] 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 [at] m.gmane.org
thiago [ Di, 06 Januar 2004 17:21 ] [ ID #82989 ]
Datenbanken » gmane.comp.db.mysql.bugs » XML escaping problem (>= doesn't become &gt;=)

Vorheriges Thema: WinMySQLadmin.exe version 1.4 is very confusing to use
Nächstes Thema: output truncated with ELT when using DISTINCT