Skip to content

Commit

Permalink
Format test sql
Browse files Browse the repository at this point in the history
  • Loading branch information
zihaoAK47 committed Oct 29, 2023
1 parent fb329ca commit dab5f69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions test/it/parser/src/main/resources/case/dml/select-with.xml
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
</right>
</binary-operation-expression>
</left>
<operator>and</operator>
<operator>AND</operator>
<right>
<binary-operation-expression start-index="70" stop-index="83">
<left>
Expand Down Expand Up @@ -550,7 +550,7 @@
<operator>=</operator>
</binary-operation-expression>
</left>
<operator>and</operator>
<operator>AND</operator>
<right>
<binary-operation-expression start-index="197" stop-index="216">
<left>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<sql-case id="select_with_subquery_factoring_with_search_depth_first_with_cycle" value="WITH dup_hiredate (eid, emp_last, mgr_id, reportLevel, hire_date, job_id) AS (SELECT employee_id, last_name, manager_id, reportLevel, hire_date, job_id FROM employees WHERE manager_id IS NULL) SEARCH DEPTH FIRST BY hire_date SET order1 CYCLE hire_date SET is_cycle TO 'Y' DEFAULT 'N' SELECT lpad(' ',2*reportLevel)||emp_last emp_name, eid, mgr_id, hire_date, job_id, is_cycle FROM dup_hiredate ORDER BY order1" db-types="Oracle" />
<sql-case id="select_with_subquery_factoring_with_search_depth_first_with_having" value="WITH emp_count (eid, emp_last, mgr_id, mgrLevel, salary, cnt_employees) AS (SELECT employee_id, last_name, manager_id, mgrLevel, salary, cnt_employees FROM employees) SEARCH DEPTH FIRST BY emp_last SET order1 SELECT emp_last, eid, mgr_id, salary FROM emp_count GROUP BY emp_last, eid, mgr_id, salary HAVING salary > 24000 ORDER BY mgr_id NULLS FIRST, emp_last" db-types="Oracle" />
<sql-case id="select_with_multiple_cte_definitions" value="WITH cte1(status, user_id) AS (SELECT status, user_id FROM t_order), cte2(item_id) AS (SELECT item_id FROM t_order_item) SELECT status, user_id, item_id FROM cte1 INNER JOIN cte2 ON cte1.user_id = cte2.user_id" db-types="SQLServer" />
<sql-case id="select_with_single_subquery" value="with t as (select a+2 c,b from t1) select c,b from t" db-types="MySQL" />
<sql-case id="select_with_multiple_subquery" value="with cte1(col1, col2, col3) as (select emp_no,first_name,last_name from employees where emp_no=10012), cte2(col1, col2, col3) as (select emp_no,first_name,last_name from employees where emp_no=10012) select col1, col2, col3 from cte1" db-types="MySQL" />
<sql-case id="select_with_recursive_union_all1" value="WITH RECURSIVE DirectoryCTE as (select * from table1 where id = 1 and project_id = 2 union all select * from project_file_catalog t INNER JOIN DirectoryCTE cte ON t.project_id = cte.project_id and t.parent_id = cte.id) select * from DirectoryCTE order by level" db-types="MySQL" />
<sql-case id="select_with_single_subquery" value="WITH t AS (SELECT a+2 c,b FROM t1) SELECT c,b FROM t" db-types="MySQL" />
<sql-case id="select_with_multiple_subquery" value="WITH cte1(col1, col2, col3) as (SELECT emp_no,first_name,last_name FROM employees WHERE emp_no=10012), cte2(col1, col2, col3) as (SELECT emp_no,first_name,last_name from employees WHERE emp_no=10012) SELECT col1, col2, col3 FROM cte1" db-types="MySQL" />
<sql-case id="select_with_recursive_union_all1" value="WITH RECURSIVE DirectoryCTE as (SELECT * FROM table1 WHERE id = 1 AND project_id = 2 UNION ALL SELECT * FROM project_file_catalog t INNER JOIN DirectoryCTE cte ON t.project_id = cte.project_id AND t.parent_id = cte.id) SELECT * FROM DirectoryCTE ORDER BY level" db-types="MySQL" />
<sql-case id="select_with_recursive_union_all2" value="WITH cte AS (SELECT 1 AS col1, 2 AS col2 UNION ALL SELECT 3, 4) SELECT col1, col2 FROM cte" db-types="MySQL" />
</sql-cases>

0 comments on commit dab5f69

Please sign in to comment.