From d74ea26ec3a7f189ec00f6b949fd95082ba5b204 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Tue, 28 Jan 2014 15:16:12 +0100 Subject: Fix parsing and formatting of statements containing EXCEPT keyword. --- sqlparse/engine/grouping.py | 2 +- sqlparse/filters.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sqlparse') diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index 44cc124..c11e5f0 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -297,7 +297,7 @@ def group_where(tlist): if not isinstance(sgroup, sql.Where)] idx = 0 token = tlist.token_next_match(idx, T.Keyword, 'WHERE') - stopwords = ('ORDER', 'GROUP', 'LIMIT', 'UNION') + stopwords = ('ORDER', 'GROUP', 'LIMIT', 'UNION', 'EXCEPT') while token: tidx = tlist.token_index(token) end = tlist.token_next_match(tidx + 1, T.Keyword, stopwords) diff --git a/sqlparse/filters.py b/sqlparse/filters.py index 337d3bf..40caf51 100644 --- a/sqlparse/filters.py +++ b/sqlparse/filters.py @@ -301,7 +301,7 @@ class ReindentFilter: def _split_kwds(self, tlist): split_words = ('FROM', 'STRAIGHT_JOIN$', 'JOIN$', 'AND', 'OR', 'GROUP', 'ORDER', 'UNION', 'VALUES', - 'SET', 'BETWEEN') + 'SET', 'BETWEEN', 'EXCEPT') def _next_token(i): t = tlist.token_next_match(i, T.Keyword, split_words, -- cgit v1.2.1