-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11177 from Mytherin/fixrevertappendinternal
Fix RevertAppendInternal
- Loading branch information
Showing
3 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
test/sql/transactions/test_index_rollback_flushed_data.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# name: test/sql/transactions/test_index_rollback_flushed_data.test | ||
# description: Test that we revert the global storage correctly after a constraint violation | ||
# group: [transactions] | ||
|
||
require skip_reload | ||
|
||
statement ok | ||
PRAGMA enable_verification | ||
|
||
statement ok con1 | ||
CREATE TABLE integers(i INTEGER UNIQUE); | ||
|
||
statement ok con1 | ||
BEGIN TRANSACTION; | ||
|
||
statement ok con2 | ||
BEGIN TRANSACTION; | ||
|
||
statement ok con1 | ||
INSERT INTO integers VALUES (-10); | ||
|
||
statement ok con2 | ||
INSERT INTO integers SELECT range FROM range(2, 4097, 1); | ||
|
||
# constraint violation | ||
statement ok con2 | ||
INSERT INTO integers VALUES (-10); | ||
|
||
# con1 commits first | ||
statement ok con1 | ||
COMMIT; | ||
|
||
# con2 fails to commit because of the conflict | ||
statement error con2 | ||
COMMIT; | ||
---- | ||
|
||
statement ok | ||
INSERT INTO integers SELECT i FROM range(2, 4097, 1) t1(i) | ||
|
||
query I | ||
SELECT MAX(i) FROM integers | ||
---- | ||
4096 |