begriffs / pg_rational

Precise fractional arithmetic for PostgreSQL
MIT License
233 stars 14 forks source link

Test failure with PG12 #10

Closed df7cb closed 4 years ago

df7cb commented 5 years ago

pg_rational is almost compatible with PG12beta1, it just fails one test because of the new ryu float output format:

16:25:54 **** regression.diffs ****
16:25:54 diff -U3 /tmp/autopkgtest.gR9uOS/tree/expected/pg_rational_test.out /tmp/autopkgtest.gR9uOS/tree/results/pg_rational_test.out
16:25:54 --- /tmp/autopkgtest.gR9uOS/tree/expected/pg_rational_test.out 2018-05-28 05:36:50.000000000 +0000
16:25:54 +++ /tmp/autopkgtest.gR9uOS/tree/results/pg_rational_test.out  2019-05-21 14:25:53.891093629 +0000
16:25:54 @@ -76,9 +76,9 @@
16:25:54  (1 row)
16:25:54  
16:25:54  select '1/3'::rational::float;
16:25:54 -      float8       
16:25:54 --------------------
16:25:54 - 0.333333333333333
16:25:54 +       float8       
16:25:54 +--------------------
16:25:54 + 0.3333333333333333
16:25:54  (1 row)
16:25:54  
16:25:54  select '-1/2'::rational::float;

A possible fix would be to put SET extra_float_digits = 0; into the test file.

A new release with the fix would be appreciated for us packagers. Thanks!

begriffs commented 5 years ago

pg_rational is almost compatible with PG12beta1, it just fails one test because of the new ryu float output format:

Thanks for testing on the beta and letting me know about the upcoming change.

A possible fix would be to put SET extra_float_digits = 1; into the test file.

Great, I'll give that a try and if it works on both pg12 and earlier versions, I'll create a tag and release.

df7cb commented 5 years ago

Fwiw, it's actually e_f_d = 0, I fixed the typo in my original posting.