Skip to content

sql: allow PRIMARY REGION syntax for CREATE / ALTER DATABASE#56883

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
otan-cockroach:create_primary_region
Nov 20, 2020
Merged

sql: allow PRIMARY REGION syntax for CREATE / ALTER DATABASE#56883
craig[bot] merged 1 commit intocockroachdb:masterfrom
otan-cockroach:create_primary_region

Conversation

@otan
Copy link
Copy Markdown
Contributor

@otan otan commented Nov 19, 2020

Release note (sql change): Introduced stubs for ALTER DATABASE ...
PRIMARY REGION and CREATE TABLE ... PRIMARY REGION

@otan otan requested review from a team and ajstorm November 19, 2020 03:47
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@otan otan force-pushed the create_primary_region branch from fde5db9 to c3b3b8d Compare November 19, 2020 03:48
Copy link
Copy Markdown
Collaborator

@ajstorm ajstorm left a comment

Choose a reason for hiding this comment

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

Reviewed 11 of 11 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @otan)


pkg/sql/parser/parse_test.go, line 77 at r1 (raw file):

		{`CREATE DATABASE a SURVIVE REGION FAILURE`},
		{`CREATE DATABASE a SURVIVE ZONE FAILURE`},
		{`CREATE DATABASE a PRIMARY REGION = "us-west-1"`},

Nit - Stupid question, but why is the "=" semantics the one that we parse to by default?


pkg/sql/sem/tree/create.go, line 80 at r1 (raw file):

	}
	if node.PrimaryRegion != "" {
		ctx.WriteString(" PRIMARY REGION = ")

Nit: Same question about "=" here. I'd think we'd default to no "="

Copy link
Copy Markdown
Contributor Author

@otan otan left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajstorm)


pkg/sql/parser/parse_test.go, line 77 at r1 (raw file):

Previously, ajstorm wrote…

Nit - Stupid question, but why is the "=" semantics the one that we parse to by default?

fixed!

Copy link
Copy Markdown
Collaborator

@ajstorm ajstorm left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajstorm)

@ajstorm ajstorm self-requested a review November 19, 2020 20:51
Release note (sql change): Introduced stubs for ALTER DATABASE ...
PRIMARY REGION and CREATE TABLE ... PRIMARY REGION
@otan otan force-pushed the create_primary_region branch from c3b3b8d to be7dc05 Compare November 20, 2020 00:12
@otan
Copy link
Copy Markdown
Contributor Author

otan commented Nov 20, 2020

thanks!

bors r=ajstorm

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 20, 2020

Build succeeded:

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.

3 participants