mirror of
https://github.com/launchbadge/sqlx
synced 2024-12-05 01:59:10 +00:00
fix(mysql): percent-decode database name (#3612)
Duplicates the fix to Postgres in #3593 to the MySQL driver.
The SQLite driver already does this: e3ef8baf23/sqlx-sqlite/src/options/parse.rs (L29-L32)
This commit is contained in:
parent
94607b5a10
commit
35f3ec1944
1 changed files with 5 additions and 1 deletions
|
@ -38,7 +38,11 @@ impl MySqlConnectOptions {
|
|||
|
||||
let path = url.path().trim_start_matches('/');
|
||||
if !path.is_empty() {
|
||||
options = options.database(path);
|
||||
options = options.database(
|
||||
&percent_decode_str(path)
|
||||
.decode_utf8()
|
||||
.map_err(Error::config)?,
|
||||
);
|
||||
}
|
||||
|
||||
for (key, value) in url.query_pairs().into_iter() {
|
||||
|
|
Loading…
Reference in a new issue