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: prevent UPDATE from crashing if subquery returns no rows #34804

Merged
merged 1 commit into from
Feb 12, 2019

Conversation

knz
Copy link
Contributor

@knz knz commented Feb 11, 2019

Fixes #32054.

Note: only the heuristic planner was affected. The CBO was handling
this case fine already.

Release note (bug fix): When using UPDATE SET (a,b) = (...subquery...), CockroachDb will not crash any more if the
subquery returns no rows.

Note: only the heuristic planner was affected. The CBO was handling
this case fine already.

Release note (bug fix): When using `UPDATE SET (a,b)
= (...subquery...)`, CockroachDb will not crash any more if the
subquery returns no rows.
@knz knz requested review from BramGruneir and a team February 11, 2019 22:48
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@BramGruneir
Copy link
Member

BramGruneir commented Feb 11, 2019 via email

@knz
Copy link
Contributor Author

knz commented Feb 11, 2019

Can you re-read the change - I think the tuple is allocated just once during planning.

@BramGruneir
Copy link
Member

BramGruneir commented Feb 11, 2019 via email

@knz
Copy link
Contributor Author

knz commented Feb 12, 2019

TFYR!

bors r+

craig bot pushed a commit that referenced this pull request Feb 12, 2019
34804: sql: prevent UPDATE from crashing if subquery returns no rows r=knz a=knz

Fixes #32054.

Note: only the heuristic planner was affected. The CBO was handling
this case fine already.

Release note (bug fix): When using `UPDATE SET (a,b)
= (...subquery...)`, CockroachDb will not crash any more if the
subquery returns no rows.

Co-authored-by: Raphael 'kena' Poss <[email protected]>
@craig
Copy link
Contributor

craig bot commented Feb 12, 2019

Build succeeded

@craig craig bot merged commit 28beb94 into cockroachdb:master Feb 12, 2019
@knz knz deleted the 20190211-update-empty-sq branch February 14, 2019 13:00
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 in UPDATE with subquery (v2.0.6)
3 participants