Skip to content

Commit 284b6c0

Browse files
craig[bot]michae2rickystewartnvbMarius Posta
committed
105857: sql: add implicit SELECT FOR SHARE locking to FK checks r=DrewKimball,nvanbenschoten,rytaft,mgartner a=michae2 **explain: add transaction information to EXPLAIN ANALYZE** Add transaction isolation, priority, and quality-of-service to the output of `EXPLAIN ANALYZE`. Release note (sql change): `EXPLAIN ANALYZE` output now includes: - the isolation level of the statement's transaction - the priority of the statement's transaction - the quality of service level of the statement's transaction --- **opt: do not use LockDurabilityGuaranteed under serializable isolation** This is a follow-up from cockroachdb#103734. We do not want to use guaranteed-durable (a.k.a. replicated) locking under serializable isolation, because it prevents pipelining and other optimizations, and is unnecessary for correctness. This commit amends 8cbc6d1 to only set durability for `SELECT FOR UPDATE` locking under weaker isolation levels. This means that query plans will be slightly different under different isolation levels, and so we must add isolation level to the optimizer memo staleness calculation. Furthermore, this commit changes the error message added by e633d5e to be about guaranteed-durable locking rather than `SELECT FOR UPDATE`, because in a later commit this specific error will also be triggered by foreign key checks under weaker isolation levels. Informs: cockroachdb#100144, cockroachdb#100156, cockroachdb#100193, cockroachdb#100194 Release note: None --- **opt: show locking durability in EXPLAIN (OPT) output** Because the "guaranteed-durable locking not yet implemented" error condition is checked in execbuilder, it prevents not only execution but also `EXPLAIN` of queries using guaranteed-durable locking. Thankfully `EXPLAIN (OPT)` bypasses execbuilder, and hence still works, so use this for now to verify that we are enabling durable locking for `SELECT FOR UPDATE` under read committed isolation. (Note that we have not yet fixed the `SELECT FOR UPDATE` plans to use more precise locking, that will come in a later PR.) Informs: cockroachdb#100194 Release note: None --- **sql: add implicit SELECT FOR SHARE locking to FK parent checks** Add SELECT FOR SHARE locking to FK parent checks. Under serializable isolation, this locking is only used when `enable_implicit_fk_locking_for_serializable` is set. Under weaker isolation levels (snapshot and read committed) this locking is always used. We only need to lock during the insertion-side FK checks, which verify the existence of a parent row. Deletion-side FK checks verify the non-existence of a child row, and these do not need to lock. Instead, to prevent concurrent inserts or updates to the child that would violate the FK constraint, we rely on the intent(s) created by the deletion conflicting with the FK locking of those concurrent inserts or updates. Fixes: cockroachdb#80683 Informs: cockroachdb#100156 Epic: CRDB-25322 Release note (sql change): Add a new session variable, `enable_implicit_fk_locking_for_serializable`, which controls locking during foreign key checks under serializable isolation. With this set to true, foreign key checks of the referenced (parent) table, such as those performed during an INSERT or UPDATE of the referencing (child) table, will lock the referenced row using SELECT FOR SHARE locking. (This is somewhat analogous to the existing `enable_implicit_select_for_update` variable but applies to the foreign key checks of a mutation statement instead of the initial row fetch.) Under weaker isolation levels such as read committed, SELECT FOR SHARE locking will always be used to ensure the database maintains the foreign key constraint, regardless of the current setting of `enable_implicit_fk_locking_for_serializable`. 107212: ui-e2e-tests: steps to enable cypress tests r=maryliag a=rickystewart This doesn't get the job fully working yet, but it's an improvement. Epic: none Part of cockroachdb#106584 Release note: None 107517: roachtest: add read committed variants of ycsb r=michae2 a=nvanbenschoten Closes cockroachdb#107112. This PR adds the following six roachtest variants: ``` ycsb/A/nodes=3/cpu=32/isolation-level=read-committed ycsb/B/nodes=3/cpu=32/isolation-level=read-committed ycsb/C/nodes=3/cpu=32/isolation-level=read-committed ycsb/D/nodes=3/cpu=32/isolation-level=read-committed ycsb/E/nodes=3/cpu=32/isolation-level=read-committed ycsb/F/nodes=3/cpu=32/isolation-level=read-committed ``` It does so after adding an `--isolation-level` flag to ycsb, which controls the isolation level to run the workload transactions under. If unset, the workload will run with the default isolation level of the database. Release note: None 107636: schemachanger: deflake TestConcurrentDeclarativeSchemaChanges r=postamar a=postamar This commit deflakes this test by checking that the second schema change actually does block because of the first one, rather than checking that it has blocked. The bug was that the latter wasn't always guaranteed to happen because we didn't force the schema changes to run in parallel. Fixes cockroachdb#106732. Release note: None Co-authored-by: Michael Erickson <[email protected]> Co-authored-by: Ricky Stewart <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]> Co-authored-by: Marius Posta <[email protected]>
5 parents 363b5da + bb857aa + 3892520 + 2a335a2 + abc0966 commit 284b6c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1583
-235
lines changed

pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/cmd/roachtest/tests/ycsb.go

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const envYCSBFlags = "ROACHTEST_YCSB_FLAGS"
2929
func registerYCSB(r registry.Registry) {
3030
workloads := []string{"A", "B", "C", "D", "E", "F"}
3131
cpusConfigs := []int{8, 32}
32+
cpusWithReadCommitted := 32
3233
cpusWithGlobalMVCCRangeTombstone := 32
3334

3435
// concurrencyConfigs contains near-optimal concurrency levels for each
@@ -45,7 +46,7 @@ func registerYCSB(r registry.Registry) {
4546
}
4647

4748
runYCSB := func(
48-
ctx context.Context, t test.Test, c cluster.Cluster, wl string, cpus int, rangeTombstone bool,
49+
ctx context.Context, t test.Test, c cluster.Cluster, wl string, cpus int, readCommitted, rangeTombstone bool,
4950
) {
5051
// For now, we only want to run the zfs tests on GCE, since only GCE supports
5152
// starting roachprod instances on zfs.
@@ -75,9 +76,11 @@ func registerYCSB(r registry.Registry) {
7576
m := c.NewMonitor(ctx, c.Range(1, nodes))
7677
m.Go(func(ctx context.Context) error {
7778
var args string
78-
args += fmt.Sprintf(" --select-for-update=%t", t.IsBuildVersion("v19.2.0"))
7979
args += " --ramp=" + ifLocal(c, "0s", "2m")
8080
args += " --duration=" + ifLocal(c, "10s", "30m")
81+
if readCommitted {
82+
args += " --isolation-level=read_committed"
83+
}
8184
if envFlags := os.Getenv(envYCSBFlags); envFlags != "" {
8285
args += " " + envFlags
8386
}
@@ -107,7 +110,7 @@ func registerYCSB(r registry.Registry) {
107110
Benchmark: true,
108111
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus)),
109112
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
110-
runYCSB(ctx, t, c, wl, cpus, false /* rangeTombstone */)
113+
runYCSB(ctx, t, c, wl, cpus, false /* readCommitted */, false /* rangeTombstone */)
111114
},
112115
Tags: registry.Tags(`aws`),
113116
})
@@ -119,19 +122,32 @@ func registerYCSB(r registry.Registry) {
119122
Benchmark: true,
120123
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus), spec.SetFileSystem(spec.Zfs)),
121124
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
122-
runYCSB(ctx, t, c, wl, cpus, false /* rangeTombstone */)
125+
runYCSB(ctx, t, c, wl, cpus, false /* readCommitted */, false /* rangeTombstone */)
123126
},
124127
})
125128
}
126129

130+
if cpus == cpusWithReadCommitted {
131+
r.Add(registry.TestSpec{
132+
Name: fmt.Sprintf("%s/isolation-level=read-committed", name),
133+
Owner: registry.OwnerTestEng,
134+
Benchmark: true,
135+
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus)),
136+
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
137+
runYCSB(ctx, t, c, wl, cpus, true /* readCommitted */, false /* rangeTombstone */)
138+
},
139+
Tags: registry.Tags(`aws`),
140+
})
141+
}
142+
127143
if cpus == cpusWithGlobalMVCCRangeTombstone {
128144
r.Add(registry.TestSpec{
129145
Name: fmt.Sprintf("%s/mvcc-range-keys=global", name),
130146
Owner: registry.OwnerTestEng,
131147
Benchmark: true,
132148
Cluster: r.MakeClusterSpec(4, spec.CPU(cpus)),
133149
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
134-
runYCSB(ctx, t, c, wl, cpus, true /* rangeTombstone */)
150+
runYCSB(ctx, t, c, wl, cpus, false /* readCommitted */, true /* rangeTombstone */)
135151
},
136152
Tags: registry.Tags(`aws`),
137153
})

pkg/sql/conn_executor_exec.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ func (ex *connExecutor) execStmtInOpenState(
627627
if !isPausablePortal() || portal.pauseInfo.execStmtInOpenState.ihWrapper == nil {
628628
ctx, needFinish = ih.Setup(
629629
ctx, ex.server.cfg, ex.statsCollector, p, ex.stmtDiagnosticsRecorder,
630-
stmt.StmtNoConstants, os.ImplicitTxn.Get(), ex.extraTxnState.shouldCollectTxnExecutionStats,
630+
stmt.StmtNoConstants, os.ImplicitTxn.Get(), ex.state.priority,
631+
ex.extraTxnState.shouldCollectTxnExecutionStats,
631632
)
632633
} else {
633634
ctx = portal.pauseInfo.execStmtInOpenState.ihWrapper.ctx
@@ -2926,7 +2927,11 @@ func (ex *connExecutor) recordTransactionFinish(
29262927
RowsWritten: ex.extraTxnState.rowsWritten,
29272928
BytesRead: ex.extraTxnState.bytesRead,
29282929
Priority: ex.state.priority,
2929-
SessionData: ex.sessionData(),
2930+
// TODO(107318): add isolation level
2931+
// TODO(107318): add qos
2932+
// TODO(107318): add asoftime or ishistorical
2933+
// TODO(107318): add readonly
2934+
SessionData: ex.sessionData(),
29302935
}
29312936

29322937
if ex.server.cfg.TestingKnobs.OnRecordTxnFinish != nil {

pkg/sql/exec_util.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3612,6 +3612,10 @@ func (m *sessionDataMutator) SetOptimizerUseImprovedJoinElimination(val bool) {
36123612
m.data.OptimizerUseImprovedJoinElimination = val
36133613
}
36143614

3615+
func (m *sessionDataMutator) SetImplicitFKLockingForSerializable(val bool) {
3616+
m.data.ImplicitFKLockingForSerializable = val
3617+
}
3618+
36153619
// Utility functions related to scrubbing sensitive information on SQL Stats.
36163620

36173621
// quantizeCounts ensures that the Count field in the

pkg/sql/insert_fast_path.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"sync"
1616

1717
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
18+
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock"
1819
"github.com/cockroachdb/cockroach/pkg/roachpb"
1920
"github.com/cockroachdb/cockroach/pkg/sql/catalog"
2021
"github.com/cockroachdb/cockroach/pkg/sql/catalog/colinfo"
@@ -188,10 +189,20 @@ func (r *insertFastPathRun) addFKChecks(
188189
if r.traceKV {
189190
log.VEventf(ctx, 2, "FKScan %s", span)
190191
}
192+
lockStrength := row.GetKeyLockingStrength(descpb.ToScanLockingStrength(c.Locking.Strength))
193+
lockWaitPolicy := row.GetWaitPolicy(descpb.ToScanLockingWaitPolicy(c.Locking.WaitPolicy))
194+
if r.fkBatch.Header.WaitPolicy != lockWaitPolicy {
195+
return errors.AssertionFailedf(
196+
"FK check lock wait policy %s did not match %s",
197+
lockWaitPolicy, r.fkBatch.Header.WaitPolicy,
198+
)
199+
}
191200
reqIdx := len(r.fkBatch.Requests)
192201
r.fkBatch.Requests = append(r.fkBatch.Requests, kvpb.RequestUnion{})
193202
r.fkBatch.Requests[reqIdx].MustSetInner(&kvpb.ScanRequest{
194203
RequestHeader: kvpb.RequestHeaderFromSpan(span),
204+
KeyLocking: lockStrength,
205+
// TODO(michae2): Once #100193 is finished, also include c.Locking.Durability.
195206
})
196207
r.fkSpanInfo = append(r.fkSpanInfo, insertFastPathFKSpanInfo{
197208
check: c,
@@ -248,6 +259,8 @@ func (n *insertFastPathNode) startExec(params runParams) error {
248259
}
249260
}
250261
maxSpans := len(n.run.fkChecks) * len(n.input)
262+
// Any FK checks using locking should have lock wait policy BLOCK.
263+
n.run.fkBatch.Header.WaitPolicy = lock.WaitPolicy_Block
251264
n.run.fkBatch.Requests = make([]kvpb.RequestUnion, 0, maxSpans)
252265
n.run.fkSpanInfo = make([]insertFastPathFKSpanInfo, 0, maxSpans)
253266
if len(n.input) > 1 {

pkg/sql/instrumentation.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import (
1818
"time"
1919

2020
"github.com/cockroachdb/cockroach/pkg/keys"
21+
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/isolation"
2122
"github.com/cockroachdb/cockroach/pkg/multitenant"
23+
"github.com/cockroachdb/cockroach/pkg/roachpb"
2224
"github.com/cockroachdb/cockroach/pkg/server/telemetry"
2325
"github.com/cockroachdb/cockroach/pkg/settings"
2426
"github.com/cockroachdb/cockroach/pkg/sql/appstatspb"
@@ -35,6 +37,7 @@ import (
3537
"github.com/cockroachdb/cockroach/pkg/sql/physicalplan"
3638
"github.com/cockroachdb/cockroach/pkg/sql/sem/eval"
3739
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
40+
"github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb"
3841
"github.com/cockroachdb/cockroach/pkg/sql/sessionphase"
3942
"github.com/cockroachdb/cockroach/pkg/sql/sqlstats"
4043
"github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry"
@@ -83,8 +86,12 @@ type instrumentationHelper struct {
8386

8487
// Query fingerprint (anonymized statement).
8588
fingerprint string
89+
90+
// Transaction information.
8691
implicitTxn bool
87-
codec keys.SQLCodec
92+
txnPriority roachpb.UserPriority
93+
94+
codec keys.SQLCodec
8895

8996
// -- The following fields are initialized by Setup() --
9097

@@ -254,10 +261,12 @@ func (ih *instrumentationHelper) Setup(
254261
stmtDiagnosticsRecorder *stmtdiagnostics.Registry,
255262
fingerprint string,
256263
implicitTxn bool,
264+
txnPriority roachpb.UserPriority,
257265
collectTxnExecStats bool,
258266
) (newCtx context.Context, needFinish bool) {
259267
ih.fingerprint = fingerprint
260268
ih.implicitTxn = implicitTxn
269+
ih.txnPriority = txnPriority
261270
ih.codec = cfg.Codec
262271
ih.origCtx = ctx
263272
ih.evalCtx = p.EvalContext()
@@ -590,6 +599,14 @@ func (ih *instrumentationHelper) emitExplainAnalyzePlanToOutputBuilder(
590599
}
591600
}
592601

602+
qos := sessiondatapb.Normal
603+
iso := isolation.Serializable
604+
if ih.evalCtx != nil {
605+
qos = ih.evalCtx.QualityOfService()
606+
iso = ih.evalCtx.TxnIsoLevel
607+
}
608+
ob.AddTxnInfo(iso, ih.txnPriority, qos)
609+
593610
if err := emitExplain(ob, ih.evalCtx, ih.codec, ih.explainPlan); err != nil {
594611
ob.AddTopLevelField("error emitting plan", fmt.Sprint(err))
595612
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# LogicTest: !local-mixed-22.2-23.1
2+
3+
# Some foreign key checks are prohibited under weaker isolation levels until we
4+
# improve locking. See #80683, #100156, #100193.
5+
6+
statement ok
7+
CREATE TABLE jars (j INT PRIMARY KEY)
8+
9+
statement ok
10+
CREATE TABLE cookies (c INT PRIMARY KEY, j INT REFERENCES jars (j))
11+
12+
statement ok
13+
SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED
14+
15+
statement ok
16+
INSERT INTO jars VALUES (1), (2)
17+
18+
# Foreign key checks of the parent require durable shared locking under weaker
19+
# isolation levels, and are not yet supported.
20+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
21+
INSERT INTO cookies VALUES (1, 1)
22+
23+
statement ok
24+
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE
25+
26+
statement ok
27+
INSERT INTO cookies VALUES (1, 1)
28+
29+
statement ok
30+
COMMIT
31+
32+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
33+
UPDATE cookies SET j = 2 WHERE c = 1
34+
35+
# Foreign key checks of the child do not require locking.
36+
query error violates foreign key constraint
37+
UPDATE jars SET j = j + 4
38+
39+
query error violates foreign key constraint
40+
DELETE FROM jars WHERE j = 1
41+
42+
statement ok
43+
DELETE FROM cookies WHERE c = 1
44+
45+
statement ok
46+
DELETE FROM jars WHERE j = 1

pkg/sql/logictest/testdata/logic_test/information_schema

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5289,6 +5289,7 @@ enable_auto_rehoming off
52895289
enable_create_stats_using_extremes off
52905290
enable_drop_enum_value on
52915291
enable_experimental_alter_column_type_general off
5292+
enable_implicit_fk_locking_for_serializable off
52925293
enable_implicit_select_for_update on
52935294
enable_implicit_transaction_for_batch_statements on
52945295
enable_insert_fast_path on

pkg/sql/logictest/testdata/logic_test/pg_catalog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,6 +2727,7 @@ distsql off N
27272727
enable_auto_rehoming off NULL NULL NULL string
27282728
enable_create_stats_using_extremes off NULL NULL NULL string
27292729
enable_experimental_alter_column_type_general off NULL NULL NULL string
2730+
enable_implicit_fk_locking_for_serializable off NULL NULL NULL string
27302731
enable_implicit_select_for_update on NULL NULL NULL string
27312732
enable_implicit_transaction_for_batch_statements on NULL NULL NULL string
27322733
enable_insert_fast_path on NULL NULL NULL string
@@ -2887,6 +2888,7 @@ distsql off N
28872888
enable_auto_rehoming off NULL user NULL off off
28882889
enable_create_stats_using_extremes off NULL user NULL off off
28892890
enable_experimental_alter_column_type_general off NULL user NULL off off
2891+
enable_implicit_fk_locking_for_serializable off NULL user NULL off off
28902892
enable_implicit_select_for_update on NULL user NULL on on
28912893
enable_implicit_transaction_for_batch_statements on NULL user NULL on on
28922894
enable_insert_fast_path on NULL user NULL on on
@@ -3044,6 +3046,7 @@ distsql_workmem NULL NULL NULL
30443046
enable_auto_rehoming NULL NULL NULL NULL NULL
30453047
enable_create_stats_using_extremes NULL NULL NULL NULL NULL
30463048
enable_experimental_alter_column_type_general NULL NULL NULL NULL NULL
3049+
enable_implicit_fk_locking_for_serializable NULL NULL NULL NULL NULL
30473050
enable_implicit_select_for_update NULL NULL NULL NULL NULL
30483051
enable_implicit_transaction_for_batch_statements NULL NULL NULL NULL NULL
30493052
enable_insert_fast_path NULL NULL NULL NULL NULL

pkg/sql/logictest/testdata/logic_test/read_committed

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
subtest select_for_update
44

55
# SELECT FOR UPDATE is prohibited under weaker isolation levels until we improve
6-
# locking. See #57031, #75457, #100144.
6+
# locking. See #57031, #75457, #100144, #100193.
77

88
statement ok
99
CREATE TABLE supermarket (
@@ -38,7 +38,7 @@ COMMIT
3838
statement ok
3939
BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED
4040

41-
query error pgcode 0A000 cannot execute SELECT FOR UPDATE statements under ReadCommitted isolation
41+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
4242
SELECT aisle FROM supermarket WHERE person = 'matilda' FOR UPDATE
4343

4444
statement ok
@@ -51,7 +51,7 @@ SET CLUSTER SETTING sql.txn.snapshot_isolation.enabled = true
5151
statement ok
5252
BEGIN TRANSACTION ISOLATION LEVEL SNAPSHOT
5353

54-
query error pgcode 0A000 cannot execute SELECT FOR UPDATE statements under Snapshot isolation
54+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
5555
SELECT aisle FROM supermarket WHERE person = 'matilda' FOR UPDATE
5656

5757
statement ok
@@ -67,7 +67,7 @@ BEGIN TRANSACTION
6767
statement ok
6868
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
6969

70-
query error pgcode 0A000 cannot execute SELECT FOR UPDATE statements under ReadCommitted isolation
70+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
7171
UPDATE supermarket
7272
SET aisle = (SELECT aisle FROM supermarket WHERE person = 'matilda' FOR UPDATE)
7373
WHERE person = 'michael'
@@ -82,7 +82,7 @@ BEGIN TRANSACTION
8282
statement ok
8383
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
8484

85-
query error pgcode 0A000 cannot execute SELECT FOR UPDATE statements under ReadCommitted isolation
85+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
8686
WITH s AS
8787
(SELECT aisle FROM supermarket WHERE person = 'matilda' FOR UPDATE)
8888
SELECT aisle + 1 FROM s
@@ -99,7 +99,7 @@ statement ok
9999
SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED
100100

101101
# But calling that function should fail.
102-
query error pgcode 0A000 cannot execute SELECT FOR UPDATE statements under ReadCommitted isolation
102+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
103103
INSERT INTO supermarket (person, aisle) VALUES ('grandma', wrangle('matilda'))
104104

105105
statement ok
@@ -116,14 +116,14 @@ statement ok
116116
PREPARE psa AS SELECT aisle FROM supermarket WHERE person = $1::STRING FOR UPDATE
117117

118118
# But execution should fail.
119-
query error pgcode 0A000 cannot execute SELECT FOR UPDATE statements under ReadCommitted isolation
119+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
120120
EXECUTE psa('matilda')
121121

122122
statement ok
123123
DEALLOCATE psa
124124

125125
# SELECT FOR UPDATE using a lookup join should also fail.
126-
query error pgcode 0A000 cannot execute SELECT FOR UPDATE statements under ReadCommitted isolation
126+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
127127
WITH names AS MATERIALIZED
128128
(SELECT 'matilda' AS person)
129129
SELECT aisle
@@ -132,14 +132,14 @@ SELECT aisle
132132
FOR UPDATE
133133

134134
# SELECT FOR UPDATE using an index join should also fail.
135-
query error pgcode 0A000 cannot execute SELECT FOR UPDATE statements under ReadCommitted isolation
135+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
136136
SELECT aisle
137137
FROM supermarket@supermarket_starts_with_idx
138138
WHERE starts_with = 'm'
139139
FOR UPDATE
140140

141141
# SELECT FOR UPDATE using a zigzag join should also fail.
142-
query error pgcode 0A000 cannot execute SELECT FOR UPDATE statements under ReadCommitted isolation
142+
query error pgcode 0A000 guaranteed-durable locking not yet implemented
143143
SELECT aisle
144144
FROM supermarket@{FORCE_ZIGZAG}
145145
WHERE starts_with = 'm' AND ends_with = 'lda'

0 commit comments

Comments
 (0)