diff options
Diffstat (limited to 'src/test/regress/sql/with.sql')
-rw-r--r-- | src/test/regress/sql/with.sql | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/test/regress/sql/with.sql b/src/test/regress/sql/with.sql index 0f5730797fa..f876c663519 100644 --- a/src/test/regress/sql/with.sql +++ b/src/test/regress/sql/with.sql @@ -414,6 +414,41 @@ with recursive search_graph(f, t, label) as ( ) search breadth first by f, t set seq select * from search_graph order by seq; +-- a constant initial value causes issues for EXPLAIN +explain (verbose, costs off) +with recursive test as ( + select 1 as x + union all + select x + 1 + from test +) search depth first by x set y +select * from test limit 5; + +with recursive test as ( + select 1 as x + union all + select x + 1 + from test +) search depth first by x set y +select * from test limit 5; + +explain (verbose, costs off) +with recursive test as ( + select 1 as x + union all + select x + 1 + from test +) search breadth first by x set y +select * from test limit 5; + +with recursive test as ( + select 1 as x + union all + select x + 1 + from test +) search breadth first by x set y +select * from test limit 5; + -- various syntax errors with recursive search_graph(f, t, label) as ( select * from graph0 g @@ -561,6 +596,23 @@ with recursive search_graph(f, t, label) as ( ) cycle f, t set is_cycle to 'Y' default 'N' using path select * from search_graph; +explain (verbose, costs off) +with recursive test as ( + select 0 as x + union all + select (x + 1) % 10 + from test +) cycle x set is_cycle using path +select * from test; + +with recursive test as ( + select 0 as x + union all + select (x + 1) % 10 + from test +) cycle x set is_cycle using path +select * from test; + -- multiple CTEs with recursive graph(f, t, label) as ( |