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

ON DUPLICATE KEY: Prevent adding a comma if key isn't in the first position #113

Merged
merged 2 commits into from
May 17, 2024

Conversation

bgrgicak
Copy link
Collaborator

WordPress Playground observed an issue with insert queries that use ON DUPLICATE KEY and don't have the KEY as the first value of the insert.

After investigating it it turns out that the condition for adding commas didn't work well in case the KEY value is in a "random" place.

This PR ensures the comma is added for all items except for the last one.

Testing instructions

  • Ensure tests pass

@bgrgicak bgrgicak self-assigned this May 17, 2024
@adamziel
Copy link
Collaborator

Good spot!

@adamziel adamziel merged commit 58f55b6 into WordPress:main May 17, 2024
8 checks passed
@adamziel adamziel changed the title Prevent adding a comma if key isn't in the first position ON DUPLICATE KEY: Prevent adding a comma if key isn't in the first position May 17, 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.

None yet

2 participants