Skip to content

panic: generate_series table function overflows when integer step passes i64::MAX #22208

@Dandandan

Description

@Dandandan

Describe the bug

The table-valued generate_series(start, stop, step) can panic when the integer iterator advances past i64::MAX while evaluating user SQL.

To Reproduce

SELECT * FROM generate_series(9223372036854775806, 9223372036854775807, 2);

Actual behavior

datafusion-cli panics:

thread 'main' panicked at datafusion/functions-table/src/generate_series.rs:101:9:
attempt to add with overflow

Expected behavior

DataFusion should return a normal execution error or stop iteration without panicking.

Notes

This is distinct from the already-filed capacity-overflow issue for scalar range/generate_series; this panic is the table function's iterator doing unchecked current + step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions