Skip to content
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: add version field to PrivilegeDescriptor #52701

Merged

Conversation

RichardJCai
Copy link
Contributor

@RichardJCai RichardJCai commented Aug 12, 2020

Add version field to PrivilegeDescriptor to allow for
validating the owner field.

PrivilegeDescriptors pre 20.1 will have InitialVersion by default
and validation will not be performed for the owner field.

PrivilegeDescriptors 20.2 and onward will have OwnerVersion
and validation will be performed on the owner field.

Release note: None

Fixes #51930

@RichardJCai RichardJCai requested a review from a team August 12, 2020 17:03
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@rohany rohany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to audit all places that the privilege descriptor is created

pkg/sql/catalog/descpb/privilege.proto Outdated Show resolved Hide resolved
@RichardJCai RichardJCai force-pushed the add_version_to_privilege_descriptor branch from 6b08b06 to df336d3 Compare August 12, 2020 17:10
@RichardJCai
Copy link
Contributor Author

Make sure to audit all places that the privilege descriptor is created

Yep, almost missed one in newCommentPrivilegeDescriptor

Add version field to PrivilegeDescriptor to allow for
validating the owner field.

PrivilegeDescriptors pre 20.1 will have InitialVersion by default
and validation will not be performed for the owner field.

PrivilegeDescriptors 20.2 and onward will have OwnerVersion
and validation will be performed on the owner field.

Release note: None
@RichardJCai RichardJCai force-pushed the add_version_to_privilege_descriptor branch from df336d3 to 610a468 Compare August 12, 2020 18:36
@RichardJCai
Copy link
Contributor Author

bors r=rohany

@craig
Copy link
Contributor

craig bot commented Aug 12, 2020

Build succeeded:

@craig craig bot merged commit fad5ca5 into cockroachdb:master Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: add FormatVersion field to PrivilegeDescriptor
3 participants