Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0538d4c

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 parenta1efcda commit0538d4c

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
UPDATESET balance=t.balance+s.balance;
565565
SELECT*FROM wq_target;
566566

567-
-- test preventing WHEN conditions from writing to the database
568-
create or replacefunctionmerge_when_and_write() returnsboolean
569-
language plpgsqlas
570-
$$
571-
BEGIN
572-
INSERT INTO targetVALUES (100,100);
573-
RETURN TRUE;
574-
END;
575-
$$;
576-
577-
BEGIN;
578-
MERGE INTO wq_target t
579-
USING wq_source sONt.tid=s.sid
580-
WHEN MATCHEDAND (merge_when_and_write()) THEN
581-
UPDATESET balance=t.balance+s.balance;
582-
ROLLBACK;
583-
dropfunction merge_when_and_write();
584-
585567
DROPTABLE wq_target, wq_source;
586568

587569
-- test triggers

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp