Skip to content

Commit

Permalink
Merge pull request #303 from blackbeam/bump-dependencies
Browse files Browse the repository at this point in the history
Update pem to 1.0.1, mysql_common to 0.28.0
  • Loading branch information
blackbeam authored Dec 24, 2021
2 parents 5304021 + 5a5d0a0 commit 24b3584
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 36 deletions.
16 changes: 13 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,34 @@ path = "src/lib.rs"
debug = true

[features]
default = ["native-tls"]
default = [
"native-tls",
"flate2/zlib",
"mysql_common/bigdecimal03",
"mysql_common/rust_decimal",
"mysql_common/time03",
"mysql_common/uuid",
"mysql_common/frunk",
]
rustls-tls = ["rustls", "webpki", "webpki-roots", "rustls-pemfile"]
nightly = []

[dev-dependencies]
lazy_static = "1.4.0"
rand = "0.8.2"
serde_derive = "1"
time = "0.3"

[dependencies]
bufstream = "~0.1"
bytes = "1.0.1"
io-enum = "1.0.0"
flate2 = { version = "1.0", default-features = false }
lru = "0.7"
mysql_common = "0.27.2"
mysql_common = { version = "0.28.0", default-features = false }
socket2 = "0.4"
once_cell = "1.7.2"
pem = "0.8.1"
pem = "1.0.1"
percent-encoding = "2.1.0"
serde = "1"
serde_json = "1"
Expand Down
44 changes: 22 additions & 22 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
SSL=false COMPRESS=true cargo test
SSL=true COMPRESS=true cargo test
SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls
SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls
SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03
SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03
SSL=false COMPRESS=true cargo test --no-default-features
SSL=false COMPRESS=false cargo test --no-default-features
SSL=false COMPRESS=true cargo test --no-default-features --features flate2/zlib,mysql_common/time03
SSL=false COMPRESS=false cargo test --no-default-features --features flate2/zlib,mysql_common/time03
env:
RUST_BACKTRACE: 1
DATABASE_URL: mysql://root:[email protected]:3306/mysql
Expand Down Expand Up @@ -91,11 +91,11 @@ jobs:
SSL=false COMPRESS=true cargo test
SSL=true COMPRESS=true cargo test
SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls
SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls
SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03
SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03
SSL=false COMPRESS=true cargo test --no-default-features
SSL=false COMPRESS=false cargo test --no-default-features
SSL=false COMPRESS=true cargo test --no-default-features --features flate2/zlib,mysql_common/time03
SSL=false COMPRESS=false cargo test --no-default-features --features flate2/zlib,mysql_common/time03
env:
RUST_BACKTRACE: 1
DATABASE_URL: mysql://[email protected]/mysql
Expand Down Expand Up @@ -142,11 +142,11 @@ jobs:
SSL=false COMPRESS=true cargo test
SSL=true COMPRESS=true cargo test
SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls
SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls
SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03
SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03
SSL=false COMPRESS=true cargo test --no-default-features
SSL=false COMPRESS=false cargo test --no-default-features
SSL=false COMPRESS=true cargo test --no-default-features --features flate2/zlib,mysql_common/time03
SSL=false COMPRESS=false cargo test --no-default-features --features flate2/zlib,mysql_common/time03
env:
RUST_BACKTRACE: 1
DATABASE_URL: mysql://root:[email protected]/mysql
Expand Down Expand Up @@ -192,11 +192,11 @@ jobs:
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=$SSL cargo test"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=$SSL COMPRESS=true cargo test"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=false COMPRESS=true cargo test --no-default-features"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=false COMPRESS=false cargo test --no-default-features"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=false COMPRESS=true cargo test --no-default-features --features flate2/zlib,mysql_common/time03"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=false COMPRESS=false cargo test --no-default-features --features flate2/zlib,mysql_common/time03"
env:
RUST_BACKTRACE: 1
DATABASE_URL: mysql://root:[email protected]/mysql
Expand Down Expand Up @@ -240,8 +240,8 @@ jobs:
--performance-schema=on \
--log-bin=mysql-bin --gtid-domain-id=1 \
--ssl \
--ssl-ca=/root/tests/ca-cert.pem \
--ssl-cert=/root/tests/server-cert.pem \
--ssl-ca=/root/tests/ca.crt \
--ssl-cert=/root/tests/server.crt \
--ssl-key=/root/tests/server-key.pem &
while ! nc -W 1 localhost 3307 | grep -q -P '.+'; do sleep 1; done
docker logs container
Expand All @@ -260,11 +260,11 @@ jobs:
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true cargo test"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=true cargo test"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=false cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=true cargo test --no-default-features --features rustls-tls,flate2/zlib,mysql_common/time03"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=false COMPRESS=true cargo test --no-default-features"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=false COMPRESS=false cargo test --no-default-features"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=false COMPRESS=true cargo test --no-default-features --features flate2/zlib,mysql_common/time03"
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=false COMPRESS=false cargo test --no-default-features --features flate2/zlib,mysql_common/time03"
env:
RUST_BACKTRACE: 1
DATABASE_URL: mysql://root:[email protected]/mysql
Expand Down
12 changes: 10 additions & 2 deletions src/conn/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,15 @@ impl Conn {
}
}

let nonce = handshake.nonce();
// Handshake scramble is always 21 bytes length (20 + zero terminator)
let nonce = {
let mut nonce = Vec::from(handshake.scramble_1_ref());
nonce.extend_from_slice(handshake.scramble_2_ref().unwrap_or(&[][..]));
// Trim zero terminator. Fill with zeroes if nonce
// is somehow smaller than 20 bytes (this matches the server behavior).
nonce.resize(20, 0);
nonce
};

let auth_plugin = handshake
.auth_plugin()
Expand Down Expand Up @@ -1160,12 +1168,12 @@ mod test {
};

use mysql_common::{binlog::events::EventData, packets::binlog_request::BinlogRequest};
use time::PrimitiveDateTime;

use crate::{
from_row, from_value, params,
prelude::*,
test_misc::get_opts,
time::PrimitiveDateTime,
Conn,
DriverError::{MissingNamedParameter, NamedParamsForPositionalQuery},
Error::DriverError,
Expand Down
1 change: 1 addition & 0 deletions src/io/tls/native_tls_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ impl Stream {
.map(|x| vec![x])
.or_else(|_| {
pem::parse_many(&*root_cert_data)
.unwrap_or_default()
.iter()
.map(pem::encode)
.map(|s| Certificate::from_pem(s.as_bytes()))
Expand Down
11 changes: 2 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@
//! println!("A double precision float value: {}", from_value::<f64>(val))
//! }
//! val @ Value::Date(..) => {
//! use mysql::chrono::NaiveDateTime;
//! println!("A date value: {}", from_value::<NaiveDateTime>(val))
//! use time::PrimitiveDateTime;
//! println!("A date value: {}", from_value::<PrimitiveDateTime>(val))
//! }
//! val @ Value::Time(..) => {
//! use std::time::Duration;
Expand Down Expand Up @@ -769,13 +769,6 @@ pub extern crate serde_json;
#[macro_use]
extern crate serde_derive;

/// Reexport of `chrono` crate.
pub use crate::myc::chrono;
/// Reexport of `time` crate.
pub use crate::myc::time;
/// Reexport of `uuid` crate.
pub use crate::myc::uuid;

mod buffer_pool;
mod conn;
pub mod error;
Expand Down

0 comments on commit 24b3584

Please sign in to comment.