Bug in error reporting for multi-line JSON

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Bug in error reporting for multi-line JSON
Дата
Msg-id CANbhV-EPBnXm3MF_TTWBwwqgn1a1Ghmep9VHfqmNBQ8BT0f+_g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Bug in error reporting for multi-line JSON  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
JSON parsing reports the line number and relevant context info
incorrectly when the JSON contains newlines. Current code mostly just
says "LINE 1" and is misleading for error correction. There were no
tests for this previously.

Proposed changes mean a JSON error such as this
{
 "one": 1,
 "two":,"two",          <-- extra comma
 "three": true
}

was previously reported as

CONTEXT:  JSON data, line 1: {
"one": 1,
"two":,...

should be reported as

CONTEXT:  JSON data, line 3: "two":,...

Attached patches:
HEAD: json_error_context.v3.patch - applies cleanly, passes make check
PG13: json_error_context.v3.patch - applies w minor fuzz, passes make check
PG12: json_error_context.v3.PG12.patch - applies cleanly, passes make check
PG11: json_error_context.v3.PG12.patch - applies cleanly, not tested
PG10: json_error_context.v3.PG12.patch - applies cleanly, not tested
PG9.6: json_error_context.v3.PG12.patch - applies cleanly, not tested
PG9.5: json_error_context.v3.PG12.patch - applies cleanly, not tested

-- 
Simon Riggs                http://www.EnterpriseDB.com/

Вложения

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Reproducible GIST index corruption under concurrent updates
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #16825: When building on Windows, cl /? retrun 'x64' not AMD64 and the build does not create x64 environment