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

opt,sql: do not allow special functions in ON clause #28839

Merged
merged 1 commit into from
Aug 20, 2018

Conversation

rytaft
Copy link
Collaborator

@rytaft rytaft commented Aug 20, 2018

Previously, both the heuristic planner and the optimizer were
erroneously allowing ON clauses to have special functions such
as generator functions or aggregates. This commit ensures that
any queries containing special functions in the ON clause now
throw an error.

Fixes #28817

Release note (sql change): Previously, CockroachDB was
erroneously allowing generator functions, aggregates, and window
functions in the ON clause of joins. These functions are no longer
allowed in join conditions, and will cause an error if used.

Previously, both the heuristic planner and the optimizer were
erroneously allowing ON clauses to have special functions such
as generator functions or aggregates. This commit ensures that
any queries containing special functions in the ON clause now
throw an error.

Fixes cockroachdb#28817

Release note (sql change): Previously, CockroachDB was
erroneously allowing generator functions, aggregates, and window
functions in the ON clause of joins. These functions are no longer
allowed in join conditions, and will cause an error if used.
@rytaft rytaft requested review from knz, RaduBerinde, andy-kimball and a team August 20, 2018 16:23
@rytaft rytaft requested a review from a team as a code owner August 20, 2018 16:23
@rytaft rytaft requested review from a team August 20, 2018 16:24
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jordanlewis
Copy link
Member

Nice find!

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Nice :)

Copy link
Member

@RaduBerinde RaduBerinde 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! 0 of 0 LGTMs obtained (and 1 stale)

Copy link
Collaborator Author

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

Thanks!

bors r+

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

craig bot pushed a commit that referenced this pull request Aug 20, 2018
28839: opt,sql: do not allow special functions in ON clause r=rytaft a=rytaft

Previously, both the heuristic planner and the optimizer were
erroneously allowing ON clauses to have special functions such
as generator functions or aggregates. This commit ensures that
any queries containing special functions in the ON clause now
throw an error.

Fixes #28817

Release note (sql change): Previously, CockroachDB was
erroneously allowing generator functions, aggregates, and window
functions in the ON clause of joins. These functions are no longer
allowed in join conditions, and will cause an error if used.

28850: sql: improve memory accounting for replace builtin r=solongordon a=solongordon

Previously the replace(...) builtin was only reserving memory after the
replace operation was performed, so it was possible to outspend the
memory budget. Now we do a worst case reservation beforehand and adjust
it based on the actual result size.

Fixes #28206

Release note: None

Co-authored-by: Rebecca Taft <becca@cockroachlabs.com>
Co-authored-by: Solon Gordon <solon@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Aug 20, 2018

Build succeeded

@craig craig bot merged commit eb2e3a5 into cockroachdb:master Aug 20, 2018
@rytaft rytaft deleted the fix-optbuilder-panic branch April 2, 2020 22:17
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.

None yet

5 participants