Commit 038a2ed1 authored by Tom Lane's avatar Tom Lane

Stabilize regression test result.

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
parent da616950
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment