Skip to content

Commit

Permalink
Merge #78297
Browse files Browse the repository at this point in the history
78297: sql: adds unique constraint checks to SCRUB r=rharding6373 a=rharding6373

The SCRUB tool validates table constraints. Before this change, it could
only validate `CHECK` and foreign key constraints. This PR enhances
SCRUB to also validate tables that contain `PRIMARY KEY`, `UNIQUE`, or
the experimental `UNIQUE WITHOUT INDEX` keywords.

Fixes: #73632

Release note (sql change): This PR expands the capabilities of the experimental
SCRUB tool to include checking unique constraints for primary keys,
unique indexes, and unique columns without indexes. The usage and output
of SCRUB is unchanged, but if there is a unique constraint violation,
users will see the error message `unique_constraint_violation` for all
rows that violate the constraint, along with information about the row.



Co-authored-by: rharding6373 <[email protected]>
  • Loading branch information
craig[bot] and rharding6373 committed May 25, 2022
2 parents 7320115 + a6567e3 commit c86696e
Show file tree
Hide file tree
Showing 9 changed files with 965 additions and 115 deletions.
4 changes: 4 additions & 0 deletions pkg/ccl/partitionccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ go_test(
"drop_test.go",
"main_test.go",
"partition_test.go",
"scrub_test.go",
"zone_test.go",
],
embed = [":partitionccl"],
Expand Down Expand Up @@ -73,6 +74,9 @@ go_test(
"//pkg/sql/lexbase",
"//pkg/sql/parser",
"//pkg/sql/randgen",
"//pkg/sql/rowenc",
"//pkg/sql/scrub",
"//pkg/sql/scrub/scrubtestutils",
"//pkg/sql/sem/eval",
"//pkg/sql/sem/tree",
"//pkg/sql/tests",
Expand Down
Loading

0 comments on commit c86696e

Please sign in to comment.