From e9d693411ca5a0a5386a5b337f5f879cd5563243 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 11 Feb 2005 22:15:12 +0000 Subject: [PATCH] Add a regression test to verify that the stack depth checker actually works (and max_stack_depth is not set too high for the platform). Inspired by trouble report from Brian Betts. --- src/test/regress/expected/errors.out | 7 +++++++ src/test/regress/sql/errors.sql | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/test/regress/expected/errors.out b/src/test/regress/expected/errors.out index 3e3a773337..5e323c7e2c 100644 --- a/src/test/regress/expected/errors.out +++ b/src/test/regress/expected/errors.out @@ -441,3 +441,10 @@ NULL); ERROR: syntax error at or near "NUL" at character 190 LINE 16: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I... ^ +-- Check that stack depth detection mechanism works and +-- max_stack_depth is not set too high +create function infinite_recurse() returns int as +'select infinite_recurse()' language sql; +\set VERBOSITY terse +select infinite_recurse(); +ERROR: stack depth limit exceeded diff --git a/src/test/regress/sql/errors.sql b/src/test/regress/sql/errors.sql index 5ccd13bbe5..cf63474160 100644 --- a/src/test/regress/sql/errors.sql +++ b/src/test/regress/sql/errors.sql @@ -367,3 +367,10 @@ INT4 UNIQUE NOT NULL); + +-- Check that stack depth detection mechanism works and +-- max_stack_depth is not set too high +create function infinite_recurse() returns int as +'select infinite_recurse()' language sql; +\set VERBOSITY terse +select infinite_recurse();