diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/files/mysql_handler.sql | 10 | ||||
| -rw-r--r-- | tests/test_split.py | 6 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/files/mysql_handler.sql b/tests/files/mysql_handler.sql new file mode 100644 index 0000000..702374e --- /dev/null +++ b/tests/files/mysql_handler.sql @@ -0,0 +1,10 @@ +create procedure proc1() +begin + declare handler for foo begin end; + select 1; +end; + +create procedure proc2() +begin + select 1; +end; diff --git a/tests/test_split.py b/tests/test_split.py index c073298..f69e3d2 100644 --- a/tests/test_split.py +++ b/tests/test_split.py @@ -154,3 +154,9 @@ def test_split_quotes_with_new_line(): stmts = sqlparse.split("select 'foo\n\bar'") assert len(stmts) == 1 assert stmts[0] == "select 'foo\n\bar'" + + +def test_split_mysql_handler_for(load_file): + # see issue581 + stmts = sqlparse.split(load_file('mysql_handler.sql')) + assert len(stmts) == 2 |
