summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2011-09-29 11:21:01 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2011-09-29 11:21:01 +0200
commit2a63e68ba78f2508da00c7cfd3244688232e4b91 (patch)
tree20ab7d3f53aa343da3a613cd9324e7b6993e2264
parent13c1d716a7798ae1a79c524dc967e9a33c534ff4 (diff)
downloadsqlparse-2a63e68ba78f2508da00c7cfd3244688232e4b91.tar.gz
Allow CASE statements as identifiers (fixes issue46).
-rw-r--r--CHANGES1
-rw-r--r--sqlparse/engine/grouping.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 7a1c87d..42433bc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,7 @@ Bug Fixes
* Avoid "stair case" effects when identifiers and functions are mixed
in identifier lists (issue45).
* Make keyword detection more restrict (issue47).
+ * Improve handling of CASE statements (issue46).
Release 0.1.3 (Jul 29, 2011)
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py
index f92a812..a024016 100644
--- a/sqlparse/engine/grouping.py
+++ b/sqlparse/engine/grouping.py
@@ -186,7 +186,8 @@ def group_identifier_list(tlist):
if not isinstance(sgroup, sql.IdentifierList)]
idx = 0
# Allowed list items
- fend1_funcs = [lambda t: isinstance(t, (sql.Identifier, sql.Function)),
+ fend1_funcs = [lambda t: isinstance(t, (sql.Identifier, sql.Function,
+ sql.Case)),
lambda t: t.is_whitespace(),
lambda t: t.ttype == T.Name,
lambda t: t.ttype == T.Wildcard,