JSON parser discards value of string token

Поиск
Список
Период
Сортировка
От Antonin Houska
Тема JSON parser discards value of string token
Дата
Msg-id 34021.1568303510@antos
обсуждение исходный текст
Список pgsql-hackers
Although the following problem does not seem to be exposed in the core, I
think it's still a problem to fix. (I've hit it when implementing a custom
parser for extension configuration file.)

If makeJsonLexContextCstringLen() is passed need_escapes=false,
JsonLexContext.strval is not initialized, and in turn, functions of
JsonSemAction which should receive the string token value
(e.g. object_field_start) receive NULL.

Attached is a patch that fixes the problem. If this approach is acceptable,
then it'd probably be worth to also rename the JsonLexContext.strval field to
something that recalls the "de-escaping", e.g. "noesc"?

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com


Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Leakproofness of texteq()/textne()
Следующее
От: James Coleman
Дата:
Сообщение: Re: [PATCH] Incremental sort (was: PoC: Partial sort)