Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1abKFZ-0003Yc-UQ for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Mar 2016 03:48:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1abKFY-0004tb-VC for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Mar 2016 03:48:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1abKFY-0004tN-Ic for pgsql-bugs@postgresql.org; Thu, 03 Mar 2016 03:48:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1abKFR-0007ve-Mk for pgsql-bugs@postgresql.org; Thu, 03 Mar 2016 03:48:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u233mJKh000405; Wed, 2 Mar 2016 22:48:19 -0500 From: Tom Lane To: Andrew Dunstan cc: johann@visagie.za.net, pgsql-bugs@postgresql.org Subject: Re: BUG #13996: json_to_record() returns non-NULL, malformed value for omitted key under some circumstances In-reply-to: <56D7A8CC.2050206@dunslane.net> References: <20160302080310.2629.98690@wrigleys.postgresql.org> <26373.1456967099@sss.pgh.pa.us> <56D7A8CC.2050206@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Wed, 02 Mar 2016 22:00:28 -0500" Date: Wed, 02 Mar 2016 22:48:19 -0500 Message-ID: <404.1456976899@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Andrew Dunstan 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