pgsql: Add all structured objects passed to pushJsonbValue piecewise.

Started by Andrew Dunstanabout 11 years ago3 messagescomitters
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

Add all structured objects passed to pushJsonbValue piecewise.

Commit 9b74f32cdbff8b9be47fc69164eae552050509ff did this for objects of
type jbvBinary, but in trying further to simplify some of the new jsonb
code I discovered that objects of type jbvObject or jbvArray passed as
WJB_ELEM or WJB_VALUE also caused problems. These too are now added
component by component.

Backpatch to 9.4.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/54547bd87f49326d67051254c363e6597d16ffda

Modified Files
--------------
src/backend/utils/adt/jsonb_util.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

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

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Andrew Dunstan (#1)
Re: pgsql: Add all structured objects passed to pushJsonbValue piecewise.

On 5/26/15 11:24 AM, Andrew Dunstan wrote:

Add all structured objects passed to pushJsonbValue piecewise.

Commit 9b74f32cdbff8b9be47fc69164eae552050509ff did this for objects of
type jbvBinary, but in trying further to simplify some of the new jsonb
code I discovered that objects of type jbvObject or jbvArray passed as
WJB_ELEM or WJB_VALUE also caused problems. These too are now added
component by component.

Backpatch to 9.4.

This causes a compiler warning:

jsonb_util.c: In function 'pushJsonbValue':
jsonb_util.c:535:3: error: passing argument 1 of 'JsonbIteratorInit'
from incompatible pointer type [-Werror]
it = JsonbIteratorInit(jbval);
^
In file included from jsonb_util.c:20:0:
../../../../src/include/utils/jsonb.h:422:23: note: expected 'struct
JsonbContainer *' but argument is of type 'struct JsonbValue *'
extern JsonbIterator *JsonbIteratorInit(JsonbContainer *container);
^

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#2)
Re: pgsql: Add all structured objects passed to pushJsonbValue piecewise.

Peter Eisentraut <peter_e@gmx.net> writes:

On 5/26/15 11:24 AM, Andrew Dunstan wrote:

Add all structured objects passed to pushJsonbValue piecewise.

This causes a compiler warning:

jsonb_util.c: In function 'pushJsonbValue':
jsonb_util.c:535:3: error: passing argument 1 of 'JsonbIteratorInit'
from incompatible pointer type [-Werror]

I'm getting multiple warnings (probably Peter's build is aborting
after the first one). Please fix.

jsonb_util.c: In function 'pushJsonbValue':
jsonb_util.c:535: warning: passing argument 1 of 'JsonbIteratorInit' from incompatible pointer type
../../../../src/include/utils/jsonb.h:422: note: expected 'struct JsonbContainer *' but argument is of type 'struct JsonbValue *'
jsonfuncs.c: In function 'addJsonbToParseState':
jsonfuncs.c:3257: warning: passing argument 3 of 'pushJsonbValue' from incompatible pointer type
../../../../src/include/utils/jsonb.h:420: note: expected 'struct JsonbValue *' but argument is of type 'struct JsonbContainer *'
jsonfuncs.c:3259: warning: passing argument 3 of 'pushJsonbValue' from incompatible pointer type
../../../../src/include/utils/jsonb.h:420: note: expected 'struct JsonbValue *' but argument is of type 'struct JsonbContainer *'
jsonfuncs.c:3237: warning: unused variable 'type'

regards, tom lane

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