]> granicus.if.org Git - postgresql/commitdiff
Tweak the width_bucket() regression tests to avoid an unnecessary
authorNeil Conway <neilc@samurai.com>
Wed, 17 Jan 2007 16:19:08 +0000 (16:19 +0000)
committerNeil Conway <neilc@samurai.com>
Wed, 17 Jan 2007 16:19:08 +0000 (16:19 +0000)
dependency on the platform's floating point implementation. Per
report from Stefan Kaltenbrunner.

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

index 3780c17e5a951cd041f0375ecab3edd0536e4185..7840990bf7dfc0e2dec02fb6e6f9334a7bad7c69 100644 (file)
@@ -754,7 +754,7 @@ CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8);
 COPY width_bucket_test (operand_num) FROM stdin;
 UPDATE width_bucket_test SET operand_f8 = operand_num::float8;
 SELECT
-    operand_num, operand_f8,
+    operand_num,
     width_bucket(operand_num, 0, 10, 5) AS wb_1,
     width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
     width_bucket(operand_num, 10, 0, 5) AS wb_2,
@@ -766,27 +766,27 @@ SELECT
     width_bucket(operand_num, -25, 25, 10) AS wb_5,
     width_bucket(operand_f8, -25, 25, 10) AS wb_5f
     FROM width_bucket_test;
-   operand_num    |    operand_f8    | wb_1 | wb_1f | wb_2 | wb_2f | wb_3 | wb_3f | wb_4 | wb_4f | wb_5 | wb_5f 
-------------------+------------------+------+-------+------+-------+------+-------+------+-------+------+-------
-             -5.2 |             -5.2 |    0 |     0 |    6 |     6 |    0 |     0 |    0 |     0 |    4 |     4
-    -0.0000000001 |           -1e-10 |    0 |     0 |    6 |     6 |    0 |     0 |    0 |     0 |    5 |     5
-   0.000000000001 |            1e-12 |    1 |     1 |    5 |     5 |    0 |     0 |    0 |     0 |    6 |     6
-                1 |                1 |    1 |     1 |    5 |     5 |    0 |     0 |    0 |     0 |    6 |     6
- 1.99999999999999 | 1.99999999999999 |    1 |     1 |    5 |     5 |    0 |     0 |    0 |     0 |    6 |     6
-                2 |                2 |    2 |     2 |    5 |     5 |    1 |     1 |    0 |     0 |    6 |     6
- 2.00000000000001 | 2.00000000000001 |    2 |     2 |    4 |     4 |    1 |     1 |    0 |     0 |    6 |     6
-                3 |                3 |    2 |     2 |    4 |     4 |    1 |     1 |    0 |     0 |    6 |     6
-                4 |                4 |    3 |     3 |    4 |     4 |    2 |     2 |    0 |     0 |    6 |     6
-              4.5 |              4.5 |    3 |     3 |    3 |     3 |    2 |     2 |    0 |     0 |    6 |     6
-                5 |                5 |    3 |     3 |    3 |     3 |    3 |     3 |    1 |     1 |    7 |     7
-              5.5 |              5.5 |    3 |     3 |    3 |     3 |    3 |     3 |   21 |    21 |    7 |     7
-                6 |                6 |    4 |     4 |    3 |     3 |    3 |     3 |   21 |    21 |    7 |     7
-                7 |                7 |    4 |     4 |    2 |     2 |    4 |     4 |   21 |    21 |    7 |     7
-                8 |                8 |    5 |     5 |    2 |     2 |    5 |     5 |   21 |    21 |    7 |     7
-                9 |                9 |    5 |     5 |    1 |     1 |    5 |     5 |   21 |    21 |    7 |     7
- 9.99999999999999 | 9.99999999999999 |    5 |     5 |    1 |     1 |    5 |     5 |   21 |    21 |    7 |     7
-               10 |               10 |    6 |     6 |    1 |     1 |    5 |     5 |   21 |    21 |    8 |     8
- 10.0000000000001 | 10.0000000000001 |    6 |     6 |    0 |     0 |    5 |     5 |   21 |    21 |    8 |     8
+   operand_num    | wb_1 | wb_1f | wb_2 | wb_2f | wb_3 | wb_3f | wb_4 | wb_4f | wb_5 | wb_5f 
+------------------+------+-------+------+-------+------+-------+------+-------+------+-------
+             -5.2 |    0 |     0 |    6 |     6 |    0 |     0 |    0 |     0 |    4 |     4
+    -0.0000000001 |    0 |     0 |    6 |     6 |    0 |     0 |    0 |     0 |    5 |     5
+   0.000000000001 |    1 |     1 |    5 |     5 |    0 |     0 |    0 |     0 |    6 |     6
+                1 |    1 |     1 |    5 |     5 |    0 |     0 |    0 |     0 |    6 |     6
+ 1.99999999999999 |    1 |     1 |    5 |     5 |    0 |     0 |    0 |     0 |    6 |     6
+                2 |    2 |     2 |    5 |     5 |    1 |     1 |    0 |     0 |    6 |     6
+ 2.00000000000001 |    2 |     2 |    4 |     4 |    1 |     1 |    0 |     0 |    6 |     6
+                3 |    2 |     2 |    4 |     4 |    1 |     1 |    0 |     0 |    6 |     6
+                4 |    3 |     3 |    4 |     4 |    2 |     2 |    0 |     0 |    6 |     6
+              4.5 |    3 |     3 |    3 |     3 |    2 |     2 |    0 |     0 |    6 |     6
+                5 |    3 |     3 |    3 |     3 |    3 |     3 |    1 |     1 |    7 |     7
+              5.5 |    3 |     3 |    3 |     3 |    3 |     3 |   21 |    21 |    7 |     7
+                6 |    4 |     4 |    3 |     3 |    3 |     3 |   21 |    21 |    7 |     7
+                7 |    4 |     4 |    2 |     2 |    4 |     4 |   21 |    21 |    7 |     7
+                8 |    5 |     5 |    2 |     2 |    5 |     5 |   21 |    21 |    7 |     7
+                9 |    5 |     5 |    1 |     1 |    5 |     5 |   21 |    21 |    7 |     7
+ 9.99999999999999 |    5 |     5 |    1 |     1 |    5 |     5 |   21 |    21 |    7 |     7
+               10 |    6 |     6 |    1 |     1 |    5 |     5 |   21 |    21 |    8 |     8
+ 10.0000000000001 |    6 |     6 |    0 |     0 |    5 |     5 |   21 |    21 |    8 |     8
 (19 rows)
 
 -- for float8 only, check positive and negative infinity: we require
index eacc4b5b73faf2715eef1f661abfa85eee5ad620..dc1452f9ef0a7c08770945742a0d890c4c061500 100644 (file)
@@ -708,7 +708,7 @@ COPY width_bucket_test (operand_num) FROM stdin;
 UPDATE width_bucket_test SET operand_f8 = operand_num::float8;
 
 SELECT
-    operand_num, operand_f8,
+    operand_num,
     width_bucket(operand_num, 0, 10, 5) AS wb_1,
     width_bucket(operand_f8, 0, 10, 5) AS wb_1f,
     width_bucket(operand_num, 10, 0, 5) AS wb_2,