SHORT VERSION: Could we have a START TRANSACTION IF EXISTS that does not commit existing transaction?
Sometimes, when a procedure is called, there are possible 2 cases:
1) The procedure has been called by a trigger: I want to continue the active transaction.
2) Called by the cli, I want to be sure that a transaction exists.
But START TRANSACTION commits existing transaction. A snippet like this does NOT solve the problem:
Because, if the procedure is called by a trigger, I get:
ERROR 1422 (HY000): Explicit or implicit commit is not allowed in stored function or trigger.
START TRANSACTION IF EXISTS would solve the problem.