What were you trying to accomplish?
Using sqlparse.split to split these SQL commands loaded from a text file. The first stored procedure includes a declare exit handler with an empty begin end; body which MySQL allows to ignore the referenced condition. We have tried including dummy statements inside the begin end; such as a simple select 1; but so far we have not been able to find anything that works other than removing the declare exit handler block altogether.
create procedure proc1()
begin
declare exit handler for sqlexception begin end;
select 1 from nowhere;
end;
create procedure proc2()
begin
select 1;
end;
Expected Behavior
sqlparse.split should split this text into two create procedure statements.
Current Behavior
sqlparse.split is returning one statement.
Steps to Reproduce (for bugs)
Use the above script text as input to sqlparse.split.
Environment
- Python 3.8
- sqlparse 0.3.1
What were you trying to accomplish?
Using
sqlparse.splitto split these SQL commands loaded from a text file. The first stored procedure includes adeclare exit handlerwith an emptybegin end;body which MySQL allows to ignore the referenced condition. We have tried including dummy statements inside thebegin end;such as a simpleselect 1;but so far we have not been able to find anything that works other than removing thedeclare exit handlerblock altogether.Expected Behavior
sqlparse.splitshould split this text into twocreate procedurestatements.Current Behavior
sqlparse.splitis returning one statement.Steps to Reproduce (for bugs)
Use the above script text as input to sqlparse.split.
Environment