Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid exponential DFA in LIKE matcher #19150

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Conversation

martint
Copy link
Member

@martint martint commented Sep 25, 2023

When a pattern contains a % and a sequence of _ somewhere after it, it may produce a DFA with exponential number of states. In such cases, fall back to the NFA matcher.

Fixes #19146

Release notes

(x) Release notes are required, with the following suggested text:

# General
* Fix query hang for certain `LIKE` patterns involving a mix of `%` and `_`. ({issue}`19146`)

When a pattern contains a % and a sequence of _ somewhere
after it, it may produce a DFA with exponential number of states.
In such cases, fall back to the NFA matcher.
@cla-bot cla-bot bot added the cla-signed label Sep 25, 2023
@martint martint merged commit e1dc146 into trinodb:master Sep 25, 2023
@martint martint deleted the like-exponential branch September 25, 2023 18:35
@github-actions github-actions bot added this to the 427 milestone Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Memory leak in LIKE operator on Trino 423
2 participants