Small improvement for plpgsql regression test.
authorTom Lane
Fri, 18 May 2018 16:10:19 +0000 (12:10 -0400)
committerTom Lane
Fri, 18 May 2018 16:10:26 +0000 (12:10 -0400)
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.

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

index 29e42fda6c13d2c6eaf2f9b690c917ce3ed40905..6ea88b3de025dae4f356f88c0546265f260eeb0d 100644 (file)
@@ -424,9 +424,11 @@ select sillyaddone(42);
 alter table mutable drop column f1;
 alter table mutable add column f1 float8;
 -- currently, this fails due to cached plan for "r.f1 + 1" expression
+-- (but we can't actually show that, because a CLOBBER_CACHE_ALWAYS build
+-- will succeed)
 -- select sillyaddone(42);
-\c -
--- but it's OK after a reconnect
+-- but it's OK if we force plan rebuilding
+discard plans;
 select sillyaddone(42);
  sillyaddone 
 -------------
index 781ccb0ccb53ec25f05b7bb314f837079ac6f50e..aba68879948e068c0bdc500eeb8511ebc5198149 100644 (file)
@@ -274,9 +274,12 @@ alter table mutable drop column f1;
 alter table mutable add column f1 float8;
 
 -- currently, this fails due to cached plan for "r.f1 + 1" expression
+-- (but we can't actually show that, because a CLOBBER_CACHE_ALWAYS build
+-- will succeed)
 -- select sillyaddone(42);
-\c -
--- but it's OK after a reconnect
+
+-- but it's OK if we force plan rebuilding
+discard plans;
 select sillyaddone(42);
 
 alter table mutable drop column f1;