From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Rename jsonb_replace to jsonb_set and allow it to add new values
Date: Sun, 31 May 2015 22:31:26 -0400
Message-ID: <556BC3FE.2020105@dunslane.net> (raw)
In-Reply-To: <14012.1433125059@sss.pgh.pa.us>
References: <E1YzDpW-0005io-D5@gemulon.postgresql.org>
<4442.1433122849@sss.pgh.pa.us>
<556BBA3C.4020406@dunslane.net>
<5085.1433124399@sss.pgh.pa.us>
<14012.1433125059@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
On 05/31/2015 10:17 PM, Tom Lane wrote:
> I wrote:
>> Some of the other machines are showing crashes, not just minor output
>> diffs.
> I tried HEAD on two different machines, and they are both showing Assert
> failures here:
>
> (gdb) bt
> #0 0x000000341ce32625 in raise () from /lib64/libc.so.6
> #1 0x000000341ce33e05 in abort () from /lib64/libc.so.6
> #2 0x00000000007b18f9 in ExceptionalCondition (
> conditionName=<value optimized out>, errorType=<value optimized out>,
> fileName=<value optimized out>, lineNumber=<value optimized out>)
> at assert.c:54
> #3 0x000000000072bd2b in pushJsonbValueScalar (pstate=0x7fff149ec388,
> seq=<value optimized out>, scalarVal=0x7fff149ec280) at jsonb_util.c:584
> #4 0x000000000072c0f7 in pushJsonbValue (pstate=0x7fff149ec388,
> seq=<value optimized out>, jbval=<value optimized out>) at jsonb_util.c:528
> #5 0x000000000072e1a3 in setPathObject (it=0x7fff149ec390,
> path_elems=0x201f9c8, path_nulls=0x201f9e8 "", path_len=1,
> st=0x7fff149ec388, level=0, newval=0x1fe9628, create=1 '\001')
> at jsonfuncs.c:3724
> #6 setPath (it=0x7fff149ec390, path_elems=0x201f9c8, path_nulls=0x201f9e8 "",
> path_len=1, st=0x7fff149ec388, level=0, newval=0x1fe9628, create=1 '\001')
> at jsonfuncs.c:3682
> #7 0x000000000072e912 in jsonb_set (fcinfo=<value optimized out>)
> at jsonfuncs.c:3486
> #8 0x00000000005d0769 in ExecMakeFunctionResultNoSets (fcache=0x1feacc0,
> econtext=0x1feb690, isNull=0x7fff149ec4bf "", isDone=<value optimized out>)
> at execQual.c:2018
> #9 0x00000000005d12cf in ExecEvalFunc (fcache=0x1feacc0, econtext=0x1feb690,
>
> (gdb) p debug_query_string
> $2 = 0x1fa6698 "select jsonb_set('{}','{x}','{\"foo\":123}');"
>
> (gdb) f 3
> #3 0x000000000072bd2b in pushJsonbValueScalar (pstate=0x7fff149ec388,
> seq=<value optimized out>, scalarVal=0x7fff149ec280) at jsonb_util.c:584
> 584 Assert(scalarVal->type == jbvString);
> (gdb) p *scalarVal
> $1 = {type = 33460272, val = {numeric = 0x3400000001, boolean = 1 '\001',
> string = {len = 1, val = 0x1fe904c "x"}, array = {nElems = 1,
> elems = 0x1fe904c, rawScalar = 0 '\000'}, object = {nPairs = 1,
> pairs = 0x1fe904c}, binary = {len = 1, data = 0x1fe904c}}}
>
> Looks like something is forgetting to initialize the type field.
Aha!
I fixed a bug regarding that recently, and now I can't find the fix. But
that gives me enough clues to be able to fix it, thanks.
cheers
andrew
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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-committers@postgresql.org
Cc: andrew@dunslane.net, tgl@sss.pgh.pa.us
Subject: Re: pgsql: Rename jsonb_replace to jsonb_set and allow it to add new values
In-Reply-To: <556BC3FE.2020105@dunslane.net>
References: <E1YzDpW-0005io-D5@gemulon.postgresql.org> <4442.1433122849@sss.pgh.pa.us> <556BBA3C.4020406@dunslane.net> <5085.1433124399@sss.pgh.pa.us> <14012.1433125059@sss.pgh.pa.us> <556BC3FE.2020105@dunslane.net>
* 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