WordPress / sqlite-database-integration

Feature Plugin to add SQLite support to WordPress. Under Development.
GNU General Public License v2.0
223 stars 37 forks source link

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

Closed bgrgicak closed 4 months ago

bgrgicak commented 4 months ago

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

adamziel commented 4 months ago

Good spot!