Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqlx-macros/src/derives/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ macro_rules! assert_attribute {

macro_rules! fail {
($t:expr, $m:expr) => {
return Err(syn::Error::new_spanned($t, $m));
return Err(syn::Error::new_spanned($t, $m))
};
}

Expand Down
3 changes: 2 additions & 1 deletion sqlx-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ macro_rules! __test_prepared_type {
#[macro_export]
macro_rules! MySql_query_for_test_prepared_type {
() => {
"SELECT {0} <=> ?, {0}, ?"
// MySQL 8.0.27 changed `<=>` to return an unsigned integer
"SELECT CAST({0} <=> ? AS SIGNED INTEGER), {0}, ?"
};
}

Expand Down
6 changes: 4 additions & 2 deletions tests/mysql/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ mod json_tests {

test_type!(json<JsonValue>(
MySql,
"SELECT CAST({0} AS BINARY) <=> CAST(? AS BINARY), CAST({0} AS BINARY) as _2, ? as _3",
// MySQL 8.0.27 changed `<=>` to return an unsigned integer
"SELECT CAST(CAST({0} AS BINARY) <=> CAST(? AS BINARY) AS SIGNED INTEGER), CAST({0} AS BINARY) as _2, ? as _3",
"'\"Hello, World\"'" == json!("Hello, World"),
"'\"😎\"'" == json!("😎"),
"'\"🙋‍♀️\"'" == json!("🙋‍♀️"),
Expand All @@ -250,7 +251,8 @@ mod json_tests {

test_type!(json_struct<Json<Friend>>(
MySql,
"SELECT CAST({0} AS BINARY) <=> CAST(? AS BINARY), CAST({0} AS BINARY) as _2, ? as _3",
// MySQL 8.0.27 changed `<=>` to return an unsigned integer
"SELECT CAST(CAST({0} AS BINARY) <=> CAST(? AS BINARY) AS SIGNED INTEGER), CAST({0} AS BINARY) as _2, ? as _3",
"\'{\"name\":\"Joe\",\"age\":33}\'" == Json(Friend { name: "Joe".to_string(), age: 33 })
));

Expand Down