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

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: 2009-05-31 17:00:44
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugspgsql-hackers
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

In response to


pgsql-hackers by date

Next:From: Andrew DunstanDate: 2009-05-31 17:09:19
Subject: check for missing tablespaces?
Previous:From: Tom LaneDate: 2009-05-31 16:21:30
Subject: Re: Feedback on writing extensible modules

pgsql-bugs by date

Next:From: WarrenDLCDate: 2009-05-31 22:15:01
Subject: failed to run initdb: 255!
Previous:From: Euler Taveira de OliveiraDate: 2009-05-29 15:56:43
Subject: Re: BUG #4830: operator does not exists

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group