Skip to content

[email protected]` broke test fixture setup #3825

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

Closed
CodingAnarchy opened this issue Apr 14, 2025 · 2 comments · Fixed by #3824
Closed

[email protected]` broke test fixture setup #3825

CodingAnarchy opened this issue Apr 14, 2025 · 2 comments · Fixed by #3824
Labels
bug regression Something worked before but doesn't now

Comments

@CodingAnarchy
Copy link

I have found these related issues/pull requests

Dependabot opened a PR to update sqlx and we are seeing test failures in CI with the following errori (running MySQL 8.0):

failed to connect to setup test database: Database(MySqlDatabaseError { code: Some("42000"), number: 1170, message: "BLOB/TEXT column 'db_name' used in key specification without a key length" })

I tried to replicate locally (running MySQL 8.4), and I get a different error in the same place:

failed to connect to setup test database: Database(MySqlDatabaseError { code: Some("42000"), number: 1064, message: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"_sqlx_test_Ylj2v2hx__h1aECWV42suiB3FA7wWvFMWM8xQ0Hk3Y_zXr6_hQg2\"' at line 1" })

Description

Error setting up test fixture database.

Reproduction steps

Run cargo test on a codebase that includes a fixture while running MySQL 8.0+.

SQLx version

0.8.4

Enabled SQLx features

mysql,migrate,runtime-tokio,chrono,tls-rustls

Database server and version

MySQL

Operating system

Linux / MacOS

Rust version

1.86.0

@abonander
Copy link
Collaborator

This must be related to #3334.

@abonander
Copy link
Collaborator

I think this wasn't caught by the tests because it doesn't run the test-attr.rs integration test twice.

@abonander abonander added the regression Something worked before but doesn't now label Apr 15, 2025
abonander added a commit that referenced this issue Apr 15, 2025
* fix(cli): correctly handle `.env` files again

* feat(ci): add functionality tests for sqlx-cli (MySQL)

* feat(ci): add functionality tests for sqlx-cli (Postgres)

* feat(ci): add functionality tests for sqlx-cli (SQLite)

* chore: prepare 0.8.5 release

* feat(ci): run `test-attr` tests twice to catch #3825

* fix: correct bugs in MySQL implementation of `#[sqlx::test]`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug regression Something worked before but doesn't now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants