summaryrefslogtreecommitdiff
path: root/sqlparse/engine
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2010-06-23 07:37:16 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2010-06-23 07:37:16 +0200
commitcc01ab2971981bdcbc3cdbb10b36b202b4655a12 (patch)
tree9bc7de55f4524973128570310ab6371f88897084 /sqlparse/engine
parentb737d2093eacf3c34e1eb413192f86f0d8623ecd (diff)
downloadsqlparse-cc01ab2971981bdcbc3cdbb10b36b202b4655a12.tar.gz
Improve statement detection for DECLARE statements outside function/procedure definitions.
The parser didn't recognized DECLARE statements outside function/procedure definitions correctly and assumed that a non-separating semicolon follows.
Diffstat (limited to 'sqlparse/engine')
-rw-r--r--sqlparse/engine/filter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sqlparse/engine/filter.py b/sqlparse/engine/filter.py
index 08ff21d..0f6eec0 100644
--- a/sqlparse/engine/filter.py
+++ b/sqlparse/engine/filter.py
@@ -41,17 +41,17 @@ class StatementFilter(TokenFilter):
return 0
# ANSI
- if ttype is not T.Keyword:
+ if ttype not in T.Keyword:
return 0
unified = value.upper()
- if unified == 'DECLARE':
+ if unified == 'DECLARE' and self._is_create:
self._in_declare = True
return 1
if unified == 'BEGIN':
- if self._in_declare:
+ if self._in_declare: # FIXME(andi): This makes no sense.
return 0
return 0