From 7395543e22d1af203a9d211afca0cfc88776ac59 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Fri, 9 Apr 2021 16:10:42 -0700 Subject: [PATCH] fix: mark blocking invocations of flush! as @blocking --- sqlx-postgres/src/connection/executor/execute.rs | 2 +- sqlx-postgres/src/connection/executor/fetch_all.rs | 2 +- sqlx-postgres/src/connection/executor/fetch_optional.rs | 2 +- sqlx-postgres/src/protocol/frontend/terminate.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sqlx-postgres/src/connection/executor/execute.rs b/sqlx-postgres/src/connection/executor/execute.rs index b871f44b..b058264d 100644 --- a/sqlx-postgres/src/connection/executor/execute.rs +++ b/sqlx-postgres/src/connection/executor/execute.rs @@ -77,7 +77,7 @@ impl PgConnection { Rt: sqlx_core::blocking::Runtime, E: Execute<'q, 'a, Postgres>, { - flush!(self); + flush!(@blocking self); impl_execute!(@blocking self, query) } } diff --git a/sqlx-postgres/src/connection/executor/fetch_all.rs b/sqlx-postgres/src/connection/executor/fetch_all.rs index 0a345a18..b2b49402 100644 --- a/sqlx-postgres/src/connection/executor/fetch_all.rs +++ b/sqlx-postgres/src/connection/executor/fetch_all.rs @@ -83,7 +83,7 @@ impl PgConnection { Rt: sqlx_core::blocking::Runtime, E: Execute<'q, 'a, Postgres>, { - flush!(self); + flush!(@blocking self); impl_fetch_all!(@blocking self, query) } } diff --git a/sqlx-postgres/src/connection/executor/fetch_optional.rs b/sqlx-postgres/src/connection/executor/fetch_optional.rs index cbb498fe..9d2a33be 100644 --- a/sqlx-postgres/src/connection/executor/fetch_optional.rs +++ b/sqlx-postgres/src/connection/executor/fetch_optional.rs @@ -91,7 +91,7 @@ impl PgConnection { Rt: sqlx_core::blocking::Runtime, E: Execute<'q, 'a, Postgres>, { - flush!(self); + flush!(@blocking self); impl_fetch_optional!(@blocking self, query) } } diff --git a/sqlx-postgres/src/protocol/frontend/terminate.rs b/sqlx-postgres/src/protocol/frontend/terminate.rs index ae409af1..bd1ae70d 100644 --- a/sqlx-postgres/src/protocol/frontend/terminate.rs +++ b/sqlx-postgres/src/protocol/frontend/terminate.rs @@ -26,7 +26,7 @@ mod tests { let mut buf = Vec::new(); Terminate.serialize(&mut buf)?; - assert_eq!(&buf, &[b'X']); + assert_eq!(&buf, &[b'X', 0, 0, 0, 4]); Ok(()) }