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(c/driver/postgresql): Fix segfault associated with uninitialized copy_reader_ #964

Merged
merged 12 commits into from
Aug 10, 2023

Conversation

ywc88
Copy link
Collaborator

@ywc88 ywc88 commented Aug 4, 2023

Fixes #958.

@ywc88 ywc88 requested a review from lidavidm as a code owner August 4, 2023 18:46
@lidavidm
Copy link
Member

lidavidm commented Aug 4, 2023

Why isn't the reader initialized, though? We shouldn't be returning a bad stream to the client in the first place.

c/driver/postgresql/statement.cc Outdated Show resolved Hide resolved
c/driver/postgresql/statement.cc Show resolved Hide resolved
@lidavidm
Copy link
Member

lidavidm commented Aug 7, 2023

Also for the PR description please specifically use Fixes #NNN so that GitHub links it properly

Solomon Choe added 2 commits August 7, 2023 15:34
Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Thanks!

@lidavidm
Copy link
Member

lidavidm commented Aug 7, 2023

Hmm, it seems to have broken one of the examples. Does python/recipe/postgresql_create_append_table.py work for you?

@ywc88
Copy link
Collaborator Author

ywc88 commented Aug 7, 2023

Hmm, it seems to have broken one of the examples. Does python/recipe/postgresql_create_append_table.py work for you?

I get:

Traceback (most recent call last):
  File "/Users/ywc/VoDa/arrow-adbc/docs/source/python/recipe/postgresql_create_append_table.py", line 59, in <module>
    assert cur.fetchone() == (4,)
           ^^^^^^^^^^^^^^^^^^^^^^
AssertionError

On both v10 and v11 (the example segfaults as expected in v10 on main). I'll take a look as to why cur.fetchone() is returning None instead of (4,).

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Can you update the PR title?

c/driver/postgresql/statement.cc Outdated Show resolved Hide resolved
@ywc88 ywc88 changed the title fix(c/driver/postgresql): check if copy reader is initialized in GetSchema to prevent segfault fix(c/driver/postgresql): Fix segfault associated with uninitialized copy_reader_ Aug 9, 2023
@lidavidm lidavidm merged commit da33e6c into apache:main Aug 10, 2023
65 checks passed
@lidavidm lidavidm added this to the ADBC Libraries 0.6.0 milestone Aug 10, 2023
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.

c/driver/postgresql: Python Segfault With cur.execute
2 participants