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: minor fixes to fix panics related to type resolution and bad planner usage #65108

Merged
merged 2 commits into from
May 13, 2021

Conversation

ajwerner
Copy link
Contributor

@ajwerner ajwerner commented May 13, 2021

See individual commits. The first commit matters but does not leave one with a good feeling. The second one is more copacetic.

Relates to #64140.

Fixes #64975.

Release note (bug fix): Fixed a bug which could cause a panic when
running a EXECUTE of a previously PREPARE'd statement with a REGCLASS,
REGTYPE parameter or a user-defined type argument after running BEGIN
AS OF SYSTEM TIME with an invalid timestamp.

Release note (bug fix): Fixed a bug which could cause a panic when issuing
a query referencing a user-defined type as a placeholder as the first operation
on a new connection.

This further paper's over the rough edges of not resetting the planner
state to keep it in sync with the connExecutor state. The test used
to panic before this change.

Touches cockroachdb#64140.

Release note (bug fix): Fixed a bug which could cause a panic when
running a EXECUTE of a previously PREPARE'd statement with a REGCLASS,
REGTYPE parameter or a user-defined type argument after running BEGIN
AS OF SYSTEM TIME with an invalid timestamp.
Before this change we'd resolve user-defined types into placeholder hints
using a planner which may not be in a valid state. This could result in
a nil-pointer panic.

I don't actually know how to trigger this from a driver but there's evidence
that it's possible. It's easy enough to hit using SQL if the previous commit
were not here.

Fixes cockroachdb#64975

Release note (bug fix): Fixed a bug which could cause a panic when issuing
a query referencing a user-defined type as a placeholder.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@ajwerner ajwerner requested review from otan and rafiss May 13, 2021 04:55
@ajwerner
Copy link
Contributor Author

@andreimatei maybe you have something to say about this.

@ajwerner ajwerner marked this pull request as ready for review May 13, 2021 05:30
Copy link
Contributor

@otan otan left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, 3 of 3 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rafiss)

@ajwerner
Copy link
Contributor Author

TFTR!

bors r=otan

@craig
Copy link
Contributor

craig bot commented May 13, 2021

Build succeeded:

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

Successfully merging this pull request may close these issues.

sql/catalog: v20.2.9: nil txn or mutex when resolving type
3 participants