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

PostgreSQL Bugfix: Ensure connection is usable after failed COPY inside a transaction #3138

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

feikesteenbergen
Copy link
Contributor

@feikesteenbergen feikesteenbergen commented Mar 21, 2024

While using COPY and transactions I kept running into errors.

This PR includes a test case that triggers that error, it fails with:

Error: encountered unexpected or invalid data: expecting ParseComplete but received CommandComplete

The second commit contains the actual fix

Does your PR solve an issue?

fixesvalidates error of #3139

While using COPY and subtransactions I kept running into errors.
This test case documents that error, it currently fails with:

    Error: encountered unexpected or invalid data: expecting ParseComplete but received CommandComplete
When a COPY statement was in error inside a subtransaction,
a Protocol Error used to be raised. By consuming the ReadyForQuery
message when there is an error, we no longer have this issue.
@feikesteenbergen feikesteenbergen changed the title Include test case for regular subtransactions PostgreSQL Bugfix: Ensure connection is usable after failed COPY inside a transaction Apr 4, 2024
@feikesteenbergen feikesteenbergen marked this pull request as ready for review April 4, 2024 10:43
@abonander abonander merged commit 17d832b into launchbadge:main Apr 19, 2024
62 checks passed
jayy-lmao pushed a commit to jayy-lmao/sqlx that referenced this pull request Jun 6, 2024
…de a transaction (launchbadge#3138)

* Include test case for regular subtransactions

While using COPY and subtransactions I kept running into errors.
This test case documents that error, it currently fails with:

    Error: encountered unexpected or invalid data: expecting ParseComplete but received CommandComplete

* PostgreSQL Copy: Consume ReadyForQuery on error

When a COPY statement was in error inside a subtransaction,
a Protocol Error used to be raised. By consuming the ReadyForQuery
message when there is an error, we no longer have this issue.
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