Skip to content

Commit aefcf42

Browse files
committed
Fix for #534 and #535
1 parent 9d1c46a commit aefcf42

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pgcat.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ username = "sharding_user"
270270
# if `server_password` is not set.
271271
password = "sharding_user"
272272

273-
pool_mode = "session"
273+
pool_mode = "transaction"
274274

275275
# PostgreSQL username used to connect to the server.
276276
# server_username = "another_user"

src/server.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,9 @@ impl Server {
997997
}
998998
}
999999

1000-
self.deallocate(names).await?;
1000+
if !names.is_empty() {
1001+
self.deallocate(names).await?;
1002+
}
10011003

10021004
Ok(())
10031005
}
@@ -1013,15 +1015,17 @@ impl Server {
10131015
/// Close a prepared statement on the server.
10141016
pub async fn deallocate(&mut self, names: Vec<String>) -> Result<(), Error> {
10151017
for name in &names {
1016-
debug!("Deallocating prepared statement `{}`", name);
1018+
info!("Deallocating prepared statement `{}`", name);
10171019

10181020
let close = Close::new(name);
10191021
let bytes: BytesMut = close.try_into()?;
10201022

10211023
self.send(&bytes).await?;
10221024
}
10231025

1024-
self.send(&flush()).await?;
1026+
if !names.is_empty() {
1027+
self.send(&flush()).await?;
1028+
}
10251029

10261030
// Read and discard CloseComplete (3)
10271031
for name in &names {

0 commit comments

Comments
 (0)