[mssql] Support single-quoted column aliases

This commit is contained in:
Nickolay Ponomarev 2019-05-11 22:12:35 +03:00
parent d0a782d8cc
commit 93c9000102
3 changed files with 30 additions and 7 deletions

View file

@ -212,6 +212,21 @@ fn parse_column_aliases() {
one_statement_parses_to("SELECT a.col + 1 newname FROM foo AS a", &sql);
}
#[test]
fn test_eof_after_as() {
let res = parse_sql_statements("SELECT foo AS");
assert_eq!(
ParserError::ParserError("Expected an identifier after AS, found: EOF".to_string()),
res.unwrap_err()
);
let res = parse_sql_statements("SELECT 1 FROM foo AS");
assert_eq!(
ParserError::ParserError("Expected an identifier after AS, found: EOF".to_string()),
res.unwrap_err()
);
}
#[test]
fn parse_select_count_wildcard() {
let sql = "SELECT COUNT(*) FROM customer";