Skip to content

The pruning predicate for LIKE expressions doesn't handle escape sequences in the compared string #22374

@masonh22

Description

@masonh22

Describe the bug

When pushing down the filter column LIKE foo\_% (i.e. all rows that start with foo_), the pruning predicate logic doesn't account for escape sequences in the compared string. Instead, it splits the string at the first wildcard, either "_" or "%", and uses that prefix as the literal to search for, producing a pruning predicate like min <= 'foo\' && 'foo\' <= max. This gives incorrect results depending on the min/max values for the row group.

To Reproduce

I will write a test that reproduces this.

Expected behavior

For column LIKE foo\_%, we should push down min <= 'foo_' && 'foo_' <= max.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions