Skip to content

Commit d23218e

Browse files
committed
[UNPIVOT] Revert to mandatory AS keyword for value aliases
1 parent 1e9dc2f commit d23218e

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16257,7 +16257,7 @@ impl<'a> Parser<'a> {
1625716257
let name = self.parse_identifier()?;
1625816258
self.expect_keyword_is(Keyword::IN)?;
1625916259
let columns = self.parse_parenthesized_column_list_inner(Mandatory, false, |p| {
16260-
p.parse_expr_with_alias_optional_as_keyword()
16260+
p.parse_expr_with_alias()
1626116261
})?;
1626216262
self.expect_token(&Token::RParen)?;
1626316263
let alias = self.maybe_parse_table_alias()?;

tests/sqlparser_common.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11578,12 +11578,6 @@ fn parse_unpivot_table() {
1157811578
verified_stmt(sql_unpivot_with_alias_and_multi_value_and_qualifier).to_string(),
1157911579
sql_unpivot_with_alias_and_multi_value_and_qualifier
1158011580
);
11581-
11582-
// optional AS keyword for unpivot value aliases
11583-
one_statement_parses_to(
11584-
"SELECT * FROM sales s UNPIVOT(q FOR quarter IN (Q1 Quater1, Q2 Quater2))",
11585-
"SELECT * FROM sales s UNPIVOT(q FOR quarter IN (Q1 AS Quater1, Q2 AS Quater2))",
11586-
);
1158711581
}
1158811582

1158911583
#[test]

0 commit comments

Comments
 (0)