Skip to content

[JDBC-V2] Statement.execute() returns false for CTE queries #2574

@chernser

Description

@chernser

Description

When com.clickhouse.jdbc.StatementImpl#execute(java.lang.String) is called for query that returns result set then method should return true.
It doesn't happen for such CTE:

WITH
	toDate('2025-08-20') as DATE_END
	,events AS (
		SELECT 1
	)
SELECT *
FROM events

However is works correctly for:

WITH events AS (
	WITH toDate('2025-08-20') as DATE_END
	SELECT 1
)
SELECT *
FROM events

Relates: dbeaver/dbeaver#39061

WITH FILL doesn't work too:

select value, toUnixTimestamp(ts)* 1000 as timestamp
from(select count() as value, toStartOfInterval(timestamp, interval 1 day) as ts
from events
where timestamp between toDateTime(1736035200) and toDateTime(1751587199)
group by ts
order by ts
with fill
from toDateTime(1736035200) to toDateTime(1751587199)
step interval '1 day');

Relates: dbeaver/dbeaver#38556

Environment

  • Cloud
  • Client version: 0.9.2
  • Language version:
  • OS:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions