Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare a diesel 2.2.2 release #4122

Merged
merged 8 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ Increasing the minimal supported Rust version will always be coupled at least wi

## Unreleased

## [2.2.2] 2024-07-19

### Fixed

* Support for libsqlite3-sys 0.29.0
* Fixed a potential panic in the sqlite cursor implementation
* Fixed support for rust numeric operators with columns of the type `Numeric`
* Removed the `SerializedDatabase::new` function due to unsoundness

## [2.2.1] 2024-06-12

## Fixed
Expand Down Expand Up @@ -2116,3 +2125,5 @@ queries or set `PIPES_AS_CONCAT` manually.
[2.1.5]: https://github.com/diesel-rs/diesel/compare/v.2.1.4...v2.1.5
[2.1.6]: https://github.com/diesel-rs/diesel/compare/v.2.1.5...v2.1.6
[2.2.0]: https://github.com/diesel-rs/diesel/compare/v.2.1.0...v2.2.0
[2.2.1]: https://github.com/diesel-rs/diesel/compare/v.2.2.0...v2.2.1
[2.2.2]: https://github.com/diesel-rs/diesel/compare/v.2.2.1...v2.2.2
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ members = [
rust-version = "1.78.0"
include = ["src/**/*.rs", "tests/**/*.rs", "LICENSE-*", "README.md"]

[workspace.dependencies]
libsqlite3-sys = "0.29"

# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
Expand Down
5 changes: 3 additions & 2 deletions diesel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel"
version = "2.2.1"
version = "2.2.2"
license = "MIT OR Apache-2.0"
description = "A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL"
readme = "README.md"
Expand All @@ -24,7 +24,7 @@ include = [
byteorder = { version = "1.0", optional = true }
chrono = { version = "0.4.20", optional = true, default-features = false, features = ["clock", "std"] }
libc = { version = "0.2.0", optional = true }
libsqlite3-sys = { version = ">=0.17.2, <0.29.0", optional = true, features = ["bundled_bindings"] }
libsqlite3-sys = { version = ">=0.17.2, <0.30.0", optional = true, features = ["bundled_bindings"] }
mysqlclient-sys = { version = ">=0.2.5, <0.5.0", optional = true }
mysqlclient-src = { version = "0.1.0", optional = true }
pq-sys = { version = ">=0.4.0, <0.7.0", optional = true }
Expand Down Expand Up @@ -54,6 +54,7 @@ cfg-if = "1"
dotenvy = "0.15"
ipnetwork = ">=0.12.2, <0.21.0"
quickcheck = "1.0.3"
tempfile = "3.10.1"

[features]
default = ["with-deprecated", "32-column-tables"]
Expand Down
2 changes: 1 addition & 1 deletion diesel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
//! with the `bundled` feature as a dependency to your crate so SQLite will be bundled:
//! ```toml
//! [dependencies]
//! libsqlite3-sys = { version = "0.25.2", features = ["bundled"] }
//! libsqlite3-sys = { version = "0.29", features = ["bundled"] }
//! ```
//! - `postgres`: This feature enables the diesel postgres backend. Enabling this feature requires a compatible
//! copy of `libpq` for your target architecture. This features implies `postgres_backend`
Expand Down
4 changes: 0 additions & 4 deletions diesel/src/mysql/types/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ where
}

fn f32_to_i64(f: f32) -> deserialize::Result<i64> {
use std::i64;

if f <= i64::MAX as f32 && f >= i64::MIN as f32 {
Ok(f.trunc() as i64)
} else {
Expand All @@ -35,8 +33,6 @@ fn f32_to_i64(f: f32) -> deserialize::Result<i64> {
}

fn f64_to_i64(f: f64) -> deserialize::Result<i64> {
use std::i64;

if f <= i64::MAX as f64 && f >= i64::MIN as f64 {
Ok(f.trunc() as i64)
} else {
Expand Down
8 changes: 4 additions & 4 deletions diesel/src/pg/types/money.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ fn add_assign_money() {
#[test]
#[should_panic(expected = "overflow adding money amounts")]
fn add_money_overflow() {
let c1 = PgMoney(::std::i64::MAX);
let c1 = PgMoney(i64::MAX);
let c2 = PgMoney(1);
let _overflow = c1 + c2;
}

#[test]
#[should_panic(expected = "overflow adding money amounts")]
fn add_assign_money_overflow() {
let mut c1 = PgMoney(::std::i64::MAX);
let mut c1 = PgMoney(i64::MAX);
c1 += PgMoney(1);
}

Expand All @@ -146,14 +146,14 @@ fn sub_assign_money() {
#[test]
#[should_panic(expected = "underflow subtracting money amounts")]
fn sub_money_underflow() {
let c1 = PgMoney(::std::i64::MIN);
let c1 = PgMoney(i64::MIN);
let c2 = PgMoney(1);
let _underflow = c1 - c2;
}

#[test]
#[should_panic(expected = "underflow subtracting money amounts")]
fn sub_assign_money_underflow() {
let mut c1 = PgMoney(::std::i64::MIN);
let mut c1 = PgMoney(i64::MIN);
c1 -= PgMoney(1);
}
4 changes: 2 additions & 2 deletions diesel/src/query_dsl/load_dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ mod private {
#[diagnostic::on_unimplemented(
note = "this is a mismatch between what your query returns and what your type expects the query to return",
note = "the fields in your struct need to match the fields returned by your query in count, order and type",
note = "consider using `#[derive(Selectable)]` + `#[diesel(check_for_backend({DB}))]` on your struct `{U}` and \n\
in your query `.select({U}::as_select())` to get a better error message"
note = "consider using `#[derive(Selectable)]` or #[derive(QueryableByName)] + `#[diesel(check_for_backend({DB}))]` \n\
on your struct `{U}` and in your query `.select({U}::as_select())` to get a better error message"
)]
pub trait CompatibleType<U, DB> {
type SqlType;
Expand Down
Loading
Loading