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

release-20.2: sql: ensure "promoted" temporary views are marked as such #63781

Conversation

ajwerner
Copy link
Contributor

This commit fixes a bug whereby views which reference temp tables are created
in the temporary schema but are not marked as being temporary. Usually this
doesn't cause a lot of trouble. Problems arise when another session attempts
to drop the database corresponding to the temp schema containing these views
before they have been cleaned up. In that case, the DROP DATABASE command
will observe an opaque descriptor not found error.

Fixes #62281.

Release note (bug fix): Fixed a bug which could cause errors in DROP DATABASE
CASCADE when the database contains temporary views in other sessions which
were not explicitly marked as TEMPORARY.

This commit fixes a bug whereby views which reference temp tables are created
in the temporary schema but are not marked as being temporary. Usually this
doesn't cause a lot of trouble. Problems arise when another session attempts
to drop the database corresponding to the temp schema containing these views
before they have been cleaned up. In that case, the `DROP DATABASE` command
will observe an opaque `descriptor not found` error.

Release note (bug fix): Fixed a bug which could cause errors in DROP DATABASE
CASCADE when the database contains temporary views in other sessions which
were not explicitly marked as TEMPORARY.
@ajwerner ajwerner requested a review from arulajmani April 16, 2021 05:33
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

:lgtm_strong:

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

@ajwerner
Copy link
Contributor Author

TFTR!

@ajwerner ajwerner merged commit 0f4525d into cockroachdb:release-20.2 Apr 16, 2021
@mgartner
Copy link
Collaborator

@ajwerner should we "forward-port" the regression test in this commit to master and release-21.1?

@ajwerner
Copy link
Contributor Author

@ajwerner should we "forward-port" the regression test in this commit to master and release-21.1?

I don't believe this bug exists on master or 21.1. See #62281 (comment).

@mgartner
Copy link
Collaborator

Yes, but having the regression test on master and release-21.1 would be useful to prevent this issue indefinitely.

@ajwerner
Copy link
Contributor Author

Whoops missed the words "regression test". Yes, will do.

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.

4 participants