pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: johann@visagie.za.net
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13996: json_to_record() returns non-NULL, malformed value for omitted key under some circumstances
Date: Wed, 02 Mar 2016 22:48:19 -0500
Message-ID: <404.1456976899@sss.pgh.pa.us> (raw)
In-Reply-To: <56D7A8CC.2050206@dunslane.net>
References: <20160302080310.2629.98690@wrigleys.postgresql.org>
	<26373.1456967099@sss.pgh.pa.us>
	<56D7A8CC.2050206@dunslane.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Andrew Dunstan <andrew@dunslane.net> writes:
> On 03/02/2016 08:04 PM, Tom Lane wrote:
>> AFAICT this is a simple thinko in the hash_object_field_end() callback,
>> as per attached patch that fixes this and doesn't break any existing
>> regression test cases.  Andrew, do you concur that this is correct,
>> or is there something I'm missing about the tracking of lex_level?

> Looks like you're right. lex_level is incremented at object/array start 
> and decremented at object/array end. So keys of the outermost object 
> will be at lex_level 1, and we shouldn't be using anything at a higher 
> level. I guess we should add something like this as an extra regression 
> test.

Yeah, I was going to adopt exactly this test case ...

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)

Message-ID: <404.1456976899@sss.pgh.pa.us>
Permalink:  ../404.1456976899@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/404.1456976899@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@dunslane.net, johann@visagie.za.net
  Subject: Re: BUG #13996: json_to_record() returns non-NULL, malformed value for omitted key under some circumstances
  In-Reply-To: <404.1456976899@sss.pgh.pa.us>
  References: <20160302080310.2629.98690@wrigleys.postgresql.org> <26373.1456967099@sss.pgh.pa.us> <56D7A8CC.2050206@dunslane.net> <404.1456976899@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