From db95a84c82b092df16fbee477a280cfd6ebddabc Mon Sep 17 00:00:00 2001 From: Xiangjin Date: Sat, 25 Feb 2023 12:33:26 +0800 Subject: [PATCH] disable last few cases --- e2e_test/batch/types/jsonb.slt.part | 23 +++++++++++++++++++++++ src/tests/regress/data/sql/jsonb.sql | 22 +++++++++++----------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/e2e_test/batch/types/jsonb.slt.part b/e2e_test/batch/types/jsonb.slt.part index 08536c19ccb27..69c3c6186ddc8 100644 --- a/e2e_test/batch/types/jsonb.slt.part +++ b/e2e_test/batch/types/jsonb.slt.part @@ -123,3 +123,26 @@ select jsonb_array_length('null'); statement ok drop table t; + +# Tests moved from regress tests due to not matching exactly. + +# PostgreSQL sorts shorter key "two" before longer key "three" +query T +SELECT '{ + "one": 1, + "two":"two", + "three": + true}'::jsonb; -- OK +---- +{"one": 1, "three": true, "two": "two"} + +# We do not support jsonb IS NULL yet. +query TTTT +SELECT + '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff', + '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq', + -- ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f, + ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t, + '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x'; +---- +{"a": 12, "b": 16} 123 t [1, 2] diff --git a/src/tests/regress/data/sql/jsonb.sql b/src/tests/regress/data/sql/jsonb.sql index 6ddf3b441f32f..aeed82c74a943 100644 --- a/src/tests/regress/data/sql/jsonb.sql +++ b/src/tests/regress/data/sql/jsonb.sql @@ -60,11 +60,11 @@ SELECT ''::jsonb; -- ERROR, no value SELECT ' '::jsonb; -- ERROR, no value -- Multi-line JSON input to check ERROR reporting -SELECT '{ - "one": 1, - "two":"two", - "three": - true}'::jsonb; -- OK +--@ SELECT '{ +--@ "one": 1, +--@ "two":"two", +--@ "three": +--@ true}'::jsonb; -- OK SELECT '{ "one": 1, "two":,"two", -- ERROR extraneous comma before field "two" @@ -933,12 +933,12 @@ SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2"],"d":{"d1":"d1" SELECT '{"aa":["a","aaa"],"qq":{"a":"12","b":"16","c":["c1","c2",["c3"],{"c4":4}],"d":{"d1":"d1","d2":"d2"}}}'::jsonb; SELECT '{"ff":["a","aaa"]}'::jsonb; -SELECT - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff', - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq', - ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f, - ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t, - '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x'; +--@ SELECT +--@ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'ff', +--@ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'qq', +--@ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'Y') IS NULL AS f, +--@ ('{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb ->> 'Y') IS NULL AS t, +--@ '{"ff":{"a":12,"b":16},"qq":123,"x":[1,2],"Y":null}'::jsonb -> 'x'; -- nested containment --@ SELECT '{"a":[1,2],"c":"b"}'::jsonb @> '{"a":[1,2]}';