diff options
author | Andi Albrecht <albrecht.andi@gmail.com> | 2014-03-03 07:55:06 +0100 |
---|---|---|
committer | Andi Albrecht <albrecht.andi@gmail.com> | 2014-03-03 07:55:06 +0100 |
commit | e6d86edf4454153c655ba548b5698a4dbe5a10fd (patch) | |
tree | 7319c7bdffffcc83946d6ba2312e7ea33947f233 /sqlparse/engine | |
parent | fcf41c86cd0f1370a5f77ffa83334c803e82157f (diff) | |
download | sqlparse-e6d86edf4454153c655ba548b5698a4dbe5a10fd.tar.gz |
Improve handling of NULL in aliased identifiers.
Diffstat (limited to 'sqlparse/engine')
-rw-r--r-- | sqlparse/engine/grouping.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index c11e5f0..bd97f41 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -117,6 +117,8 @@ def group_as(tlist): return not token.ttype in (T.DML, T.DDL) def _left_valid(token): + if token.ttype is T.Keyword and token.value in ('NULL'): + return True return token.ttype is not T.Keyword _group_left_right(tlist, T.Keyword, 'AS', sql.Identifier, @@ -233,6 +235,7 @@ def group_identifier_list(tlist): lambda t: t.ttype == T.Keyword, lambda t: isinstance(t, sql.Comparison), lambda t: isinstance(t, sql.Comment), + lambda t: t.ttype == T.Comment.Multiline, ] tcomma = tlist.token_next_match(idx, T.Punctuation, ',') start = None |