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

Prevent use of extended query protocol for BEGIN before COPY #1639

Merged
merged 1 commit into from Dec 6, 2019

Conversation

ringerc
Copy link
Member

@ringerc ringerc commented Dec 6, 2019

When autocommit is off and the first query in a transaction is a COPY, we were
sending a BEGIN using the extended query protocol. It was being permitted to
use named portals as well, ignoring prepareThreshold.

Fix by forcing simple query mode and marking the BEGIN as oneshot.

Fixes #1638

When autocommit is off and the first query in a transaction is a COPY, we were
sending a BEGIN using the extended query protocol. It was being permitted to
use named portals as well, ignoring prepareThreshold.

Fix by forcing simple query mode and marking the BEGIN as oneshot.

Fixes pgjdbc#1638
@ringerc
Copy link
Member Author

ringerc commented Dec 6, 2019

I wasn't able to concoct a sensible regression test for this, so a quick review would be much appreciated.

@ringerc
Copy link
Member Author

ringerc commented Dec 6, 2019

CI failure was https://travis-ci.org/pgjdbc/pgjdbc/jobs/621530668?utm_medium=notification&utm_source=github_status

Failed tests: 
  LogicalReplicationTest.testDuringSendBigTransactionConnectionCloseSlotStatusNotActive:370 Execute close method on Connection should lead to stop replication as fast as possible, as result we wait that on view pg_replication_slots status for slot will change to no active
Expected: <false>
     but: was <true>

I don't see how that's related. Test bug?

@davecramer davecramer merged commit b371153 into pgjdbc:master Dec 6, 2019
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.

Unnecessary use of v3 Parse/Bind/Execute and named portal sending BEGIN for COPY
2 participants