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

Fix #8185 - SIGSEGV with WHERE CURRENT OF statement with statement cache turned on #8191

Open
wants to merge 1 commit into
base: v5.0-release
Choose a base branch
from

Conversation

asfernandes
Copy link
Member

No description provided.

@@ -177,6 +177,9 @@ void DsqlRequest::destroy(thread_db* tdbb, DsqlRequest* dsqlRequest)
{
childStatement->addFlags(DsqlStatement::FLAG_ORPHAN);
childStatement->setParentRequest(nullptr);
childStatement->setParentDbKey(nullptr);
childStatement->setParentRecVersion(nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it pointless to clean fields of statement which is going to be removed from cache and thus destructed? FLAG_ORPHAN already prevent any usage of the statement.

@aafemt
Copy link
Contributor

aafemt commented Jul 25, 2024

BTW, where FLAG_ORPHAN is reset so reused statement won't throw "invalid handle" error?

@asfernandes
Copy link
Member Author

BTW, where FLAG_ORPHAN is reset so reused statement won't throw "invalid handle" error?

Statement link to the cursor is established at prepare time.
Once the cursor request is disposed, links are broken forever, until someone compiles another statement.

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.

2 participants