Commit e61234d
authored
Merge 'translate/insert: Implement INSERT OR REPLACE' from Preston Thorpe
This PR implements support for `INSERT OR REPLACE INTO t`.
For `OR IGNORE`, we currently rewrite this internally to an `ON CONFLICT
DO NOTHING`, and I was hopeful we could do this with OR REPLACE, however
it seems SQLite actually deletes the row and then proceeds to insert, so
we could not simply rewrite this to an `ON CONFLICT DO UPDATE SET
col=excluded.col`, as this would result in differing rowid's when
compared to SQLite.
Reviewed-by: Jussi Saurio <[email protected]>
Closes #3972File tree
6 files changed
+483
-53
lines changed- core/translate
- testing
- tests/fuzz
6 files changed
+483
-53
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
612 | | - | |
| 612 | + | |
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
660 | | - | |
| 660 | + | |
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | | - | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | | - | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
508 | 512 | | |
509 | 513 | | |
510 | 514 | | |
511 | | - | |
| 515 | + | |
512 | 516 | | |
513 | 517 | | |
514 | 518 | | |
| |||
676 | 680 | | |
677 | 681 | | |
678 | 682 | | |
679 | | - | |
| 683 | + | |
680 | 684 | | |
681 | 685 | | |
682 | 686 | | |
| |||
703 | 707 | | |
704 | 708 | | |
705 | 709 | | |
706 | | - | |
| 710 | + | |
707 | 711 | | |
708 | 712 | | |
709 | 713 | | |
| |||
0 commit comments