Force all result formats to binary

This commit is contained in:
Steven Fackler 2014-08-14 20:22:12 -07:00
parent 619dd47fca
commit 455dea3bd0
2 changed files with 2 additions and 14 deletions

View File

@ -140,7 +140,7 @@ use message::{Bind,
Sync,
Terminate};
use message::{WriteMessage, ReadMessage};
use types::{Oid, PostgresType, ToSql, FromSql, PgUnknownType};
use types::{Oid, PostgresType, ToSql, FromSql, PgUnknownType, Binary};
#[macro_escape]
mod macros;
@ -1118,9 +1118,7 @@ impl<'conn> PostgresStatement<'conn> {
values.push(value);
};
let result_formats: Vec<i16> = self.result_desc.iter().map(|desc| {
desc.ty.result_format() as i16
}).collect();
let result_formats = Vec::from_elem(self.result_desc.len(), Binary as i16);
try_pg!(self.conn.write_messages([
Bind {

View File

@ -115,16 +115,6 @@ macro_rules! make_postgres_type(
_ => unreachable!()
}
}
/// Returns the wire format needed for the value of `self`.
pub fn result_format(&self) -> Format {
match *self {
PgUnknownType { name: ref name, .. }
if "hstore" == name.as_slice() => Binary,
PgUnknownType { .. } => Text,
_ => Binary
}
}
}
)
)