summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2012-04-19 22:21:00 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2012-04-19 22:21:00 +0200
commit3942d09bd0be0a7b207864ebd0a5ce2ea0f9e28e (patch)
tree72d23fe4ea5e9663d2a79b509d37f743f67704fa
parentfb9ba15d47f6041a1ebebc738ec2707da0de49f1 (diff)
downloadsqlparse-3942d09bd0be0a7b207864ebd0a5ce2ea0f9e28e.tar.gz
Properly group placeholders in identifier lists (fixes #52).
-rw-r--r--CHANGES7
-rw-r--r--sqlparse/engine/grouping.py1
2 files changed, 5 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 7e1941e..098e846 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,9 +2,10 @@ Development
-----------
Bug Fixes
- * Avoid "stair case" effects when identifiers, functions or keywords
- are mixed in identifier lists (issue45, issue49) and when asterisks
- are used as operators (issue58).
+ * Avoid "stair case" effects when identifiers, functions,
+ placeholders or keywords are mixed in identifier lists (issue45,
+ issue49, issue52) and when asterisks are used as operators
+ (issue58).
* Make keyword detection more restrict (issue47).
* Improve handling of CASE statements (issue46).
* Fix statement splitting when parsing recursive statements (issue57,
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py
index 923ea63..55ec7e2 100644
--- a/sqlparse/engine/grouping.py
+++ b/sqlparse/engine/grouping.py
@@ -197,6 +197,7 @@ def group_identifier_list(tlist):
lambda t: t.match(T.Keyword, 'role'),
lambda t: t.ttype == T.Number.Integer,
lambda t: t.ttype == T.String.Single,
+ lambda t: t.ttype == T.Name.Placeholder,
lambda t: isinstance(t, sql.Comparison),
lambda t: isinstance(t, sql.Comment),
]