From cf5e451178f989d6f5cc2532bbad584bcce71487 Mon Sep 17 00:00:00 2001 From: Radu Berinde Date: Thu, 18 Mar 2021 14:05:29 -0400 Subject: [PATCH] opt: add a regression test for INSERT ON CONFLICT with ORDER BY Informs #57434. Release note: None --- pkg/sql/logictest/testdata/logic_test/upsert | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/sql/logictest/testdata/logic_test/upsert b/pkg/sql/logictest/testdata/logic_test/upsert index 4cb4386fcf55..e2f06cc8636d 100644 --- a/pkg/sql/logictest/testdata/logic_test/upsert +++ b/pkg/sql/logictest/testdata/logic_test/upsert @@ -1274,3 +1274,16 @@ SELECT * FROM uniq ---- x1 y1 z1 x2 y2 z2 + +# Regression test for #57434. +statement ok +CREATE TABLE target (x INT PRIMARY KEY, y INT, z INT, UNIQUE (y, z)) + +statement ok +CREATE TABLE source (a INT, b INT, c INT) + +statement ok +INSERT INTO source VALUES (1, 1, 2), (1, 2, 1) + +statement ok +INSERT INTO target SELECT * FROM source ORDER BY rowid ON CONFLICT DO NOTHING