fix(core): preserve Rust 1.77 compatibility
This commit is contained in:
1 parent
010e588d64
commit
b276c0c646
2 files changed
+8
-6
No files matched your search
@@ -1629,11 +1629,13 @@ pub async fn list_tables_filtered(
|
||||
Ok(tables)
|
||||
}
|
||||
|
||||
// `Option::is_none_or` requires Rust 1.82, while DBX still supports Rust 1.77.2.
|
||||
#[allow(clippy::unnecessary_map_or)]
|
||||
fn should_fallback_empty_list_tables(filter: Option<&str>) -> bool {
|
||||
// MySQL proxies such as MyCat can return an empty information_schema.TABLES
|
||||
// even when SHOW TABLES exposes objects. Avoid the fallback for active
|
||||
// searches so normal MySQL "no match" queries do not rescan large schemas.
|
||||
!filter.is_some_and(|filter| !filter.trim().is_empty())
|
||||
filter.map_or(true, |filter| filter.trim().is_empty())
|
||||
}
|
||||
|
||||
fn filter_list_tables_fallback(
|
||||
|
||||
@@ -818,11 +818,11 @@ fn split_sql_statement_ranges_with_options(sql: &str, options: SqlParsingOptions
|
||||
in_backtick = !in_backtick;
|
||||
i += ch.len_utf8();
|
||||
}
|
||||
';' if !in_single_quote
|
||||
&& !in_double_quote
|
||||
&& !in_backtick
|
||||
&& custom_delimiter.is_none()
|
||||
&& !(options.profile.supports_custom_delimiter_commands && is_on_delimiter_line(sql, start, i)) =>
|
||||
';' if !(in_single_quote
|
||||
|| in_double_quote
|
||||
|| in_backtick
|
||||
|| custom_delimiter.is_some()
|
||||
|| (options.profile.supports_custom_delimiter_commands && is_on_delimiter_line(sql, start, i))) =>
|
||||
{
|
||||
let is_mysql_routine =
|
||||
options.profile.supports_mysql_routine_blocks && starts_with_mysql_routine_block(&sql[start..i]);
|
||||
|
||||
Reference in new issue
Block a user