New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: disallow explicit unique checks under read committed isolation #110879
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
, andUPSERT
statements against someREGIONAL BY ROW
tables will fail under Read Committed isolation with the following error:For more details about which
REGIONAL BY ROW
tables are affected, please see: https://go.crdb.dev/issue-v/110873/v23.2