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

Thiago Conde Figueiró <[email protected]>
Newsgroups gmane.comp.db.mysql.bugs
Organization nTime Mobile Solutions
Message-ID <[email protected]>
	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:


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 = CAC.carrierId and                        \
                    LEFT(E.userCellphone, 2) = CAC.prefix and         \
                    MID(E.userCellphone, 3, 2) <= CAC.endNumber and   \
                    MID(E.userCellphone, 3, 2) >= CAC.startNumber     \
         group by C.carrierId;" 

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

	Here is the actual output.

<?xml version="1.0"?>

<resultset statement="select C.name Op, count(E.emailProfileId)
TotalAccounts from MDEmailReader.EmailProfiles E, MDRegister.Carriers C,
                MDRegister.CarrierAreaCodes CAC                         
        where C.carrierId = CAC.carrierId and                           
                LEFT(E.userCellphone, 2) = CAC.prefix and               
             MID(E.userCellphone, 3, 2) &lt;= CAC.endNumber and         
             MID(E.userCellphone, 3, 2) >= 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ó          Gerência de Operações
[email protected]        Cel.: (21) 9329-0308

-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.