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: validate computed columns during ALTER TABLE #36518

Merged
merged 1 commit into from
Apr 5, 2019
Merged

sql: validate computed columns during ALTER TABLE #36518

merged 1 commit into from
Apr 5, 2019

Conversation

maddyblue
Copy link
Contributor

Previously these were only validated during CREATE, allowing the creation
of incorrect columns. validateComputedColumn has removed its dependency
on the tree.CreateTable struct so that the alter code can use it. Because
of this, all FKs must be computed prior to the computed validate checks.

Fixes #36036

Release note (bug fix): Correctly validate computed columns during ALTER
TABLE ADD COLUMN.

@maddyblue maddyblue requested review from thoszhang, vivekmenezes and a team April 4, 2019 07:55
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@vivekmenezes
Copy link
Contributor

Thanks for fixing this. I see some tests failing with your change.

Previously these were only validated during CREATE, allowing the creation
of incorrect columns. validateComputedColumn has removed its dependency
on the tree.CreateTable struct so that the alter code can use it. Because
of this, all FKs must be computed prior to the computed validate checks.

Fixes #36036

Release note (bug fix): Correctly validate computed columns during ALTER
TABLE ADD COLUMN.
@maddyblue
Copy link
Contributor Author

Fixed. We had a test that had enshrined the unsupported feature of computed columns depending on other computed columns.

@maddyblue
Copy link
Contributor Author

ping @vivekmenezes. I'd like to get this into 19.1.

@vivekmenezes
Copy link
Contributor

bors r+

craig bot pushed a commit that referenced this pull request Apr 5, 2019
36518: sql: validate computed columns during ALTER TABLE r=vivekmenezes a=mjibson

Previously these were only validated during CREATE, allowing the creation
of incorrect columns. validateComputedColumn has removed its dependency
on the tree.CreateTable struct so that the alter code can use it. Because
of this, all FKs must be computed prior to the computed validate checks.

Fixes #36036

Release note (bug fix): Correctly validate computed columns during ALTER
TABLE ADD COLUMN.

Co-authored-by: Matt Jibson <matt.jibson@gmail.com>
@craig
Copy link
Contributor

craig bot commented Apr 5, 2019

Build succeeded

@craig craig bot merged commit 8162df4 into cockroachdb:master Apr 5, 2019
@maddyblue maddyblue deleted the alter-comp branch April 5, 2019 17:26
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: panic: ReturnType called on TypedExpr with empty typeAnnotation
3 participants