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

Don't add too many spaces when replacing clauses #558

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

MoonE
Copy link
Contributor

@MoonE MoonE commented May 9, 2024

There were unnecessary spaced included in the statement when

  • a clause is removed (replaced with empty string)
  • the replacement string already has spaces
  • the replacement was at the start or end of the statement

This will require some tests to be updated in phpMyAdmin.
e. g.: https://github.com/phpmyadmin/phpmyadmin/blob/99c2939eda6c1c3ab9ffe4b1f903bab182d686db/test/classes/Display/ResultsTest.php#L1469

src/Utils/Query.php Outdated Show resolved Hide resolved
@MoonE MoonE force-pushed the replace-clause-spaces branch 3 times, most recently from 4945c8f to 18c70f3 Compare May 9, 2024 23:09
Copy link
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this version is probably better because I see quite some crash reports due to ram eaten while trying to compile a regex

@MauricioFauth
Copy link
Member

I think this should target the master branch.

@MoonE MoonE changed the base branch from 5.10.x to master June 1, 2024 13:22
When a clause is removed (replaced with empty string) or the replacement
string already has spaces or the replacement was at the start or end of
the statement there were unnecessary spaced included in the statement.

Signed-off-by: Maximilian Krög <[email protected]>
@MauricioFauth MauricioFauth merged commit f2bafbb into phpmyadmin:master Aug 25, 2024
9 of 10 checks passed
@MauricioFauth MauricioFauth self-assigned this Aug 25, 2024
@MoonE MoonE deleted the replace-clause-spaces branch August 25, 2024 19:06
@williamdes williamdes added this to the 6.0.0 milestone Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants