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: catch invalid functions in the UPDATE SET RHS #32505

Merged
merged 1 commit into from Nov 20, 2018

Conversation

Projects
None yet
3 participants
@knz
Copy link
Member

knz commented Nov 20, 2018

Fixes #32477.
This is a leftover case from #26425.

Prior to this patch, an invalid scalar function in the RHS of UPDATE
... SET would not be rejected during planning and cause a crash during
execution.

This patch fixes this by ensuring the bad construct is rejected during
planning.

Release note (bug fix): CockroachDB now properly rejects queries
that use an invalid function in UPDATE SET (e.g., an aggregation).

sql: catch invalid functions in the UPDATE SET RHS
Prior to this patch, an invalid scalar function in the RHS of UPDATE
... SET would not be rejected during planning and cause a crash during
execution.

This patch fixes this by ensuring the bad construct is rejected during
planning.

Release note (bug fix): CockroachDB now properly rejects queries
that use an invalid function in UPDATE SET (e.g., an aggregation).

@knz knz requested review from bobvawter and BramGruneir Nov 20, 2018

@knz knz added this to Triage in SQL Front-end, Lang & Semantics via automation Nov 20, 2018

@knz knz requested review from cockroachdb/sql-execution-prs as code owners Nov 20, 2018

@cockroach-teamcity

This comment has been minimized.

Copy link
Member

cockroach-teamcity commented Nov 20, 2018

This change is Reviewable

@knz

This comment has been minimized.

Copy link
Member

knz commented Nov 20, 2018

Note: I checked that UPSERT ... ON CONFLICT DO UPDATE SET ... already does the right check.

@BramGruneir
Copy link
Member

BramGruneir left a comment

:lgtm:

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

@knz

This comment has been minimized.

Copy link
Member

knz commented Nov 20, 2018

cc @andy-kimball you'll probably want to have some similar check when planning the projection for UPDATE/UPSERT.

@knz

This comment has been minimized.

Copy link
Member

knz commented Nov 20, 2018

bors r+

craig bot pushed a commit that referenced this pull request Nov 20, 2018

Merge #32505
32505: sql: catch invalid functions in the UPDATE SET RHS r=knz a=knz

Fixes #32477.
This is a leftover case from #26425.

Prior to this patch, an invalid scalar function in the RHS of UPDATE
... SET would not be rejected during planning and cause a crash during
execution.

This patch fixes this by ensuring the bad construct is rejected during
planning.

Release note (bug fix): CockroachDB now properly rejects queries
that use an invalid function in UPDATE SET (e.g., an aggregation).

Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@craig

This comment has been minimized.

Copy link

craig bot commented Nov 20, 2018

Build succeeded

@craig craig bot merged commit 28a0f45 into cockroachdb:master Nov 20, 2018

3 checks passed

GitHub CI (Cockroach) TeamCity build finished
Details
bors Build succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@knz knz deleted the knz:20181120-update-fix branch Nov 20, 2018

@knz knz moved this from Triage to Finished (m2.2-2) in SQL Front-end, Lang & Semantics Nov 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment