Is it intended behavior that if I call a
stored procedure inside a
stored procedure will automatically commit?
pseudo procedure proc1
create procedure proc1(in var1 int, out var2 int) begin start transaction; -- some code here commit; end
pseudo procedure proc2, the one will call the proc1
create procedure proc2() lbl_begin: begin start transaction; -- modify some data here call proc1(0, var2); if var != 0 then rollback; leave lbl_begin; end; commit; end;
Even the rollback on proc2 is executed, the data modified before the call of the proc1 is still committed.
Is it a bug or its an intended behavior?