Skip to content

Commit 1bcb2d9

Browse files
authored
Merge branch 'master' into fix-alter-table-row-format-keyword-773
2 parents 26d7d65 + ac3b9e0 commit 1bcb2d9

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎AUTHORS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Alphabetical list of contributors:
8282
* Victor Hahn <[email protected]>
8383
* Victor Uriarte <[email protected]>
8484
* Ville Skyttä <[email protected]>
85+
* Vincent Gao <[email protected]>
8586
* vthriller <[email protected]>
8687
* wayne.wuw <[email protected]>
8788
* Will Jones <[email protected]>

‎CHANGELOG‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Bug Fixes
3636
* Recognize ``ROW_FORMAT`` as a keyword so that ``ALTER TABLE ... ROW_FORMAT=...``
3737
no longer merges the table name and the option into a single identifier
3838
(issue773).
39+
* Recognize ``MATERIALIZED`` as a keyword so it is parsed and formatted
40+
consistently in ``CREATE MATERIALIZED VIEW`` statements (issue752).
3941

4042

4143
Release 0.5.5 (Dec 19, 2025)

‎sqlparse/keywords.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@
359359
# 'M': tokens.Keyword,
360360
'MAP': tokens.Keyword,
361361
'MATCH': tokens.Keyword,
362+
'MATERIALIZED': tokens.Keyword,
362363
'MAXEXTENTS': tokens.Keyword,
363364
'MAXVALUE': tokens.Keyword,
364365
'MESSAGE_LENGTH': tokens.Keyword,

‎tests/test_regressions.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,14 @@ def test_alter_table_row_format_issue773():
469469
assert e.tokens[4].get_real_name() == 'mytable'
470470

471471

472+
def test_materialized_view_issue752():
473+
p = sqlparse.parse('CREATE MATERIALIZED VIEW v AS SELECT 1')[0]
474+
assert p.tokens[2].ttype == T.Keyword
475+
formatted = sqlparse.format('create materialized view v as select 1',
476+
keyword_case='upper')
477+
assert formatted == 'CREATE MATERIALIZED VIEW v AS SELECT 1'
478+
479+
472480
@pytest.fixture
473481
def limit_recursion():
474482
curr_limit = sys.getrecursionlimit()

0 commit comments

Comments
 (0)