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/