Skip to content

Recursive CTE not recognized as SELECT #76

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);
  }

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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