Skip to content

Panics in MIN()/MAX() aggregate functions (SQLancer) #12011

@2010YOUY01

Description

@2010YOUY01

Describe the bug

See reproducer in datafusion-cli

DataFusion CLI v41.0.0
> select min(1,2);
thread 'main' panicked at /Users/yongting/Desktop/code/my_datafusion/arrow-datafusion/datafusion/functions-aggregate/src/min_max.rs:71:5:
assertion `left == right` failed
  left: 2
 right: 1
DataFusion CLI v41.0.0
> select max(2,1);
thread 'main' panicked at /Users/yongting/Desktop/code/my_datafusion/arrow-datafusion/datafusion/functions-aggregate/src/min_max.rs:71:5:
assertion `left == right` failed
  left: 2
 right: 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To Reproduce

No response

Expected behavior

Note those queries are invalid since MIN/MAX only takes one argument, but it should still return an error instead of crash

Additional context

Found by SQLancer #11030

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