From d72c607b6d0be268dddae92137a0737fdb76a617 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Tue, 11 Feb 2014 23:09:27 -0800 Subject: [PATCH] Don't desync the stream on error in quick_query --- src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d6373be7..012d571f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -654,8 +654,10 @@ impl InnerPostgresConnection { result.push(row.move_iter().map(|opt| opt.map(|b| str::from_utf8_owned(b).unwrap())) .collect()), - ErrorResponse { fields } => - return Err(PgDbError(PostgresDbError::new(fields))), + ErrorResponse { fields } => { + if_ok!(self.wait_for_ready()); + return Err(PgDbError(PostgresDbError::new(fields))); + } _ => {} } }