From 47e7f56a52870bdb278225fc05866efcb5e65a1d Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Wed, 13 Apr 2011 16:04:56 +0200 Subject: Don't group trailing whitepsace in WHERE clauses (fixes issue35). --- sqlparse/engine/grouping.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sqlparse/engine') diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index 3a2e3c3..d233772 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -253,7 +253,8 @@ def group_where(tlist): else: end = tlist.tokens[tlist.token_index(end) - 1] group = tlist.group_tokens(sql.Where, - tlist.tokens_between(token, end)) + tlist.tokens_between(token, end), + ignore_ws=True) idx = tlist.token_index(group) token = tlist.token_next_match(idx, T.Keyword, 'WHERE') -- cgit v1.2.1