aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/sql/with.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/sql/with.sql')
-rw-r--r--src/test/regress/sql/with.sql10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/regress/sql/with.sql b/src/test/regress/sql/with.sql
index 3107cbcb911..d79be72a353 100644
--- a/src/test/regress/sql/with.sql
+++ b/src/test/regress/sql/with.sql
@@ -272,6 +272,16 @@ with recursive search_graph(f, t, label, path, cycle) as (
)
select * from search_graph;
+-- ordering by the path column has same effect as SEARCH DEPTH FIRST
+with recursive search_graph(f, t, label, path, cycle) as (
+ select *, array[row(g.f, g.t)], false from graph g
+ union all
+ select g.*, path || row(g.f, g.t), row(g.f, g.t) = any(path)
+ from graph g, search_graph sg
+ where g.f = sg.t and not cycle
+)
+select * from search_graph order by path;
+
--
-- test multiple WITH queries
--