Log In - Home Page

Patch: Bugfix for XPATH() if expression returns a scalar value

Edit Patch - Move To Another CommitFest - Delete Patch

CommitFest 2011-06
Topic SQL Features
Patch Status Committed
Author Florian Pflug
Reviewers Radosław Smogura
Committer Tom Lane
Close Date 2011-07-21
Comments
Patch by fgp on 2011-05-31 12:24:22 PM: Initial version.
Patch by fgp on 2011-05-31 07:32:52 PM: Replace invalid characters with entities in scalar results of XPath expression instead of complaining as version 1 of this patch did.
Patch by fgp on 2011-06-09 11:29:29 PM: Rebased onto HEAD
Review by fgp on 2011-06-29 10:13:28 PM: Radoslaw thinks the patch is fine, expect for the escaping of the return values, even though that will create values of type XML which are not well-formed.
Review by rsmogura on 2011-07-14 05:54:35 PM: I like scalars, I don't like escaping, according to others escaping is ok. My objections to escaping are as follow:
- possibility of double escaping
- problems with de-escaping this on client side
- this patch doens't resolves all mentioned problems about inserting wrong XMLs, if we are going in this mentioned spirit the result of text node must not only be escaped, but wrapped by any kind of root element
- backward compatibility problems
- when I ask for text() I want to extract text not a XML, if I want to get node I will ask /* not a text(/*)
- if user recreates XML which is serialized as text in some node, after patch he will insert improper XMLs, because he will get escaped text - no root element.

Add Comment

Please log in to comment on this patch.