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

Simplify regex detecting comments in sql query #45012

Merged
merged 1 commit into from May 3, 2022

Conversation

fatkodima
Copy link
Member

This regex has extra * for --- like comments that is not needed, since * is also added here

/\A(?:[(\s]|#{COMMENT_REGEX})*#{Regexp.union(*parts)}/

Closes #45011

ping @yassenb

@eileencodes eileencodes merged commit 3c48b40 into rails:main May 3, 2022
eileencodes added a commit that referenced this pull request May 3, 2022
Simplify regex detecting comments in sql query
@eileencodes
Copy link
Member

Thanks @fatkodima! Backported to 7-0-stable in f154d9b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executing raw SQL with comments can be very slow
2 participants