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: better error message for unsupported UNION variant of recursive CTEs #46643

Merged
merged 1 commit into from
Mar 27, 2020

Conversation

RaduBerinde
Copy link
Member

Postgres supports a variant of recursive CTEs that uses UNION instead
of UNION ALL. We don't support it as of yet; this commit improves the
error returned in this case.

Fixes #46378.

Release note: None

Release justification: low risk change to new functionality.

@RaduBerinde RaduBerinde requested a review from rytaft March 26, 2020 19:40
@RaduBerinde RaduBerinde requested a review from a team as a code owner March 26, 2020 19:40
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde
Copy link
Member Author

@awoods187 the new error looks like this, let me know if it's ok:

ERROR: unimplemented: recursive query "paths" uses UNION which is not implemented (only UNION ALL is supported)
SQLSTATE: 0A000
HINT: You have attempted to use a feature that is not yet implemented.
See: https://github.com/cockroachdb/cockroach/issues/46642

Copy link
Collaborator

@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.

:lgtm:

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @RaduBerinde)


pkg/sql/opt/optbuilder/testdata/with, line 1146 at r1 (raw file):

           └──  "?column?":8 => b:10

build

Maybe add a comment to say that this doesn't cause an error since there's no recursive reference

…CTEs

Postgres supports a variant of recursive CTEs that uses UNION instead
of UNION ALL. We don't support it as of yet; this commit improves the
error returned in this case.

Fixes cockroachdb#46378.

Release note: None

Release justification: low risk change to new functionality.
Copy link
Member Author

@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.

TFTR!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @rytaft)


pkg/sql/opt/optbuilder/testdata/with, line 1146 at r1 (raw file):

Previously, rytaft (Rebecca Taft) wrote…

Maybe add a comment to say that this doesn't cause an error since there's no recursive reference

Done.

Copy link
Collaborator

@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.

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@RaduBerinde
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 27, 2020

Build succeeded

@craig craig bot merged commit 8f793a0 into cockroachdb:master Mar 27, 2020
@RaduBerinde RaduBerinde deleted the cte-error branch March 30, 2020 18:51
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: add unimplemented error for recursive query without union all
3 participants