Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YzFrT-0005cg-SZ for pgsql-committers@arkaria.postgresql.org; Mon, 01 Jun 2015 02:54:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YzFrT-0005vq-B0 for pgsql-committers@arkaria.postgresql.org; Mon, 01 Jun 2015 02:53:59 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YzFrS-0005vk-ON for pgsql-committers@postgresql.org; Mon, 01 Jun 2015 02:53:58 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YzFrQ-0006YE-0P for pgsql-committers@postgresql.org; Mon, 01 Jun 2015 02:53:57 +0000 Received: from mfilter8-d.gandi.net (mfilter8-d.gandi.net [217.70.178.137]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 11EC441C056; Mon, 1 Jun 2015 04:53:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter8-d.gandi.net Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter8-d.gandi.net (mfilter8-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Q4wUe2Xgt4l6; Mon, 1 Jun 2015 04:53:52 +0200 (CEST) X-Originating-IP: 98.122.164.227 Received: from [192.168.10.146] (unknown [98.122.164.227]) (Authenticated sender: adsend@dunslane.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 659A241C04E; Mon, 1 Jun 2015 04:53:52 +0200 (CEST) Message-ID: <556BC93F.3060304@dunslane.net> Date: Sun, 31 May 2015 22:53:51 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-committers@postgresql.org Subject: Re: pgsql: Rename jsonb_replace to jsonb_set and allow it to add new values References: <4442.1433122849@sss.pgh.pa.us> <556BBA3C.4020406@dunslane.net> <5085.1433124399@sss.pgh.pa.us> <556BC152.8000508@dunslane.net> <14172.1433125523@sss.pgh.pa.us> In-Reply-To: <14172.1433125523@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 05/31/2015 10:25 PM, Tom Lane wrote: > Andrew Dunstan writes: >> well, that's what we have a buildfarm for. > It looks like this problem is in setPathObject: > > setPathObject(JsonbIterator **it, Datum *path_elems, bool *path_nulls, > int path_len, JsonbParseState **st, int level, > Jsonb *newval, uint32 npairs, bool create) > { > JsonbValue v; > int i; > JsonbValue k; > bool done = false; > > if (level >= path_len || path_nulls[level]) > done = true; > > /* empty object is a special case for create */ > if ((npairs == 0) && create && (level == path_len - 1)) > { > JsonbValue new = k; > > new.val.string.len = VARSIZE_ANY_EXHDR(path_elems[level]); > new.val.string.val = VARDATA_ANY(path_elems[level]); > > (void) pushJsonbValue(st, WJB_KEY, &new); > > Since "k" is undefined at this point, initializing "new" that way is pure > hogwash. I'm surprised gcc doesn't complain about it. > > (BTW, could I lobby to not use "new" as a variable name? lldb gets > confused, probably because "new" is a C++ keyword.) > > OK, I'll fix these too. 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