@@ -195,7 +195,7 @@ func TestHandleQuery(t *testing.T) {
195195 },
196196 "SELECT jsonb_array_length('[1, 2, 3]'::jsonb)" : {
197197 "description" : {"jsonb_array_length" },
198- "types" : {uint32ToString (pgtype .XID8OID )},
198+ "types" : {uint32ToString (pgtype .Int4OID )},
199199 "values" : {"3" },
200200 },
201201 "SELECT jsonb_pretty('{\" key\" : \" value\" }'::JSONB)" : {
@@ -258,6 +258,16 @@ func TestHandleQuery(t *testing.T) {
258258 "types" : {uint32ToString (pgtype .TextOID )},
259259 "values" : {"bemidb" },
260260 },
261+ "SELECT COALESCE(NULL, '[]'::jsonb) AS json_value" : {
262+ "description" : {"json_value" },
263+ "types" : {uint32ToString (pgtype .JSONOID )},
264+ "values" : {"[]" },
265+ },
266+ "SELECT jsonb_array_length(COALESCE('[]'::jsonb, '{}'::jsonb)) AS length" : {
267+ "description" : {"length" },
268+ "types" : {uint32ToString (pgtype .Int4OID )},
269+ "values" : {"0" },
270+ },
261271 "SELECT * FROM pg_catalog.pg_stat_gssapi" : {
262272 "description" : {"pid" , "gss_authenticated" , "principal" , "encrypted" , "credentials_delegated" },
263273 "types" : {uint32ToString (pgtype .Int4OID ), uint32ToString (pgtype .BoolOID ), uint32ToString (pgtype .TextOID ), uint32ToString (pgtype .BoolOID ), uint32ToString (pgtype .BoolOID )},
0 commit comments