From: Tomas Vondra Date: Fri, 21 Apr 2017 22:11:35 +0000 (+0200) Subject: Resolve failures in tablesample regression test suite X-Git-Tag: XL_10_R1BETA1~353 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=0e071bd0938a3118ec7deaddeb7170ddb43baa8b;p=postgres-xl.git Resolve failures in tablesample regression test suite Expected query results are adopted from XL 9.5, and seem to be quite stable. Removed part of expected results which comes from upstream, but from a later commit. --- diff --git a/src/test/regress/expected/tablesample.out b/src/test/regress/expected/tablesample.out index 35fd45379b..e1429d6da1 100644 --- a/src/test/regress/expected/tablesample.out +++ b/src/test/regress/expected/tablesample.out @@ -5,13 +5,11 @@ INSERT INTO test_tablesample SELECT t.id FROM test_tablesample AS t TABLESAMPLE SYSTEM (50) REPEATABLE (0); id ---- - 3 - 4 - 5 6 - 7 8 -(6 rows) + 9 + 7 +(4 rows) SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (100.0/11) REPEATABLE (0); id @@ -21,28 +19,23 @@ SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (100.0/11) REPEATABLE (0); SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (50) REPEATABLE (0); id ---- - 3 - 4 - 5 6 8 -(6 rows) + 9 + 7 +(4 rows) SELECT id FROM test_tablesample TABLESAMPLE BERNOULLI (50) REPEATABLE (0); id ---- - 4 - 5 - 6 - 7 8 -(5 rows) + 9 +(2 rows) SELECT id FROM test_tablesample TABLESAMPLE BERNOULLI (5.5) REPEATABLE (0); id ---- - 7 -(1 row) +(0 rows) -- 100% should give repeatable count results (ie, all rows) in any case SELECT count(*) FROM test_tablesample TABLESAMPLE SYSTEM (100); @@ -92,31 +85,29 @@ DECLARE tablesample_cur CURSOR FOR FETCH FIRST FROM tablesample_cur; id ---- - 3 + 6 (1 row) FETCH NEXT FROM tablesample_cur; id ---- - 4 + 8 (1 row) FETCH NEXT FROM tablesample_cur; id ---- - 5 + 9 (1 row) SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (50) REPEATABLE (0); id ---- - 3 - 4 - 5 6 - 7 8 -(6 rows) + 9 + 7 +(4 rows) FETCH NEXT FROM tablesample_cur; id @@ -137,19 +128,19 @@ FETCH NEXT FROM tablesample_cur; FETCH FIRST FROM tablesample_cur; id ---- - 3 + 6 (1 row) FETCH NEXT FROM tablesample_cur; id ---- - 4 + 8 (1 row) FETCH NEXT FROM tablesample_cur; id ---- - 5 + 9 (1 row) FETCH NEXT FROM tablesample_cur; @@ -227,65 +218,6 @@ SELECT count(*) FROM test_tablesample TABLESAMPLE bernoulli (('1'::text < '0'::t 0 (1 row) --- check behavior during rescans, as well as correct handling of min/max pct -select * from - (values (0),(100)) v(pct), - lateral (select count(*) from tenk1 tablesample bernoulli (pct)) ss; - pct | count ------+------- - 0 | 0 - 100 | 10000 -(2 rows) - -select * from - (values (0),(100)) v(pct), - lateral (select count(*) from tenk1 tablesample system (pct)) ss; - pct | count ------+------- - 0 | 0 - 100 | 10000 -(2 rows) - -explain (costs off) -select pct, count(unique1) from - (values (0),(100)) v(pct), - lateral (select * from tenk1 tablesample bernoulli (pct)) ss - group by pct; - QUERY PLAN --------------------------------------------------------- - HashAggregate - Group Key: "*VALUES*".column1 - -> Nested Loop - -> Values Scan on "*VALUES*" - -> Sample Scan on tenk1 - Sampling: bernoulli ("*VALUES*".column1) -(6 rows) - -select pct, count(unique1) from - (values (0),(100)) v(pct), - lateral (select * from tenk1 tablesample bernoulli (pct)) ss - group by pct; - pct | count ------+------- - 100 | 10000 -(1 row) - -select pct, count(unique1) from - (values (0),(100)) v(pct), - lateral (select * from tenk1 tablesample system (pct)) ss - group by pct; - pct | count ------+------- - 100 | 10000 -(1 row) - --- check that collations get assigned within the tablesample arguments -SELECT count(*) FROM test_tablesample TABLESAMPLE bernoulli (('1'::text < '0'::text)::int); - count -------- - 0 -(1 row) - -- check behavior during rescans, as well as correct handling of min/max pct select * from (values (0),(100)) v(pct),