1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

More float test and portability fixes.

Avoid assuming exact results in tstypes test; some platforms vary.
(per buildfarm members eulachon, danio, lapwing)

Avoid dubious usage (inherited from upstream) of bool parameters to
copy_special_str, to see if this fixes the mac/ppc failures (per
buildfarm members prariedog and locust). (Isolated test programs on a
ppc mac don't seem to show any other cause that would explain them.)
This commit is contained in:
Andrew Gierth
2019-02-13 19:35:50 +00:00
parent 711bab1e4d
commit da6520be7f
4 changed files with 39 additions and 34 deletions

View File

@ -1,3 +1,5 @@
-- deal with numeric instability of ts_rank
SET extra_float_digits = 0;
--Base tsvector test
SELECT '1'::tsvector;
tsvector
@ -787,57 +789,57 @@ select to_tsvector('simple', '') @@ '!foo' AS "true";
--ranking
SELECT ts_rank(' a:1 s:2C d g'::tsvector, 'a | s');
ts_rank
-------------
0.091189064
ts_rank
-----------
0.0911891
(1 row)
SELECT ts_rank(' a:1 sa:2C d g'::tsvector, 'a | s');
ts_rank
-------------
0.030396355
ts_rank
-----------
0.0303964
(1 row)
SELECT ts_rank(' a:1 sa:2C d g'::tsvector, 'a | s:*');
ts_rank
-------------
0.091189064
ts_rank
-----------
0.0911891
(1 row)
SELECT ts_rank(' a:1 sa:2C d g'::tsvector, 'a | sa:*');
ts_rank
-------------
0.091189064
ts_rank
-----------
0.0911891
(1 row)
SELECT ts_rank(' a:1 s:2B d g'::tsvector, 'a | s');
ts_rank
------------
0.15198177
ts_rank
----------
0.151982
(1 row)
SELECT ts_rank(' a:1 s:2 d g'::tsvector, 'a | s');
ts_rank
------------
0.06079271
ts_rank
-----------
0.0607927
(1 row)
SELECT ts_rank(' a:1 s:2C d g'::tsvector, 'a & s');
ts_rank
------------
0.14015312
ts_rank
----------
0.140153
(1 row)
SELECT ts_rank(' a:1 s:2B d g'::tsvector, 'a & s');
ts_rank
------------
0.19820644
ts_rank
----------
0.198206
(1 row)
SELECT ts_rank(' a:1 s:2 d g'::tsvector, 'a & s');
ts_rank
------------
0.09910322
ts_rank
-----------
0.0991032
(1 row)
SELECT ts_rank_cd(' a:1 s:2C d g'::tsvector, 'a | s');
@ -885,7 +887,7 @@ SELECT ts_rank_cd(' a:1 s:2 d g'::tsvector, 'a | s');
SELECT ts_rank_cd(' a:1 s:2C d g'::tsvector, 'a & s');
ts_rank_cd
------------
0.13333334
0.133333
(1 row)
SELECT ts_rank_cd(' a:1 s:2B d g'::tsvector, 'a & s');
@ -903,13 +905,13 @@ SELECT ts_rank_cd(' a:1 s:2 d g'::tsvector, 'a & s');
SELECT ts_rank_cd(' a:1 s:2A d g'::tsvector, 'a <-> s');
ts_rank_cd
------------
0.18181819
0.181818
(1 row)
SELECT ts_rank_cd(' a:1 s:2C d g'::tsvector, 'a <-> s');
ts_rank_cd
------------
0.13333334
0.133333
(1 row)
SELECT ts_rank_cd(' a:1 s:2 d g'::tsvector, 'a <-> s');
@ -927,13 +929,13 @@ SELECT ts_rank_cd(' a:1 s:2 d:2A g'::tsvector, 'a <-> s');
SELECT ts_rank_cd(' a:1 s:2,3A d:2A g'::tsvector, 'a <2> s:A');
ts_rank_cd
------------
0.09090909
0.0909091
(1 row)
SELECT ts_rank_cd(' a:1 b:2 s:3A d:2A g'::tsvector, 'a <2> s:A');
ts_rank_cd
------------
0.09090909
0.0909091
(1 row)
SELECT ts_rank_cd(' a:1 sa:2D sb:2A g'::tsvector, 'a <-> s:*');

View File

@ -1,3 +1,6 @@
-- deal with numeric instability of ts_rank
SET extra_float_digits = 0;
--Base tsvector test
SELECT '1'::tsvector;