From 04999f06024d5b40624df1ab059b8613d22f410d Mon Sep 17 00:00:00 2001 From: xfz <73645462+xuefengze@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:56:08 +0800 Subject: [PATCH] test(regress): enable delete (#13277) --- src/tests/regress/data/expected/delete.out | 8 ++++---- src/tests/regress/data/schedule | 2 +- src/tests/regress/data/sql/delete.sql | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tests/regress/data/expected/delete.out b/src/tests/regress/data/expected/delete.out index e7eb3285f8851..9f0f62ec98f28 100644 --- a/src/tests/regress/data/expected/delete.out +++ b/src/tests/regress/data/expected/delete.out @@ -1,10 +1,10 @@ CREATE TABLE delete_test ( - id SERIAL PRIMARY KEY, + id INTEGER PRIMARY KEY, a INT, b text ); -INSERT INTO delete_test (a) VALUES (10); -INSERT INTO delete_test (a, b) VALUES (50, repeat('x', 10000)); +INSERT INTO delete_test (id, a) VALUES (1, 10); +INSERT INTO delete_test (id, a, b) VALUES (2, 50, repeat('x', 10000)); INSERT INTO delete_test (a) VALUES (100); -- allow an alias to be specified for DELETE's target table DELETE FROM delete_test AS dt WHERE dt.a > 75; @@ -15,7 +15,7 @@ ERROR: invalid reference to FROM-clause entry for table "delete_test" LINE 1: DELETE FROM delete_test dt WHERE delete_test.a > 25; ^ HINT: Perhaps you meant to reference the table alias "dt". -SELECT id, a, char_length(b) FROM delete_test; +SELECT id, a, char_length(b) FROM delete_test ORDER BY id; id | a | char_length ----+----+------------- 1 | 10 | diff --git a/src/tests/regress/data/schedule b/src/tests/regress/data/schedule index 90fd97b9ffec0..6c424e7ba299d 100644 --- a/src/tests/regress/data/schedule +++ b/src/tests/regress/data/schedule @@ -9,6 +9,6 @@ test: boolean varchar text int2 int4 int8 float4 float8 comments test: strings date time timestamp interval -test: case arrays +test: case arrays delete test: jsonb test: regex diff --git a/src/tests/regress/data/sql/delete.sql b/src/tests/regress/data/sql/delete.sql index d8cb99e93cb5c..9c02a840a13d0 100644 --- a/src/tests/regress/data/sql/delete.sql +++ b/src/tests/regress/data/sql/delete.sql @@ -1,21 +1,21 @@ CREATE TABLE delete_test ( - id SERIAL PRIMARY KEY, + id INTEGER PRIMARY KEY, a INT, b text ); -INSERT INTO delete_test (a) VALUES (10); -INSERT INTO delete_test (a, b) VALUES (50, repeat('x', 10000)); -INSERT INTO delete_test (a) VALUES (100); +INSERT INTO delete_test (id, a) VALUES (1, 10); +INSERT INTO delete_test (id, a, b) VALUES (2, 50, repeat('x', 10000)); +--@ INSERT INTO delete_test (a) VALUES (100); -- allow an alias to be specified for DELETE's target table -DELETE FROM delete_test AS dt WHERE dt.a > 75; +--@ DELETE FROM delete_test AS dt WHERE dt.a > 75; -- if an alias is specified, don't allow the original table name -- to be referenced -DELETE FROM delete_test dt WHERE delete_test.a > 25; +--@ DELETE FROM delete_test dt WHERE delete_test.a > 25; -SELECT id, a, char_length(b) FROM delete_test; +SELECT id, a, char_length(b) FROM delete_test ORDER BY id; -- delete a row with a TOASTed value DELETE FROM delete_test WHERE a > 25;