Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression tests fail with PG12 #25

Open
df7cb opened this issue May 21, 2019 · 6 comments
Open

Regression tests fail with PG12 #25

df7cb opened this issue May 21, 2019 · 6 comments

Comments

@df7cb
Copy link
Contributor

df7cb commented May 21, 2019

Regression tests fail with PG12beta1 because floating point output is now more precise by default:

16:50:42 --- /tmp/autopkgtest.SxiwfA/tree/expected/test1.out	2019-05-21 14:50:21.000000000 +0000
16:50:42 +++ /tmp/autopkgtest.SxiwfA/tree/results/test1.out	2019-05-21 14:50:41.994778640 +0000
16:50:42 @@ -7,27 +7,27 @@
16:50:42  \set b '\'Euler T Oliveira\''
16:50:42  \set c '\'Oiler Taviera do Oliviera\''
16:50:42  select block(:a, :b), block_op(:a, :b), :a ~++ :b as operator;
16:50:42 -       block       | block_op | operator 
16:50:42 --------------------+----------+----------
16:50:42 - 0.571428571428571 | f        | f
16:50:42 +       block        | block_op | operator 
16:50:42 +--------------------+----------+----------
16:50:42 + 0.5714285714285714 | f        | f
16:50:42  (1 row)
16:50:42  
16:50:42  select cosine(:a, :b), cosine_op(:a, :b), :a ~## :b as operator;
16:50:42 -      cosine       | cosine_op | operator 
16:50:42 --------------------+-----------+----------
16:50:42 - 0.577350269189626 | f         | f
16:50:42 +       cosine       | cosine_op | operator 
16:50:42 +--------------------+-----------+----------
16:50:42 + 0.5773502691896258 | f         | f
16:50:42  (1 row)
16:50:42  
16:50:42  select dice(:a, :b), dice_op(:a, :b), :a ~-~ :b as operator;
16:50:42 -       dice        | dice_op | operator 
16:50:42 --------------------+---------+----------
16:50:42 - 0.571428571428571 | f       | f
16:50:42 +        dice        | dice_op | operator 
16:50:42 +--------------------+---------+----------
16:50:42 + 0.5714285714285714 | f       | f
16:50:42  (1 row)
16:50:42  
16:50:42  select euclidean(:a, :b), euclidean_op(:a, :b), :a ~!! :b as operator;
16:50:42 -     euclidean     | euclidean_op | operator 
16:50:42 --------------------+--------------+----------
16:50:42 - 0.653589838486225 | f            | f
16:50:42 +     euclidean      | euclidean_op | operator 
16:50:42 +--------------------+--------------+----------
16:50:42 + 0.6535898384862245 | f            | f
16:50:42  (1 row)
16:50:42  
16:50:42  select hamming_text(:a, :c), hamming_text_op(:a, :c), :a ~@~ :c as operator;
16:50:42 @@ -43,9 +43,9 @@
16:50:42  (1 row)
16:50:42  
16:50:42  select jaro(:a, :b), jaro_op(:a, :b), :a ~%% :b as operator;
16:50:42 -       jaro        | jaro_op | operator 
16:50:42 --------------------+---------+----------
16:50:42 - 0.796666666666667 | t       | t
16:50:42 +        jaro        | jaro_op | operator 
16:50:42 +--------------------+---------+----------
16:50:42 + 0.7966666666666666 | t       | t
16:50:42  (1 row)
16:50:42  
16:50:42  select jarowinkler(:a, :b), jarowinkler_op(:a, :b), :a ~@@ :b as operator;
16:50:42 @@ -77,13 +77,13 @@
16:50:42  select overlapcoefficient(:a, :b), overlapcoefficient_op(:a, :b), :a ~** :b as operator;
16:50:42   overlapcoefficient | overlapcoefficient_op | operator 
16:50:42  --------------------+-----------------------+----------
16:50:42 -  0.666666666666667 | f                     | f
16:50:42 + 0.6666666666666666 | f                     | f
16:50:42  (1 row)
16:50:42  
16:50:42  select qgram(:a, :b), qgram_op(:a, :b), :a ~~~ :b as operator;
16:50:42 -       qgram       | qgram_op | operator 
16:50:42 --------------------+----------+----------
16:50:42 - 0.711111111111111 | t        | t
16:50:42 +       qgram        | qgram_op | operator 
16:50:42 +--------------------+----------+----------
16:50:42 + 0.7111111111111111 | t        | t
16:50:42  (1 row)
16:50:42  
16:50:42  --select smithwaterman(:a, :b), smithwaterman_op(:a, :b), :a ~=~ :b as operator;
16:50:42 diff -U3 /tmp/autopkgtest.SxiwfA/tree/expected/test4.out /tmp/autopkgtest.SxiwfA/tree/results/test4.out
16:50:42 --- /tmp/autopkgtest.SxiwfA/tree/expected/test4.out	2018-03-27 04:39:53.000000000 +0000
16:50:42 +++ /tmp/autopkgtest.SxiwfA/tree/results/test4.out	2019-05-21 14:50:42.154779828 +0000
16:50:42 @@ -29,13 +29,13 @@
16:50:42  (2 rows)
16:50:42  
16:50:42  SELECT a, cosine(a, :a) FROM simtst WHERE a ~## :a;
16:50:42 -             a             |      cosine       
16:50:42 ----------------------------+-------------------
16:50:42 - Euler Taveira de Oliveira |                 1
16:50:42 - Euler T. de Oliveira      |              0.75
16:50:42 - Euler Oliveira            | 0.707106781186547
16:50:42 - Euler Taveira             | 0.707106781186547
16:50:42 - Oliveira, Euler           | 0.707106781186547
16:50:42 +             a             |       cosine       
16:50:42 +---------------------------+--------------------
16:50:42 + Euler Taveira de Oliveira |                  1
16:50:42 + Euler T. de Oliveira      |               0.75
16:50:42 + Euler Oliveira            | 0.7071067811865475
16:50:42 + Euler Taveira             | 0.7071067811865475
16:50:42 + Oliveira, Euler           | 0.7071067811865475
16:50:42  (5 rows)
16:50:42  
16:50:42  CREATE INDEX simtsti ON simtst USING gin (a gin_similarity_ops);
16:50:42 @@ -56,13 +56,13 @@
16:50:42  
16:50:42  SET enable_bitmapscan TO ON;
16:50:42  SELECT a, cosine(a, :a) FROM simtst WHERE a ~## :a;
16:50:42 -             a             |      cosine       
16:50:42 ----------------------------+-------------------
16:50:42 - Euler Taveira de Oliveira |                 1
16:50:42 - Euler T. de Oliveira      |              0.75
16:50:42 - Euler Oliveira            | 0.707106781186547
16:50:42 - Euler Taveira             | 0.707106781186547
16:50:42 - Oliveira, Euler           | 0.707106781186547
16:50:42 +             a             |       cosine       
16:50:42 +---------------------------+--------------------
16:50:42 + Euler Taveira de Oliveira |                  1
16:50:42 + Euler T. de Oliveira      |               0.75
16:50:42 + Euler Oliveira            | 0.7071067811865475
16:50:42 + Euler Taveira             | 0.7071067811865475
16:50:42 + Oliveira, Euler           | 0.7071067811865475
16:50:42  (5 rows)
16:50:42  
16:50:42  DROP TABLE simtst;

A possible fix would be to hardcode SET extra_float_digits = 0; in the test file.

A new release with the fix would be nice so we packagers could update the packages. Thanks!

@eulerto
Copy link
Owner

eulerto commented May 21, 2019

@df7cb v12beta1 is on my radar. You were faster than me. I will provide a fix ASAP.

@eulerto
Copy link
Owner

eulerto commented May 22, 2019

@df7cb could you check again? I tested pg_similarity down to 9.2.

@df7cb
Copy link
Contributor Author

df7cb commented May 31, 2019

The fix looks correct, thanks! Could you tag a new release?

@eulerto
Copy link
Owner

eulerto commented May 31, 2019

@df7cb I'm waiting your confirmation. Thanks. ;-)

@df7cb
Copy link
Contributor Author

df7cb commented Jun 3, 2019

Everything ok on PG11 and 12.

@df7cb
Copy link
Contributor Author

df7cb commented Oct 29, 2019

Hi, could you tag a new release with these changes?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants