close
Skip to content

fix(c/driver/postgresql): avoid crash if closing invalidated result#2653

Merged
lidavidm merged 3 commits into
apache:mainfrom
lidavidm:gh-2629
Mar 28, 2025
Merged

fix(c/driver/postgresql): avoid crash if closing invalidated result#2653
lidavidm merged 3 commits into
apache:mainfrom
lidavidm:gh-2629

Conversation

@lidavidm
Copy link
Copy Markdown
Member

The driver does not prevent you from closing a statement when there is still an open result set. Then closing the result set would crash. Avoid this by having the result set keep a weak pointer to the actual state.

Fixes #2629.

The driver does not prevent you from closing a statement when
there is still an open result set.  Then closing the result set
would crash.  Avoid this by having the result set keep a weak
pointer to the actual state.

Fixes apache#2629.
@lidavidm lidavidm marked this pull request as ready for review March 27, 2025 08:00
@github-actions github-actions Bot added this to the ADBC Libraries 18 milestone Mar 27, 2025
Copy link
Copy Markdown
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines +223 to +225
struct ExportedTupleReader {
std::weak_ptr<TupleReader> self;
};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add a comment about what this is doing (or maybe just link the issue?).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea, done.

@lidavidm lidavidm merged commit c2fd239 into apache:main Mar 28, 2025
@lidavidm lidavidm deleted the gh-2629 branch March 28, 2025 03:44
colin-rogers-dbt pushed a commit to dbt-labs/arrow-adbc that referenced this pull request Jun 10, 2025
…pache#2653)

The driver does not prevent you from closing a statement when there is
still an open result set. Then closing the result set would crash. Avoid
this by having the result set keep a weak pointer to the actual state.

Fixes apache#2629.
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.

SEGFAULT when using ADBC Postgres driver with Go FlightServer

3 participants