pgsql: Fix unescaping of JSON Unicode escapes, especially for non-UTF8.

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема pgsql: Fix unescaping of JSON Unicode escapes, especially for non-UTF8.
Дата
Msg-id E1Ump5a-00023B-VR@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix unescaping of JSON Unicode escapes, especially for non-UTF8.

Per discussion  on -hackers. We treat Unicode escapes when unescaping
them similarly to the way we treat them in PostgreSQL string literals.
Escapes in the ASCII range are always accepted, no matter what the
database encoding. Escapes for higher code points are only processed in
UTF8 databases, and attempts to process them in other databases will
result in an error. \u0000 is never unescaped, since it would result in
an impermissible null byte.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/78ed8e03c67d7333708f5c1873ec1d239ae2d7e0

Modified Files
--------------
doc/src/sgml/func.sgml               |   11 +
src/backend/utils/adt/json.c         |   42 +-
src/test/regress/expected/json.out   |   23 +-
src/test/regress/expected/json_1.out |  960 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/json.sql        |    8 +-
5 files changed, 1033 insertions(+), 11 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: Improve description of loread/lowrite.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Improve updatability checking for views and foreign tables.