pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Bugs in copyfuncs/equalfuncs support for JSON node types
Date: Mon, 04 Jul 2022 22:40:41 -0400
Message-ID: <1809332.1656988841@sss.pgh.pa.us> (raw)
In-Reply-To: <20220705021857.GO13040@telsasoft.com>
References: <1794155.1656984188@sss.pgh.pa.us>
	<20220705021857.GO13040@telsasoft.com>

Justin Pryzby <pryzby@telsasoft.com> writes:
> Do the missing fields indicate a deficiency in test coverage ?
> _copyJsonTablePlan.pathname and _equalJsonTable.plan.

Yeah, I'd say so, but I think constructing a test case to prove
it's broken might be more trouble than it's worth --- particularly
seeing that we're about to automate this stuff.  Because of that,
I wouldn't even be really concerned about these bugs in HEAD; but
this needs to be back-patched into v15.

The existing COPY_PARSE_PLAN_TREES logic purports to test this
area, but it fails to notice these bugs for a few reasons:

* JsonTable.lateral: COPY_PARSE_PLAN_TREES itself failed to detect
this problem because of matching omissions in _copyJsonTable and
_equalJsonTable.  But the lack of any follow-on failure implies
that we don't have any test cases where the lateral flag is significant.
Maybe that means the field is useless?  This one would be worth a closer
look, perhaps.

* JsonTableColumn.format: this scalar-instead-of-deep-copy bug
would only be detectable if you were able to clobber the original
parse tree after copying.  I have no ideas about an easy way to
do that.  It'd surely bite somebody in the field someday, but
making a reproducible test is way harder.

* JsonTable.plan: to detect the missed comparison, you'd have to
build a test case where comparing two such trees actually made
a visible difference; which would require a fair amount of thought
I fear.  IIUC this node type will only appear down inside jointrees,
which we don't usually do comparisons on.

			regards, tom lane





view thread (4+ messages)

Message-ID: <1809332.1656988841@sss.pgh.pa.us>
Permalink:  ../1809332.1656988841@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1809332.1656988841@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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pryzby@telsasoft.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Bugs in copyfuncs/equalfuncs support for JSON node types
  In-Reply-To: <1809332.1656988841@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