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: fix DDL after write error message #58182

Merged

Conversation

jayshrivastava
Copy link
Contributor

Previously, the error message said "schema change statement
cannot follow a statement that has written in the same
transaction". This message is incorrect because DDLs after
writes are allowed if the first schema change in a txn occurs
before the first write. This change updates the error message
to reflect the latter.

Release note: None

@jayshrivastava jayshrivastava requested a review from a team as a code owner December 22, 2020 15:53
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@thoszhang thoszhang 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 @jayshrivastava and @lucy-zhang)


pkg/sql/opt/exec/execbuilder/relational.go, line 161 at r1 (raw file):

					"if the first write statement occurs before the first schema change statement in a transaction, "+
						"then no schema change statements may follow the write statement"),

What do you think of the first schema change statement in a transaction must precede all writes?

Copy link
Contributor

@thoszhang thoszhang 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 @jayshrivastava)


pkg/sql/opt/exec/execbuilder/relational.go, line 161 at r1 (raw file):

Previously, lucy-zhang (Lucy Zhang) wrote…
					"if the first write statement occurs before the first schema change statement in a transaction, "+
						"then no schema change statements may follow the write statement"),

What do you think of the first schema change statement in a transaction must precede all writes?

Or any writes

Previously, the error message said "schema change statement
cannot follow a statement that has written in the same
transaction". This message is incorrect because DDLs after
writes are allowed if the first schema change in a txn occurs
before the first write. This change updates the error message
to reflect the latter.

Release note: None
@jayshrivastava jayshrivastava force-pushed the fix-ddl-after-write-message branch from 36662fd to da4b129 Compare December 23, 2020 17:57
Copy link
Contributor Author

@jayshrivastava jayshrivastava 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 @lucy-zhang)


pkg/sql/opt/exec/execbuilder/relational.go, line 161 at r1 (raw file):

Previously, lucy-zhang (Lucy Zhang) wrote…

Or any writes

Makes sense

Copy link
Contributor

@thoszhang thoszhang left a comment

Choose a reason for hiding this comment

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

Thanks!

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@jayshrivastava
Copy link
Contributor Author

bors r=lucy-zhang

@craig
Copy link
Contributor

craig bot commented Dec 23, 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