diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2016-05-29 08:46:49 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2016-05-29 08:46:49 +0200 |
| commit | da82fa289773bb2b080d9dcd8eb7d60dbd8916f2 (patch) | |
| tree | cf7f98b3fef2bd38e9c9678e816d5a7177c343b9 /sqlparse | |
| parent | fdb12571c0f557542f92901e3e6db9ee5b7602c7 (diff) | |
| parent | cc8e4f1b0321d65d244825b1006de68f8952e071 (diff) | |
| download | sqlparse-da82fa289773bb2b080d9dcd8eb7d60dbd8916f2.tar.gz | |
Merge pull request #242 from tenghuanhe/master
CREATE TABLE should not be parsed as Function
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/engine/grouping.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index e30abab..f7953e7 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -220,6 +220,15 @@ def group_typecasts(tlist): @recurse(sql.Function) def group_functions(tlist): + has_create = False + has_table = False + for tmp_token in tlist.tokens: + if tmp_token.value == u'CREATE': + has_create = True + if tmp_token.value == u'TABLE': + has_table = True + if has_create and has_table: + return token = tlist.token_next_by(t=T.Name) while token: next_ = tlist.token_next(token) |
