summaryrefslogtreecommitdiff
path: root/sqlparse/engine
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2015-07-28 20:24:06 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2015-07-28 20:24:06 +0200
commit5d71c27e5194dfc8b8869f3170803e1d18bad6dc (patch)
tree944522019decb4e54067efec4b2ec3c77ee8134b /sqlparse/engine
parent8987a3a6b540ea35bbb1f9c5f49f3306501289cd (diff)
downloadsqlparse-5d71c27e5194dfc8b8869f3170803e1d18bad6dc.tar.gz
Handle END IF correctly when splitting statements (fixes #194).
Diffstat (limited to 'sqlparse/engine')
-rw-r--r--sqlparse/engine/filter.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sqlparse/engine/filter.py b/sqlparse/engine/filter.py
index e7ea0ec..f7dd264 100644
--- a/sqlparse/engine/filter.py
+++ b/sqlparse/engine/filter.py
@@ -51,6 +51,9 @@ class StatementFilter:
return 1
return 0
+ if unified in ('END IF', 'END FOR'):
+ return -1
+
if unified == 'END':
# Should this respect a preceeding BEGIN?
# In CASE ... WHEN ... END this results in a split level -1.