From 2a63e68ba78f2508da00c7cfd3244688232e4b91 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Thu, 29 Sep 2011 11:21:01 +0200 Subject: Allow CASE statements as identifiers (fixes issue46). --- CHANGES | 1 + sqlparse/engine/grouping.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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, -- cgit v1.2.1