summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--sqlparse/engine/grouping.py1
-rw-r--r--sqlparse/filters.py3
-rw-r--r--sqlparse/keywords.py1
-rw-r--r--sqlparse/sql.py3
5 files changed, 7 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index c7c46ec..2337c6b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,7 @@ In Development
prefixed with @.
* Improved parsing of identifier lists (issue2).
* Recursive recognition of AS (issue4) and CASE.
+ * Improved support for UPDATE statements.
Release 0.1.0
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py
index bdf2cd0..fd6af67 100644
--- a/sqlparse/engine/grouping.py
+++ b/sqlparse/engine/grouping.py
@@ -139,6 +139,7 @@ def group_identifier_list(tlist):
lambda t: t.match(T.Keyword, 'null'),
lambda t: t.ttype == T.Number.Integer,
lambda t: t.ttype == T.String.Single,
+ lambda t: isinstance(t, Comparsion),
]
tcomma = tlist.token_next_match(idx, T.Punctuation, ',')
start = None
diff --git a/sqlparse/filters.py b/sqlparse/filters.py
index f1163ca..1ff767e 100644
--- a/sqlparse/filters.py
+++ b/sqlparse/filters.py
@@ -162,7 +162,8 @@ class ReindentFilter(Filter):
def _split_kwds(self, tlist):
split_words = ('FROM', 'JOIN$', 'AND', 'OR',
- 'GROUP', 'ORDER', 'UNION', 'VALUES')
+ 'GROUP', 'ORDER', 'UNION', 'VALUES',
+ 'SET')
idx = 0
token = tlist.token_next_match(idx, T.Keyword, split_words,
regex=True)
diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py
index 578f54f..97bd635 100644
--- a/sqlparse/keywords.py
+++ b/sqlparse/keywords.py
@@ -565,6 +565,7 @@ KEYWORDS_COMMON = {
'LIKE': Keyword,
'ON': Keyword,
'IN': Keyword,
+ 'SET': Keyword,
'BY': Keyword,
'GROUP': Keyword,
diff --git a/sqlparse/sql.py b/sqlparse/sql.py
index d1ee143..52d9b4a 100644
--- a/sqlparse/sql.py
+++ b/sqlparse/sql.py
@@ -386,7 +386,8 @@ class IdentifierList(TokenList):
Whitespaces and punctuations are not included in this list.
"""
- return [x for x in self.tokens if isinstance(x, Identifier)]
+ return [x for x in self.tokens
+ if not x.is_whitespace() and not x.match(T.Punctuation, ',')]
class Parenthesis(TokenList):