File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -484,6 +484,11 @@ class Parser(parser.Parser):
484
484
TokenType .SHOW : lambda self : self ._parse_show (),
485
485
}
486
486
487
+ SET_PARSERS = {
488
+ ** parser .Parser .SET_PARSERS ,
489
+ "VARIABLE" : lambda self : self ._parse_set_item_assignment ("VARIABLE" ),
490
+ }
491
+
487
492
def _parse_lambda (self , alias : bool = False ) -> t .Optional [exp .Expression ]:
488
493
index = self ._index
489
494
if not self ._match_text_seq ("LAMBDA" ):
Original file line number Diff line number Diff line change @@ -1686,3 +1686,12 @@ def test_extract_date_parts(self):
1686
1686
with self .subTest (f"Testing DuckDB EXTRACT({ part } FROM foo)" ):
1687
1687
# All of these should remain as is, they don't have synonyms
1688
1688
self .validate_identity (f"EXTRACT({ part } FROM foo)" )
1689
+
1690
+ def test_set_item (self ):
1691
+ self .validate_identity ("SET memory_limit = '10GB'" )
1692
+ self .validate_identity ("SET SESSION default_collation = 'nocase'" )
1693
+ self .validate_identity ("SET GLOBAL sort_order = 'desc'" )
1694
+ self .validate_identity ("SET VARIABLE my_var = 30" )
1695
+ self .validate_identity ("SET VARIABLE location_map = (SELECT foo FROM bar)" )
1696
+
1697
+ self .validate_identity ("SET VARIABLE my_var TO 30" , "SET VARIABLE my_var = 30" )
You can’t perform that action at this time.
0 commit comments