server: fix remaining broken mysql queries
All checks were successful
Build and test / check (push) Successful in 2m48s
Build and test / build (push) Successful in 3m30s
Build and test / check-license (push) Successful in 4m52s
Build and test / test (push) Successful in 4m46s
Build and test / docs (push) Successful in 6m7s

This commit is contained in:
2025-12-14 15:22:37 +09:00
parent 920544ef3a
commit 919fd326ba
2 changed files with 26 additions and 20 deletions

View File

@@ -52,7 +52,7 @@ pub async fn complete_database_name(
) -> CompleteDatabaseNameResponse {
let result = sqlx::query(
r#"
SELECT `SCHEMA_NAME` AS `database`
SELECT CAST(`SCHEMA_NAME` AS CHAR(64)) AS `database`
FROM `information_schema`.`SCHEMATA`
WHERE `SCHEMA_NAME` NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys')
AND `SCHEMA_NAME` REGEXP ?
@@ -244,7 +244,7 @@ pub async fn list_databases(
let result = sqlx::query_as::<_, DatabaseRow>(
r#"
SELECT `SCHEMA_NAME` AS `database`
SELECT CAST(`SCHEMA_NAME` AS CHAR(64)) AS `database`
FROM `information_schema`.`SCHEMATA`
WHERE `SCHEMA_NAME` = ?
"#,
@@ -276,7 +276,7 @@ pub async fn list_all_databases_for_user(
) -> ListAllDatabasesResponse {
let result = sqlx::query_as::<_, DatabaseRow>(
r#"
SELECT `SCHEMA_NAME` AS `database`
SELECT CAST(`SCHEMA_NAME` AS CHAR(64)) AS `database`
FROM `information_schema`.`SCHEMATA`
WHERE `SCHEMA_NAME` NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys')
AND `SCHEMA_NAME` REGEXP ?