diff options
| author | Aki Ariga <chezou+github@gmail.com> | 2022-05-03 00:33:01 -0700 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2022-08-24 21:08:17 +0200 |
| commit | 7de1999a0af9dbbd09f0afb3a50383ad91c22c4c (patch) | |
| tree | 631532bb4b3d5d2af10260bdfaac17a16e03d7de /sqlparse | |
| parent | 4862d68ef15617266c8cc8174beb705fb388ec20 (diff) | |
| download | sqlparse-7de1999a0af9dbbd09f0afb3a50383ad91c22c4c.tar.gz | |
CREATE TABLE tbl AS SELECT should return get_alias() for its column
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/engine/grouping.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index 2fb0a4c..d250e18 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -341,12 +341,15 @@ def group_aliased(tlist): def group_functions(tlist): has_create = False has_table = False + has_as = False for tmp_token in tlist.tokens: if tmp_token.value == 'CREATE': has_create = True if tmp_token.value == 'TABLE': has_table = True - if has_create and has_table: + if tmp_token.value == 'AS': + has_as = True + if has_create and has_table and not has_as: return tidx, token = tlist.token_next_by(t=T.Name) |
