From: Tomas Vondra Date: Sat, 6 May 2017 21:47:28 +0000 (+0200) Subject: Resolve failures in json and jsonb regression tests X-Git-Tag: XL_10_R1BETA1~304 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=1e3d451d2f9559ed4fe390e36a0e13b93c62b560;p=postgres-xl.git Resolve failures in json and jsonb regression tests The failures were caused by failed distribution key updates, which also caused differences in subsequent query results. Instead of making the table replicated as usual, I've decided to use DISTRIBUTE RANDOMLY in this case, because we don't have that exercised in the tests yet. --- diff --git a/src/test/regress/expected/json.out b/src/test/regress/expected/json.out index efcdc4141e..7cb0f27883 100644 --- a/src/test/regress/expected/json.out +++ b/src/test/regress/expected/json.out @@ -362,11 +362,11 @@ FROM (SELECT $$a$$ || x AS b, "z":[{"f1":2,"f2":[1,2,3]},{"f1":5,"f2":[4,5,6]}]} (4 rows) -CREATE TEMP TABLE rows AS +CREATE TEMP TABLE rows DISTRIBUTED RANDOMLY AS SELECT x, 'txt' || x as y FROM generate_series(1,3) AS x; SELECT row_to_json(q,true) -FROM rows q; +FROM rows q ORDER BY x, y; row_to_json -------------- {"x":1, + diff --git a/src/test/regress/expected/jsonb.out b/src/test/regress/expected/jsonb.out index a6d25defb0..e0ab3d3994 100644 --- a/src/test/regress/expected/jsonb.out +++ b/src/test/regress/expected/jsonb.out @@ -345,7 +345,7 @@ select to_jsonb(timestamptz '-Infinity'); (1 row) --jsonb_agg -CREATE TEMP TABLE rows AS +CREATE TEMP TABLE rows DISTRIBUTED RANDOMLY AS SELECT x, 'txt' || x as y FROM generate_series(1,3) AS x; SELECT jsonb_agg(q) diff --git a/src/test/regress/sql/json.sql b/src/test/regress/sql/json.sql index 603288bd1a..3685a54377 100644 --- a/src/test/regress/sql/json.sql +++ b/src/test/regress/sql/json.sql @@ -93,12 +93,12 @@ FROM (SELECT $$a$$ || x AS b, FROM generate_series(1,2) x, generate_series(4,5) y) q; -CREATE TEMP TABLE rows AS +CREATE TEMP TABLE rows DISTRIBUTED RANDOMLY AS SELECT x, 'txt' || x as y FROM generate_series(1,3) AS x; SELECT row_to_json(q,true) -FROM rows q; +FROM rows q ORDER BY x, y; SELECT row_to_json(row((select array_agg(x) as d from generate_series(5,10) x)),false); diff --git a/src/test/regress/sql/jsonb.sql b/src/test/regress/sql/jsonb.sql index b84bd70a29..fbdfbd8964 100644 --- a/src/test/regress/sql/jsonb.sql +++ b/src/test/regress/sql/jsonb.sql @@ -84,7 +84,7 @@ select to_jsonb(timestamptz '-Infinity'); --jsonb_agg -CREATE TEMP TABLE rows AS +CREATE TEMP TABLE rows DISTRIBUTED RANDOMLY AS SELECT x, 'txt' || x as y FROM generate_series(1,3) AS x;