summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2013-04-20 08:32:08 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2013-04-20 08:32:08 +0200
commitfd480bf40646cdb53bce377db5d11dc52a760dad (patch)
tree59bea5608c5b8c580e9dc426e9a2d79161f99af9 /sqlparse
parent90ebf68e551805a30cf7c9907f04f7038e941b5a (diff)
downloadsqlparse-fd480bf40646cdb53bce377db5d11dc52a760dad.tar.gz
Allow NULL keyword in assignments (fixes #90).
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/engine/grouping.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py
index d60ee5a..07f9392 100644
--- a/sqlparse/engine/grouping.py
+++ b/sqlparse/engine/grouping.py
@@ -125,7 +125,9 @@ def group_comparison(tlist):
return (token.ttype in (T.String.Symbol, T.Name, T.Number,
T.Number.Integer, T.Literal,
T.Literal.Number.Integer)
- or isinstance(token, (sql.Identifier,)))
+ or isinstance(token, (sql.Identifier,))
+ or (token.ttype is T.Keyword
+ and token.value.upper() in ['NULL', ]))
_group_left_right(tlist, T.Operator.Comparison, None, sql.Comparison,
check_left=_parts_valid, check_right=_parts_valid)