Commit 58f55b6
authored
ON DUPLICATE KEY: Prevent adding a comma if key isn't in the first position (#113)
[WordPress Playground observed an
issu](WordPress/wordpress-playground#731
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 pass1 parent 4b0dab5 commit 58f55b6
File tree
2 files changed
+18
-2
lines changed- tests
- wp-includes/sqlite
2 files changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
508 | 523 | | |
509 | 524 | | |
510 | 525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2803 | 2803 | | |
2804 | 2804 | | |
2805 | 2805 | | |
2806 | | - | |
| 2806 | + | |
| 2807 | + | |
2807 | 2808 | | |
2808 | | - | |
| 2809 | + | |
2809 | 2810 | | |
2810 | 2811 | | |
2811 | 2812 | | |
| |||
0 commit comments