kokizzu / plv8js

Automatically exported from code.google.com/p/plv8js
Other
0 stars 0 forks source link

Arrays of composites are not handled properly as parameters. #54

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

create type acomp as (x int, y text, z timestamptz);
do language plv8 $$ var jres = plv8.execute("select 
$1::acomp[]",[[{"x":2,"z":null,"y":null}]]);  
plv8.elog(NOTICE,JSON.stringify(jres));$$;

What is the expected output? What do you see instead?

Should get:

NOTICE:  [{"acomp":[{"x":2,"y":null,"z":null}]}]

Instead get:

ERROR:  Error: malformed record literal: "[object Object]"

Suggested fix is at: 
https://bitbucket.org/adunstan/plv8js/commits/1a09219c0842efcc1e96fdfe74442d2a2b
244b94

Please use labels and text to provide additional information.

Original issue reported on code.google.com by AMDuns...@gmail.com on 21 Feb 2013 at 3:47

GoogleCodeExporter commented 9 years ago

Original comment by AMDuns...@gmail.com on 21 Feb 2013 at 3:50

GoogleCodeExporter commented 9 years ago
Good catch, go ahead.

Original comment by umi.tan...@gmail.com on 21 Feb 2013 at 10:22