Skip to content

Treat an empty Statement.filters list as a scan instead of panicking - #271

Merged
khaf merged 1 commit into
v3from
empty-statement-filters
Oct 7, 2026
Merged

khaf merged 1 commit into
v3from
empty-statement-filters

Conversation

@paul-brackin

Copy link
Copy Markdown
Contributor

The query encoder indexed filters[0] whenever filters was Some, so a statement with Some(vec![]) panicked the per-node query task with an out-of-bounds index, surfacing as a client error -1.

Add a crate-private Statement::filter() accessor that returns the first filter or None, and use it at every site that decides query vs. scan: the encoder, the query/scan metrics label, and the scan flag handed to the ExecuteTask from query_operate and query_execute_udf. An empty list now behaves exactly like None everywhere.

Adds query_empty_filter_list_scans, which fails with the panic on the old encoder line and passes with the fix.

@khaf khaf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@khaf
khaf merged commit 4e2e497 into v3 Oct 7, 2026
5 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants