Reduce recursion depth in recently-added regression test.

Some buildfarm members fail the test with the original depth of 10 levels,
apparently because they are running at the minimum max_stack_depth setting
of 100kB and using ~ 10k per recursion level.  While it might be
interesting to try to figure out why they're eating so much stack, it isn't
likely that any fix for that would be back-patchable.  So just change the
test to recurse only 5 levels.  The extra levels don't prove anything
correctness-wise anyway.
This commit is contained in:
Tom Lane 2010-11-03 13:41:46 -04:00
parent 70a0160b07
commit 0abc8fdd4d
2 changed files with 7 additions and 7 deletions

View File

@ -3996,8 +3996,8 @@ DROP FUNCTION nonsimple_expr_test();
create function recurse(float8) returns float8 as
$$
begin
if ($1 < 10) then
return sql_recurse($1 + 1);
if ($1 > 0) then
return sql_recurse($1 - 1);
else
return $1;
end if;
@ -4006,10 +4006,10 @@ $$ language plpgsql;
-- "limit" is to prevent this from being inlined
create function sql_recurse(float8) returns float8 as
$$ select recurse($1) limit 1; $$ language sql;
select recurse(0);
select recurse(5);
recurse
---------
10
0
(1 row)
create function error1(text) returns text language sql as

View File

@ -3199,8 +3199,8 @@ DROP FUNCTION nonsimple_expr_test();
create function recurse(float8) returns float8 as
$$
begin
if ($1 < 10) then
return sql_recurse($1 + 1);
if ($1 > 0) then
return sql_recurse($1 - 1);
else
return $1;
end if;
@ -3211,7 +3211,7 @@ $$ language plpgsql;
create function sql_recurse(float8) returns float8 as
$$ select recurse($1) limit 1; $$ language sql;
select recurse(0);
select recurse(5);
create function error1(text) returns text language sql as
$$ SELECT relname::text FROM pg_class c WHERE c.oid = $1::regclass $$;