Skip to content

Recursive CTE not recognized as SELECT #76

@marschall

Description

@marschall

Recursive CTE are categoried as QueryType.OTHER instead of QueryType.SELECT by QueryUtils. Reproducer

class QueryUtilsTests {

  @Test
  void getQueryType() {
    String sql = "WITH RECURSIVE t(n, level_num) AS (SELECT next value for SEQ_PARENT_ID as n, 1 as level_num UNION ALL SELECT next value for SEQ_PARENT_ID as n, level_num + 1 as level_num  FROM t  WHERE level_num < ?) SELECT n FROM t";
    QueryType queryType = QueryUtils.getQueryType(sql);
    assertSame(QueryType.SELECT, queryType);
  }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions