git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: e52f8b3) | patch
Convert xml_in to report errors softly.
2022年12月16日 15:58:49 +0000 (10:58 -0500)
2022年12月16日 16:10:40 +0000 (11:10 -0500)
commit 37bef842f5530fc9f4a48daba9f4709ee5e36c9b
Convert xml_in to report errors softly.

The key idea here is that xml_parse must distinguish hard errors
from soft errors. We want to throw a hard error for libxml
initialization failures: those might be out-of-memory, or something
else, but in any case they are not the fault of the input string.
If we get to the point of parsing the input, and something goes
wrong, we can fairly consider that to mean bad input.

One thing that arguably does mean bad input, but I didn't trouble
to handle softly, is encoding conversion failure while converting
the server encoding to UTF8. This might be something to improve
later, but it seems like a pretty low-probability scenario.

Discussion: https://postgr.es/m/3564577.1671142683@sss.pgh.pa.us
src/backend/utils/adt/xml.c diff | blob | blame | history
src/test/regress/expected/xml.out diff | blob | blame | history
src/test/regress/expected/xml_1.out diff | blob | blame | history
src/test/regress/expected/xml_2.out diff | blob | blame | history
src/test/regress/sql/xml.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /