mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
re-add support for nested comments in mssql (#1754)
This commit is contained in:
parent
9e09b617e8
commit
d5dbe86da9
2 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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![
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue