Make float8_tbl replicated to stabilize float8 test
authorTomas Vondra <[email protected]>
Fri, 25 Aug 2017 22:05:15 +0000 (00:05 +0200)
committerTomas Vondra <[email protected]>
Fri, 25 Aug 2017 22:32:02 +0000 (00:32 +0200)
As the table has just a single float8 column, XL automatically picks
ROUNDROBIN distribution. Commit 1d14325822 randomized selection of the
initial node, which with single-row inserts (used by the float8 tests)
effectively means random distribution, while before that all the rows
would be routed to the first node.

Some of the tests in float8 test suite seem to be sensitive to this, in
particular this overflow test:

    SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f ORDER BY f1;
    ERROR:  value out of range: overflow

One of the rows (containing 1.2345678901234e-200) triggers an underflow,
so when the database hits it first, it will report this error instead:

    ERROR:  value out of range: underflow

The probability of hitting this is however fairly low (less than 10%),
as the executor has to touch the underflowing value first.

src/test/regress/expected/float8.out
src/test/regress/sql/float8.sql

index 061ff87813a9d62eb889744a88de10d4241917d3..ce39f9b5fe90deec7ee713276ba9b2b1c7c87416 100644 (file)
@@ -1,7 +1,7 @@
 --
 -- FLOAT8
 --
-CREATE TABLE FLOAT8_TBL(f1 float8);
+CREATE TABLE FLOAT8_TBL(f1 float8) DISTRIBUTE BY REPLICATION;
 INSERT INTO FLOAT8_TBL(f1) VALUES ('    0.0   ');
 INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30  ');
 INSERT INTO FLOAT8_TBL(f1) VALUES ('   -34.84');
index 5d6c103afec16f5e3f6bb0b38d2e2da406e281d9..668653eb4426363da67300ec7588e8a1627a7ed9 100644 (file)
@@ -2,7 +2,7 @@
 -- FLOAT8
 --
 
-CREATE TABLE FLOAT8_TBL(f1 float8);
+CREATE TABLE FLOAT8_TBL(f1 float8) DISTRIBUTE BY REPLICATION;
 
 INSERT INTO FLOAT8_TBL(f1) VALUES ('    0.0   ');
 INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30  ');