This commit is contained in:
Steven Fackler 2015-12-25 20:20:28 -07:00
parent 4f37625cd6
commit f79e98e07a
3 changed files with 10 additions and 11 deletions

View File

@ -1337,8 +1337,8 @@ fn read_rows(conn: &mut InnerConnection, buf: &mut VecDeque<Vec<Option<Vec<u8>>>
} }
} }
return Err(Error::Io(std_io::Error::new(std_io::ErrorKind::InvalidInput, return Err(Error::Io(std_io::Error::new(std_io::ErrorKind::InvalidInput,
"COPY queries cannot be directly \ "COPY queries cannot be directly \
executed"))); executed")));
} }
_ => { _ => {
conn.desynchronized = true; conn.desynchronized = true;

View File

@ -217,7 +217,7 @@ impl<'a> Row<'a> {
{ {
let idx = match idx.idx(self.stmt) { let idx = match idx.idx(self.stmt) {
Some(idx) => idx, Some(idx) => idx,
None => return None None => return None,
}; };
let ty = self.stmt.columns()[idx].type_(); let ty = self.stmt.columns()[idx].type_();

View File

@ -322,9 +322,9 @@ impl<'conn> Statement<'conn> {
match try!(conn.read_message()) { match try!(conn.read_message()) {
ReadyForQuery { .. } => { ReadyForQuery { .. } => {
return Err(Error::Io(io::Error::new(io::ErrorKind::InvalidInput, return Err(Error::Io(io::Error::new(io::ErrorKind::InvalidInput,
"called `copy_in` on a \ "called `copy_in` on a \
non-`COPY FROM STDIN` \ non-`COPY FROM STDIN` \
statement"))); statement")));
} }
_ => {} _ => {}
} }
@ -422,8 +422,8 @@ impl<'conn> Statement<'conn> {
} }
try!(conn.wait_for_ready()); try!(conn.wait_for_ready());
return Err(Error::Io(io::Error::new(io::ErrorKind::InvalidInput, return Err(Error::Io(io::Error::new(io::ErrorKind::InvalidInput,
"called `copy_out` on a non-`COPY TO \ "called `copy_out` on a non-`COPY TO \
STDOUT` statement"))); STDOUT` statement")));
} }
ErrorResponse { fields } => { ErrorResponse { fields } => {
try!(conn.wait_for_ready()); try!(conn.wait_for_ready());
@ -434,9 +434,8 @@ impl<'conn> Statement<'conn> {
match try!(conn.read_message()) { match try!(conn.read_message()) {
ReadyForQuery { .. } => { ReadyForQuery { .. } => {
return Err(Error::Io(io::Error::new(io::ErrorKind::InvalidInput, return Err(Error::Io(io::Error::new(io::ErrorKind::InvalidInput,
"called `copy_out` on a \ "called `copy_out` on a \
non-`COPY TO STDOUT` \ non-`COPY TO STDOUT` statement")));
statement")));
} }
_ => {} _ => {}
} }