mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-29 18:34:04 +00:00
Add MSSQL dialect and fix up the postgres' identifier rules
The `@@version` test is MS' dialect of SQL, it seems, so test it with
its own dialect.
Update the rules for identifiers in Postresql dialect per documentation,
while we're at it. The current identifier rules in Postgresql dialect
were introduced in this commit - as a copy of generic rules, it seems:
810cd8e6cf (diff-2808df0fba0aed85f9d35c167bd6a5f1L138)
This commit is contained in:
parent
5047f2c02e
commit
304710d59a
8 changed files with 75 additions and 15 deletions
|
@ -1171,11 +1171,13 @@ fn parse_invalid_subquery_without_parens() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic(expected = "Parse results with PostgreSqlDialect are different from AnsiSqlDialect")]
|
||||
#[should_panic(
|
||||
expected = "Parse results with GenericSqlDialect are different from PostgreSqlDialect"
|
||||
)]
|
||||
fn ensure_multiple_dialects_are_tested() {
|
||||
// The SQL here must be parsed differently by different dialects.
|
||||
// At the time of writing, `@foo` is accepted as a valid identifier
|
||||
// by the generic and the postgresql dialect, but not by the ANSI one.
|
||||
// by the Generic and the MSSQL dialect, but not by Postgres and ANSI.
|
||||
let _ = parse_sql_statements("SELECT @foo");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue