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 #45237

Merged
merged 1 commit into from Jun 2, 2022

Conversation

fatkodima
Copy link
Member

@fatkodima fatkodima commented Jun 1, 2022

/m is redundant in the regexp (. is only used in the single line comment pattern of the regexp, but this patern already ends with \n).

Follow up to #45012.
Fixes #45234.

@matthewd
Copy link
Member

matthewd commented Jun 2, 2022

Yeah, it's exposed by the performance issue here, but as far as I can see, the (?m:.) here is incorrect, not just redundant: the expression would consume any sequence of lines where the first begins with --.

@matthewd matthewd merged commit 16c0026 into rails:main Jun 2, 2022
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.

Write sql query detection for Postgres extremely slow
2 participants