Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8112bcf

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 1fb17b1 commit 8112bcf

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/test/regress/expected/with.out

+8-8
Original file line numberDiff line numberDiff line change
@@ -3149,19 +3149,19 @@ with ordinality as (select 1 as x) select * from ordinality;
31493149
(1 row)
31503150

31513151
-- check sane response to attempt to modify CTE relation
3152-
WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
3153-
ERROR: relation "test" does not exist
3154-
LINE 1: WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
3155-
^
3152+
WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (1);
3153+
ERROR: relation "with_test" does not exist
3154+
LINE 1: WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (...
3155+
^
31563156
-- check response to attempt to modify table with same name as a CTE (perhaps
31573157
-- surprisingly it works, because CTEs don't hide tables from data-modifying
31583158
-- statements)
3159-
create temp table test (i int);
3160-
with test as (select 42) insert into test select * from test;
3161-
select * from test;
3159+
create temp table with_test (i int);
3160+
with with_test as (select 42) insert into with_test select * from with_test;
3161+
select * from with_test;
31623162
i
31633163
----
31643164
42
31653165
(1 row)
31663166

3167-
drop table test;
3167+
drop table with_test;

src/test/regress/sql/with.sql

+5-5
Original file line numberDiff line numberDiff line change
@@ -1459,12 +1459,12 @@ create table foo (with ordinality); -- fail, WITH is a reserved word
14591459
with ordinality as (select 1 as x) select * from ordinality;
14601460

14611461
-- check sane response to attempt to modify CTE relation
1462-
WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
1462+
WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (1);
14631463

14641464
-- check response to attempt to modify table with same name as a CTE (perhaps
14651465
-- surprisingly it works, because CTEs don't hide tables from data-modifying
14661466
-- statements)
1467-
create temp table test (i int);
1468-
with test as (select 42) insert into test select * from test;
1469-
select * from test;
1470-
drop table test;
1467+
create temp table with_test (i int);
1468+
with with_test as (select 42) insert into with_test select * from with_test;
1469+
select * from with_test;
1470+
drop table with_test;

0 commit comments

Comments
 (0)