Skip to content

Commit

Permalink
Merge #39501
Browse files Browse the repository at this point in the history
39501: sql: fix VALIDATE CONSTRAINT fk logic test r=lucy-zhang a=lucy-zhang

Previously, we weren't properly making unvalidated constraints in the `fk`
logic tests, so `VALIDATE CONSTRAINT` was a no-op.

Release note: None

Co-authored-by: Lucy Zhang <lucy-zhang@users.noreply.github.com>
  • Loading branch information
craig[bot] and lucy-zhang committed Aug 12, 2019
2 parents ddc7c97 + fc73905 commit b44713c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/fk
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ CREATE TABLE b (

# Add the constraint separately so that it's unvalidated, so we can test VALIDATE CONSTRAINT.
statement ok
ALTER TABLE b ADD CONSTRAINT fk_ref FOREIGN KEY (a_y, a_x) REFERENCES a (y, x)
ALTER TABLE b ADD CONSTRAINT fk_ref FOREIGN KEY (a_y, a_x) REFERENCES a (y, x) NOT VALID

statement ok
INSERT INTO a (x, y) VALUES ('x1', 'y1')
Expand Down Expand Up @@ -1813,7 +1813,7 @@ CREATE TABLE b (

# Add the constraint separately so that it's unvalidated, so we can test VALIDATE CONSTRAINT.
statement ok
ALTER TABLE b ADD CONSTRAINT fk_ref FOREIGN KEY (a_z, a_y, a_x) REFERENCES a (z, y, x)
ALTER TABLE b ADD CONSTRAINT fk_ref FOREIGN KEY (a_z, a_y, a_x) REFERENCES a (z, y, x) NOT VALID

statement ok
INSERT INTO a (x, y, z) VALUES ('x1', 'y1', 'z1')
Expand Down

0 comments on commit b44713c

Please sign in to comment.