Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd0fb919

Browse files
author
Maksim Milyutin
committed
Add tests for special case with ONLY statement
1 parent2704b14 commitd0fb919

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

‎expected/pathman_basic.out

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,28 @@ SELECT COUNT(*) FROM ONLY test.num_range_rel;
190190
0
191191
(1 row)
192192

193+
/* test special case: ONLY statement with not-ONLY for partitioned table */
193194
SELECT * FROM ONLY test.range_rel UNION SELECT * FROM test.range_rel;
194195
ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
196+
SELECT * FROM test.range_rel UNION SELECT * FROM ONLY test.range_rel;
197+
ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
198+
SELECT * FROM test.range_rel UNION SELECT * FROM test.range_rel UNION SELECT * FROM ONLY test.range_rel;
199+
ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
200+
SELECT * FROM ONLY test.range_rel UNION SELECT * FROM test.range_rel UNION SELECT * FROM test.range_rel;
201+
ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
202+
/* FIXME: result of next command execution is not right just yet */
203+
WITH q1 AS (SELECT * FROM test.range_rel), q2 AS (SELECT * FROM ONLY test.range_rel) SELECT * FROM q1 JOIN q2 USING(id);
204+
ERROR: It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
205+
WITH q1 AS (SELECT * FROM ONLY test.range_rel) SELECT * FROM test.range_rel JOIN q1 USING(id);
206+
id | dt | txt | dt | txt
207+
----+----+-----+----+-----
208+
(0 rows)
209+
210+
SELECT * FROM test.range_rel WHERE id = (SELECT id FROM ONLY test.range_rel LIMIT 1);
211+
id | dt | txt
212+
----+----+-----
213+
(0 rows)
214+
195215
SET pg_pathman.enable_runtimeappend = OFF;
196216
SET pg_pathman.enable_runtimemergeappend = OFF;
197217
VACUUM;

‎sql/pathman_basic.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@ INSERT INTO test.num_range_rel
5757
SELECTCOUNT(*)FROMtest.num_range_rel;
5858
SELECTCOUNT(*)FROM ONLYtest.num_range_rel;
5959

60+
/* test special case: ONLY statement with not-ONLY for partitioned table*/
6061
SELECT*FROM ONLYtest.range_relUNIONSELECT*FROMtest.range_rel;
62+
SELECT*FROMtest.range_relUNIONSELECT*FROM ONLYtest.range_rel;
63+
SELECT*FROMtest.range_relUNIONSELECT*FROMtest.range_relUNIONSELECT*FROM ONLYtest.range_rel;
64+
SELECT*FROM ONLYtest.range_relUNIONSELECT*FROMtest.range_relUNIONSELECT*FROMtest.range_rel;
65+
/* FIXME: result of next command execution is not right just yet*/
66+
WITH q1AS (SELECT*FROMtest.range_rel), q2AS (SELECT*FROM ONLYtest.range_rel)SELECT*FROM q1JOIN q2 USING(id);
67+
WITH q1AS (SELECT*FROM ONLYtest.range_rel)SELECT*FROMtest.range_relJOIN q1 USING(id);
68+
SELECT*FROMtest.range_relWHERE id= (SELECT idFROM ONLYtest.range_relLIMIT1);
6169

6270
SETpg_pathman.enable_runtimeappend= OFF;
6371
SETpg_pathman.enable_runtimemergeappend= OFF;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp