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

schemachanger: support CREATE SCHEMA ... AUTHORIZATION #118995

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

annrpom
Copy link
Contributor

@annrpom annrpom commented Feb 8, 2024

This patch enables support for CREATE SCHEMA ... AUTHORIZATION in the declarative schema changer

Fixes: #115369
Epic: CRDB-31331

Release note: None

Copy link

blathers-crl bot commented Feb 8, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@annrpom
Copy link
Contributor Author

annrpom commented Feb 21, 2024

Is there a reason as to why CREATE SCHEMA isn't enabled? It's version gated by 23.2

@annrpom
Copy link
Contributor Author

annrpom commented Feb 22, 2024

^ from the above comment:

reflect.TypeOf((*tree.CreateSchema)(nil)): {fn: CreateSchema, statementTags: []string{tree.CreateSchemaTag}, on: false, checks: isV232Active},

@annrpom
Copy link
Contributor Author

annrpom commented Mar 4, 2024

Apologies for the hoarding on this one - prioritized on-call duties, but finally got to testing last week to make sure I'm not missing anything obvious. RFAL

@annrpom annrpom marked this pull request as ready for review March 4, 2024 16:19
@annrpom annrpom requested review from a team as code owners March 4, 2024 16:19
@annrpom annrpom requested review from herkolategan and srosenberg and removed request for a team March 4, 2024 16:19
Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @annrpom, @herkolategan, and @srosenberg)


pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_schema.go line 74 at r1 (raw file):

	owner := b.CurrentUser()
	if !n.AuthRole.Undefined() {
		authRole, err := decodeusername.FromRoleSpec(

It would be nice to get an end to end test to cover this.

@annrpom
Copy link
Contributor Author

annrpom commented Mar 4, 2024

Is there a reason as to why CREATE SCHEMA isn't enabled? It's version gated by 23.2

As discussed in our team weekly, we have an issue out to do exactly this (enable CREATE SCHEMA). I'll leave out commit 2 since it relies on said issue

This patch enables support for `CREATE SCHEMA ... AUTHORIZATION`
in the declarative schemachanger

Fixes: cockroachdb#115369
Epic: CRDB-31331

Release note: None
@annrpom annrpom requested a review from fqazi March 5, 2024 16:26
@annrpom
Copy link
Contributor Author

annrpom commented Mar 5, 2024

It would be nice to get an end to end test to cover this.

Done!

Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 7 of 7 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @annrpom, @herkolategan, and @srosenberg)

@annrpom
Copy link
Contributor Author

annrpom commented Mar 6, 2024

TFTR! ('-')7

bors r=fqazi

@craig
Copy link
Contributor

craig bot commented Mar 6, 2024

Build succeeded:

@craig craig bot merged commit 82eb30e into cockroachdb:master Mar 6, 2024
25 of 28 checks passed
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: support CREATE SCHEMA AUTHORIZATION ... in declarative schema changer
3 participants