diff options
author | Andi Albrecht <albrecht.andi@gmail.com> | 2016-10-24 20:06:39 +0200 |
---|---|---|
committer | Andi Albrecht <albrecht.andi@gmail.com> | 2016-10-24 20:06:39 +0200 |
commit | b68e4b781b8d74b0222411e83a16408a83cde7d6 (patch) | |
tree | 2b8538cd16986986a2f0495ded2354f293d39058 /sqlparse/engine | |
parent | ce7125072675d4c5391c5dddadb2a95946e62568 (diff) | |
download | sqlparse-b68e4b781b8d74b0222411e83a16408a83cde7d6.tar.gz |
Fix special case for #284 when statement starts with orphaned AS.
Diffstat (limited to 'sqlparse/engine')
-rw-r--r-- | sqlparse/engine/grouping.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index 5fa3909..3c49201 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -380,7 +380,7 @@ def _group(tlist, cls, match, if match(token): nidx, next_ = tlist.token_next(tidx) - if valid_prev(prev_) and valid_next(next_): + if prev_ and valid_prev(prev_) and valid_next(next_): from_idx, to_idx = post(tlist, pidx, tidx, nidx) grp = tlist.group_tokens(cls, from_idx, to_idx, extend=extend) |