Skip to content

Commit 6bb1c71

Browse files
authored
preparing 0.5.6 release (#1382)
* fix(pool): reenable connection reaper * fix warnings * chore: bump published crates to 0.5.6 * chore: update CHANGELOG.md for 0.5.6
1 parent 774880d commit 6bb1c71

File tree

11 files changed

+64
-38
lines changed

11 files changed

+64
-38
lines changed

CHANGELOG.md

+33
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.5.6 - 2021-08-16
9+
10+
A large bugfix release, including but not limited to:
11+
12+
* [[#1329]] Implement `MACADDR` type for Postgres [[@nomick]]
13+
* [[#1363]] Fix `PortalSuspended` for array of composite types in Postgres [[@AtkinsChang]]
14+
* [[#1320]] Reimplement `sqlx::Pool` internals using `futures-intrusive` [[@abonander]]
15+
* This addresses a number of deadlocks/stalls on acquiring connections from the pool.
16+
* [[#1332]] Macros: tell the compiler about external files/env vars to watch [[@abonander]]
17+
* Includes `sqlx build-script` to create a `build.rs` to watch `migrations/` for changes.
18+
* Nightly users can try `RUSTFLAGS=--cfg sqlx_macros_unstable` to tell the compiler
19+
to watch `migrations/` for changes instead of using a build script.
20+
* See the new section in the docs for `sqlx::migrate!()` for details.
21+
* [[#1351]] Fix a few sources of segfaults/errors in SQLite driver [[@abonander]]
22+
* Includes contributions from [[@link2ext]] and [[@madadam]].
23+
* [[#1323]] Keep track of column typing in SQLite EXPLAIN parsing [[@marshoepial]]
24+
* This fixes errors in the macros when using `INSERT/UPDATE/DELETE ... RETURNING ...` in SQLite.
25+
26+
[A total of 25 pull requests][0.5.6-prs] were merged this release cycle!
27+
28+
[#1329]: https://github.com/launchbadge/sqlx/pull/1329
29+
[#1363]: https://github.com/launchbadge/sqlx/pull/1363
30+
[#1320]: https://github.com/launchbadge/sqlx/pull/1320
31+
[#1332]: https://github.com/launchbadge/sqlx/pull/1332
32+
[#1351]: https://github.com/launchbadge/sqlx/pull/1351
33+
[#1323]: https://github.com/launchbadge/sqlx/pull/1323
34+
[0.5.6-prs]: https://github.com/launchbadge/sqlx/pulls?q=is%3Apr+is%3Amerged+merged%3A2021-05-24..2021-08-17
35+
836
## 0.5.5 - 2021-05-24
937

1038
- [[#1242]] Fix infinite loop at compile time when using query macros [[@toshokan]]
@@ -925,3 +953,8 @@ Fix docs.rs build by enabling a runtime feature in the docs.rs metadata in `Carg
925953
[@feikesteenbergen]: https://github.com/feikesteenbergen
926954
[@etcaton]: https://github.com/ETCaton
927955
[@toshokan]: https://github.com/toshokan
956+
[@nomick]: https://github.com/nomick
957+
[@marshoepial]: https://github.com/marshoepial
958+
[@link2ext]: https://github.com/link2ext
959+
[@madadam]: https://github.com/madadam
960+
[@AtkinsChang]: https://github.com/AtkinsChang

Cargo.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ members = [
1818

1919
[package]
2020
name = "sqlx"
21-
version = "0.5.5"
21+
version = "0.5.6"
2222
license = "MIT OR Apache-2.0"
2323
readme = "README.md"
2424
repository = "https://github.com/launchbadge/sqlx"

sqlx-cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-cli"
3-
version = "0.5.5"
3+
version = "0.5.6"
44
description = "Command-line utility for SQLx, the Rust SQL toolkit."
55
edition = "2018"
66
readme = "README.md"

sqlx-core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-core"
3-
version = "0.5.5"
3+
version = "0.5.6"
44
repository = "https://github.com/launchbadge/sqlx"
55
description = "Core of SQLx, the rust SQL toolkit. Not intended to be used directly."
66
license = "MIT OR Apache-2.0"

sqlx-core/src/pool/connection.rs

-7
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,6 @@ impl<DB: Database> DerefMut for Idle<DB> {
132132
}
133133
}
134134

135-
impl<'s, C> Floating<'s, C> {
136-
pub fn into_leakable(self) -> C {
137-
self.guard.cancel();
138-
self.inner
139-
}
140-
}
141-
142135
impl<'s, DB: Database> Floating<'s, Live<DB>> {
143136
pub fn new_live(conn: DB::Connection, guard: DecrementSizeGuard<'s>) -> Self {
144137
Self {

sqlx-core/src/pool/inner.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ use crate::connection::Connection;
44
use crate::database::Database;
55
use crate::error::Error;
66
use crate::pool::{deadline_as_timeout, PoolOptions};
7-
use crossbeam_queue::{ArrayQueue, SegQueue};
8-
use futures_core::task::{Poll, Waker};
7+
use crossbeam_queue::ArrayQueue;
8+
99
use futures_intrusive::sync::{Semaphore, SemaphoreReleaser};
10-
use futures_util::future;
10+
1111
use std::cmp;
1212
use std::mem;
1313
use std::ptr;
1414
use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
15-
use std::sync::{Arc, Weak};
16-
use std::task::Context;
15+
use std::sync::Arc;
16+
1717
use std::time::{Duration, Instant};
1818

1919
/// Ihe number of permits to release to wake all waiters, such as on `SharedPool::close()`.
@@ -90,7 +90,7 @@ impl<DB: Database> SharedPool<DB> {
9090
.await;
9191

9292
while let Some(idle) = self.idle_conns.pop() {
93-
idle.live.float(self).close().await;
93+
let _ = idle.live.float(self).close().await;
9494
}
9595
}
9696

@@ -322,16 +322,16 @@ fn spawn_reaper<DB: Database>(pool: &Arc<SharedPool<DB>>) {
322322
(None, None) => return,
323323
};
324324

325-
// let pool = Arc::clone(&pool);
326-
//
327-
// sqlx_rt::spawn(async move {
328-
// while !pool.is_closed() {
329-
// if !pool.idle_conns.is_empty() {
330-
// do_reap(&pool).await;
331-
// }
332-
// sqlx_rt::sleep(period).await;
333-
// }
334-
// });
325+
let pool = Arc::clone(&pool);
326+
327+
sqlx_rt::spawn(async move {
328+
while !pool.is_closed() {
329+
if !pool.idle_conns.is_empty() {
330+
do_reap(&pool).await;
331+
}
332+
sqlx_rt::sleep(period).await;
333+
}
334+
});
335335
}
336336

337337
async fn do_reap<DB: Database>(pool: &SharedPool<DB>) {

sqlx-core/src/postgres/types/money.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::{
66
types::Type,
77
};
88
use byteorder::{BigEndian, ByteOrder};
9-
use std::convert::TryFrom;
109
use std::{
1110
io,
1211
ops::{Add, AddAssign, Sub, SubAssign},
@@ -97,6 +96,8 @@ impl PgMoney {
9796
/// [`Decimal`]: crate::types::Decimal
9897
#[cfg(feature = "decimal")]
9998
pub fn from_decimal(mut decimal: rust_decimal::Decimal, locale_frac_digits: u32) -> Self {
99+
use std::convert::TryFrom;
100+
100101
// this is all we need to convert to our expected locale's `frac_digits`
101102
decimal.rescale(locale_frac_digits);
102103

sqlx-core/src/sqlite/statement/handle.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ use libsqlite3_sys::{
1414
sqlite3_column_bytes, sqlite3_column_count, sqlite3_column_database_name,
1515
sqlite3_column_decltype, sqlite3_column_double, sqlite3_column_int, sqlite3_column_int64,
1616
sqlite3_column_name, sqlite3_column_origin_name, sqlite3_column_table_name,
17-
sqlite3_column_type, sqlite3_column_value, sqlite3_db_handle, sqlite3_finalize, sqlite3_reset,
18-
sqlite3_sql, sqlite3_step, sqlite3_stmt, sqlite3_stmt_readonly, sqlite3_table_column_metadata,
19-
sqlite3_value, SQLITE_DONE, SQLITE_MISUSE, SQLITE_OK, SQLITE_ROW, SQLITE_TRANSIENT,
20-
SQLITE_UTF8,
17+
sqlite3_column_type, sqlite3_column_value, sqlite3_db_handle, sqlite3_finalize, sqlite3_sql,
18+
sqlite3_stmt, sqlite3_stmt_readonly, sqlite3_table_column_metadata, sqlite3_value,
19+
SQLITE_MISUSE, SQLITE_OK, SQLITE_TRANSIENT, SQLITE_UTF8,
2120
};
2221

2322
use crate::error::{BoxDynError, Error};

sqlx-macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-macros"
3-
version = "0.5.5"
3+
version = "0.5.6"
44
repository = "https://github.com/launchbadge/sqlx"
55
description = "Macros for SQLx, the rust SQL toolkit. Not intended to be used directly."
66
license = "MIT OR Apache-2.0"

sqlx-rt/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-rt"
3-
version = "0.5.5"
3+
version = "0.5.6"
44
repository = "https://github.com/launchbadge/sqlx"
55
license = "MIT OR Apache-2.0"
66
description = "Runtime abstraction used by SQLx, the Rust SQL toolkit. Not intended to be used directly."

0 commit comments

Comments
 (0)