summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/regress/expected/case.out9
-rw-r--r--src/test/regress/sql/case.sql11
2 files changed, 10 insertions, 10 deletions
diff --git a/src/test/regress/expected/case.out b/src/test/regress/expected/case.out
index 5c34af24dc1..aac2fc0107c 100644
--- a/src/test/regress/expected/case.out
+++ b/src/test/regress/expected/case.out
@@ -305,6 +305,9 @@ SELECT * FROM CASE_TBL;
-- the isNull flag for the case test value incorrectly became true, causing
-- the third WHEN-clause not to match. The volatile function calls are needed
-- to prevent constant-folding in the planner, which would hide the bug.
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
CREATE FUNCTION vol(text) returns text as
'begin return $1; end' language plpgsql volatile;
SELECT CASE
@@ -335,13 +338,9 @@ SELECT CASE volfoo('bar') WHEN 'foo'::foodomain THEN 'is foo' ELSE 'is not foo'
is not foo
(1 row)
+ROLLBACK;
--
-- Clean up
--
DROP TABLE CASE_TBL;
DROP TABLE CASE2_TBL;
-DROP OPERATOR = (foodomain, foodomain);
-DROP FUNCTION inline_eq(foodomain, foodomain);
-DROP FUNCTION volfoo(text);
-DROP DOMAIN foodomain;
-DROP FUNCTION vol(text);
diff --git a/src/test/regress/sql/case.sql b/src/test/regress/sql/case.sql
index 6d1365e3f2f..1f5caf696fd 100644
--- a/src/test/regress/sql/case.sql
+++ b/src/test/regress/sql/case.sql
@@ -167,6 +167,10 @@ SELECT * FROM CASE_TBL;
-- the third WHEN-clause not to match. The volatile function calls are needed
-- to prevent constant-folding in the planner, which would hide the bug.
+-- Wrap this in a single transaction so the transient '=' operator doesn't
+-- cause problems in concurrent sessions
+BEGIN;
+
CREATE FUNCTION vol(text) returns text as
'begin return $1; end' language plpgsql volatile;
@@ -194,14 +198,11 @@ CREATE OPERATOR = (procedure = inline_eq,
SELECT CASE volfoo('bar') WHEN 'foo'::foodomain THEN 'is foo' ELSE 'is not foo' END;
+ROLLBACK;
+
--
-- Clean up
--
DROP TABLE CASE_TBL;
DROP TABLE CASE2_TBL;
-DROP OPERATOR = (foodomain, foodomain);
-DROP FUNCTION inline_eq(foodomain, foodomain);
-DROP FUNCTION volfoo(text);
-DROP DOMAIN foodomain;
-DROP FUNCTION vol(text);