0002-Fix-tests.patch
application/octet-stream
Filename: 0002-Fix-tests.patch
Type: application/octet-stream
Part: 1
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0002
Subject: Fix tests.
| File | + | − |
|---|---|---|
| src/test/regress/expected/portals.out | 19 | 0 |
| src/test/regress/expected/rowtypes.out | 2 | 5 |
| src/test/regress/sql/portals.sql | 14 | 0 |
From 4a6521055859a5ddb60250be0d341ce30d9d2424 Mon Sep 17 00:00:00 2001 From: Vaibhave Sekar <vsekar@microsoft.com> Date: Sun, 25 Jan 2026 10:34:55 +0000 Subject: [PATCH 2/2] Fix tests. --- src/test/regress/expected/portals.out | 19 +++++++++++++++++++ src/test/regress/expected/rowtypes.out | 7 ++----- src/test/regress/sql/portals.sql | 14 ++++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/test/regress/expected/portals.out b/src/test/regress/expected/portals.out index 06726ed4ab7..c4408c8d0bf 100644 --- a/src/test/regress/expected/portals.out +++ b/src/test/regress/expected/portals.out @@ -1561,3 +1561,22 @@ fetch all in held_portal; (1 row) reset default_toast_compression; +-- Changing a composite type after a cursor has emitted rows should error +DROP TYPE IF EXISTS portal_composite CASCADE; +NOTICE: type "portal_composite" does not exist, skipping +CREATE TYPE portal_composite AS (a int, b int); +BEGIN; +DECLARE stale_portal CURSOR FOR + SELECT (i, power(2, 10))::portal_composite FROM generate_series(1, 2) i; +FETCH FROM stale_portal; + row +---------- + (1,1024) +(1 row) + +ALTER TYPE portal_composite ALTER ATTRIBUTE b TYPE text; +FETCH FROM stale_portal; -- should fail instead of crashing +ERROR: type portal_composite has changed +DETAIL: The composite value was created using a previous definition of type portal_composite. +ROLLBACK; +DROP TYPE portal_composite; diff --git a/src/test/regress/expected/rowtypes.out b/src/test/regress/expected/rowtypes.out index 9168979a620..4b9104219b7 100644 --- a/src/test/regress/expected/rowtypes.out +++ b/src/test/regress/expected/rowtypes.out @@ -135,11 +135,8 @@ ERROR: cannot alter table "fullname" because column "people.fn" uses its row ty -- but this should work: alter table fullname add column suffix text default null; select * from people; - fn | bd --------------+------------ - (Joe,Blow,) | 01-10-1984 -(1 row) - +ERROR: type fullname has changed +DETAIL: The composite value was created using a previous definition of type fullname. -- test insertion/updating of subfields update people set fn.suffix = 'Jr'; select * from people; diff --git a/src/test/regress/sql/portals.sql b/src/test/regress/sql/portals.sql index fc4cccb96c0..17110ee7c2e 100644 --- a/src/test/regress/sql/portals.sql +++ b/src/test/regress/sql/portals.sql @@ -605,3 +605,17 @@ drop table toasted_data; fetch all in held_portal; reset default_toast_compression; + +-- Changing a composite type after a cursor has emitted rows should error +DROP TYPE IF EXISTS portal_composite CASCADE; +CREATE TYPE portal_composite AS (a int, b int); + +BEGIN; +DECLARE stale_portal CURSOR FOR + SELECT (i, power(2, 10))::portal_composite FROM generate_series(1, 2) i; +FETCH FROM stale_portal; +ALTER TYPE portal_composite ALTER ATTRIBUTE b TYPE text; +FETCH FROM stale_portal; -- should fail instead of crashing +ROLLBACK; + +DROP TYPE portal_composite; -- 2.43.0