summaryrefslogtreecommitdiff
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/test_split.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_split.py b/tests/test_split.py
index 5146bcb..50b3a6b 100644
--- a/tests/test_split.py
+++ b/tests/test_split.py
@@ -1,3 +1,4 @@
+
# -*- coding: utf-8 -*-
# Tests splitting functions.
@@ -86,3 +87,9 @@ class SQLSplitTest(TestCaseBase):
'comment on table actor is \'The actor table.\';')
stmts = sqlparse.split(sql)
self.assertEqual(len(stmts), 2)
+
+ def test_cursor_declare(self):
+ sql = ('DECLARE CURSOR "foo" AS SELECT 1;\n'
+ 'SELECT 2;')
+ stmts = sqlparse.split(sql)
+ self.assertEqual(len(stmts), 2)