diff options
-rw-r--r-- | sqlparse/engine/grouping.py | 4 | ||||
-rw-r--r-- | tests/test_grouping.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index d250e18..86d8fc6 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -343,9 +343,9 @@ def group_functions(tlist): has_table = False has_as = False for tmp_token in tlist.tokens: - if tmp_token.value == 'CREATE': + if tmp_token.value.upper() == 'CREATE': has_create = True - if tmp_token.value == 'TABLE': + if tmp_token.value.upper() == 'TABLE': has_table = True if tmp_token.value == 'AS': has_as = True diff --git a/tests/test_grouping.py b/tests/test_grouping.py index 8c034f9..546ad4b 100644 --- a/tests/test_grouping.py +++ b/tests/test_grouping.py @@ -660,3 +660,7 @@ def test_grouping_as_cte(): assert p[0].get_alias() is None assert p[2].value == 'AS' assert p[4].value == 'WITH' + +def test_grouping_create_table(): + p = sqlparse.parse("create table db.tbl (a string)")[0].tokens + assert p[4].value == "db.tbl" |