Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: [HACKERS] BUG #4822: xmlattributes encodes '&' twice


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
  • Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>
  • Subject: Re: [HACKERS] BUG #4822: xmlattributes encodes '&' twice
  • Date: Sun, 31 May 2009 13:00:44 -0400
  • Message-id: <28781.1243789244@sss.pgh.pa.us> <text/plain>

Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> Here is a patch to fix the bug. I added a parameter 'encode' to
> map_sql_value_to_xml_value() and pass false for xml attributes.

One thing I was wondering about, which is sort of highlighted by your
patch, is why is there the special exception for XML type in the
existing code, and how does that interact with this behavior?
  
> ! 		/* ... exactly as-is for XML or encode is not required */
> ! 		if (type == XMLOID || !encode)
>   			return str;

Seems like there could be cases where we're getting one too many or too
few encoding passes when the input is XML.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group