From 3d13c5d4bb14f76d407285f2a91e7061585fd6da Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Sat, 12 Sep 2009 08:05:34 +0200 Subject: Prevent WHERE grouper from consuming closing parenthesis (fixes issue9, reported by estama). --- sqlparse/engine/grouping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sqlparse/engine') diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index d30031f..a03c0b4 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -231,7 +231,7 @@ def group_where(tlist): tidx = tlist.token_index(token) end = tlist.token_next_match(tidx+1, T.Keyword, stopwords) if end is None: - end = tlist.tokens[-1] + end = tlist._groupable_tokens[-1] else: end = tlist.tokens[tlist.token_index(end)-1] group = tlist.group_tokens(Where, tlist.tokens_between(token, end)) -- cgit v1.2.1