Commit b320b51
committed
copy: step txn unconditionally
Currently, we have an issue with COPY FROM command if it runs within the
txn which had just been rolled back to a savepoint - we'd hit an
assertion error in the KV layer. This commit fixes the oversight by
stepping the txn, similar to what we do on the main query path.
Additionally, this commit explicitly prohibits running COPY FROM via the
internal executor (previously it could lead to undefined behavior or
internal errors) and adds a test with savepoints for COPY TO (which
works because it uses different execution machinery than COPY FROM).
Release note (bug fix): Previously, CockroachDB could encounter an
internal error when evaluating COPY FROM command in a transaction after
it's been rolled back to a savepoint. The bug has been present since
before 23.2 version and is now fixed.1 parent d83d1d5 commit b320b51
File tree
5 files changed
+67
-42
lines changed- pkg/sql
- copy
- opt/exec/execbuilder/testdata
5 files changed
+67
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3228 | 3228 | | |
3229 | 3229 | | |
3230 | 3230 | | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
3231 | 3237 | | |
3232 | 3238 | | |
3233 | 3239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
| 649 | + | |
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | | - | |
656 | | - | |
657 | | - | |
| 655 | + | |
| 656 | + | |
658 | 657 | | |
659 | 658 | | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
| 659 | + | |
671 | 660 | | |
672 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
673 | 678 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 679 | + | |
| 680 | + | |
678 | 681 | | |
679 | | - | |
680 | | - | |
681 | | - | |
| 682 | + | |
| 683 | + | |
682 | 684 | | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
691 | 692 | | |
| 693 | + | |
692 | 694 | | |
693 | 695 | | |
694 | 696 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
66 | 74 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1472 | 1472 | | |
1473 | 1473 | | |
1474 | 1474 | | |
1475 | | - | |
1476 | | - | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
| 1475 | + | |
| 1476 | + | |
1480 | 1477 | | |
1481 | 1478 | | |
1482 | 1479 | | |
1483 | 1480 | | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
1484 | 1486 | | |
1485 | 1487 | | |
1486 | 1488 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
0 commit comments