fix(sql-analysis): tolerate Oracle admin DDL in diagnostics

This commit is contained in:
zipg authored and GitHub committed 2026-09-20 11:06:40 +08:00
1 parent a67bbb4ed5
commit 88ba58a79c
9 files changed
+241 -99

No files matched your search

+7
View File
@@ -954,6 +954,13 @@ fn split_sql_statement_ranges(sql: &str) -> Vec<SqlStatementRange> {
split_sql_statement_ranges_with_options(sql, SqlParsingOptions::default())
}
/// Statement ranges that keep their byte offsets into `sql`, so callers can rewrite
/// individual statements in place (see the Oracle administrative DDL tolerance in
/// `sql_analysis`).
pub(crate) fn statement_ranges_for_database(sql: &str, db_type: DatabaseType) -> Vec<SqlStatementRange> {
split_sql_statement_ranges_with_options(sql, SqlParsingOptions::for_database_type(db_type))
}
fn split_sql_statement_ranges_with_options(sql: &str, options: SqlParsingOptions) -> Vec<SqlStatementRange> {
let mut ranges = Vec::new();
let mut start = 0;