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

Commit 1118a8d

Browse files
committed
Remove useless MERGE test
This was trying to exercise an ERROR we don't actually have. Backpatch to 15. Reported by Teja Mupparti <Tejeswar.Mupparti@microsoft.com> Discussion: https://postgr.es/m/SN6PR2101MB1040BDAF740EA4389484E92BF0079@SN6PR2101MB1040.namprd21.prod.outlook.com
1 parent 1ad033d commit 1118a8d

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

src/test/regress/expected/merge.out

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -843,22 +843,6 @@ SELECT * FROM wq_target;
843843
1 | 499
844844
(1 row)
845845

846-
-- test preventing WHEN conditions from writing to the database
847-
create or replace function merge_when_and_write() returns boolean
848-
language plpgsql as
849-
$$
850-
BEGIN
851-
INSERT INTO target VALUES (100, 100);
852-
RETURN TRUE;
853-
END;
854-
$$;
855-
BEGIN;
856-
MERGE INTO wq_target t
857-
USING wq_source s ON t.tid = s.sid
858-
WHEN MATCHED AND (merge_when_and_write()) THEN
859-
UPDATE SET balance = t.balance + s.balance;
860-
ROLLBACK;
861-
drop function merge_when_and_write();
862846
DROP TABLE wq_target, wq_source;
863847
-- test triggers
864848
create or replace function merge_trigfunc () returns trigger

src/test/regress/sql/merge.sql

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -564,24 +564,6 @@ WHEN MATCHED AND t.tableoid >= 0 THEN
564564
UPDATE SET balance = t.balance + s.balance;
565565
SELECT * FROM wq_target;
566566

567-
-- test preventing WHEN conditions from writing to the database
568-
create or replace function merge_when_and_write() returns boolean
569-
language plpgsql as
570-
$$
571-
BEGIN
572-
INSERT INTO target VALUES (100, 100);
573-
RETURN TRUE;
574-
END;
575-
$$;
576-
577-
BEGIN;
578-
MERGE INTO wq_target t
579-
USING wq_source s ON t.tid = s.sid
580-
WHEN MATCHED AND (merge_when_and_write()) THEN
581-
UPDATE SET balance = t.balance + s.balance;
582-
ROLLBACK;
583-
drop function merge_when_and_write();
584-
585567
DROP TABLE wq_target, wq_source;
586568

587569
-- test triggers

0 commit comments

Comments
 (0)