Stabilize regression test result.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 Mar 2018 04:09:26 +0000 (00:09 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 Mar 2018 04:09:26 +0000 (00:09 -0400)
If random() returns a result sufficiently close to zero, float8out
switches to scientific notation, breaking this test case's expectation
that the output should look like '0.xxxxxxxxx'.  Casting to numeric
should fix that.  Per buildfarm member pogona.

Discussion: https://postgr.es/m/20180324212502.wt4serghfidge2on@alap3.anarazel.de

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

index dacb657706360db97ca0a99017c580d3be87b075..66cdad760ca6552242f50fff609079b61b6cb9f0 100644 (file)
@@ -22,7 +22,7 @@ LINE 1: SELECT ptest1('x');
 HINT:  To call a procedure, use CALL.
 CALL ptest1('a');  -- ok
 CALL ptest1('xy' || 'zzy');  -- ok, constant-folded arg
-CALL ptest1(substring(random()::text, 1, 1));  -- ok, volatile arg
+CALL ptest1(substring(random()::numeric(20,15)::text, 1, 1));  -- ok, volatile arg
 \df ptest1
                         List of functions
  Schema |  Name  | Result data type | Argument data types | Type 
index a6a935f578a435152c8ed09d4b0d55e85f41cbde..1be9c6fd78f52db291bcb7f8a697996d61c65901 100644 (file)
@@ -14,7 +14,7 @@ $$;
 SELECT ptest1('x');  -- error
 CALL ptest1('a');  -- ok
 CALL ptest1('xy' || 'zzy');  -- ok, constant-folded arg
-CALL ptest1(substring(random()::text, 1, 1));  -- ok, volatile arg
+CALL ptest1(substring(random()::numeric(20,15)::text, 1, 1));  -- ok, volatile arg
 
 \df ptest1
 SELECT pg_get_functiondef('ptest1'::regproc);