-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
opgen: added a bool field in struct opgen.transition #90719
Conversation
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.
LGTM though based on our conversation today this might not be needed after all. Your call.
return tstn.from | ||
} | ||
// All transitions results from `equiv(xxx)` specs. Return `to` of the last transition. | ||
return t.transitions[len(t.transitions)-1].to |
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.
Wouldn't return target
be the same thing here, but simpler?
This PR adds a bool field in struct opgen.transition that indicates whether it results from a `equiv(xx)` transition spec in the opgen file. It will be useful for a test where we need to find the inital status on a adding/dropping path. Without such a change, it can be problematic if we have a `equiv(xx)` spec as the first transition. E.g. ToAbsent( PUBLIC, equiv(VALIDATED), to(WRITE_ONLY), to(ABSENT), ) Without this change, the inital status will confusingly be `VALIDATED`, and the next status will be `PUBLIC`. With this change, the initial status will be `PUBLIC`, and the next status will be `WRITE_ONLY`. We also added some comments when we make transitions from the specs. Release note: None
db2d219
to
bd0bfda
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.
I think it's generally good so I'm going to merge it.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @postamar)
pkg/sql/schemachanger/scplan/internal/opgen/op_gen.go
line 154 at r1 (raw file):
Previously, postamar (Marius Posta) wrote…
Wouldn't
return target
be the same thing here, but simpler?
That's correct! Will change it.
TFTR! bors r+ |
Build succeeded: |
This PR adds a bool field in struct opgen.transition that indicates whether it results from a
equiv(xx)
transition spec in the opgen file. It will be useful for a test where we need to find the inital status on a adding/dropping path. Without such a change, it can be problematic if we have aequiv(xx)
spec as the first transition. E.g.Without this change, the inital status will confusingly be
VALIDATED
, and the next status will bePUBLIC
.With this change, the initial status will be
PUBLIC
, and the next status will beWRITE_ONLY
.We also added some comments when we make transitions from the specs.
Epic: None
Release note: None