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

pgwire: fix for specific cases of unnamed portal execution #83164

Closed
wants to merge 1 commit into from

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Jun 22, 2022

refs MagicStack/asyncpg#580 (comment)

The Postgres docs say that an unnamed portal is automatically closed
when a Bind command for another unnamed portal or a simple query is
sent. We already implemented that for "normal" portals, but not for
portals that were partially executed.

This does not address the general case, but it does handle the common
case that we see from tools like asyncpg.

Release note (bug fix): Previously, executing an unnamed portal with a
row count limit could encounter errors if another unnamed portal was
opened. Now, CockroachDB correctly handles the common case of preparing
and binding an unnamed portal by closing the existing unnamed portal.
This matches the Postgres wire protocol.

@rafiss rafiss requested review from jordanlewis and a team June 22, 2022 03:00
@rafiss rafiss requested a review from a team as a code owner June 22, 2022 03:00
@cockroach-teamcity
Copy link
Member

This change is Reviewable

The Postgres docs say that an unnamed portal is automatically closed
when a Bind command for another unnamed portal or a simple query is
sent. We already implemented that for "normal" portals, but not for
portals that were partially executed.

This does not address the general case, but it does handle the common
case that we see from tools like asyncpg.

Release note (bug fix): Previously, executing an unnamed portal with a
row count limit could encounter errors if another unnamed portal was
opened. Now, CockroachDB correctly handles the common case of preparing
and binding an unnamed portal by closing the existing unnamed portal.
This matches the Postgres wire protocol.
@rafiss
Copy link
Collaborator Author

rafiss commented Apr 15, 2023

closing since #40195 was resolved and eliminates the need for this workaround

@rafiss rafiss closed this Apr 15, 2023
@rafiss rafiss deleted the fix-unnamed-portal branch April 15, 2023 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge bors won't merge a PR with this label. X-noremind Bots won't notify about PRs with X-noremind
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants