Skip to content

breaking(mysql): assume all non-binary collations compatible with str #3924

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

Merged
merged 1 commit into from
Jul 8, 2025
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
12 changes: 6 additions & 6 deletions .github/workflows/sqlx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
mariadb: [ verylatest, 11_4, 10_11, 10_4 ]
mariadb: [ verylatest, 11_8, 11_4, 10_11, 10_6 ]
runtime: [ async-std, tokio ]
tls: [ native-tls, rustls-aws-lc-rs, rustls-ring, none ]
needs: check
Expand All @@ -446,7 +446,7 @@ jobs:
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
SQLX_OFFLINE_DIR: .sqlx
RUSTFLAGS: --cfg mariadb_${{ matrix.mariadb }}
RUSTFLAGS: --cfg mariadb="${{ matrix.mariadb }}"

# Run the `test-attr` test again to cover cleanup.
- run: >
Expand All @@ -457,7 +457,7 @@ jobs:
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
SQLX_OFFLINE_DIR: .sqlx
RUSTFLAGS: --cfg mariadb_${{ matrix.mariadb }}
RUSTFLAGS: --cfg mariadb="${{ matrix.mariadb }}"

# Remove test artifacts
- run: cargo clean -p sqlx
Expand All @@ -471,7 +471,7 @@ jobs:
env:
SQLX_OFFLINE: true
SQLX_OFFLINE_DIR: .sqlx
RUSTFLAGS: -D warnings --cfg mariadb_${{ matrix.mariadb }}
RUSTFLAGS: -D warnings --cfg mariadb="${{ matrix.mariadb }}"

# Test macros in offline mode (still needs DATABASE_URL to run)
- run: >
Expand All @@ -483,7 +483,7 @@ jobs:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
SQLX_OFFLINE: true
SQLX_OFFLINE_DIR: .sqlx
RUSTFLAGS: --cfg mariadb_${{ matrix.mariadb }}
RUSTFLAGS: --cfg mariadb="${{ matrix.mariadb }}"

# client SSL authentication

Expand All @@ -500,4 +500,4 @@ jobs:
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root@localhost:3306/sqlx?sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fcerts%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt
RUSTFLAGS: --cfg mariadb_${{ matrix.mariadb }}
RUSTFLAGS: --cfg mariadb="${{ matrix.mariadb }}"
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ cast_sign_loss = 'deny'
# See `clippy.toml`
disallowed_methods = 'deny'

[lints.rust]
unexpected_cfgs = { level = 'warn', check-cfg = ['cfg(mariadb, values(any()))'] }

#
# Any
#
Expand Down
4 changes: 2 additions & 2 deletions sqlx-core/src/raw_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ impl<'q> RawSql<'q> {
///
/// Otherwise, you might want to add `LIMIT 1` to your query.
#[inline]
pub async fn fetch_optional<'e, E, DB>(self, executor: E) -> crate::Result<DB::Row>
pub async fn fetch_optional<'e, E, DB>(self, executor: E) -> crate::Result<Option<DB::Row>>
where
'q: 'e,
DB: Database,
E: Executor<'e, Database = DB>,
{
executor.fetch_one(self).await
executor.fetch_optional(self).await
}
}
Loading