Skip to content

Commit cadd98c

Browse files
committed
Fix overly generic name in with.sql test.
Avoid the name "test". In the 10 branch, this could clash with alter_table.sql, as seen in the build farm. That other instance was already renamed in later branches by commit 2cf8c7a, but it's good to future-proof the name here too. Back-patch to 10. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKGJf4RAXUyAYVUcQawcptX%3DnhEco3SYpuPK5cCbA-F1eLA%40mail.gmail.com
1 parent e4f7c51 commit cadd98c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/test/regress/expected/with.out

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,19 +2392,19 @@ with ordinality as (select 1 as x) select * from ordinality;
23922392
(1 row)
23932393

23942394
-- check sane response to attempt to modify CTE relation
2395-
WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
2396-
ERROR: relation "test" does not exist
2397-
LINE 1: WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
2398-
^
2395+
WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (1);
2396+
ERROR: relation "with_test" does not exist
2397+
LINE 1: WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (...
2398+
^
23992399
-- check response to attempt to modify table with same name as a CTE (perhaps
24002400
-- surprisingly it works, because CTEs don't hide tables from data-modifying
24012401
-- statements)
2402-
create temp table test (i int);
2403-
with test as (select 42) insert into test select * from test;
2404-
select * from test;
2402+
create temp table with_test (i int);
2403+
with with_test as (select 42) insert into with_test select * from with_test;
2404+
select * from with_test;
24052405
i
24062406
----
24072407
42
24082408
(1 row)
24092409

2410-
drop table test;
2410+
drop table with_test;

src/test/regress/sql/with.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,12 +1120,12 @@ create table foo (with ordinality); -- fail, WITH is a reserved word
11201120
with ordinality as (select 1 as x) select * from ordinality;
11211121

11221122
-- check sane response to attempt to modify CTE relation
1123-
WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
1123+
WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (1);
11241124

11251125
-- check response to attempt to modify table with same name as a CTE (perhaps
11261126
-- surprisingly it works, because CTEs don't hide tables from data-modifying
11271127
-- statements)
1128-
create temp table test (i int);
1129-
with test as (select 42) insert into test select * from test;
1130-
select * from test;
1131-
drop table test;
1128+
create temp table with_test (i int);
1129+
with with_test as (select 42) insert into with_test select * from with_test;
1130+
select * from with_test;
1131+
drop table with_test;

0 commit comments

Comments
 (0)