You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recursive CTE are categoried as QueryType.OTHER instead of QueryType.SELECT by QueryUtils. Reproducer
classQueryUtilsTests {
@TestvoidgetQueryType() {
Stringsql = "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";
QueryTypequeryType = QueryUtils.getQueryType(sql);
assertSame(QueryType.SELECT, queryType);
}
}
The text was updated successfully, but these errors were encountered:
Hi @marschall,
Thanks for the report.
Admittedly, the current QueryUtils.getQueryType is flawed.
I do not intend to provide a full query parser to detect the type, but at least the logic needs to be replaceable by the user.
I'll extract the logic to an interface based strategy and allow users to provide own query type detector.
Recursive CTE are categoried as
QueryType.OTHER
instead ofQueryType.SELECT
byQueryUtils
. ReproducerThe text was updated successfully, but these errors were encountered: