From f91b8580db91cf8b88952fafb2026c0d077f737b Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Sun, 7 Apr 2024 15:14:20 +0300 Subject: [PATCH] Fixed tests --- ...34_recursive_cte_tree_merge_tree.reference | 118 +++++++++--------- .../03034_recursive_cte_tree_merge_tree.sql | 42 ++++--- 2 files changed, 86 insertions(+), 74 deletions(-) diff --git a/tests/queries/0_stateless/03034_recursive_cte_tree_merge_tree.reference b/tests/queries/0_stateless/03034_recursive_cte_tree_merge_tree.reference index 305c9621d2f..5f2b50da031 100644 --- a/tests/queries/0_stateless/03034_recursive_cte_tree_merge_tree.reference +++ b/tests/queries/0_stateless/03034_recursive_cte_tree_merge_tree.reference @@ -159,77 +159,83 @@ WITH RECURSIVE subdepartment AS SELECT * FROM subdepartment ORDER BY name; 1 0 A -- corner case in which sub-WITH gets initialized first -WITH RECURSIVE q AS ( - SELECT * FROM department - UNION ALL - (WITH x AS (SELECT * FROM q) - SELECT * FROM x) - ) -SELECT * FROM q LIMIT 24; -7 5 G +SELECT * FROM +( + WITH RECURSIVE q AS ( + SELECT * FROM department + UNION ALL + (WITH x AS (SELECT * FROM q) + SELECT * FROM x) + ) + SELECT * FROM q LIMIT 24 +) ORDER BY id, parent_department, name; +0 0 ROOT +0 0 ROOT 0 0 ROOT 1 0 A -2 1 B -3 2 C -4 2 D -5 0 E -6 4 F -7 5 G -0 0 ROOT +1 0 A 1 0 A 2 1 B -3 2 C -4 2 D -5 0 E -6 4 F -7 5 G -0 0 ROOT -1 0 A +2 1 B 2 1 B 3 2 C -4 2 D -5 0 E -6 4 F -WITH RECURSIVE q AS ( - SELECT * FROM department - UNION ALL - (WITH RECURSIVE x AS ( - SELECT * FROM department - UNION ALL - (SELECT * FROM q UNION ALL SELECT * FROM x) - ) - SELECT * FROM x) - ) -SELECT * FROM q LIMIT 32; -7 5 G -6 4 F -0 0 ROOT -1 0 A -2 1 B +3 2 C 3 2 C 4 2 D -5 0 E -7 5 G -6 4 F -0 0 ROOT -1 0 A -2 1 B -3 2 C +4 2 D 4 2 D 5 0 E -7 5 G +5 0 E +5 0 E 6 4 F +6 4 F +6 4 F +7 5 G +7 5 G +7 5 G +SELECT * FROM +( + WITH RECURSIVE q AS ( + SELECT * FROM department + UNION ALL + (WITH RECURSIVE x AS ( + SELECT * FROM department + UNION ALL + (SELECT * FROM q UNION ALL SELECT * FROM x) + ) + SELECT * FROM x) + ) + SELECT * FROM q LIMIT 32 +) ORDER BY id, parent_department, name; +0 0 ROOT +0 0 ROOT +0 0 ROOT 0 0 ROOT 1 0 A -2 1 B -3 2 C -4 2 D -5 0 E -7 5 G -6 4 F -0 0 ROOT +1 0 A +1 0 A 1 0 A 2 1 B +2 1 B +2 1 B +2 1 B +3 2 C +3 2 C +3 2 C 3 2 C 4 2 D +4 2 D +4 2 D +4 2 D 5 0 E +5 0 E +5 0 E +5 0 E +6 4 F +6 4 F +6 4 F +6 4 F +7 5 G +7 5 G +7 5 G +7 5 G diff --git a/tests/queries/0_stateless/03034_recursive_cte_tree_merge_tree.sql b/tests/queries/0_stateless/03034_recursive_cte_tree_merge_tree.sql index c8ee41ceb99..fd8350e5b3e 100644 --- a/tests/queries/0_stateless/03034_recursive_cte_tree_merge_tree.sql +++ b/tests/queries/0_stateless/03034_recursive_cte_tree_merge_tree.sql @@ -148,24 +148,30 @@ WITH RECURSIVE subdepartment AS SELECT * FROM subdepartment ORDER BY name; -- corner case in which sub-WITH gets initialized first -WITH RECURSIVE q AS ( - SELECT * FROM department - UNION ALL - (WITH x AS (SELECT * FROM q) - SELECT * FROM x) - ) -SELECT * FROM q LIMIT 24; +SELECT * FROM +( + WITH RECURSIVE q AS ( + SELECT * FROM department + UNION ALL + (WITH x AS (SELECT * FROM q) + SELECT * FROM x) + ) + SELECT * FROM q LIMIT 24 +) ORDER BY id, parent_department, name; -WITH RECURSIVE q AS ( - SELECT * FROM department - UNION ALL - (WITH RECURSIVE x AS ( - SELECT * FROM department - UNION ALL - (SELECT * FROM q UNION ALL SELECT * FROM x) - ) - SELECT * FROM x) - ) -SELECT * FROM q LIMIT 32; +SELECT * FROM +( + WITH RECURSIVE q AS ( + SELECT * FROM department + UNION ALL + (WITH RECURSIVE x AS ( + SELECT * FROM department + UNION ALL + (SELECT * FROM q UNION ALL SELECT * FROM x) + ) + SELECT * FROM x) + ) + SELECT * FROM q LIMIT 32 +) ORDER BY id, parent_department, name; -- { echoOff }