aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pl/plpgsql/src/expected/plpgsql_cache.out8
-rw-r--r--src/pl/plpgsql/src/expected/plpgsql_cache_1.out8
-rw-r--r--src/pl/plpgsql/src/expected/plpgsql_record.out18
-rw-r--r--src/pl/plpgsql/src/sql/plpgsql_cache.sql8
-rw-r--r--src/pl/plpgsql/src/sql/plpgsql_record.sql16
5 files changed, 36 insertions, 22 deletions
diff --git a/src/pl/plpgsql/src/expected/plpgsql_cache.out b/src/pl/plpgsql/src/expected/plpgsql_cache.out
index c2cf0136050..cc0c57b8794 100644
--- a/src/pl/plpgsql/src/expected/plpgsql_cache.out
+++ b/src/pl/plpgsql/src/expected/plpgsql_cache.out
@@ -3,10 +3,10 @@
--
-- These tests logically belong in plpgsql_record.sql, and perhaps someday
-- can be merged back into it. For now, however, their results are different
--- between regular and CLOBBER_CACHE_ALWAYS builds, so we must have two
+-- depending on debug_invalidate_system_caches_always, so we must have two
-- expected-output files to cover both cases. To minimize the maintenance
-- effort resulting from that, this file should contain only tests that
--- do have different results under CLOBBER_CACHE_ALWAYS.
+-- do have different results under debug_invalidate_system_caches_always.
--
-- check behavior with changes of a named rowtype
create table c_mutable(f1 int, f2 text);
@@ -21,7 +21,7 @@ select c_sillyaddone(42);
alter table c_mutable drop column f1;
alter table c_mutable add column f1 float8;
-- currently, this fails due to cached plan for "r.f1 + 1" expression
--- (but a CLOBBER_CACHE_ALWAYS build will succeed)
+-- (but if debug_invalidate_system_caches_always is on, it will succeed)
select c_sillyaddone(42);
ERROR: type of parameter 4 (double precision) does not match that when preparing the plan (integer)
CONTEXT: PL/pgSQL function c_sillyaddone(integer) line 1 at RETURN
@@ -52,7 +52,7 @@ select show_result_type('select 1 as a');
(1 row)
-- currently this fails due to cached plan for pg_typeof expression
--- (but a CLOBBER_CACHE_ALWAYS build will succeed)
+-- (but if debug_invalidate_system_caches_always is on, it will succeed)
select show_result_type('select 2.0 as a');
ERROR: type of parameter 5 (numeric) does not match that when preparing the plan (integer)
CONTEXT: SQL statement "select pg_typeof(r.a)"
diff --git a/src/pl/plpgsql/src/expected/plpgsql_cache_1.out b/src/pl/plpgsql/src/expected/plpgsql_cache_1.out
index 0ac2c64a15c..2a42875747e 100644
--- a/src/pl/plpgsql/src/expected/plpgsql_cache_1.out
+++ b/src/pl/plpgsql/src/expected/plpgsql_cache_1.out
@@ -3,10 +3,10 @@
--
-- These tests logically belong in plpgsql_record.sql, and perhaps someday
-- can be merged back into it. For now, however, their results are different
--- between regular and CLOBBER_CACHE_ALWAYS builds, so we must have two
+-- depending on debug_invalidate_system_caches_always, so we must have two
-- expected-output files to cover both cases. To minimize the maintenance
-- effort resulting from that, this file should contain only tests that
--- do have different results under CLOBBER_CACHE_ALWAYS.
+-- do have different results under debug_invalidate_system_caches_always.
--
-- check behavior with changes of a named rowtype
create table c_mutable(f1 int, f2 text);
@@ -21,7 +21,7 @@ select c_sillyaddone(42);
alter table c_mutable drop column f1;
alter table c_mutable add column f1 float8;
-- currently, this fails due to cached plan for "r.f1 + 1" expression
--- (but a CLOBBER_CACHE_ALWAYS build will succeed)
+-- (but if debug_invalidate_system_caches_always is on, it will succeed)
select c_sillyaddone(42);
c_sillyaddone
---------------
@@ -55,7 +55,7 @@ select show_result_type('select 1 as a');
(1 row)
-- currently this fails due to cached plan for pg_typeof expression
--- (but a CLOBBER_CACHE_ALWAYS build will succeed)
+-- (but if debug_invalidate_system_caches_always is on, it will succeed)
select show_result_type('select 2.0 as a');
show_result_type
------------------------
diff --git a/src/pl/plpgsql/src/expected/plpgsql_record.out b/src/pl/plpgsql/src/expected/plpgsql_record.out
index 6e835c0751b..86d06659241 100644
--- a/src/pl/plpgsql/src/expected/plpgsql_record.out
+++ b/src/pl/plpgsql/src/expected/plpgsql_record.out
@@ -426,8 +426,8 @@ select getf1(row(1,2));
1
(1 row)
--- a CLOBBER_CACHE_ALWAYS build will report this error with a different
--- context stack than other builds, so suppress context output
+-- the context stack is different when debug_invalidate_system_caches_always
+-- is set, so suppress context output
\set SHOW_CONTEXT never
select getf1(row(1,2)::two_int8s);
ERROR: record "x" has no field "f1"
@@ -507,9 +507,12 @@ select sillyaddone(42);
-- test for change of type of column f1 should be here someday;
-- for now see plpgsql_cache test
alter table mutable drop column f1;
+-- the context stack is different when debug_invalidate_system_caches_always
+-- is set, so suppress context output
+\set SHOW_CONTEXT never
select sillyaddone(42); -- fail
ERROR: record "r" has no field "f1"
-CONTEXT: PL/pgSQL function sillyaddone(integer) line 1 at assignment
+\set SHOW_CONTEXT errors
create function getf3(x mutable) returns int language plpgsql as
$$ begin return x.f3; end $$;
select getf3(null::mutable); -- doesn't work yet
@@ -524,8 +527,8 @@ select getf3(null::mutable); -- now it works
(1 row)
alter table mutable drop column f3;
--- a CLOBBER_CACHE_ALWAYS build will report this error with a different
--- context stack than other builds, so suppress context output
+-- the context stack is different when debug_invalidate_system_caches_always
+-- is set, so suppress context output
\set SHOW_CONTEXT never
select getf3(null::mutable); -- fails again
ERROR: record "x" has no field "f3"
@@ -549,9 +552,12 @@ select sillyaddtwo(42);
(1 row)
drop table mutable2;
+-- the context stack is different when debug_invalidate_system_caches_always
+-- is set, so suppress context output
+\set SHOW_CONTEXT never
select sillyaddtwo(42); -- fail
ERROR: type "mutable2" does not exist
-CONTEXT: PL/pgSQL function sillyaddtwo(integer) line 1 at assignment
+\set SHOW_CONTEXT errors
create table mutable2(f0 text, f1 int, f2 text);
select sillyaddtwo(42);
sillyaddtwo
diff --git a/src/pl/plpgsql/src/sql/plpgsql_cache.sql b/src/pl/plpgsql/src/sql/plpgsql_cache.sql
index f3b64d9209f..061f674c9a6 100644
--- a/src/pl/plpgsql/src/sql/plpgsql_cache.sql
+++ b/src/pl/plpgsql/src/sql/plpgsql_cache.sql
@@ -3,10 +3,10 @@
--
-- These tests logically belong in plpgsql_record.sql, and perhaps someday
-- can be merged back into it. For now, however, their results are different
--- between regular and CLOBBER_CACHE_ALWAYS builds, so we must have two
+-- depending on debug_invalidate_system_caches_always, so we must have two
-- expected-output files to cover both cases. To minimize the maintenance
-- effort resulting from that, this file should contain only tests that
--- do have different results under CLOBBER_CACHE_ALWAYS.
+-- do have different results under debug_invalidate_system_caches_always.
--
-- check behavior with changes of a named rowtype
@@ -20,7 +20,7 @@ alter table c_mutable drop column f1;
alter table c_mutable add column f1 float8;
-- currently, this fails due to cached plan for "r.f1 + 1" expression
--- (but a CLOBBER_CACHE_ALWAYS build will succeed)
+-- (but if debug_invalidate_system_caches_always is on, it will succeed)
select c_sillyaddone(42);
-- but it's OK if we force plan rebuilding
@@ -42,7 +42,7 @@ $$;
select show_result_type('select 1 as a');
-- currently this fails due to cached plan for pg_typeof expression
--- (but a CLOBBER_CACHE_ALWAYS build will succeed)
+-- (but if debug_invalidate_system_caches_always is on, it will succeed)
select show_result_type('select 2.0 as a');
-- but it's OK if we force plan rebuilding
diff --git a/src/pl/plpgsql/src/sql/plpgsql_record.sql b/src/pl/plpgsql/src/sql/plpgsql_record.sql
index be10f00b1e6..722048c7308 100644
--- a/src/pl/plpgsql/src/sql/plpgsql_record.sql
+++ b/src/pl/plpgsql/src/sql/plpgsql_record.sql
@@ -257,8 +257,8 @@ create function getf1(x record) returns int language plpgsql as
$$ begin return x.f1; end $$;
select getf1(1);
select getf1(row(1,2));
--- a CLOBBER_CACHE_ALWAYS build will report this error with a different
--- context stack than other builds, so suppress context output
+-- the context stack is different when debug_invalidate_system_caches_always
+-- is set, so suppress context output
\set SHOW_CONTEXT never
select getf1(row(1,2)::two_int8s);
\set SHOW_CONTEXT errors
@@ -316,7 +316,11 @@ select sillyaddone(42);
-- for now see plpgsql_cache test
alter table mutable drop column f1;
+-- the context stack is different when debug_invalidate_system_caches_always
+-- is set, so suppress context output
+\set SHOW_CONTEXT never
select sillyaddone(42); -- fail
+\set SHOW_CONTEXT errors
create function getf3(x mutable) returns int language plpgsql as
$$ begin return x.f3; end $$;
@@ -324,8 +328,8 @@ select getf3(null::mutable); -- doesn't work yet
alter table mutable add column f3 int;
select getf3(null::mutable); -- now it works
alter table mutable drop column f3;
--- a CLOBBER_CACHE_ALWAYS build will report this error with a different
--- context stack than other builds, so suppress context output
+-- the context stack is different when debug_invalidate_system_caches_always
+-- is set, so suppress context output
\set SHOW_CONTEXT never
select getf3(null::mutable); -- fails again
\set SHOW_CONTEXT errors
@@ -342,7 +346,11 @@ select sillyaddtwo(42); -- fail
create table mutable2(f1 int, f2 text);
select sillyaddtwo(42);
drop table mutable2;
+-- the context stack is different when debug_invalidate_system_caches_always
+-- is set, so suppress context output
+\set SHOW_CONTEXT never
select sillyaddtwo(42); -- fail
+\set SHOW_CONTEXT errors
create table mutable2(f0 text, f1 int, f2 text);
select sillyaddtwo(42);
select sillyaddtwo(43);