pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: tanghy.fnst@fujitsu.com <tanghy.fnst@fujitsu.com>
Cc: Hamid Akhtar <hamid.akhtar@gmail.com>
Cc: Simon Riggs <simon.riggs@enterprisedb.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: Bug in error reporting for multi-line JSON
Date: Wed, 25 Aug 2021 10:55:52 -0400
Message-ID: <552305.1629903352@sss.pgh.pa.us> (raw)
In-Reply-To: <A999DFE1-BD97-4E93-9EBF-55B386974C90@yesql.se>
References: <CANbhV-EPBnXm3MF_TTWBwwqgn1a1Ghmep9VHfqmNBQ8BT0f+_g@mail.gmail.com>
	<914794.1611252508@sss.pgh.pa.us>
	<CANbhV-FJk_+XTcnuuxujP2FUi7qwC=sUUyEBcbqYoOWmZhxD4A@mail.gmail.com>
	<CANugjhuR8U+uzSptTZ7tEUGvCt8vGnSz89rRw+89yd+wx_nLvA@mail.gmail.com>
	<CANugjhsOvEk9OJ4b1Y3CxC9A8GwHt-cRU1-ymiod859En833-Q@mail.gmail.com>
	<01F48B70-5CAA-4922-B900-80E49A2D8488@yesql.se>
	<849057.1614635401@sss.pgh.pa.us>
	<OS0PR01MB61137C4054774F44E3A9DC89FBC69@OS0PR01MB6113.jpnprd01.prod.outlook.com>
	<A999DFE1-BD97-4E93-9EBF-55B386974C90@yesql.se>

Daniel Gustafsson <daniel@yesql.se> writes:
>> On 25 Aug 2021, at 10:22, tanghy.fnst@fujitsu.com wrote:
>> I think the while condition "context_start < context_end" added in commit ffd3944ab9 is useless. Thoughts?

> Judging by the diff it’s likely a leftover from the previous coding.  I don’t
> see a case for when it would hit, but it also doesn’t seem to do any harm apart
> from potentially causing static analyzers to get angry.

Yeah.  I think that while reviewing this patch I read the while-condition
as a range check on context_start, but it isn't --- both inequalities
are in the same direction.  I suppose there could be some quibble
about what happens if context_end - context_start is so large as to
overflow an integer, but that's never gonna happen (and if it did,
we'd have other issues, for instance the lack of any check-for-interrupt
in this loop).

Will fix.

			regards, tom lane





view thread (11+ messages)

Message-ID: <552305.1629903352@sss.pgh.pa.us>
Permalink:  ../552305.1629903352@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/552305.1629903352@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, daniel@yesql.se, tanghy.fnst@fujitsu.com, hamid.akhtar@gmail.com, simon.riggs@enterprisedb.com
  Subject: Re: Bug in error reporting for multi-line JSON
  In-Reply-To: <552305.1629903352@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox