Skip to content

Commit

Permalink
Fix(parser): add asc, desc to id var tokens (#1671)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas authored May 22, 2023
1 parent 028fa35 commit 1a88b17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sqlglot/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ class Parser(metaclass=_Parser):
TokenType.VAR,
TokenType.ANTI,
TokenType.APPLY,
TokenType.ASC,
TokenType.AUTO_INCREMENT,
TokenType.BEGIN,
TokenType.BOTH,
Expand All @@ -220,6 +221,7 @@ class Parser(metaclass=_Parser):
TokenType.CONSTRAINT,
TokenType.DEFAULT,
TokenType.DELETE,
TokenType.DESC,
TokenType.DESCRIBE,
TokenType.DIV,
TokenType.END,
Expand Down
2 changes: 2 additions & 0 deletions tests/fixtures/identity.sql
Original file line number Diff line number Diff line change
Expand Up @@ -822,3 +822,5 @@ SELECT NEXT VALUE FOR db.schema.sequence_name OVER (ORDER BY foo), col
SELECT PERCENTILE_CONT(x, 0.5) OVER ()
SELECT PERCENTILE_CONT(x, 0.5 RESPECT NULLS) OVER ()
SELECT PERCENTILE_CONT(x, 0.5 IGNORE NULLS) OVER ()
WITH my_cte AS (SELECT 'a' AS desc) SELECT desc AS description FROM my_cte
WITH my_cte AS (SELECT 'a' AS asc) SELECT asc AS description FROM my_cte

0 comments on commit 1a88b17

Please sign in to comment.