sql: disallow explicit unique checks under read committed isolation#110879
sql: disallow explicit unique checks under read committed isolation#110879craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
|
|
||
| statement ok | ||
| INSERT INTO city VALUES ('Vancouver', 'The Big Smoke', 'BC'), ('Salem', 'Cherry City', 'OR') | ||
| ON CONFLICT (name, state_or_province) DO NOTHING |
There was a problem hiding this comment.
This INSERT ON CONFLICT DO NOTHING case is broken (and I suspect the corresponding UPSERT and INSERT ON CONFLICT DO UPDATE cases are also broken). Hold off on reviewing while I try to fix those.
There was a problem hiding this comment.
Ok, this is fixed now (by using uniqueCheckHelper.init).
5b6e349 to
11ee263
Compare
Because we do not yet support predicate locking, add a check to execbuilder that disallows any query using it (currently only unique checks under read committed isolation). Informs: cockroachdb#110873 Release note (sql): We do not yet support explicit unique checks under Read Committed isolation. This means that some `INSERT`, `UPDATE`, and `UPSERT` statements against some `REGIONAL BY ROW` tables will fail under Read Committed isolation with the following error: ``` unimplemented: explicit unique checks are not yet supported under read committed isolation SQLSTATE: 0A000 ``` For more details about which `REGIONAL BY ROW` tables are affected, please see: https://go.crdb.dev/issue-v/110873/v23.2
11ee263 to
d0c46fe
Compare
mgartner
left a comment
There was a problem hiding this comment.
Reviewed 2 of 11 files at r1, 12 of 12 files at r2, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @michae2, @msirek, and @nvanbenschoten)
pkg/sql/logictest/testdata/logic_test/hash_sharded_index_read_committed line 21 at r2 (raw file):
statement ok CREATE UNIQUE INDEX ON sharded_unique (a) USING HASH
nit: You should be able to include this in the CREATE TABLE statement above.
DrewKimball
left a comment
There was a problem hiding this comment.
Reviewed 2 of 11 files at r1, 12 of 12 files at r2, all commit messages.
Reviewable status:complete! 2 of 0 LGTMs obtained (waiting on @michae2, @msirek, and @nvanbenschoten)
|
Thank you! bors r=mgartner,DrewKimball |
|
Build succeeded: |
(This is a follow-on PR after #107961.)
Because we do not yet support predicate locking, add a check to execbuilder that disallows any query using it (currently only unique checks under read committed isolation).
Informs: #110873
Release note (sql): We do not yet support explicit unique checks under Read Committed isolation. This means that some
INSERT,UPDATE, andUPSERTstatements against someREGIONAL BY ROWtables will fail under Read Committed isolation with the following error:For more details about which
REGIONAL BY ROWtables are affected, please see: https://go.crdb.dev/issue-v/110873/v23.2