Skip to content

Commit ed5a656

Browse files
authored
Merge pull request #324 from blackbeam/version-0.35.0
Prepare version 0.35.0
2 parents 73976c1 + 40a13cd commit ed5a656

File tree

7 files changed

+91
-91
lines changed

7 files changed

+91
-91
lines changed

Cargo.toml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ futures-util = "0.3"
2121
futures-sink = "0.3"
2222
keyed_priority_queue = "0.4"
2323
lru = "0.12.0"
24-
mysql_common = { version = "0.33", default-features = false }
24+
mysql_common = { version = "0.34", default-features = false }
2525
pem = "3.0"
2626
percent-encoding = "2.1.0"
2727
pin-project = "1.0.2"
@@ -35,7 +35,7 @@ tokio-util = { version = "0.7.2", features = ["codec", "io"] }
3535
tracing = { version = "0.1.37", default-features = false, features = [
3636
"attributes",
3737
], optional = true }
38-
twox-hash = "2"
38+
twox-hash = { version = "2", default-features = false, features = ["xxhash64"] }
3939
url = "2.1"
4040
hdrhistogram = { version = "7.5", optional = true }
4141

@@ -55,6 +55,7 @@ optional = true
5555
[dependencies.rustls]
5656
version = "0.23"
5757
default-features = false
58+
features = ["std"]
5859
optional = true
5960

6061
[dependencies.rustls-pemfile]
@@ -77,36 +78,16 @@ socket2 = { version = "0.5.2", features = ["all"] }
7778
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread"] }
7879

7980
[features]
80-
default = [
81-
"flate2/zlib",
82-
"bigdecimal",
83-
"rust_decimal",
84-
"time",
85-
"frunk",
86-
"derive",
87-
"native-tls-tls",
88-
"binlog",
89-
]
81+
default = ["flate2/zlib", "derive"]
9082

91-
default-rustls = [
92-
"default-rustls-no-provider",
93-
"aws-lc-rs",
94-
]
83+
default-rustls = ["default-rustls-no-provider", "aws-lc-rs"]
9584

96-
default-rustls-ring = [
97-
"default-rustls-no-provider",
98-
"ring",
99-
]
85+
default-rustls-ring = ["default-rustls-no-provider", "ring"]
10086

10187
default-rustls-no-provider = [
10288
"flate2/rust_backend",
103-
"bigdecimal",
104-
"rust_decimal",
105-
"time",
106-
"frunk",
10789
"derive",
10890
"rustls-tls",
109-
"binlog",
11091
"tls12",
11192
]
11293

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ mysql_async = "<desired version>"
2020

2121
## Crate Features
2222

23-
Default feature set is wide – it includes all default [`mysql_common` features][myslqcommonfeatures]
24-
as well as `native-tls`-based TLS support.
23+
By default there are only two features enabled:
24+
25+
* `flate2/zlib` — choosing flate2 backend is mandatory
26+
* `derive` — see ["Derive Macros" section in `mysql_common` docs][mysqlcommonderive]
2527

2628
### List Of Features
2729

@@ -37,21 +39,18 @@ as well as `native-tls`-based TLS support.
3739
mysql_async = { version = "*", default-features = false, features = ["minimal"]}
3840
```
3941

40-
* `minimal-rust` - same as `minimal` but rust-based flate2 backend is chosen. Enables:
42+
* `minimal-rust` - same as `minimal` but with rust-based flate2 backend. Enables:
4143

4244
- `flate2/rust_backend`
4345

4446
* `default` – enables the following set of features:
4547

46-
- `minimal`
47-
- `native-tls-tls`
48-
- `bigdecimal`
49-
- `rust_decimal`
50-
- `time`
51-
- `frunk`
52-
- `binlog`
48+
- `flate2/zlib`
49+
- `derive`
50+
51+
* `default-rustls` – default set of features with TLS via `rustls/aws-lc-rs`
5352

54-
* `default-rustls` – same as default but with `rustls-tls` instead of `native-tls-tls`.
53+
* `default-rustls-ring` – default set of features with TLS via `rustls/ring`
5554

5655
**Example:**
5756

@@ -60,21 +59,22 @@ as well as `native-tls`-based TLS support.
6059
mysql_async = { version = "*", default-features = false, features = ["default-rustls"] }
6160
```
6261

63-
* `native-tls-tls` – enables `native-tls`-based TLS support _(conflicts with `rustls-tls`)_
62+
* `native-tls-tls` – enables TLS via `native-tls`
6463

6564
**Example:**
6665

6766
```toml
6867
[dependencies]
69-
mysql_async = { version = "*", default-features = false, features = ["native-tls-tls"] }
68+
mysql_async = { version = "*", default-features = false, features = ["minimal", "native-tls-tls"] }
7069

71-
* `rustls-tls` – enables `native-tls`-based TLS support _(conflicts with `native-tls-tls`)_
70+
* `rustls-tls` - enables rustls TLS backend with no provider. You should enable one
71+
of existing providers using `aws-lc-rs` or `ring` features:
7272

7373
**Example:**
7474

7575
```toml
7676
[dependencies]
77-
mysql_async = { version = "*", default-features = false, features = ["rustls-tls"] }
77+
mysql_async = { version = "*", default-features = false, features = ["minimal-rust", "rustls-tls", "ring"] }
7878

7979
* `tracing` – enables instrumentation via `tracing` package.
8080

@@ -94,7 +94,7 @@ as well as `native-tls`-based TLS support.
9494

9595
- `mysql_common/binlog"
9696

97-
#### Proxied features
97+
#### Proxied features (see [`mysql_common`` fatures][myslqcommonfeatures])
9898

9999
* `derive` – enables `mysql_common/derive` feature
100100
* `chrono` = enables `mysql_common/chrono` feature
@@ -104,6 +104,7 @@ as well as `native-tls`-based TLS support.
104104
* `frunk` = enables `mysql_common/frunk` feature
105105

106106
[myslqcommonfeatures]: https://github.com/blackbeam/rust_mysql_common#crate-features
107+
[mysqlcommonderive]: https://github.com/blackbeam/rust_mysql_common?tab=readme-ov-file#derive-macros
107108

108109
## TLS/SSL Support
109110

azure-pipelines.yml

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ jobs:
4141
- bash: |
4242
cargo +nightly build -Zfeatures=dev_dep
4343
SSL=false COMPRESS=false cargo test
44-
SSL=true COMPRESS=false cargo test
44+
SSL=true COMPRESS=false cargo test --features native-tls-tls
4545
SSL=false COMPRESS=true cargo test
46-
SSL=true COMPRESS=true cargo test
47-
SSL=true COMPRESS=false cargo test --no-default-features --features default-rustls
46+
SSL=true COMPRESS=true cargo test --features rustls-tls,ring
4847
48+
SSL=true COMPRESS=false cargo check --no-default-features --features default-rustls
49+
SSL=true COMPRESS=false cargo check --no-default-features --features default-rustls-ring
4950
SSL=true COMPRESS=false cargo check --no-default-features --features minimal
5051
SSL=true COMPRESS=false cargo check --no-default-features --features minimal-rust
52+
SSL=true COMPRESS=false cargo check --no-default-features --features minimal,tracing
5153
env:
5254
RUST_BACKTRACE: 1
5355
DATABASE_URL: mysql://root:[email protected]:3306/mysql
@@ -82,9 +84,8 @@ jobs:
8284
displayName: Install Rust (Windows)
8385
- bash: |
8486
SSL=false COMPRESS=false cargo test
85-
SSL=true COMPRESS=false cargo test
87+
SSL=true COMPRESS=false cargo test --features native-tls-tls
8688
SSL=false COMPRESS=true cargo test
87-
SSL=true COMPRESS=true cargo test
8889
env:
8990
RUST_BACKTRACE: 1
9091
DATABASE_URL: mysql://root:[email protected]/mysql
@@ -96,6 +97,12 @@ jobs:
9697
strategy:
9798
maxParallel: 10
9899
matrix:
100+
v91:
101+
DB_VERSION: "9.1"
102+
v90:
103+
DB_VERSION: "9.0"
104+
v84:
105+
DB_VERSION: "8.4"
99106
v80:
100107
DB_VERSION: "8.0-debian"
101108
v57:
@@ -126,12 +133,19 @@ jobs:
126133
docker exec container bash -l -c "apt-get --allow-unauthenticated -y update"
127134
docker exec container bash -l -c "apt-get install -y curl clang libssl-dev pkg-config build-essential"
128135
docker exec container bash -l -c "curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable"
129-
displayName: Install Rust in docker
136+
displayName: Install Rust in docker (Debian)
137+
condition: or(eq(variables['DB_VERSION'], '5.6'), eq(variables['DB_VERSION'], '5.7-debian'), eq(variables['DB_VERSION'], '8.0-debian'))
138+
- bash: |
139+
docker exec container bash -l -c "microdnf install dnf"
140+
docker exec container bash -l -c "dnf group install \"Development Tools\""
141+
docker exec container bash -l -c "curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable"
142+
displayName: Install Rust in docker (RedHat)
143+
condition: not(or(eq(variables['DB_VERSION'], '5.6'), eq(variables['DB_VERSION'], '5.7-debian'), eq(variables['DB_VERSION'], '8.0-debian')))
130144
- bash: |
131145
if [[ "5.6" != "$(DB_VERSION)" ]]; then SSL=true; else DATABASE_URL="mysql://root2:[email protected]/mysql?secure_auth=false"; fi
132146
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL cargo test"
133147
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL COMPRESS=true cargo test"
134-
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=$SSL cargo test"
148+
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=$SSL cargo test --features native-tls-tls"
135149
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=$SSL COMPRESS=true cargo test"
136150
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=$SSL COMPRESS=true cargo test --no-default-features --features default-rustls"
137151
env:
@@ -145,16 +159,16 @@ jobs:
145159
strategy:
146160
maxParallel: 10
147161
matrix:
162+
v1162:
163+
DB_VERSION: "11.6.2"
164+
v1152:
165+
DB_VERSION: "11.5.2"
166+
v1144:
167+
DB_VERSION: "11.4.2"
148168
v113:
149-
DB_VERSION: "11.3"
169+
DB_VERSION: "11.3.2"
150170
v1011:
151-
DB_VERSION: "10.11"
152-
v106:
153-
DB_VERSION: "10.6"
154-
v105:
155-
DB_VERSION: "10.5"
156-
v104:
157-
DB_VERSION: "10.4"
171+
DB_VERSION: "10.11.10"
158172
steps:
159173
- bash: |
160174
sudo apt-get update
@@ -194,7 +208,7 @@ jobs:
194208
- bash: |
195209
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL cargo test"
196210
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL COMPRESS=true cargo test"
197-
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true cargo test"
211+
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true cargo test --features native-tls-tls"
198212
docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true COMPRESS=true cargo test"
199213
if [[ "10.1" != "$(DB_VERSION)" ]]; then docker exec container bash -l -c "cd \$HOME && DATABASE_URL=$DATABASE_URL SSL=true cargo test --no-default-features --features default-rustls"; fi
200214
env:
@@ -207,10 +221,14 @@ jobs:
207221
vmImage: "ubuntu-latest"
208222
strategy:
209223
matrix:
210-
v5.3.0:
211-
DB_VERSION: "v5.3.0"
212-
v5.0.6:
213-
DB_VERSION: "v5.0.6"
224+
v8.5.0:
225+
DB_VERSION: "v8.5.0"
226+
v7.6.0:
227+
DB_VERSION: "v7.6.0"
228+
v6.6.0:
229+
DB_VERSION: "v6.6.0"
230+
v5.4.3:
231+
DB_VERSION: "v5.4.3"
214232
steps:
215233
- bash: |
216234
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh

src/conn/mod.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,7 @@ impl Conn {
504504
self.inner.capabilities = handshake.capabilities() & self.inner.opts.get_capabilities();
505505
self.inner.version = handshake
506506
.maria_db_server_version_parsed()
507-
.map(|version| {
508-
self.inner.is_mariadb = true;
509-
version
510-
})
507+
.inspect(|_| self.inner.is_mariadb = true)
511508
.or_else(|| handshake.server_version_parsed())
512509
.unwrap_or((0, 0, 0));
513510
self.inner.id = handshake.connection_id();
@@ -982,7 +979,7 @@ impl Conn {
982979
/// Configures the connection based on server settings. In particular:
983980
///
984981
/// * It reads and stores socket address inside the connection unless if socket address is
985-
/// already in [`Opts`] or if `prefer_socket` is `false`.
982+
/// already in [`Opts`] or if `prefer_socket` is `false`.
986983
///
987984
/// * It reads and stores `max_allowed_packet` in the connection unless it's already in [`Opts`]
988985
///
@@ -1420,7 +1417,7 @@ mod test {
14201417
for (plug, val, pass) in variants {
14211418
dbg!((plug, val, pass, conn.inner.version));
14221419

1423-
if plug == "mysql_native_password" && conn.inner.version >= (9, 0, 0) {
1420+
if plug == "mysql_native_password" && conn.inner.version >= (8, 4, 0) {
14241421
continue;
14251422
}
14261423

@@ -1429,7 +1426,7 @@ mod test {
14291426
let query = format!("CREATE USER 'test_user'@'%' IDENTIFIED WITH {}", plug);
14301427
conn.query_drop(query).await.unwrap();
14311428

1432-
if conn.inner.version <= (8, 0, 11) {
1429+
if conn.inner.version < (8, 0, 11) {
14331430
conn.query_drop(format!("SET old_passwords = {}", val))
14341431
.await
14351432
.unwrap();
@@ -1572,7 +1569,7 @@ mod test {
15721569
};
15731570

15741571
for (i, plugin) in plugins.iter().enumerate() {
1575-
if *plugin == "mysql_native_password" && conn.server_version() >= (9, 0, 0) {
1572+
if *plugin == "mysql_native_password" && conn.server_version() >= (8, 4, 0) {
15761573
continue;
15771574
}
15781575

src/conn/pool/futures/disconnect_pool.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ impl Future for DisconnectPool {
6060
Some(drop) => match drop.send(None) {
6161
Ok(_) => {
6262
// Recycler is alive. Waiting for it to finish.
63-
Poll::Ready(Ok(ready!(Box::pin(drop.closed()).as_mut().poll(cx))))
63+
ready!(Box::pin(drop.closed()).as_mut().poll(cx));
64+
Poll::Ready(Ok(()))
6465
}
6566
Err(_) => {
6667
// Recycler seem dead. No one will wake us.

0 commit comments

Comments
 (0)