Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7d5b403

Browse files
committed
Small improvement for plpgsql regression test.
Use DISCARD PLANS instead of a reconnect to force reconstruction of a cached plan; this corresponds more nearly to what people might actually do in practice.
1 parent cfb758b commit 7d5b403

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/pl/plpgsql/src/expected/plpgsql_record.out

+4-2
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,11 @@ select sillyaddone(42);
424424
alter table mutable drop column f1;
425425
alter table mutable add column f1 float8;
426426
-- currently, this fails due to cached plan for "r.f1 + 1" expression
427+
-- (but we can't actually show that, because a CLOBBER_CACHE_ALWAYS build
428+
-- will succeed)
427429
-- select sillyaddone(42);
428-
\c -
429-
-- but it's OK after a reconnect
430+
-- but it's OK if we force plan rebuilding
431+
discard plans;
430432
select sillyaddone(42);
431433
sillyaddone
432434
-------------

src/pl/plpgsql/src/sql/plpgsql_record.sql

+5-2
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,12 @@ alter table mutable drop column f1;
274274
alter table mutable add column f1 float8;
275275

276276
-- currently, this fails due to cached plan for "r.f1 + 1" expression
277+
-- (but we can't actually show that, because a CLOBBER_CACHE_ALWAYS build
278+
-- will succeed)
277279
-- select sillyaddone(42);
278-
\c -
279-
-- but it's OK after a reconnect
280+
281+
-- but it's OK if we force plan rebuilding
282+
discard plans;
280283
select sillyaddone(42);
281284

282285
alter table mutable drop column f1;

0 commit comments

Comments
 (0)