Re: Bug in error reporting for multi-line JSON

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Hamid Akhtar <hamid.akhtar@gmail.com>
Cc: Simon Riggs <simon.riggs@enterprisedb.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-bugs@postgresql.org
Date: 2021-03-01T14:04:40Z
Lists: pgsql-bugs, pgsql-hackers
> On 27 Feb 2021, at 22:19, Hamid Akhtar <hamid.akhtar@gmail.com> wrote:

> This thread has been inactive for more than a month now. 
> 
> So, I have reworked Simon's patch and incorporated Tom's feedback. The changes include:
> - Changing the variable name from "pos_last_linefeed" to "last_linestart" as it now points to the character after the newline character,
> - The "for" loop in report_json_context function has been significantly simplified and uses a while loop.
>  
> The attached patch is created against the current master branch.

The updated version address the review comments, and pass all tests with no
documentation updates required.  Playing around with I was also unable to break
it.

I'm changing the status of this patch to Ready for Committer.

--
Daniel Gustafsson		https://vmware.com/




Commits

  1. Remove redundant test.

  2. Improve reporting for syntax errors in multi-line JSON data.