Calculate row count button - Can't count rows for non-SELECT queries
Author: rz-1Created Sep 28, 2026Updated Sep 28, 2026
Labelswait for review
Description
After updating to the latest version of DBeaver Community Edition (persisting through the current 26.2.x release train since upgrading from v26.0.5), clicking the "Calculate total row count" button on a query result panel fails locally with an internal error.
The core SQL parser engine is failing to recognize queries starting with a Common Table Expression (WITH clause) as valid SELECT queries. Instead of wrapping the query into an internal count statement, it halts execution and returns a local UI error message. This functionality worked perfectly in versions prior to the 26.0.x engine rewrite.
DBeaver Version
Community 26.2.1
Operating System
Windows 11
Database and driver
- Database: Snowflake
- Driver: Snowflake JDBC Driver (Default bundled)
Steps to reproduce
- Open an active SQL Editor tab connected to a Snowflake warehouse.
- Execute a standard query utilizing a Common Table Expression (CTE) that fetches the initial row layout successfully:
WITH cte_example AS ( SELECT id, name, department FROM employees WHERE status = 'Active' ) SELECT department, COUNT(*) as total_staff FROM cte_example GROUP BY department; - Click the Calculate total row count button (circular green arrow icon) in the bottom data grid toolbar.
- Actual Result: DBeaver blocks the action and throws a pop-up / error dialog stating:
Can't count rows for non-SELECT queries - Expected Result: DBeaver's parser should identify the query as a data-fetching query and cleanly structure it into a subquery block to pull the complete count.
Additional context
- Manually wrapping the exact same CTE text works completely fine on the target database, proving it is a valid data-retrieval structure:
SELECT COUNT(*) FROM ( WITH cte_example AS ( SELECT id, name, department FROM employees WHERE status = 'Active' ) SELECT department, COUNT(*) as total_staff FROM cte_example GROUP BY department ) as temp_table; - The internal parser is completely misclassifying the
WITHstatement as a metadata or non-data query, rendering the row count feature useless for standard dialect workflows using CTE structures.
Source: dbeaver/dbeaver