re-add support for nested comments in mssql (#1754)

This commit is contained in:
Ophir LOJKINE 2025-03-01 07:13:33 +01:00 committed by GitHub
parent 9e09b617e8
commit d5dbe86da9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View file

@ -95,4 +95,9 @@ impl Dialect for MsSqlDialect {
fn supports_timestamp_versioning(&self) -> bool {
true
}
/// See <https://learn.microsoft.com/en-us/sql/t-sql/language-elements/slash-star-comment-transact-sql?view=sql-server-ver16>
fn supports_nested_comments(&self) -> bool {
true
}
}

View file

@ -1620,6 +1620,22 @@ fn parse_create_table_with_valid_options() {
}
}
#[test]
fn parse_nested_slash_star_comment() {
let sql = r#"
select
/*
comment level 1
/*
comment level 2
*/
*/
1;
"#;
let canonical = "SELECT 1";
ms().one_statement_parses_to(sql, canonical);
}
#[test]
fn parse_create_table_with_invalid_options() {
let invalid_cases = vec![