File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ Bug Fixes
2323* Fix parsing of nested order clauses (issue745, pr746 by john-bodley).
2424* Thread-safe initialization of Lexer class (issue730).
2525* Classify TRUNCATE as DDL and GRANT/REVOKE as DCL keywords (based on pr719
26- by josuc1, thanks for bringing this up!)
26+ by josuc1, thanks for bringing this up!).
27+ * Fix parsing of PRIMARY KEY (issue740).
2728
2829
2930Release 0.4.4 (Apr 18, 2023)
Original file line number Diff line number Diff line change 7777 (r'DOUBLE\s+PRECISION\b' , tokens .Name .Builtin ),
7878 (r'GROUP\s+BY\b' , tokens .Keyword ),
7979 (r'ORDER\s+BY\b' , tokens .Keyword ),
80+ (r'PRIMARY\s+KEY\b' , tokens .Keyword ),
8081 (r'HANDLER\s+FOR\b' , tokens .Keyword ),
8182 (r'GO(\s\d+)\b' , tokens .Keyword ),
8283 (r'(LATERAL\s+VIEW\s+)'
Original file line number Diff line number Diff line change @@ -444,3 +444,9 @@ def test_copy_issue672():
444444 p = sqlparse .parse ('select * from foo' )[0 ]
445445 copied = copy .deepcopy (p )
446446 assert str (p ) == str (copied )
447+
448+
449+ def test_primary_key_issue740 ():
450+ p = sqlparse .parse ('PRIMARY KEY' )[0 ]
451+ assert len (p .tokens ) == 1
452+ assert p .tokens [0 ].ttype == T .Keyword
You can’t perform that action at this time.
0 commit comments