Fix for upstream changes

This commit is contained in:
Steven Fackler 2014-11-28 12:24:34 -08:00
parent d7cec2c7e5
commit dd9c712ea9
4 changed files with 19 additions and 19 deletions

View File

@ -67,7 +67,7 @@ extern crate phf_mac;
extern crate log; extern crate log;
use url::Url; use url::Url;
use openssl::crypto::hash::{MD5, Hasher}; use openssl::crypto::hash::{HashType, Hasher};
use openssl::ssl::SslContext; use openssl::ssl::SslContext;
use serialize::hex::ToHex; use serialize::hex::ToHex;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
@ -443,11 +443,11 @@ impl InnerConnection {
} }
AuthenticationMD5Password { salt } => { AuthenticationMD5Password { salt } => {
let pass = try!(user.password.ok_or(ConnectError::MissingPassword)); let pass = try!(user.password.ok_or(ConnectError::MissingPassword));
let mut hasher = Hasher::new(MD5); let mut hasher = Hasher::new(HashType::MD5);
hasher.update(pass.as_bytes()); hasher.update(pass.as_bytes());
hasher.update(user.user.as_bytes()); hasher.update(user.user.as_bytes());
let output = hasher.finalize()[].to_hex(); let output = hasher.finalize()[].to_hex();
let mut hasher = Hasher::new(MD5); let mut hasher = Hasher::new(HashType::MD5);
hasher.update(output.as_bytes()); hasher.update(output.as_bytes());
hasher.update(&salt); hasher.update(&salt);
let output = format!("md5{}", hasher.finalize()[].to_hex()); let output = format!("md5{}", hasher.finalize()[].to_hex());
@ -1560,7 +1560,7 @@ impl<'a> CopyInStatement<'a> {
/// ///
/// Returns the number of rows copied. /// Returns the number of rows copied.
pub fn execute<'b, I, J>(&self, mut rows: I) -> Result<uint> pub fn execute<'b, I, J>(&self, mut rows: I) -> Result<uint>
where I: Iterator<J>, J: Iterator<&'b ToSql + 'b> { where I: Iterator<J>, J: Iterator<&'b (ToSql + 'b)> {
let mut conn = self.conn.conn.borrow_mut(); let mut conn = self.conn.conn.borrow_mut();
try!(conn.write_messages(&[ try!(conn.write_messages(&[

View File

@ -49,50 +49,50 @@ macro_rules! range(
('(', $h:expr ')') => ( ('(', $h:expr ')') => (
::postgres::types::range::Range::new(None, ::postgres::types::range::Range::new(None,
Some(::postgres::types::range::RangeBound::new($h, Some(::postgres::types::range::RangeBound::new($h,
::postgres::types::range::Exclusive))) ::postgres::types::range::BoundType::Exclusive)))
); );
('(', $h:expr ']') => ( ('(', $h:expr ']') => (
::postgres::types::range::Range::new(None, ::postgres::types::range::Range::new(None,
Some(::postgres::types::range::RangeBound::new($h, Some(::postgres::types::range::RangeBound::new($h,
::postgres::types::range::Inclusive))) ::postgres::types::range::BoundType::Inclusive)))
); );
('(' $l:expr, ')') => ( ('(' $l:expr, ')') => (
::postgres::types::range::Range::new( ::postgres::types::range::Range::new(
Some(::postgres::types::range::RangeBound::new($l, Some(::postgres::types::range::RangeBound::new($l,
::postgres::types::range::Exclusive)), None) ::postgres::types::range::BoundType::Exclusive)), None)
); );
('[' $l:expr, ')') => ( ('[' $l:expr, ')') => (
::postgres::types::range::Range::new( ::postgres::types::range::Range::new(
Some(::postgres::types::range::RangeBound::new($l, Some(::postgres::types::range::RangeBound::new($l,
::postgres::types::range::Inclusive)), None) ::postgres::types::range::BoundType::Inclusive)), None)
); );
('(' $l:expr, $h:expr ')') => ( ('(' $l:expr, $h:expr ')') => (
::postgres::types::range::Range::new( ::postgres::types::range::Range::new(
Some(::postgres::types::range::RangeBound::new($l, Some(::postgres::types::range::RangeBound::new($l,
::postgres::types::range::Exclusive)), ::postgres::types::range::BoundType::Exclusive)),
Some(::postgres::types::range::RangeBound::new($h, Some(::postgres::types::range::RangeBound::new($h,
::postgres::types::range::Exclusive))) ::postgres::types::range::BoundType::Exclusive)))
); );
('(' $l:expr, $h:expr ']') => ( ('(' $l:expr, $h:expr ']') => (
::postgres::types::range::Range::new( ::postgres::types::range::Range::new(
Some(::postgres::types::range::RangeBound::new($l, Some(::postgres::types::range::RangeBound::new($l,
::postgres::types::range::Exclusive)), ::postgres::types::range::BoundType::Exclusive)),
Some(::postgres::types::range::RangeBound::new($h, Some(::postgres::types::range::RangeBound::new($h,
::postgres::types::range::Inclusive))) ::postgres::types::range::BoundType::Inclusive)))
); );
('[' $l:expr, $h:expr ')') => ( ('[' $l:expr, $h:expr ')') => (
::postgres::types::range::Range::new( ::postgres::types::range::Range::new(
Some(::postgres::types::range::RangeBound::new($l, Some(::postgres::types::range::RangeBound::new($l,
::postgres::types::range::Inclusive)), ::postgres::types::range::BoundType::Inclusive)),
Some(::postgres::types::range::RangeBound::new($h, Some(::postgres::types::range::RangeBound::new($h,
::postgres::types::range::Exclusive))) ::postgres::types::range::BoundType::Exclusive)))
); );
('[' $l:expr, $h:expr ']') => ( ('[' $l:expr, $h:expr ']') => (
::postgres::types::range::Range::new( ::postgres::types::range::Range::new(
Some(::postgres::types::range::RangeBound::new($l, Some(::postgres::types::range::RangeBound::new($l,
::postgres::types::range::Inclusive)), ::postgres::types::range::BoundType::Inclusive)),
Some(::postgres::types::range::RangeBound::new($h, Some(::postgres::types::range::RangeBound::new($h,
::postgres::types::range::Inclusive))) ::postgres::types::range::BoundType::Inclusive)))
) )
) )

View File

@ -6,7 +6,8 @@ extern crate serialize;
extern crate url; extern crate url;
extern crate openssl; extern crate openssl;
use openssl::ssl::{SslContext, Sslv3}; use openssl::ssl::SslContext;
use openssl::ssl::SslMethod::Sslv3;
use std::io::timer; use std::io::timer;
use std::time::Duration; use std::time::Duration;

View File

@ -2,12 +2,11 @@ use std::i32;
use postgres::types::range::{RangeBound, use postgres::types::range::{RangeBound,
Range, Range,
Inclusive,
Exclusive,
UpperBound, UpperBound,
LowerBound, LowerBound,
Normalizable, Normalizable,
BoundType}; BoundType};
use postgres::types::range::BoundType::{Inclusive, Exclusive};
#[test] #[test]
fn test_range_bound_lower_lt() { fn test_range_bound_lower_lt() {