Skip to content

Commit f7d7ac2

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 2ff2099 commit f7d7ac2

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
@@ -3118,19 +3118,19 @@ with ordinality as (select 1 as x) select * from ordinality;
31183118
(1 row)
31193119

31203120
-- check sane response to attempt to modify CTE relation
3121-
WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
3122-
ERROR: relation "test" does not exist
3123-
LINE 1: WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
3124-
^
3121+
WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (1);
3122+
ERROR: relation "with_test" does not exist
3123+
LINE 1: WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (...
3124+
^
31253125
-- check response to attempt to modify table with same name as a CTE (perhaps
31263126
-- surprisingly it works, because CTEs don't hide tables from data-modifying
31273127
-- statements)
3128-
create temp table test (i int);
3129-
with test as (select 42) insert into test select * from test;
3130-
select * from test;
3128+
create temp table with_test (i int);
3129+
with with_test as (select 42) insert into with_test select * from with_test;
3130+
select * from with_test;
31313131
i
31323132
----
31333133
42
31343134
(1 row)
31353135

3136-
drop table test;
3136+
drop table with_test;

src/test/regress/sql/with.sql

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

14531453
-- check sane response to attempt to modify CTE relation
1454-
WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
1454+
WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (1);
14551455

14561456
-- check response to attempt to modify table with same name as a CTE (perhaps
14571457
-- surprisingly it works, because CTEs don't hide tables from data-modifying
14581458
-- statements)
1459-
create temp table test (i int);
1460-
with test as (select 42) insert into test select * from test;
1461-
select * from test;
1462-
drop table test;
1459+
create temp table with_test (i int);
1460+
with with_test as (select 42) insert into with_test select * from with_test;
1461+
select * from with_test;
1462+
drop table with_test;

0 commit comments

Comments
 (0)