-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Expand file tree
/
Copy pathsavepoints
More file actions
54 lines (39 loc) · 1.13 KB
/
savepoints
File metadata and controls
54 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Regression test for https://github.com/cockroachdb/cockroach/issues/94337.
# The linked issue only manifests itself if the read request is able to drop
# latches early. Before this bug was fixed, one of the conditions required for
# a read request to drop its latches early was that it needed to have a higher
# read timestamp compared to the timestamp at which it had written all intents
# the read overlapped with. Adding the sleeps here bumps the transaction's read
# timestamp, by virtue of the closed timestamp interval.
statement ok
CREATE TABLE a (id INT);
statement ok
BEGIN
statement ok
SELECT pg_sleep(1.5)
statement ok
SAVEPOINT s
statement ok
SELECT pg_sleep(1.5)
statement ok
INSERT INTO a(id) VALUES (0);
statement ok
ROLLBACK TO SAVEPOINT s
query I
SELECT * FROM a
----
statement ok
COMMIT
# Regression test for https://github.com/cockroachdb/cockroach/issues/135118.
# Rolling back a savepoint before rolling back the transaction caused the
# transaction rollback to fail.
statement ok
BEGIN
statement ok
SAVEPOINT sp1
statement ok
INSERT INTO a(id) VALUES (1);
statement ok
ROLLBACK TO SAVEPOINT sp1
statement ok
ROLLBACK