]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Improve numeric_power() tests for large integer powers.
authorDean Rasheed <dean.a.rasheed@gmail.com>
Thu, 5 Aug 2021 21:24:28 +0000 (22:24 +0100)
committerDean Rasheed <dean.a.rasheed@gmail.com>
Thu, 5 Aug 2021 21:24:28 +0000 (22:24 +0100)
Two of the tests added by 4dd5ce2fd fail on buildfarm member
castoroides, though it's not clear why. Improve the tests to report
the actual values produced, if they're not what was expected.

Apply to v11 only for now, until it's clearer what's going on.

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

index 897096680eb019b733cf8f5f1857fd74854b5147..fdf6a0d7e76182ec37e77d8d3e8beadb93cf39dc 100644 (file)
@@ -1668,10 +1668,10 @@ select 1.000000000123 ^ (-2147483648);
  0.7678656556403084
 (1 row)
 
-select 0.9999999999 ^ 23300000000000 = 0 as rounds_to_zero;
+select coalesce(nullif(0.9999999999 ^ 23300000000000, 0), 0) as rounds_to_zero;
  rounds_to_zero 
 ----------------
- t
+              0
 (1 row)
 
 -- cases that used to error out
@@ -1687,10 +1687,10 @@ select 0.5678 ^ (-85);
  782333637740774446257.7719390061997396
 (1 row)
 
-select 0.9999999999 ^ 70000000000000 = 0 as underflows;
+select coalesce(nullif(0.9999999999 ^ 70000000000000, 0), 0) as underflows;
  underflows 
 ------------
- t
+          0
 (1 row)
 
 -- negative base to integer powers
index 972e3aaec492ae3884f6d0a9178ae91d9f5ce189..63ab78e5fcf6853be24f6ff4e9725290c6e4d90c 100644 (file)
@@ -907,12 +907,12 @@ select 3.789 ^ 35;
 select 1.2 ^ 345;
 select 0.12 ^ (-20);
 select 1.000000000123 ^ (-2147483648);
-select 0.9999999999 ^ 23300000000000 = 0 as rounds_to_zero;
+select coalesce(nullif(0.9999999999 ^ 23300000000000, 0), 0) as rounds_to_zero;
 
 -- cases that used to error out
 select 0.12 ^ (-25);
 select 0.5678 ^ (-85);
-select 0.9999999999 ^ 70000000000000 = 0 as underflows;
+select coalesce(nullif(0.9999999999 ^ 70000000000000, 0), 0) as underflows;
 
 -- negative base to integer powers
 select (-1.0) ^ 2147483646;