summaryrefslogtreecommitdiff
path: root/sqlparse/engine
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2011-04-13 16:04:56 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2011-04-13 16:04:56 +0200
commit47e7f56a52870bdb278225fc05866efcb5e65a1d (patch)
tree1b35d2b9e25a375cbc256fc406c0d55ac979f120 /sqlparse/engine
parentea2b23a46b4dacf1d76cdbdaa172e25e3b733466 (diff)
downloadsqlparse-47e7f56a52870bdb278225fc05866efcb5e65a1d.tar.gz
Don't group trailing whitepsace in WHERE clauses (fixes issue35).
Diffstat (limited to 'sqlparse/engine')
-rw-r--r--sqlparse/engine/grouping.py3
1 files changed, 2 insertions, 1 deletions
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')