diff --git a/src/mariadb/protocol/deserialize.rs b/src/mariadb/protocol/deserialize.rs index d9c4da02..495a06a7 100644 --- a/src/mariadb/protocol/deserialize.rs +++ b/src/mariadb/protocol/deserialize.rs @@ -31,13 +31,15 @@ impl<'a> DeContext<'a> { pub async fn next_packet(&mut self) -> Result<(), failure::Error> { if let Some(stream) = &mut self.stream { - println!("Called next packet"); self.decoder = Decoder::new(stream.next_packet().await?); - Ok(()) - } else { - failure::bail!("Calling next_packet on DeContext with no stream provided") + return Ok(()); + } else if self.decoder.buf.len() > 0 { + // There is still data in the buffer + return Ok(()) } + + failure::bail!("Calling next_packet on DeContext with no stream provided") } } diff --git a/src/mariadb/protocol/packets/binary/com_stmt_prepare_resp.rs b/src/mariadb/protocol/packets/binary/com_stmt_prepare_resp.rs index d876318c..a1a8451d 100644 --- a/src/mariadb/protocol/packets/binary/com_stmt_prepare_resp.rs +++ b/src/mariadb/protocol/packets/binary/com_stmt_prepare_resp.rs @@ -1,4 +1,4 @@ -use crate::mariadb::{DeContext, Deserialize, ComStmtPrepareOk, ColumnDefPacket, Capabilities, EofPacket}; +use crate::mariadb::{Framed, DeContext, Deserialize, ComStmtPrepareOk, ColumnDefPacket, Capabilities, EofPacket}; #[derive(Debug, Default)] pub struct ComStmtPrepareResp {